+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-description
-{
- margin-left: 0 !important;
-}
-
-separator, #webdeveloper-about-dialog
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-#webdeveloper-about-details
-{
- background-color: #ffffff !important;
- color: #000000 !important;
- padding: 0.5em !important;
-}
-
-#webdeveloper-about-details hbox
-{
- background-image: url("chrome://webdeveloper/content/images/logo/large.png") !important;
- background-position: top right !important;
- background-repeat: no-repeat !important;
- min-height: 35px !important;
- padding-right: 35px !important;
-}
-
-.date
-{
- color: #999999 !important;
-}
-
-.name
-{
- font-size: x-large !important;
- padding-right: 0.25em !important;
-}
-
-.name, .title
-{
- font-weight: bold !important;
-}
-
-.title
-{
- padding-top: 0.25em !important;
-}
-
-.url
-{
- color: #0000ff !important;
- cursor: pointer !important;
- text-decoration: underline !important;
-}
-.url:hover
-{
- color: #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-// Opens the URL in a new tab
-function webdeveloper_openURL(urlElement)
-{
- var parentWindow = null;
- var url = urlElement.firstChild.nodeValue;
-
- // If there is a parent window
- if(window.opener)
- {
- // If there is a grand parent window
- if(window.opener.opener)
- {
- parentWindow = window.opener.opener;
- }
- else
- {
- parentWindow = window.opener;
- }
- }
-
- // If a parent window was found
- if(parentWindow)
- {
- // If the open in windows preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true))
- {
- var newTab = parentWindow.getBrowser().addTab(url);
-
- // If the open tabs in background preference is not set or is set to false
- if(!webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- parentWindow.getBrowser().selectedTab = newTab;
- }
- }
- else
- {
- parentWindow.open(url);
- }
-
- window.close();
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/about/about.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept"
- id="webdeveloper-about-dialog"
- title="&webdeveloper.about.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/about/about.js"/>
-
- <vbox id="webdeveloper-about-details">
- <hbox>
- <description class="name">Web Developer</description>
- <description class="name">1.1.4</description>
- </hbox>
- <description value="&webdeveloper.about.build.date;" class="title"/>
- <description class="date">June 5, 2007</description>
- <description value="&webdeveloper.about.author;" class="title"/>
- <description>Chris Pederick</description>
- <description onclick="webdeveloper_openURL(this)" class="url">http://chrispederick.com/work/web-developer/</description>
- </vbox>
- <separator class="groove"/>
-</dialog>
\ No newline at end of file
+++ /dev/null
-// Constructs an application object
-function WebDeveloperApplication(applicationPath)
-{
- this.applicationPath = applicationPath;
- this.executable = this.getExecutable();
- this.file = null;
-}
-
-// Creates a source file
-WebDeveloperApplication.prototype.createSourceFile = function(temporaryDirectory, uri)
-{
- var sourceFile = null;
-
- // If the URI has a file scheme
- if(uri.scheme == "file")
- {
- var fileProtocolHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"].createInstance(Components.interfaces.nsIFileProtocolHandler);
-
- sourceFile = fileProtocolHandler.getFileFromURLSpec(uri.spec);
- }
-
- // If the source file is not set
- if(!sourceFile)
- {
- var fileExtension = "html";
- var fileName = uri.host;
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
-
- sourceFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- url.spec = uri.spec;
-
- // If the URL has a file extension
- if(url.fileExtension)
- {
- fileExtension = url.fileExtension;
- }
-
- temporaryDirectory.append("webdeveloper_" + fileName + "_" + new Date().getTime() + "." + fileExtension);
- sourceFile.initWithPath(temporaryDirectory.path);
- }
-
- return sourceFile;
-}
-
-// Returns an executable for the application
-WebDeveloperApplication.prototype.getExecutable = function()
-{
- var executable = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- executable.initWithPath(this.applicationPath);
-
- return executable;
-}
-
-// Returns the post data
-WebDeveloperApplication.prototype.getPostData = function()
-{
- // Try to get the post data
- try
- {
- var sessionHistory = getWebNavigation().sessionHistory;
- var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false).QueryInterface(Components.interfaces.nsISHEntry);
-
- return entry.postData;
- }
- catch(exception)
- {
- return null;
- }
-}
-
-// Launch the application with the given file
-WebDeveloperApplication.prototype.launchWithFile = function()
-{
- var mimeService = Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"].getService(Components.interfaces.nsIMIMEService);
- var mimeInfo = mimeService.getFromTypeAndExtension(this.file.path, null);
-
- mimeInfo.alwaysAskBeforeHandling = false;
- mimeInfo.preferredAction = Components.interfaces.nsIMIMEInfo.useHelperApp;
- mimeInfo.preferredApplicationHandler = this.executable;
-
- mimeInfo.launchWithFile(this.file);
-}
-
-// Launch the application with the source from the given URI
-WebDeveloperApplication.prototype.launchWithSource = function(uri)
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var temporaryDirectory = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsIFile);
-
- // If the temporary directory exists, is a directory and is writable
- if(temporaryDirectory.exists() && temporaryDirectory.isDirectory() && temporaryDirectory.isWritable())
- {
- // If the executable exists
- if(this.executable.exists())
- {
- this.file = this.createSourceFile(temporaryDirectory, uri);
-
- if(uri.scheme == "file")
- {
- this.launchWithFile();
- }
- else
- {
- var webBrowserPersistInterface = Components.interfaces.nsIWebBrowserPersist;
- var webBrowserPersist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webBrowserPersistInterface);
-
- webBrowserPersist.persistFlags = webBrowserPersistInterface.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION | webBrowserPersistInterface.PERSIST_FLAGS_FROM_CACHE | webBrowserPersistInterface.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
- webBrowserPersist.progressListener = this;
-
- webBrowserPersist.saveURI(uri, null, uri, this.getPostData(), null, this.file);
- }
- }
- else
- {
- webdeveloper_error(stringBundle.getFormattedString("webdeveloper_launchApplicationFailed", [this.applicationPath]));
- }
- }
- else
- {
- webdeveloper_error(stringBundle.getFormattedString("webdeveloper_tempDirectoryFailed", [temporaryDirectory.path]));
- }
-}
-
-// Launch the application with the given URL
-WebDeveloperApplication.prototype.launchWithURL = function(url)
-{
- // If the executable exists, is a file and is executable
- if(this.executable.exists() && this.executable.isFile() && this.executable.isExecutable())
- {
- var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
- var processArguments = new Array(url);
-
- process.init(this.executable);
- process.run(false, processArguments, processArguments.length);
- }
- else
- {
- webdeveloper_error(document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_launchApplicationFailed", [this.applicationPath]));
- }
-}
-
-// Called when the progress state changes
-WebDeveloperApplication.prototype.onStateChange = function(webProgress, request, stateFlags, status)
-{
- // If the progress has stopped
- if(stateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
- {
- this.launchWithFile();
- }
-}
-
-// Indicates the interfaces this object supports
-WebDeveloperApplication.prototype.QueryInterface = function(id)
-{
- // If the query is for a supported interface
- if(id.equals(Components.interfaces.nsISupports) || id.equals(Components.interfaces.nsIWebProgressListener))
- {
- return this;
- }
-
- throw Components.results.NS_NOINTERFACE;
-}
-
-// Dummy methods requiring implementations
-WebDeveloperApplication.prototype.onLocationChange = function(webProgress, request, location) {}
-WebDeveloperApplication.prototype.onProgressChange = function(webProgress, request, currentSelfProgress, maximumSelfProgress, currentTotalProgress, maximumTotalProgress) {}
-WebDeveloperApplication.prototype.onSecurityChange = function(webProgress, request, state) {}
-WebDeveloperApplication.prototype.onStatusChange = function(webProgress, request, status, message) {}
+++ /dev/null
-// Returns true if the array contains the element
-function webdeveloper_contains(array, element)
-{
- // If the array and element are set
- if(array && element)
- {
- try
- {
- // If the element does not exist in the array
- if(array.indexOf(element) == -1)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- catch(exception)
- {
- var arrayLength = array.length;
-
- // Loop through the array
- for(var i = 0; i < arrayLength; i++)
- {
- // If the element is found
- if(array[i] == element)
- {
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
-// Returns true if the array contains media with the given URL
-function webdeveloper_mediaArrayContains(array, url)
-{
- // If the array and url are set
- if(array && url)
- {
- var arrayLength = array.length;
-
- // Loop through the array
- for(var i = 0; i < arrayLength; i++)
- {
- // If media with the given URL is found
- if(array[i].src == url)
- {
- return true;
- }
- }
- }
-
- return false;
-}
+++ /dev/null
-// Get the cookies
-function webdeveloper_getCookies(host, path, sort)
-{
- var cookies = new Array();
-
- // If the host is set
- if(host)
- {
- var cookie = null;
- var cookieEnumeration = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).enumerator;
- var cookieHost = null;
- var cookiePath = null;
-
- // Loop through the cookies
- while(cookieEnumeration.hasMoreElements())
- {
- cookie = cookieEnumeration.getNext().QueryInterface(Components.interfaces.nsICookie);
-
- cookieHost = cookie.host;
- cookiePath = cookie.path;
-
- // If there is a host and path for this cookie
- if(cookieHost && cookiePath)
- {
- // If the cookie host starts with '.'
- if(cookieHost.charAt(0) == ".")
- {
- cookieHost = cookieHost.substring(1);
- }
-
- // If the host and cookie host and path and cookie path match
- if((host == cookieHost || host.indexOf("." + cookieHost) != -1) && (path == cookiePath || path.indexOf(cookiePath) == 0))
- {
- cookies.push(cookie);
- }
- }
- }
-
- // If sorting cookies
- if(sort)
- {
- cookies.sort(webdeveloper_sortCookies);
- }
- }
-
- return cookies;
-}
-
-// Sorts two cookies
-function webdeveloper_sortCookies(cookieOne, cookieTwo)
-{
- // If cookie one and cookie two are set
- if(cookieOne && cookieTwo)
- {
- var cookieOneHost = cookieOne.host;
- var cookieOneName = cookieOne.name;
- var cookieTwoHost = cookieTwo.host;
- var cookieTwoName = cookieTwo.name;
-
- // If the cookies are equal
- if(cookieOneHost == cookieTwoHost && cookieOneName == cookieTwoName)
- {
- return 0;
- }
- else if(cookieOneHost < cookieTwoHost || (cookieOneHost == cookieTwoHost && cookieOneName < cookieTwoName))
- {
- return -1;
- }
- }
-
- return 1;
-}
\ No newline at end of file
+++ /dev/null
-// Formats a style rule property
-function webdeveloper_formatStyleRuleProperty(styleRuleProperty)
-{
- // Switch on the style rule property
- switch(styleRuleProperty)
- {
- case "margin-bottom-value":
- return "margin-bottom";
- case "margin-left-value":
- return "margin-left";
- case "margin-right-value":
- return "margin-right";
- case "margin-top-value":
- return "margin-top";
- case "padding-bottom-value":
- return "padding-bottom";
- case "padding-left-value":
- return "padding-left";
- case "padding-right-value":
- return "padding-right";
- case "padding-top-value":
- return "padding-top";
- case "-x-background-x-position":
- return "background-x-position";
- case "-x-background-y-position":
- return "background-y-position";
- default:
- return styleRuleProperty;
- }
-}
-
-// Formats a style rule value
-function webdeveloper_formatStyleRuleValue(styleRuleValue)
-{
- // If the style rule value is set
- if(styleRuleValue)
- {
- var rgbRegularExpression = new RegExp("rgb\\((\\d{1,3}),\\s(\\d{1,3}),\\s(\\d{1,3})\\)", "gi");
- var styleRuleValueColor = rgbRegularExpression.exec(styleRuleValue);
-
- // If the style rule value is a color
- if(styleRuleValueColor)
- {
- var blue = parseInt(styleRuleValueColor[3]).toString(16);
- var green = parseInt(styleRuleValueColor[2]).toString(16);
- var red = parseInt(styleRuleValueColor[1]).toString(16);
-
- // If the blue color is only 1 character long
- if(blue.length == 1)
- {
- blue = "0" + blue;
- }
-
- // If the green color is only 1 character long
- if(green.length == 1)
- {
- green = "0" + green;
- }
-
- // If the red color is only 1 character long
- if(red.length == 1)
- {
- red = "0" + red;
- }
-
- return "#" + red + green + blue;
- }
- }
-
- return styleRuleValue;
-}
-
-// Returns the list of the style sheets for the specified document
-function webdeveloper_getStyleSheetsForDocument(contentDocument, includeInline, includeAlternate)
-{
- var styleSheets = new Array();
-
- // If the content document is set
- if(contentDocument)
- {
- var documentStyleSheets = contentDocument.styleSheets;
- var documentStyleSheetsLength = documentStyleSheets.length;
- var documentURL = contentDocument.documentURI;
- var styleSheet = null;
-
- // Loop through the style sheets
- for(var i = 0; i < documentStyleSheetsLength; i++)
- {
- styleSheet = documentStyleSheets[i];
-
- // If this is a valid style sheet and including alternate style sheets or this is not alternate
- if(webdeveloper_isValidStyleSheet(styleSheet) && (includeAlternate || !webdeveloper_isAlternateStyleSheet(styleSheet)))
- {
- // If including inline style sheets or this is not inline
- if(includeInline || styleSheet.href != documentURL)
- {
- styleSheets.push(styleSheet);
- }
-
- styleSheets = styleSheets.concat(webdeveloper_getStyleSheetsImportedFromStyleSheet(styleSheet));
- }
- }
- }
-
- return styleSheets;
-}
-
-// Returns the list of style sheets imported from the specified style sheet
-function webdeveloper_getStyleSheetsImportedFromStyleSheet(styleSheet)
-{
- var styleSheets = new Array();
-
- // If the style sheet is set
- if(styleSheet)
- {
- var cssRule = null;
- var cssRules = styleSheet.cssRules;
- var cssRulesLength = cssRules.length;
- var importedStyleSheet = null;
- var importRule = Components.interfaces.nsIDOMCSSRule.IMPORT_RULE;
-
- // Loop through the the style sheet rules
- for(var i = 0; i < cssRulesLength; i++)
- {
- cssRule = cssRules[i];
-
- // If this is an import rule
- if(cssRule.type == importRule)
- {
- importedStyleSheet = cssRule.styleSheet;
-
- // If this style sheet is valid
- if(webdeveloper_isValidStyleSheet(importedStyleSheet))
- {
- styleSheets.push(importedStyleSheet);
-
- styleSheets = styleSheets.concat(webdeveloper_getStyleSheetsImportedFromStyleSheet(importedStyleSheet));
- }
- }
- }
- }
-
- return styleSheets;
-}
-
-// If there is a style sheet for this media type
-function webdeveloper_hasStyleSheetForMedia(styleSheetList, media)
-{
- // If the style sheet list and media are set
- if(styleSheetList && media)
- {
- var styleSheet = null;
- var styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetLength; i++)
- {
- styleSheet = styleSheetList[i];
-
- // If this style sheet is valid and is for this media type
- if(webdeveloper_isValidStyleSheet(styleSheet) && webdeveloper_isMediaStyleSheet(styleSheet, media))
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-// Is this style sheet an alternate style sheet
-function webdeveloper_isAlternateStyleSheet(styleSheet)
-{
- // If the style sheet is set
- if(styleSheet)
- {
- var ownerNode = styleSheet.ownerNode;
-
- // If the owner node is set
- if(ownerNode)
- {
- // If the owner node is a processing instruction
- if(ownerNode.nodeType == Components.interfaces.nsIDOMNode.PROCESSING_INSTRUCTION_NODE)
- {
- // If the processing instruction data contains alternate="yes"
- if(ownerNode.data.indexOf('alternate="yes"') != -1)
- {
- return true;
- }
- }
- else if(ownerNode.hasAttribute("rel") && ownerNode.getAttribute("rel").toLowerCase() == "alternate stylesheet")
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-// Is this style sheet for this media type
-function webdeveloper_isMediaStyleSheet(styleSheet, matchMediaType)
-{
- // If the style sheet and match media type are set
- if(styleSheet && matchMediaType)
- {
- var media = styleSheet.media;
- var mediaLength = media.length;
- var mediaType = null;
-
- // If there is no media and the match media type is screen
- if(mediaLength == 0 && matchMediaType == "screen")
- {
- return true;
- }
-
- // Loop through the media
- for(var i = 0; i < mediaLength; i++)
- {
- mediaType = media.item(i).toLowerCase();
-
- // If the media type is all or matches the match media type
- if(mediaType == "all" || mediaType == matchMediaType)
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-// Is this style sheet a valid style sheet
-function webdeveloper_isValidStyleSheet(styleSheet)
-{
- // If the style sheet is set
- if(styleSheet)
- {
- var styleSheetHref = styleSheet.href;
-
- // If the style sheet href is set and this is not an internal style sheet or the style sheet href is not set and this does not have a Web Developer id
- if((styleSheetHref && styleSheetHref.indexOf("about:PreferenceStyleSheet") != 0 && styleSheetHref.indexOf("chrome://") != 0 && styleSheetHref.indexOf("data:text/css") != 0 && styleSheetHref.indexOf("jar:file://") != 0 && styleSheetHref.indexOf("resource://") != 0) || (!styleSheetHref && (!styleSheet.hasAttribute("id") || styleSheet.getAttribute("id").indexOf("webdeveloper-") != 0)))
- {
- return true;
- }
- }
-
- return false;
-}
-
-// Is this style rule is a valid style rule
-function webdeveloper_isValidStyleRule(styleRuleList, styleRule)
-{
- // If the style rule is set
- if(styleRule)
- {
- // If the style rule is an invalid style rule
- if(styleRule.indexOf("-moz-") == 0 || ((styleRule == "margin-left-ltr-source" || styleRule == "margin-left-rtl-source" || styleRule == "margin-right-ltr-source" || styleRule == "margin-right-rtl-source" || styleRule == "padding-left-ltr-source" || styleRule == "padding-left-rtl-source" || styleRule == "padding-right-ltr-source" || styleRule == "padding-right-rtl-source") && styleRuleList.getPropertyValue(styleRule) == "physical"))
- {
- return false;
- }
-
- return true;
- }
-
- return false;
-}
\ No newline at end of file
+++ /dev/null
-// Returns the current content document
-function webdeveloper_getContentDocument()
-{
- return webdeveloper_getSelectedBrowser().contentDocument;
-}
-
-// Returns the current content window
-function webdeveloper_getContentWindow()
-{
- return webdeveloper_getSelectedBrowser().contentWindow;
-}
-
-// Returns the document body element
-function webdeveloper_getDocumentBodyElement(contentDocument)
-{
- // If there is a body element
- if(contentDocument.body)
- {
- return contentDocument.body;
- }
- else
- {
- var bodyElementList = contentDocument.getElementsByTagName("body");
-
- // If there is a body element
- if(bodyElementList.length > 0)
- {
- return bodyElementList[0];
- }
- }
-
- return contentDocument.documentElement;
-}
-
-// Returns the document head element
-function webdeveloper_getDocumentHeadElement(contentDocument)
-{
- var headElementList = contentDocument.getElementsByTagName("head");
-
- // If there is a head element
- if(headElementList.length > 0)
- {
- return headElementList[0];
- }
-
- return contentDocument.documentElement;
-}
-
-// Gets all the documents from the current page
-function webdeveloper_getDocuments(frame)
-{
- var documents = new Array();
-
- // If the frame is set
- if(frame)
- {
- var frames = frame.frames;
- var framesLength = frames.length;
-
- // If the frame document exists
- if(frame.document)
- {
- documents.push(frame.document);
- }
-
- // Loop through the frames
- for(var i = 0; i < framesLength; i++)
- {
- documents = documents.concat(webdeveloper_getDocuments(frames[i]));
- }
- }
-
- return documents;
-}
-
-// Get the ancestors of the element
-function webdeveloper_getElementAncestors(element)
-{
- var ancestors = webdeveloper_getElementAncestorsInternal(element);
-
- // Reverse the list and remove the last element which is the original element
- ancestors.reverse();
- ancestors.pop();
-
- return ancestors;
-}
-
-// Recursively gets the ancestors of an element
-function webdeveloper_getElementAncestorsInternal(element)
-{
- var ancestors = new Array();
-
- // If the element is set
- if(element)
- {
- var parentElement = element.parentNode;
-
- // If the element has a tag name
- if(element.tagName)
- {
- ancestors.push(element);
- }
-
- // If there is a parent element
- if(parentElement)
- {
- ancestors = ancestors.concat(webdeveloper_getElementAncestorsInternal(parentElement));
- }
- }
-
- return ancestors;
-}
-
-// Get the children of the element
-function webdeveloper_getElementChildren(element)
-{
- var children = new Array();
-
- // If the element is set
- if(element)
- {
- var child = null;
- var childNodes = element.childNodes;
- var childLength = childNodes.length;
-
- // Loop through the children
- for(var i = 0; i < childLength; i++)
- {
- child = childNodes[i];
-
- // If the child and tag name are set
- if(child && child.tagName)
- {
- children.push(child);
- }
- }
- }
-
- return children;
-}
-
-// Get the position of the element
-function webdeveloper_getElementPosition(element, xPosition)
-{
- var position = 0;
-
- // If the element is set
- if(element)
- {
- var elementOffsetParent = element.offsetParent;
-
- // If the element has an offset parent
- if(elementOffsetParent)
- {
- // While there is an offset parent
- while((elementOffsetParent = element.offsetParent) != null)
- {
- // If getting the x position
- if(xPosition)
- {
- position += element.offsetLeft;
- }
- else
- {
- position += element.offsetTop;
- }
-
- element = elementOffsetParent;
- }
- }
- else
- {
- // If getting the x position
- if(xPosition)
- {
- position = element.offsetLeft;
- }
- else
- {
- position = element.offsetTop;
- }
- }
- }
-
- return position;
-}
-
-// Get the x position of the element
-function webdeveloper_getElementPositionX(element)
-{
- return webdeveloper_getElementPosition(element, true);
-}
-
-// Get the y position of the element
-function webdeveloper_getElementPositionY(element)
-{
- return webdeveloper_getElementPosition(element, false);
-}
-
-// Returns the text from an element
-function webdeveloper_getElementText(element)
-{
- var elementText = "";
-
- // If the element is set
- if(element)
- {
- var childNode = null;
- var childNodeList = element.childNodes;
- var childNodeLength = childNodeList.length;
- var childNodeType = null;
-
- // Loop through the child nodes
- for(var i = 0; i < childNodeLength; i++)
- {
- childNode = childNodeList[i];
- childNodeType = childNode.nodeType;
-
- // If the child node type is an element
- if(childNodeType == Node.ELEMENT_NODE)
- {
- elementText += webdeveloper_getElementText(childNode);
- }
- else if(childNodeType == Node.TEXT_NODE)
- {
- elementText += childNode.nodeValue + " ";
- }
- }
- }
-
- return elementText;
-}
-
-// Returns the list of the images for the specified document
-function webdeveloper_getImagesForDocument(contentDocument, includeBackgroundImages, includeIcons)
-{
- var images = new Array();
-
- // If the content document is set
- if(contentDocument)
- {
- var backgroundImage = null;
- var computedStyle = null;
- var cssURI = CSSPrimitiveValue.CSS_URI;
- var documentURL = contentDocument.documentURI;
- var element = null;
- var image = null;
- var imageInterface = Components.interfaces.nsIDOMHTMLImageElement;
- var inputInterface = Components.interfaces.nsIDOMHTMLInputElement;
- var linkInterface = Components.interfaces.nsIDOMHTMLLinkElement;
- var treeWalker = contentDocument.createTreeWalker(contentDocument, NodeFilter.SHOW_ELEMENT, null, false);
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
-
- // While the tree walker has more nodes
- while((element = treeWalker.nextNode()) != null)
- {
- // If this is an image element
- if(element instanceof imageInterface)
- {
- images.push(element);
- }
- else if(element instanceof inputInterface && element.src && element.type && element.type.toLowerCase() == "image")
- {
- image = new Image();
- url.spec = documentURL;
- image.src = url.resolve(element.src);
-
- // If this is not a chrome image
- if(image.src.indexOf("chrome://") != 0)
- {
- images.push(image);
- }
- }
- else if(includeIcons && element instanceof linkInterface && element.href && element.href.indexOf("chrome://") != 0 && element.rel && element.rel.indexOf("icon") != -1)
- {
- image = new Image();
- url.spec = documentURL;
- image.src = url.resolve(element.href);
-
- images.push(image);
- }
- else if(includeBackgroundImages)
- {
- computedStyle = element.ownerDocument.defaultView.getComputedStyle(element, null);
-
- // If the computed style is set
- if(computedStyle)
- {
- backgroundImage = computedStyle.getPropertyCSSValue("background-image");
-
- // If this element has a background image and it is a URI
- if(backgroundImage && backgroundImage.primitiveType == cssURI)
- {
- image = new Image();
- image.src = backgroundImage.getStringValue();
-
- // If this is not a chrome image
- if(image.src.indexOf("chrome://") != 0)
- {
- images.push(image);
- }
- }
- }
- }
- }
- }
-
- return images;
-}
-
-// Returns the list of the objects for the specified document
-function webdeveloper_getObjectsForDocument(contentDocument)
-{
- var objects = new Array();
-
- // If the content document is set
- if(contentDocument)
- {
- var documentObjects = contentDocument.embeds;
- var documentObjectsLength = documentObjects.length;
-
- // Loop through the document objects
- for(var i = 0; i < documentObjectsLength; i++)
- {
- objects.push(documentObjects[i]);
- }
- }
-
- return objects;
-}
-
-// Returns the selected browser
-function webdeveloper_getSelectedBrowser()
-{
- return window.top.getBrowser().selectedBrowser;
-}
-
-// Returns the list of the scripts for the specified document
-function webdeveloper_getScriptsForDocument(contentDocument, includeInline)
-{
- var scripts = new Array();
-
- // If the content document is set
- if(contentDocument)
- {
- var documentScript = null;
- var documentScripts = contentDocument.getElementsByTagName("script");
- var documentScriptsLength = documentScripts.length;
- var documentURL = contentDocument.documentURI;
-
- // Loop through the document scripts
- for(var i = 0; i < documentScriptsLength; i++)
- {
- documentScript = documentScripts[i];
-
- // If including inline scripts or this is not inline
- if(includeInline || documentScript.src != documentURL)
- {
- scripts.push(documentScript);
- }
- }
- }
-
- return scripts;
-}
-
-// Inserts the given child after the element
-function webdeveloper_insertAfter(child, after)
-{
- // If the child and after are set
- if(child && after)
- {
- var nextSibling = after.nextSibling;
- var parent = after.parentNode;
-
- // If the element has a next sibling
- if(nextSibling)
- {
- parent.insertBefore(child, nextSibling);
- }
- else
- {
- parent.appendChild(child);
- }
- }
-}
-
-// Inserts the given child as the first child of the element
-function webdeveloper_insertAsFirstChild(element, child)
-{
- // If the element and child are set
- if(element && child)
- {
- // If the element has child nodes
- if(element.hasChildNodes())
- {
- element.insertBefore(child, element.firstChild);
- }
- else
- {
- element.appendChild(child);
- }
- }
-}
-
-// Returns true if the ancestor element is an ancestor of the element
-function webdeveloper_isAncestor(element, ancestorElement)
-{
- // If the element and ancestor element are set
- if(element && ancestorElement)
- {
- var parentElement = null;
-
- // Loop through the parent elements
- while((parentElement = element.parentNode) != null)
- {
- // If the parent element is the ancestor element
- if(parentElement == ancestorElement)
- {
- return true;
- }
- else
- {
- element = parentElement;
- }
- }
- }
-
- return false;
-}
-
-// Returns true if the page has frames
-function webdeveloper_pageHasFrames()
-{
- // If the content document has a frame element
- if(webdeveloper_getContentDocument().getElementsByTagName("frame").length > 0)
- {
- return true;
- }
-
- return false;
-}
-
-// Removes all child elements from an element
-function webdeveloper_removeAllChildElements(element)
-{
- // If the element is set
- if(element)
- {
- var childElements = element.childNodes;
-
- // Loop through the child elements
- for(var i = 0; i < childElements.length; i++)
- {
- element.removeChild(childElements[i]);
- }
-
- childElements = element.childNodes;
-
- // Loop through the child elements
- while(childElements.length > 0)
- {
- element.removeChild(childElements[0]);
- }
- }
-}
-
-// Removes all elements matching the XPath
-function webdeveloper_removeAllElementsByXPath(contentDocument, xPath)
-{
- var elementList = webdeveloper_evaluateXPath(contentDocument, xPath);
- var elementsLength = elementList.length;
-
- // Loop through all the elements
- for(var i = 0; i < elementsLength; i++)
- {
- webdeveloper_removeElement(elementList[i]);
- }
-
-}
-
-// Removes an element
-function webdeveloper_removeElement(element)
-{
- // If the element and it's parent node are set
- if(element && element.parentNode)
- {
- element.parentNode.removeChild(element);
- }
-}
\ No newline at end of file
+++ /dev/null
-// Gets the size of a file
-function webdeveloper_getFileSize(url)
-{
- var cacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
- var cacheSession = null;
- var file = null;
- var fileSize = null;
- var readAccess = Components.interfaces.nsICache.ACCESS_READ;
-
- // Try to get the file size from the HTTP cache
- try
- {
- cacheSession = cacheService.createSession("HTTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
-
- // If there is a file
- if(file)
- {
- fileSize = file.dataSize;
- }
- }
- catch(exception)
- {
- // Try to get the file size from the FTP cache
- try
- {
- cacheSession = cacheService.createSession("FTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
-
- // If there is a file
- if(file)
- {
- fileSize = file.dataSize;
- }
- }
- catch(exception)
- {
- fileSize = null;
- }
- }
-
- // If the file size could not be retrieved from the cache
- if(!fileSize)
- {
- // Try to download the file
- try
- {
- var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
-
- fileSize = ioService.newChannelFromURI(ioService.newURI(url, null, null)).open().available();
- }
- catch(exception)
- {
- fileSize = null;
- }
- }
-
- return fileSize;
-}
-
-// Gets the uncompressed size of a file
-function webdeveloper_getUncompressedFileSize(url)
-{
- var cacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
- var cacheSession = null;
- var file = null;
- var fileCompressed = true;
- var fileSize = null;
- var readAccess = Components.interfaces.nsICache.ACCESS_READ;
-
- // Try to get the file size from the HTTP cache
- try
- {
- cacheSession = cacheService.createSession("HTTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
- }
- catch(exception)
- {
- // Try to get the file size from the FTP cache
- try
- {
- cacheSession = cacheService.createSession("FTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
- }
- catch(exception)
- {
- file = null;
- }
- }
-
- // If there is a file
- if(file)
- {
- var encoding = null;
- var responseHeaders = null;
-
- // Try to get the cache encoding
- try
- {
- // Specific case-sensitive required
- encoding = file.getMetaDataElement("request-Accept-Encoding");
- }
- catch(exception)
- {
- encoding = null;
-
- // Try to get the response headers
- try
- {
- // Specific case-sensitive required
- responseHeaders = file.getMetaDataElement("response-head");
- }
- catch(exception)
- {
- responseHeaders = null;
- }
- }
-
- // If the cache is not GZIP encoded
- if((!encoding || encoding.indexOf("gzip") == -1) && (!responseHeaders || responseHeaders.indexOf("Content-Encoding: gzip") == -1))
- {
- fileCompressed = false;
- }
- }
-
- // If the file is compressed
- if(fileCompressed)
- {
- // Try to download the file
- try
- {
- var request = new XMLHttpRequest();
-
- request.open("get", url, false);
- request.send(null);
-
- fileSize = request.responseText.length;
- }
- catch(exception)
- {
- fileSize = null;
- }
- }
-
- return fileSize;
-}
-
-// Retrieves the source from the given URL
-function webdeveloper_retrieveSource(url)
-{
- var source = null;
-
- // If the URL is not entirely generated
- if(url.indexOf("wyciwyg://") != 0)
- {
- var cacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
- var cacheSession = null;
- var file = null;
- var readAccess = Components.interfaces.nsICache.ACCESS_READ;
-
- // Try to get the file size from the HTTP cache
- try
- {
- cacheSession = cacheService.createSession("HTTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
- }
- catch(exception)
- {
- // Try to get the file size from the FTP cache
- try
- {
- cacheSession = cacheService.createSession("FTP", 0, true);
- cacheSession.doomEntriesIfExpired = false;
- file = cacheSession.openCacheEntry(url, readAccess, false);
- }
- catch(exception)
- {
- file = null;
- }
- }
-
- // If there is a file
- if(file)
- {
- var encoding = null;
- var responseHeaders = null;
-
- // Try to get the cache encoding
- try
- {
- // Specific case-sensitive required
- encoding = file.getMetaDataElement("request-Accept-Encoding");
- }
- catch(exception)
- {
- encoding = null;
-
- // Try to get the response headers
- try
- {
- // Specific case-sensitive required
- responseHeaders = file.getMetaDataElement("response-head");
- }
- catch(exception)
- {
- responseHeaders = null;
- }
- }
-
- // If the cache is not GZIP encoded
- if((!encoding || encoding.indexOf("gzip") == -1) && (!responseHeaders || (responseHeaders.indexOf("Content-Encoding: deflate") == -1 && responseHeaders.indexOf("Content-Encoding: gzip") == -1)))
- {
- var inputStream = file.openInputStream(0);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
-
- scriptableStream.init(inputStream);
-
- source = scriptableStream.read(scriptableStream.available());
-
- scriptableStream.close();
- inputStream.close();
- }
- }
-
- // If the source has not been loaded
- if(!source)
- {
- // Try to load the URL
- try
- {
- var request = new XMLHttpRequest();
-
- request.open("get", url, false);
- request.send(null);
-
- source = request.responseText;
- }
- catch(exception)
- {
- source = null;
- }
- }
- }
-
- return source;
-}
+++ /dev/null
-// Adds an href to the history
-function webdeveloper_addToHistory(href)
-{
- // If the href is set
- if(href)
- {
- var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIGlobalHistory);
-
- // If the href is not already in the history
- if(!globalHistory.isVisited(href))
- {
- globalHistory.addPage(href);
- }
- }
-}
-
-// Clears the history
-function webdeveloper_removeAllFromHistory()
-{
- Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory).removeAllPages();
-}
-
-// Removes an href from the history
-function webdeveloper_removeFromHistory(href)
-{
- // If the href is set
- if(href)
- {
- var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIGlobalHistory);
-
- // If the href is in the history
- if(globalHistory.isVisited(href))
- {
- Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory).removePage(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(href, null, null));
- }
- }
-}
+++ /dev/null
-// Returns true if the extension is running on a Mac
-function webdeveloper_isMac()
-{
- var appInfo = Components.classes["@mozilla.org/xre/app-info;1"];
-
- // If app info is set
- if(appInfo)
- {
- // If the OS is set to Darwin
- if(appInfo.getService(Components.interfaces.nsIXULRuntime).OS == "Darwin")
- {
- return true;
- }
- }
- else if(!webdeveloper_isPreferenceSet("general.platform.override") && navigator.platform.indexOf("Mac") == 0)
- {
- return true;
- }
-
- return false;
-}
\ No newline at end of file
+++ /dev/null
-var webdeveloper_preferencesService = null;
-
-// Deletes a preference
-function webdeveloper_deletePreference(preference)
-{
- // If the preference is set
- if(preference)
- {
- // If a user preference is set
- if(webdeveloper_isPreferenceSet(preference))
- {
- webdeveloper_getPreferencesService().clearUserPref(preference);
- }
- }
-}
-
-// Deletes a preference branch
-function webdeveloper_deletePreferenceBranch(branch)
-{
- // If the branch is set
- if(branch)
- {
- webdeveloper_getPreferencesService().deleteBranch(branch);
- }
-}
-
-// Gets a boolean preference, returning false if the preference is not set
-function webdeveloper_getBooleanPreference(preference, userPreference)
-{
- // If the preference is set
- if(preference)
- {
- // If not a user preference or a user preference is set
- if(!userPreference || webdeveloper_isPreferenceSet(preference))
- {
- try
- {
- return webdeveloper_getPreferencesService().getBoolPref(preference);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
-
- return false;
-}
-
-// Gets an integer preference, returning 0 if the preference is not set
-function webdeveloper_getIntegerPreference(preference, userPreference)
-{
- // If the preference is set
- if(preference)
- {
- // If not a user preference or a user preference is set
- if(!userPreference || webdeveloper_isPreferenceSet(preference))
- {
- try
- {
- return webdeveloper_getPreferencesService().getIntPref(preference);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
-
- return 0;
-}
-
-// Gets the preferences service
-function webdeveloper_getPreferencesService()
-{
- // If the preferences service is not set
- if(!webdeveloper_preferencesService)
- {
- webdeveloper_preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
- }
-
- return webdeveloper_preferencesService;
-}
-
-// Gets a string preference, returning null if the preference is not set
-function webdeveloper_getStringPreference(preference, userPreference)
-{
- // If the preference is set
- if(preference)
- {
- // If not a user preference or a user preference is set
- if(!userPreference || webdeveloper_isPreferenceSet(preference))
- {
- try
- {
- return webdeveloper_getPreferencesService().getComplexValue(preference, Components.interfaces.nsISupportsString).data.trim();
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
-
- return null;
-}
-
-// Is a preference set
-function webdeveloper_isPreferenceSet(preference)
-{
- // If the preference is set
- if(preference)
- {
- return webdeveloper_getPreferencesService().prefHasUserValue(preference);
- }
-
- return false;
-}
-
-// Sets a boolean preference
-function webdeveloper_setBooleanPreference(preference, value)
-{
- // If the preference is set
- if(preference)
- {
- webdeveloper_getPreferencesService().setBoolPref(preference, value);
- }
-}
-
-// Sets a boolean preference if it is not already set
-function webdeveloper_setBooleanPreferenceIfNotSet(preference, value)
-{
- // If the preference is not set
- if(!webdeveloper_isPreferenceSet(preference))
- {
- webdeveloper_getPreferencesService().setBoolPref(preference, value);
- }
-}
-
-// Sets an integer preference
-function webdeveloper_setIntegerPreference(preference, value)
-{
- // If the preference is set
- if(preference)
- {
- webdeveloper_getPreferencesService().setIntPref(preference, value);
- }
-}
-
-// Sets an integer preference if it is not already set
-function webdeveloper_setIntegerPreferenceIfNotSet(preference, value)
-{
- // If the preference is not set
- if(!webdeveloper_isPreferenceSet(preference))
- {
- webdeveloper_setIntegerPreference(preference, value);
- }
-}
-
-// Sets a string preference
-function webdeveloper_setStringPreference(preference, value)
-{
- // If the preference is set
- if(preference)
- {
- var supportsStringInterface = Components.interfaces.nsISupportsString;
- var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(supportsStringInterface);
-
- string.data = value;
-
- webdeveloper_getPreferencesService().setComplexValue(preference, supportsStringInterface, string);
- }
-}
-
-// Sets a string preference if it is not already set
-function webdeveloper_setStringPreferenceIfNotSet(preference, value)
-{
- // If the preference is not set
- if(!webdeveloper_isPreferenceSet(preference))
- {
- webdeveloper_setStringPreference(preference, value);
- }
-}
\ No newline at end of file
+++ /dev/null
-// Shows a clear confirmation
-function webdeveloper_clearConfirmation(message)
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- return webdeveloper_confirmationDialog(stringBundle.getString("webdeveloper_clearConfirmation"), message, stringBundle.getString("webdeveloper_clear"));
-}
-
-// Shows a close confirmation
-function webdeveloper_closeConfirmation(message)
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- return webdeveloper_confirmationDialog(stringBundle.getString("webdeveloper_closeConfirmation"), message, stringBundle.getString("webdeveloper_close"));
-}
-
-// Shows a confirmation dialog
-function webdeveloper_confirmationDialog(title, message, buttonText)
-{
- // If the hide confirmation dialogs preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.confirmation.dialogs.hide", true))
- {
- var checkBox = {value: false};
- var promptServiceInterface = Components.interfaces.nsIPromptService;
- var result = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(promptServiceInterface).confirmEx(null, title, message, promptServiceInterface.BUTTON_TITLE_IS_STRING * promptServiceInterface.BUTTON_POS_0 + promptServiceInterface.BUTTON_TITLE_CANCEL * promptServiceInterface.BUTTON_POS_1, buttonText, null, null, document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_stopConfirmation"), checkBox);
-
- // If the check box was checked
- if(checkBox.value)
- {
- webdeveloper_setBooleanPreference("webdeveloper.confirmation.dialogs.hide", true);
- }
-
- // If the delete is confirmed
- if(result == 0)
- {
- return true;
- }
-
- return false;
- }
-
- return true;
-}
-
-// Shows a delete confirmation
-function webdeveloper_deleteConfirmation(message)
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- return webdeveloper_confirmationDialog(stringBundle.getString("webdeveloper_deleteConfirmation"), message, stringBundle.getString("webdeveloper_delete"));
-}
-
-// Shows an error message
-function webdeveloper_error(message)
-{
- Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService).alert(null, document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_errorMessage"), message);
-}
-
-// Shows an informational dialog
-function webdeveloper_informationalDialog(title, message)
-{
- var checkBox = {value: false};
- var promptServiceInterface = Components.interfaces.nsIPromptService;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var result = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(promptServiceInterface).alertCheck(null, title, message, stringBundle.getString("webdeveloper_stopInformational"), checkBox);
-
- // If the check box was checked
- if(checkBox.value)
- {
- webdeveloper_setBooleanPreference("webdeveloper.informational.dialogs.hide", true);
- }
-}
-
-// Shows a message
-function webdeveloper_message(title, message)
-{
- Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService).alert(null, title, message);
-}
+++ /dev/null
-// Removes a substring from a string
-function webdeveloper_removeSubstring(string, substring)
-{
- // If the strings are not empty
- if(string && substring)
- {
- var substringStart = string.indexOf(substring);
-
- // If the substring is found in the string
- if(substring && substringStart != -1)
- {
- return string.substring(0, substringStart) + string.substring(substringStart + substring.length, string.length);
- }
-
- return string;
- }
-
- return "";
-}
-
-// Tests if a string ends with the given string
-String.prototype.endsWith = function(endsWithString)
-{
- return (this.substr(this.length - endsWithString.length) == endsWithString);
-}
-
-// Trims leading and trailing spaces from a string
-String.prototype.trim = function()
-{
- return this.replace(new RegExp("^\\s+|\\s+$", "gi"), "");
-}
+++ /dev/null
-// Constructs a validate accessibility object
-function WebDeveloperValidateAccessibility()
-{
- this.file = null;
- this.formElement = null;
- this.inputElement = null;
- this.validationRequest = null;
-}
-
-// Cleans up
-WebDeveloperValidateAccessibility.prototype.cleanUp = function()
-{
- this.deleteFile();
-
- // If the validation request is set
- if(this.validationRequest)
- {
- this.validationRequest.abort();
- }
-}
-
-// Creates a source file
-WebDeveloperValidateAccessibility.prototype.createSourceFile = function(uri)
-{
- var temporaryDirectory = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsIFile);
-
- // If the temporary directory exists, is a directory and is writable
- if(temporaryDirectory.exists() && temporaryDirectory.isDirectory() && temporaryDirectory.isWritable())
- {
- var fileName = "";
- var sourceFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- // Try to get the host
- try
- {
- fileName = uri.host;
- }
- catch(exception)
- {
- // Do nothing
- }
-
- temporaryDirectory.append("webdeveloper_" + fileName + "_" + new Date().getTime() + ".html");
- sourceFile.initWithPath(temporaryDirectory.path);
-
- return sourceFile;
- }
- else
- {
- webdeveloper_error(document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_tempDirectoryFailed", [temporaryDirectory.path]));
-
- return null;
- }
-}
-
-// Deletes the file
-WebDeveloperValidateAccessibility.prototype.deleteFile = function()
-{
- // If the file is set
- if(this.file)
- {
- // Try to delete the file
- try
- {
- this.file.remove(false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- this.file = null;
- }
-}
-
-// Returns the post data
-WebDeveloperValidateAccessibility.prototype.getPostData = function()
-{
- // Try to get the post data
- try
- {
- var sessionHistory = getWebNavigation().sessionHistory;
- var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false).QueryInterface(Components.interfaces.nsISHEntry);
-
- return entry.postData;
- }
- catch(exception)
- {
- return null;
- }
-}
-
-// Parses the validation results by type
-WebDeveloperValidateAccessibility.prototype.parseValidationResultsByType = function(type)
-{
- var resultsHTML = this.validationRequest.responseText;
- var count = resultsHTML.split(type + ".gif").length;
-
- // If the count is greater than 0
- if(count > 0)
- {
- return count - 1;
- }
-
- return 0;
-}
-
-// Retrieves the HTML
-WebDeveloperValidateAccessibility.prototype.retrieveHTML = function()
-{
- var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
- var htmlText = null;
- var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
-
- converter.charset = webdeveloper_getContentDocument().characterSet;
-
- inputStream.init(this.file, 0x01, 0444, null);
- scriptableStream.init(inputStream);
-
- htmlText = converter.ConvertToUnicode(scriptableStream.read(scriptableStream.available()));
-
- scriptableStream.close();
- inputStream.close();
-
- return htmlText;
-}
-
-// Saves the HTML
-WebDeveloperValidateAccessibility.prototype.saveHTML = function(uri)
-{
- var webBrowserPersistInterface = Components.interfaces.nsIWebBrowserPersist;
- var webBrowserPersist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webBrowserPersistInterface);
-
- webBrowserPersist.persistFlags = webBrowserPersistInterface.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION | webBrowserPersistInterface.PERSIST_FLAGS_FROM_CACHE | webBrowserPersistInterface.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
- webBrowserPersist.progressListener = this;
-
- webBrowserPersist.saveURI(uri, null, uri, this.getPostData(), null, this.file);
-}
-
-// Submits the background request to validate the accessibility
-WebDeveloperValidateAccessibility.prototype.submitBackgroundRequest = function()
-{
- var requestBody = "CheckURL=1&URLTest=Your+HTML";
-
- // If the priority 1 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority1", true))
- {
- requestBody += "&p1=1";
- }
-
- // If the priority 2 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority2", true))
- {
- requestBody += "&p2=1";
- }
-
- // If the priority 3 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority3", true))
- {
- requestBody += "&p3=1";
- }
-
- // If the Section 508 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.section508", true))
- {
- requestBody += "&s508=1";
- }
-
- requestBody += "&myHTML=" + encodeURIComponent(this.retrieveHTML());
- this.validationRequest.onreadystatechange = webdeveloper_updatePageAccessibilityValidationDetails;
-
- this.validationRequest.open("post", "http://www.hermish.com/check_this.cfm", true);
-
- // Try to set the request header
- try
- {
- this.validationRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- this.validationRequest.send(requestBody);
- }
- catch(exception)
- {
- // Reset the validation request
- this.validationRequest = new XMLHttpRequest();
- }
-
- this.deleteFile();
-}
-
-// Submits the form to validate the accessibility
-WebDeveloperValidateAccessibility.prototype.submitForm = function()
-{
- this.inputElement.value = this.retrieveHTML();
-
- this.deleteFile();
- this.formElement.submit();
-}
-
-// Validate the accessibility of the given URI in the background
-WebDeveloperValidateAccessibility.prototype.validateBackgroundAccessibility = function(uri)
-{
- this.file = this.createSourceFile(uri);
-
- // If the validation request is not set
- if(!this.validationRequest)
- {
- this.validationRequest = new XMLHttpRequest();
- }
-
- this.saveHTML(uri);
-}
-
-// Validate the accessibility of the given URI
-WebDeveloperValidateAccessibility.prototype.validateAccessibility = function(uri)
-{
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var imageElement = generatedDocument.createElement("img");
- var inputElement = null;
- var pElement = generatedDocument.createElement("p");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- generatedDocument.title = stringBundle.getString("webdeveloper_validateAccessibility");
- this.file = this.createSourceFile(uri);
- this.formElement = generatedDocument.createElement("form");
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- imageElement.setAttribute("alt", "loading");
- imageElement.setAttribute("src", "chrome://webdeveloper/content/images/content/loading.gif");
- pElement.appendChild(imageElement);
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_contactingValidator")));
- pElement.setAttribute("class", "loading");
- bodyElement.appendChild(pElement);
-
- this.formElement.setAttribute("action", "http://www.hermish.com/check_this.cfm");
- this.formElement.setAttribute("method", "post");
- this.formElement.setAttribute("style", "display: none");
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "CheckURL");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
-
- // If the priority 1 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority1", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "p1");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- // If the priority 2 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority2", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "p2");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- // If the priority 3 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority3", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "p3");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- // If the Section 508 preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.section508", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "s508");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "URLTest");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "Your HTML");
- this.formElement.appendChild(inputElement);
-
- this.inputElement = generatedDocument.createElement("input");
-
- this.inputElement.setAttribute("name", "myHTML");
- this.inputElement.setAttribute("type", "hidden");
- this.formElement.appendChild(this.inputElement);
- bodyElement.appendChild(this.formElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-
- this.saveHTML(uri);
-}
-
-// Called when the progress state changes
-WebDeveloperValidateAccessibility.prototype.onStateChange = function(webProgress, request, stateFlags, status)
-{
- // If the progress has stopped
- if(stateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
- {
- // If the file is set and exists
- if(this.file && this.file.exists())
- {
- // If the validation request is set
- if(this.validationRequest)
- {
- this.submitBackgroundRequest();
- }
- else
- {
- this.submitForm();
- }
- }
- }
-}
-
-// Indicates the interfaces this object supports
-WebDeveloperValidateAccessibility.prototype.QueryInterface = function(id)
-{
- // If the query is for a supported interface
- if(id.equals(Components.interfaces.nsISupports) || id.equals(Components.interfaces.nsIWebProgressListener))
- {
- return this;
- }
-
- throw Components.results.NS_NOINTERFACE;
-}
-
-// Dummy methods requiring implementations
-WebDeveloperValidateAccessibility.prototype.onLocationChange = function(webProgress, request, location) {}
-WebDeveloperValidateAccessibility.prototype.onProgressChange = function(webProgress, request, currentSelfProgress, maximumSelfProgress, currentTotalProgress, maximumTotalProgress) {}
-WebDeveloperValidateAccessibility.prototype.onSecurityChange = function(webProgress, request, state) {}
-WebDeveloperValidateAccessibility.prototype.onStatusChange = function(webProgress, request, status, message) {}
+++ /dev/null
-// Constructs a validate CSS object
-function WebDeveloperValidateCSS()
-{
- this.file = null;
- this.validationRequest = null;
-}
-
-// Cleans up
-WebDeveloperValidateCSS.prototype.cleanUp = function()
-{
- // If the file is set
- if(this.file)
- {
- // Try to delete the file
- try
- {
- this.file.remove(false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- this.file = null;
- }
-
- // If the validation request is set
- if(this.validationRequest)
- {
- this.validationRequest.abort();
- }
-}
-
-// Creates a source file
-WebDeveloperValidateCSS.prototype.createSourceFile = function(uri)
-{
- var temporaryDirectory = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsIFile);
-
- // If the temporary directory exists, is a directory and is writable
- if(temporaryDirectory.exists() && temporaryDirectory.isDirectory() && temporaryDirectory.isWritable())
- {
- var fileName = "";
- var sourceFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- // Try to get the host
- try
- {
- fileName = uri.host;
- }
- catch(exception)
- {
- // Do nothing
- }
-
- temporaryDirectory.append("webdeveloper_" + fileName + "_" + new Date().getTime() + ".css");
- sourceFile.initWithPath(temporaryDirectory.path);
-
- return sourceFile;
- }
- else
- {
- webdeveloper_error(document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_tempDirectoryFailed", [temporaryDirectory.path]));
-
- return null;
- }
-}
-
-// Parses the validation results by type
-WebDeveloperValidateCSS.prototype.parseValidationResultsByType = function(type)
-{
- var count = 0;
- var resultsHTML = this.validationRequest.responseText;
- var startPosition = resultsHTML.indexOf('<div id="' + type + '">');
-
- // If the start position is greater than 0
- if(startPosition > 0)
- {
- var endPosition = resultsHTML.indexOf("</div>", startPosition);
-
- // If the end position is greater than 0
- if(endPosition > 0)
- {
- count = resultsHTML.slice(startPosition, endPosition).split("<li>").length;
- }
- }
-
- // If the count is greater than 0
- if(count > 0)
- {
- return count - 1;
- }
-
- return 0;
-}
-
-// Retrieves the CSS for the given document list
-WebDeveloperValidateCSS.prototype.retrieveCSS = function(documentList)
-{
- var documentLength = documentList.length;
- var documentURL = null;
- var pageDocument = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleSheet = null;
- var styleSheetHref = null;
- var styleSheetLength = null;
- var styleSheetList = null;
- var styleText = "";
- var styleElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- styleSheetList = pageDocument.getElementsByTagName("style");
- styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleElement = styleSheetList[j];
- styleSheet = styleElement.sheet;
-
- // If this is a valid style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet))
- {
- styleText += "/* " + stringBundle.getFormattedString("webdeveloper_embeddedStylesFrom", [styleSheet.href]) + " */\n\n";
- styleText += styleElement.innerHTML.trim() + "\n\n";
- }
- }
-
- styleSheetList = webdeveloper_getStyleSheetsForDocument(pageDocument, true, true);
- styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(j = 0; j < styleSheetLength; j++)
- {
- styleSheetHref = styleSheetList[j].href;
-
- // If this is not an inline style sheet
- if(styleSheetHref != documentURL)
- {
- styleText += webdeveloper_retrieveSource(styleSheetHref);
- }
- }
- }
-
- return styleText;
-}
-
-// Validate the CSS from the given URI and document list in the background
-WebDeveloperValidateCSS.prototype.validateBackgroundCSS = function(uri, documentList)
-{
- var boundaryString = new Date().getTime();
- var boundary = "--" + boundaryString;
- var requestBody = boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"css.css\"\r\n";
-
- // If the validation request is not set
- if(!this.validationRequest)
- {
- this.validationRequest = new XMLHttpRequest();
- }
-
- this.validationRequest.onreadystatechange = webdeveloper_updatePageCSSValidationDetails;
-
- requestBody += "Content-Type: text/css\r\n\r\n";
- requestBody += this.retrieveCSS(documentList) + "\r\n";
- requestBody += boundary + "\r\n";
- requestBody += "Content-Disposition: form-data; name=\"profile\"\r\n\r\n" + webdeveloper_getStringPreference("webdeveloper.validate.local.css.profile", true) + "\r\n";
- requestBody += boundary + "\r\n";
- requestBody += "Content-Disposition: form-data; name=\"usermedium\"\r\n\r\nall\r\n";
- requestBody += boundary + "\r\n";
- requestBody += "Content-Disposition: form-data; name=\"warning\"\r\n\r\n0\r\n";
- requestBody += boundary + "--";
-
- this.validationRequest.open("post", "http://jigsaw.w3.org/css-validator/validator", true);
-
- // Try to set the request header
- try
- {
- this.validationRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundaryString);
- this.validationRequest.send(requestBody);
- }
- catch(exception)
- {
- // Reset the validation request
- this.validationRequest = new XMLHttpRequest();
- }
-}
-
-// Validate the CSS from the given URI and document list
-WebDeveloperValidateCSS.prototype.validateCSS = function(uri, documentList)
-{
- var oldTab = getBrowser().selectedTab;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var formElement = generatedDocument.createElement("form");
- var imageElement = generatedDocument.createElement("img");
- var inputElement = null;
- var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
- var pElement = generatedDocument.createElement("p");
- var scriptElement = generatedDocument.createElement("script");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleText = null;
-
- generatedDocument.title = stringBundle.getString("webdeveloper_validateCSS");
- this.file = this.createSourceFile(uri);
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- imageElement.setAttribute("alt", "loading");
- imageElement.setAttribute("src", "chrome://webdeveloper/content/images/content/loading.gif");
- pElement.appendChild(imageElement);
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_contactingValidator")));
- pElement.setAttribute("class", "loading");
- bodyElement.appendChild(pElement);
-
- styleText = this.retrieveCSS(documentList);
-
- this.file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 00644);
- outputStream.init(this.file, 0x04 | 0x08 | 0x20 | 0x40, 00644, null);
-
- outputStream.write(styleText, styleText.length);
- outputStream.close();
-
- formElement.setAttribute("action", "http://jigsaw.w3.org/css-validator/validator");
- formElement.setAttribute("enctype", "multipart/form-data");
- formElement.setAttribute("method", "post");
- formElement.setAttribute("style", "display: none");
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "profile");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", webdeveloper_getStringPreference("webdeveloper.validate.local.css.profile", true));
- formElement.appendChild(inputElement);
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "usermedium");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "all");
- formElement.appendChild(inputElement);
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "warning");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "0");
- formElement.appendChild(inputElement);
-
- inputElement = generatedDocument.createElement("input")
-
- inputElement.setAttribute("name", "file");
- inputElement.setAttribute("type", "file");
-
- inputElement.value = this.file.path;
-
- formElement.appendChild(inputElement);
- bodyElement.appendChild(formElement);
- formElement.submit();
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-// Constructs a validate HTML object
-function WebDeveloperValidateHTML()
-{
- this.file = null;
- this.fileElement = null;
- this.formElement = null;
- this.validationRequest = null;
-}
-
-// Cleans up
-WebDeveloperValidateHTML.prototype.cleanUp = function()
-{
- // If the file is set
- if(this.file)
- {
- // Try to delete the file
- try
- {
- this.file.remove(false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- this.file = null;
- }
-
- // If the validation request is set
- if(this.validationRequest)
- {
- this.validationRequest.abort();
- }
-}
-
-// Creates a source file
-WebDeveloperValidateHTML.prototype.createSourceFile = function(uri)
-{
- var temporaryDirectory = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsIFile);
-
- // If the temporary directory exists, is a directory and is writable
- if(temporaryDirectory.exists() && temporaryDirectory.isDirectory() && temporaryDirectory.isWritable())
- {
- var fileName = "";
- var sourceFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- // Try to get the host
- try
- {
- fileName = uri.host;
- }
- catch(exception)
- {
- // Do nothing
- }
-
- temporaryDirectory.append("webdeveloper_" + fileName + "_" + new Date().getTime() + ".html");
- sourceFile.initWithPath(temporaryDirectory.path);
-
- return sourceFile;
- }
- else
- {
- webdeveloper_error(document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_tempDirectoryFailed", [temporaryDirectory.path]));
-
- return null;
- }
-}
-
-// Returns the post data
-WebDeveloperValidateHTML.prototype.getPostData = function()
-{
- // Try to get the post data
- try
- {
- var sessionHistory = getWebNavigation().sessionHistory;
- var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false).QueryInterface(Components.interfaces.nsISHEntry);
-
- return entry.postData;
- }
- catch(exception)
- {
- return null;
- }
-}
-
-// Saves the HTML
-WebDeveloperValidateHTML.prototype.saveHTML = function(uri)
-{
- var webBrowserPersistInterface = Components.interfaces.nsIWebBrowserPersist;
- var webBrowserPersist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webBrowserPersistInterface);
-
- webBrowserPersist.persistFlags = webBrowserPersistInterface.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION | webBrowserPersistInterface.PERSIST_FLAGS_FROM_CACHE | webBrowserPersistInterface.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
- webBrowserPersist.progressListener = this;
-
- webBrowserPersist.saveURI(uri, null, uri, this.getPostData(), null, this.file);
-}
-
-// Submits the background request to validate the HTML
-WebDeveloperValidateHTML.prototype.submitBackgroundRequest = function()
-{
- var boundaryString = new Date().getTime();
- var boundary = "--" + boundaryString;
- var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
- var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
- var requestBody = boundary + "\r\nContent-Disposition: form-data; name=\"uploaded_file\"; filename=\"" + this.file.leafName + "\"\r\n";
-
- converter.charset = webdeveloper_getContentDocument().characterSet;
- this.validationRequest.onreadystatechange = webdeveloper_updatePageHTMLValidationDetails;
-
- inputStream.init(this.file, 0x01, 0444, null);
- scriptableStream.init(inputStream);
-
- requestBody += "Content-Type: text/html\r\n\r\n";
- requestBody += converter.ConvertToUnicode(scriptableStream.read(scriptableStream.available())) + "\r\n";
- requestBody += boundary + "--";
-
- scriptableStream.close();
- inputStream.close();
-
- this.validationRequest.open("post", "http://validator.w3.org/check", true);
-
- // Try to set the request header
- try
- {
- this.validationRequest.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundaryString);
- this.validationRequest.send(requestBody);
- }
- catch(exception)
- {
- // Reset the validation request
- this.validationRequest = new XMLHttpRequest();
- }
-}
-
-// Submits the form to validate the HTML
-WebDeveloperValidateHTML.prototype.submitForm = function()
-{
- this.fileElement.value = this.file.path;
-
- this.formElement.submit();
-}
-
-// Validate the HTML from the given URI in the background
-WebDeveloperValidateHTML.prototype.validateBackgroundHTML = function(uri)
-{
- this.file = this.createSourceFile(uri);
-
- // If the validation request is not set
- if(!this.validationRequest)
- {
- this.validationRequest = new XMLHttpRequest();
- }
-
- this.saveHTML(uri);
-}
-
-// Validate the HTML from the given URI
-WebDeveloperValidateHTML.prototype.validateHTML = function(uri)
-{
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var imageElement = generatedDocument.createElement("img");
- var inputElement = null;
- var pElement = generatedDocument.createElement("p");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- generatedDocument.title = stringBundle.getString("webdeveloper_validateHTML");
- this.file = this.createSourceFile(uri);
- this.formElement = generatedDocument.createElement("form");
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- imageElement.setAttribute("alt", "loading");
- imageElement.setAttribute("src", "chrome://webdeveloper/content/images/content/loading.gif");
- pElement.appendChild(imageElement);
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_contactingValidator")));
- pElement.setAttribute("class", "loading");
- bodyElement.appendChild(pElement);
-
- this.formElement.setAttribute("action", "http://validator.w3.org/check");
- this.formElement.setAttribute("enctype", "multipart/form-data");
- this.formElement.setAttribute("method", "post");
- this.formElement.setAttribute("style", "display: none");
-
- // If the show outline preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.outline", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "outline");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- // If the show parse tree preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.parse.tree", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "sp");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- // If the show source preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.source", true))
- {
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "ss");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
- }
-
- inputElement = generatedDocument.createElement("input");
-
- inputElement.setAttribute("name", "verbose");
- inputElement.setAttribute("type", "hidden");
- inputElement.setAttribute("value", "1");
- this.formElement.appendChild(inputElement);
-
- this.fileElement = generatedDocument.createElement("input");
-
- this.fileElement.setAttribute("name", "uploaded_file");
- this.fileElement.setAttribute("type", "file");
- this.formElement.appendChild(this.fileElement);
- bodyElement.appendChild(this.formElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-
- this.saveHTML(uri);
-}
-
-// Called when the progress state changes
-WebDeveloperValidateHTML.prototype.onStateChange = function(webProgress, request, stateFlags, status)
-{
- // If the progress has stopped
- if(stateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
- {
- // If the file is set and exists
- if(this.file && this.file.exists())
- {
- // If the validation request is set
- if(this.validationRequest)
- {
- this.submitBackgroundRequest();
- }
- else
- {
- this.submitForm();
- }
- }
- }
-}
-
-// Indicates the interfaces this object supports
-WebDeveloperValidateHTML.prototype.QueryInterface = function(id)
-{
- // If the query is for a supported interface
- if(id.equals(Components.interfaces.nsISupports) || id.equals(Components.interfaces.nsIWebProgressListener))
- {
- return this;
- }
-
- throw Components.results.NS_NOINTERFACE;
-}
-
-// Dummy methods requiring implementations
-WebDeveloperValidateHTML.prototype.onLocationChange = function(webProgress, request, location) {}
-WebDeveloperValidateHTML.prototype.onProgressChange = function(webProgress, request, currentSelfProgress, maximumSelfProgress, currentTotalProgress, maximumTotalProgress) {}
-WebDeveloperValidateHTML.prototype.onSecurityChange = function(webProgress, request, state) {}
-WebDeveloperValidateHTML.prototype.onStatusChange = function(webProgress, request, status, message) {}
+++ /dev/null
-// Evaluates an XPath against a given node
-function webdeveloper_evaluateXPath(node, xPath)
-{
- var result = null;
- var resultList = new Array();
- var xPathEvaluator = new XPathEvaluator();
- var results = null;
-
- // If the node has an owner document
- if(node.ownerDocument)
- {
- results = xPathEvaluator.evaluate(xPath, node, xPathEvaluator.createNSResolver(node.ownerDocument.documentElement), 0, null);
- }
- else
- {
- results = xPathEvaluator.evaluate(xPath, node, xPathEvaluator.createNSResolver(node.documentElement), 0, null);
- }
-
- // Loop through the results
- while((result = results.iterateNext()) != null)
- {
- resultList.push(result);
- }
-
- return resultList;
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:chrome="http://www.mozilla.org/rdf/chrome#"
- xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-
- <RDF:Seq about="urn:mozilla:overlays">
- <RDF:li resource="chrome://browser/content/browser.xul"/>
- </RDF:Seq>
- <RDF:Seq about="chrome://browser/content/browser.xul">
- <RDF:li>chrome://webdeveloper/content/webdeveloper.xul</RDF:li>
- </RDF:Seq>
- <RDF:Seq about="urn:mozilla:package:root">
- <RDF:li resource="urn:mozilla:package:webdeveloper"/>
- </RDF:Seq>
- <RDF:Description about="urn:mozilla:package:webdeveloper"
- chrome:author="Chris Pederick"
- chrome:authorURL="http://chrispederick.com/work/web-developer/"
- chrome:description="Adds a menu and a toolbar with various web developer tools."
- chrome:displayName="Web Developer 1.1.4"
- chrome:extension="true"
- chrome:name="webdeveloper"
- chrome:settingsURL="chrome://webdeveloper/content/options/options.xul"/>
-</RDF:RDF>
+++ /dev/null
-// Adds a cookie
-function webdeveloper_addCookie()
-{
- window.openDialog("chrome://webdeveloper/content/dialogs/cookie.xul", "webdeveloper-cookie-dialog", "centerscreen,chrome,modal", "add");
-}
-
-// Clears all session cookies
-function webdeveloper_clearSessionCookies()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the clearing is confirmed
- if(webdeveloper_clearConfirmation(stringBundle.getString("webdeveloper_clearSessionCookiesConfirmation")))
- {
- var cookie = null;
- var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);
- var cookies = cookieManager.enumerator;
- var removed = 0;
-
- // Loop through the cookies
- while(cookies.hasMoreElements())
- {
- cookie = cookies.getNext();
-
- // If this is a cookie with no expiration
- if(cookie instanceof Components.interfaces.nsICookie && cookie.expires == "0")
- {
- cookieManager.remove(cookie.host, cookie.name, cookie.path, false);
- removed++;
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var title = stringBundle.getString("webdeveloper_clearSessionCookies");
-
- // If one session cookie was removed
- if(removed == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_clearSessionCookiesSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_clearSessionCookiesMultipleResult", [removed]));
- }
- }
- }
-}
-
-// Deletes a cookie
-function webdeveloper_deleteCookie(event)
-{
- var eventTarget = event.target;
-
- // If there is an event target and the click was not a right click
- if(eventTarget && event.button != 2)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the deletion is confirmed
- if(webdeveloper_deleteConfirmation(stringBundle.getString("webdeveloper_deleteCookieConfirmation")))
- {
- Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).remove(eventTarget.getAttribute("cookie-host"), eventTarget.getAttribute("cookie-name"), eventTarget.getAttribute("cookie-path"), false);
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- webdeveloper_informationalDialog(stringBundle.getString("webdeveloper_deleteCookie"), stringBundle.getString("webdeveloper_deleteCookieResult"));
- }
- }
-
- event.preventDefault();
- }
-}
-
-// Called when a delete cookie link is moused out
-function webdeveloper_deleteCookieMouseOut(event)
-{
- // If there is an event target
- if(event.target)
- {
- getBrowser().contentWindow.status = "";
-
- event.preventDefault();
- }
-}
-
-// Called when a delete cookie link is moused over
-function webdeveloper_deleteCookieMouseOver(event)
-{
- // If there is an event target
- if(event.target)
- {
- getBrowser().contentWindow.status = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_deleteCookie");
-
- event.preventDefault();
- }
-}
-
-// Deletes all the cookies for the current domain
-function webdeveloper_deleteDomainCookies()
-{
- var cookies = new Array();
- var cookiesLength = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var message = null;
- var pageDocument = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- cookies = cookies.concat(webdeveloper_getCookies(pageDocument.location.hostname, "/", false));
- }
-
- cookiesLength = cookies.length;
-
- // If one cookie was found
- if(cookiesLength == 1)
- {
- message = stringBundle.getString("webdeveloper_deleteDomainCookiesSingleConfirmation");
- }
- else
- {
- message = stringBundle.getFormattedString("webdeveloper_deleteDomainCookiesMultipleConfirmation", [cookiesLength]);
- }
-
- // If the deletion is confirmed
- if(cookiesLength == 0 || webdeveloper_deleteConfirmation(message))
- {
- var cookie = null;
- var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);
-
- // Loop through all the cookies
- for(i = 0 ; i < cookiesLength; i++)
- {
- cookie = cookies[i];
-
- cookieManager.remove(cookie.host, cookie.name, cookie.path, false);
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var title = stringBundle.getString("webdeveloper_deleteDomainCookies");
-
- // If one cookie was found
- if(cookiesLength == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_deleteDomainCookiesSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_deleteDomainCookiesMultipleResult", [cookiesLength]));
- }
- }
- }
-}
-
-// Deletes all the cookies for the current path
-function webdeveloper_deletePathCookies()
-{
- var cookies = new Array();
- var cookiesLength = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var message = null;
- var pageDocument = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- cookies = cookies.concat(webdeveloper_getCookies(pageDocument.location.hostname, pageDocument.location.pathname, false));
- }
-
- cookiesLength = cookies.length;
-
- // If one cookie was found
- if(cookiesLength == 1)
- {
- message = stringBundle.getString("webdeveloper_deletePathCookiesSingleConfirmation");
- }
- else
- {
- message = stringBundle.getFormattedString("webdeveloper_deletePathCookiesMultipleConfirmation", [cookiesLength]);
- }
-
- // If the deletion is confirmed
- if(cookiesLength == 0 || webdeveloper_deleteConfirmation(message))
- {
- var cookie = null;
- var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);
-
- // Loop through all the cookies
- for(i = 0 ; i < cookiesLength; i++)
- {
- cookie = cookies[i];
-
- cookieManager.remove(cookie.host, cookie.name, cookie.path, false);
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var title = stringBundle.getString("webdeveloper_deletePathCookies");
-
- // If one cookie was found
- if(cookiesLength == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_deletePathCookiesSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_deletePathCookiesMultipleResult", [cookiesLength]));
- }
- }
- }
-}
-
-// Edits a cookie
-function webdeveloper_editCookie(event)
-{
- var eventTarget = event.target;
-
- // If there is an event target and the click was not a right click
- if(eventTarget && event.button != 2)
- {
- window.openDialog("chrome://webdeveloper/content/dialogs/cookie.xul", "webdeveloper-cookie-dialog", "centerscreen,chrome,modal", "edit", eventTarget.getAttribute("cookie-name"), eventTarget.getAttribute("cookie-value"), eventTarget.getAttribute("cookie-host"), eventTarget.getAttribute("cookie-path"), eventTarget.getAttribute("cookie-expires"), eventTarget.getAttribute("cookie-secure"));
-
- event.preventDefault();
- }
-}
-
-// Called when an edit cookie link is moused out
-function webdeveloper_editCookieMouseOut(event)
-{
- // If there is an event target
- if(event.target)
- {
- getBrowser().contentWindow.status = "";
-
- event.preventDefault();
- }
-}
-
-// Called when an edit cookie link is moused over
-function webdeveloper_editCookieMouseOver(event)
-{
- // If there is an event target
- if(event.target)
- {
- getBrowser().contentWindow.status = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_editCookie");
-
- event.preventDefault();
- }
-}
-
-// Toggles cookies
-function webdeveloper_toggleCookies(element)
-{
- var cookieBehavior = 0;
-
- // If disabling cookies
- if(element.getAttribute("checked"))
- {
- cookieBehavior = 2;
- }
-
- webdeveloper_setIntegerPreference("network.cookie.cookieBehavior", cookieBehavior);
-}
-
-// Toggles external site cookies
-function webdeveloper_toggleExternalSiteCookies(element)
-{
- var cookieBehavior = 0;
-
- // If disabling external cookies
- if(element.getAttribute("checked"))
- {
- cookieBehavior = 1;
- }
-
- webdeveloper_setIntegerPreference("network.cookie.cookieBehavior", cookieBehavior);
-}
-
-// Updates the disable cookies menu
-function webdeveloper_updateDisableCookiesMenu(suffix)
-{
- var disableExternalSiteCookiesChecked = false;
- var disableExternalSiteCookiesMenu = document.getElementById("webdeveloper-disable-external-site-cookies-" + suffix);
- var disableCookiesChecked = false;
- var disableCookiesPreferenceValue = webdeveloper_getIntegerPreference("network.cookie.cookieBehavior", true);
-
- // If the cookie preference value is set to 2
- if(disableCookiesPreferenceValue == 2)
- {
- disableCookiesChecked = true;
- }
- else if(disableCookiesPreferenceValue == 1)
- {
- disableExternalSiteCookiesChecked = true;
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-all-cookies-" + suffix), "checked", disableCookiesChecked);
- webdeveloper_configureElement(disableExternalSiteCookiesMenu, "checked", disableExternalSiteCookiesChecked);
- webdeveloper_configureElement(disableExternalSiteCookiesMenu, "disabled", disableCookiesChecked);
-}
-
-// Displays all the cookies for the page
-function webdeveloper_viewCookieInformation()
-{
- var cellDataElement = null;
- var cellHeaderElement = null;
- var cookie = null;
- var cookieExpires = null;
- var cookieHost = null;
- var cookieLength = null;
- var cookieName = null;
- var cookiePath = null;
- var cookies = null;
- var cookieSecure = null;
- var cookieValue = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var hostName = null;
- var linkElement = null;
- var listElement = null;
- var listItemElement = null;
- var location = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var preElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var tableElement = null;
- var tableRowElement = null;
- var title = stringBundle.getFormattedString("webdeveloper_viewCookieInformationTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- hostName = null;
- pageDocument = documentList[i];
- location = pageDocument.location;
-
- // Try to get the host name
- try
- {
- hostName = location.hostname;
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // If the host name is set
- if(hostName)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- cookies = webdeveloper_getCookies(hostName, location.pathname, true);
- cookieLength = cookies.length;
- spanElement = generatedDocument.createElement("span");
-
- linkElement.setAttribute("href", pageDocument.documentURI);
- linkElement.appendChild(generatedDocument.createTextNode(pageDocument.documentURI));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- headerElement = generatedDocument.createElement("h3");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
-
- // If there is one cookie
- if(cookieLength == 1)
- {
- headerElement.appendChild(generatedDocument.createTextNode(cookieLength + " " + stringBundle.getString("webdeveloper_cookie").toLowerCase()));
- }
- else
- {
- headerElement.appendChild(generatedDocument.createTextNode(cookieLength + " " + stringBundle.getString("webdeveloper_cookies").toLowerCase()));
- }
-
- bodyElement.appendChild(headerElement);
-
- // Loop through the cookies
- for(var j = 0; j < cookieLength; j++)
- {
- cookie = cookies[j];
- cookieHost = cookie.host;
- cookieName = cookie.name;
- cookiePath = cookie.path;
- cookieSecure = cookie.isSecure;
- cookieValue = cookie.value;
- tableElement = generatedDocument.createElement("table");
-
- // Cookie name
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_name")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(cookieName));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Cookie value
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_value")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.setAttribute("class", "shaded");
- cellDataElement.appendChild(generatedDocument.createTextNode(cookieValue));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Cookie host
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_host")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(cookieHost));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Cookie path
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_path")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.setAttribute("class", "shaded");
- cellDataElement.appendChild(generatedDocument.createTextNode(cookiePath));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Cookie secure
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_secure")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // If the cookie is secure
- if(cookieSecure)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_yes")));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_no")));
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // If the cookie has an expiration date
- if(cookie.expires)
- {
- cookieExpires = new Date(cookie.expires * 1000).toUTCString();
- }
- else
- {
- cookieExpires = stringBundle.getString("webdeveloper_viewCookieInformationSession");
- }
-
- // Cookie expires
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_expires")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.setAttribute("class", "shaded");
- cellDataElement.appendChild(generatedDocument.createTextNode(cookieExpires));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- divElement.appendChild(tableElement);
-
- // Edit link
- linkElement = generatedDocument.createElement("a");
- listElement = generatedDocument.createElement("ul");
- listItemElement = generatedDocument.createElement("li");
-
- linkElement.addEventListener("blur", webdeveloper_editCookieMouseOut, false);
- linkElement.addEventListener("click", webdeveloper_editCookie, false);
- linkElement.addEventListener("focus", webdeveloper_editCookieMouseOver, false);
- linkElement.addEventListener("mouseout", webdeveloper_editCookieMouseOut, false);
- linkElement.addEventListener("mouseover", webdeveloper_editCookieMouseOver, false);
- linkElement.setAttribute("cookie-expires", cookieExpires);
- linkElement.setAttribute("cookie-host", cookieHost);
- linkElement.setAttribute("cookie-name", cookieName);
- linkElement.setAttribute("cookie-path", cookiePath);
- linkElement.setAttribute("cookie-secure", cookieSecure);
- linkElement.setAttribute("cookie-value", cookieValue);
- linkElement.setAttribute("href", "http://example.com/");
-
- linkElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_editCookie")));
- listItemElement.appendChild(linkElement);
- listItemElement.setAttribute("class", "edit");
- listElement.appendChild(listItemElement);
-
- // Delete link
- linkElement = generatedDocument.createElement("a");
- listItemElement = generatedDocument.createElement("li");
-
- linkElement.addEventListener("blur", webdeveloper_deleteCookieMouseOut, false);
- linkElement.addEventListener("click", webdeveloper_deleteCookie, false);
- linkElement.addEventListener("focus", webdeveloper_deleteCookieMouseOver, false);
- linkElement.addEventListener("mouseout", webdeveloper_deleteCookieMouseOut, false);
- linkElement.addEventListener("mouseover", webdeveloper_deleteCookieMouseOver, false);
- linkElement.setAttribute("cookie-host", cookieHost);
- linkElement.setAttribute("cookie-name", cookieName);
- linkElement.setAttribute("cookie-path", cookiePath);
- linkElement.setAttribute("href", "http://example.com/");
-
- linkElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_deleteCookie")));
- listItemElement.appendChild(linkElement);
- listItemElement.setAttribute("class", "delete");
- listElement.appendChild(listItemElement);
- listElement.setAttribute("class", "commands");
- divElement.appendChild(listElement);
- divElement.appendChild(generatedDocument.createElement("hr"));
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-var webdeveloper_userStyleSheet = null;
-
-// Adds a user style sheet to the page
-function webdeveloper_addUserStyleSheet(element)
-{
- var addStyleSheet = element.getAttribute("checked");
-
- // If adding a style sheet
- if(addStyleSheet)
- {
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- filePicker.appendFilter(stringBundle.getString("webdeveloper_styleSheetDescription"), "*.css");
- filePicker.init(window, stringBundle.getString("webdeveloper_addUserStyleSheet"), filePicker.modeOpen);
-
- // If the user selected a style sheet
- if(filePicker.show() == filePicker.returnOK)
- {
- var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
-
- inputStream.init(filePicker.file, 0x01, 0444, null);
- scriptableStream.init(inputStream);
-
- webdeveloper_userStyleSheet = scriptableStream.read(scriptableStream.available());
-
- scriptableStream.close();
- inputStream.close();
- }
- else
- {
- addStyleSheet = false;
- webdeveloper_userStyleSheet = null;
- }
- }
-
- // If adding a style sheet and the style sheet is not empty
- if(addStyleSheet && webdeveloper_userStyleSheet)
- {
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var styleElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleElement = pageDocument.createElement("style");
-
- styleElement.setAttribute("id", "webdeveloper-add-user-style-sheet");
- styleElement.setAttribute("type", "text/css");
- styleElement.appendChild(pageDocument.createTextNode(webdeveloper_userStyleSheet));
-
- webdeveloper_getDocumentHeadElement(pageDocument).appendChild(styleElement);
- }
-
- webdeveloper_addAppliedStyle("webdeveloper-add-user-style-sheet");
- }
- else
- {
- webdeveloper_userStyleSheet = null;
- webdeveloper_removeStyleSheet("webdeveloper-add-user-style-sheet", true);
- }
-}
-
-// Display CSS for the given media type
-function webdeveloper_displayCSSMediaType(type, reset)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var media = null;
- var pageDocument = null;
- var styleSheet = null;
- var styleSheetLength = null;
- var styleSheetList = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleSheetList = pageDocument.styleSheets;
- styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If the style sheet is valid and not an alternate style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && !webdeveloper_isAlternateStyleSheet(styleSheet))
- {
- media = styleSheet.media;
-
- // If resetting
- if(reset)
- {
- // If the style sheet has the webdeveloper-appended-screen media
- if(webdeveloper_isMediaStyleSheet(styleSheet, "webdeveloper-appended-screen"))
- {
- media.deleteMedium("webdeveloper-appended-screen");
- media.deleteMedium("screen");
- }
- else if(webdeveloper_isMediaStyleSheet(styleSheet, "webdeveloper-deleted-screen"))
- {
- media.appendMedium("screen");
- media.deleteMedium("webdeveloper-deleted-screen");
- }
- }
- else
- {
- // If the style sheet matches this media
- if(webdeveloper_isMediaStyleSheet(styleSheet, type))
- {
- // If the style sheet has the screen media
- if(!webdeveloper_isMediaStyleSheet(styleSheet, "screen"))
- {
- media.appendMedium("webdeveloper-appended-screen");
- media.appendMedium("screen");
- }
- }
- else if(webdeveloper_isMediaStyleSheet(styleSheet, "screen"))
- {
- // If the media length is not 0
- if(media.length != 0)
- {
- media.deleteMedium("screen");
- }
-
- media.appendMedium("webdeveloper-deleted-screen");
- }
- }
-
- // Force the styles to reapply by disabling and enabling the style sheet
- styleSheet.disabled = true;
- styleSheet.disabled = false;
- }
- }
- }
-}
-
-// Display the disable individual style sheet menu
-function webdeveloper_displayDisableIndividualStyleSheetMenu(menu)
-{
- var currentDocument = webdeveloper_getContentDocument();
- var mediaList = null;
- var menuItem = null;
- var ownerNode = null;
- var styleSheet = null;
- var styleSheetHref = null;
- var styleSheetLabel = null;
- var styleSheetList = currentDocument.styleSheets;
- var styleSheetLength = styleSheetList.length;
-
- webdeveloper_removeGeneratedMenuItems(menu);
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetLength; i++)
- {
- styleSheet = styleSheetList[i];
- ownerNode = styleSheet.ownerNode;
- styleSheetHref = styleSheet.href;
-
- // If this is a valid style sheet, is not an line style sheet and is not an alternate style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && styleSheetHref != currentDocument.documentURI)
- {
- menuItem = document.createElement("menuitem");
-
- // If the owner node is set, is not a processing instruction and has a title attribute
- if(ownerNode && ownerNode.nodeType != Components.interfaces.nsIDOMNode.PROCESSING_INSTRUCTION_NODE && ownerNode.hasAttribute("title"))
- {
- styleSheetLabel = ownerNode.getAttribute("title");
- }
- else
- {
- styleSheetLabel = styleSheetHref;
- }
-
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", styleSheetLabel);
- menuItem.setAttribute("oncommand", "webdeveloper_toggleIndividualStyleSheet('" + styleSheetHref + "')");
- menuItem.setAttribute("type", "checkbox");
-
- // If the style sheet is disabled
- if(!styleSheet.disabled)
- {
- menuItem.setAttribute("checked", true);
- }
-
- menu.appendChild(menuItem);
- }
- }
-
- // If the menu has no children
- if(!menu.hasChildNodes())
- {
- menuItem = document.createElement("menuitem");
- styleSheetLabel = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_noStyleSheets");
-
- menuItem.disabled = true;
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", styleSheetLabel);
- menu.appendChild(menuItem);
- }
-}
-
-// Display CSS for the handheld media type
-function webdeveloper_displayHandheldCSS(element)
-{
- var printElement = document.getElementById("webdeveloper-display-print-css-menu");
-
- webdeveloper_configureElementByAppliedStyle(printElement, "checked", "webdeveloper-display-print-css");
-
- // If the print element is checked
- if(printElement.getAttribute("checked"))
- {
- webdeveloper_displayCSSMediaType("print", true);
- webdeveloper_removeStyleSheet("webdeveloper-display-print-css");
- }
-
- webdeveloper_displayCSSMediaType("handheld", !element.getAttribute("checked"));
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-display-handheld-css");
-}
-
-// Display CSS for the print media type
-function webdeveloper_displayPrintCSS(element)
-{
- var handheldElement = document.getElementById("webdeveloper-display-handheld-css-menu");
-
- webdeveloper_configureElementByAppliedStyle(handheldElement, "checked", "webdeveloper-display-handheld-css");
-
- // If the handheld element is checked
- if(handheldElement.getAttribute("checked"))
- {
- webdeveloper_displayCSSMediaType("handheld", true);
- webdeveloper_removeStyleSheet("webdeveloper-display-handheld-css");
- }
-
- webdeveloper_displayCSSMediaType("print", !element.getAttribute("checked"));
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-display-print-css");
-}
-
-// Allows the user to edit the CSS of the current page
-function webdeveloper_editCSS()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var editCSS = stringBundle.getString("webdeveloper_editCSS");
-
- // If edit CSS is open in the dashboard
- if(webdeveloper_isOpenInDashboard(editCSS))
- {
- webdeveloper_closeInDashboard(editCSS);
- }
- else if(webdeveloper_pageHasFrames())
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", stringBundle.getString("webdeveloper_framesNotSupported"));
- }
- else
- {
- webdeveloper_openInDashboard(editCSS, "chrome://webdeveloper/content/dashboard/edit_css.xul");
- }
-}
-
-// Toggles the border box model
-function webdeveloper_toggleBorderBoxModel(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/use_border_box_model.css", "webdeveloper-use-border-box-model");
-}
-
-// Toggles the browser default styles
-function webdeveloper_toggleBrowserDefaultStyles(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/disable_browser_default_styles.css", "webdeveloper-disable-browser-default-styles");
-}
-
-// Toggles all the inline styles in elements in the document
-function webdeveloper_toggleDocumentInlineStyles(node, disable)
-{
- // If the node exists and is an element
- if(node && node.nodeType == Node.ELEMENT_NODE)
- {
- var childNodes = node.childNodes;
- var childNodesLength = childNodes.length;
-
- // If disabling styles and the node has a style attribute
- if(disable && node.hasAttribute("style"))
- {
- node.setAttribute("webdeveloper-inline-style", node.getAttribute("style"));
- node.removeAttribute("style");
- }
- else if(!disable && node.hasAttribute("webdeveloper-inline-style"))
- {
- node.setAttribute("style", node.getAttribute("webdeveloper-inline-style"));
- node.removeAttribute("webdeveloper-inline-style");
- }
-
- // Loop through the child nodes
- for(var i = 0; i < childNodesLength; i++)
- {
- webdeveloper_toggleDocumentInlineStyles(childNodes[i], disable);
- }
- }
-}
-
-// Toggles all the embedded styles on the page
-function webdeveloper_toggleEmbeddedStyles(element)
-{
- var disable = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var styleSheetLength = null;
- var styleSheetList = null;
- var styleSheet = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleSheetList = pageDocument.getElementsByTagName("style");
- styleSheetLength = styleSheetList.length;
-
- // Loop through all the stylesheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j].sheet;
-
- // If this is a valid style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet))
- {
- styleSheet.disabled = disable;
- }
- }
-
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-disable-embedded-styles");
-}
-
-// Toggles all the inline styles in elements on the page
-function webdeveloper_toggleInlineStyles(element)
-{
- var disable = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- webdeveloper_toggleDocumentInlineStyles(documentList[i].documentElement, disable);
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-disable-inline-styles");
-}
-
-// Toggles all the linked styles on the page
-function webdeveloper_toggleLinkedStyles(element)
-{
- var disable = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var ownerNode = null;
- var pageDocument = null;
- var styleSheet = null;
- var styleSheetLength = null;
- var styleSheetList = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleSheetList = pageDocument.styleSheets;
- styleSheetLength = styleSheetList.length;
-
- // Loop through all the stylesheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If this is a valid style sheet, is not an inline style sheet and is not an alternate style sheet or style sheets are being disabled
- if(webdeveloper_isValidStyleSheet(styleSheet) && styleSheet.href != pageDocument.documentURI && (!webdeveloper_isAlternateStyleSheet(styleSheet) || disable))
- {
- styleSheet.disabled = disable;
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-disable-linked-styles");
-}
-
-// Toggles the print styles for the page
-function webdeveloper_togglePrintStyles(element)
-{
- var disable = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var styleSheet = null;
- var styleSheetLength = null;
- var styleSheetList = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleSheetList = pageDocument.styleSheets;
- styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If the style sheet is valid, is not an alternate style sheet and is a print style sheet, but not a screen style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && !webdeveloper_isAlternateStyleSheet(styleSheet) && webdeveloper_isMediaStyleSheet(styleSheet, "print") && !webdeveloper_isMediaStyleSheet(styleSheet, "screen"))
- {
- styleSheet.disabled = disable;
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-disable-print-styles");
-}
-
-// Toggles the styles for the page
-function webdeveloper_toggleStyles(element)
-{
- var disable = true;
- var contentWindow = webdeveloper_getContentWindow();
- var documentList = webdeveloper_getDocuments(contentWindow);
- var documentLength = documentList.length;
- var key = null;
- var ownerNode = null;
- var pageDocument = null;
- var styleElement = null;
- var styleSheet = null;
- var styleSheetLength = null;
- var styleSheetList = null;
-
- // If the element is set
- if(element)
- {
- disable = element.getAttribute("checked");
- }
- else
- {
- var currentDocument = contentWindow.document;
-
- element = document.getElementById("webdeveloper-disable-all-styles-menu");
-
- // If the disable all styles element is set
- if(currentDocument.getElementById("webdeveloper-disable-all-styles"))
- {
- disable = false;
- }
-
- webdeveloper_configureElement(element, "checked", disable);
- }
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleSheetList = pageDocument.styleSheets;
- styleSheetLength = styleSheetList.length;
-
- // Loop through all the stylesheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If this is a valid style sheet and is not an alternate style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && (!webdeveloper_isAlternateStyleSheet(styleSheet) || disable))
- {
- styleSheet.disabled = disable;
- }
- }
-
- webdeveloper_toggleDocumentInlineStyles(pageDocument.documentElement, disable);
- }
-
- // Toggle other CSS feature keyboard shortcuts
- document.getElementById("webdeveloper-edit-css-key").setAttribute("disabled", disable);
- document.getElementById("webdeveloper-view-style-information-key").setAttribute("disabled", disable);
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-disable-all-styles");
-}
-
-// Updates the CSS menu
-function webdeveloper_updateCSSMenu(suffix)
-{
- var currentDocument = webdeveloper_getContentDocument();
- var disableAllStylesChecked = webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-disable-all-styles");
- var menu = document.getElementById("webdeveloper-edit-css-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- var editCSSOpen = webdeveloper_isOpenInDashboard(document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_editCSS"));
-
- webdeveloper_configureElement(menu, "checked", editCSSOpen);
-
- // If edit CSS is not open and the page has frames
- if(!editCSSOpen && webdeveloper_pageHasFrames())
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
-
- webdeveloper_configureElement(menu, "disabled", disableAllStylesChecked);
- }
-
- menu = document.getElementById("webdeveloper-view-style-information-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- // If the DOM Inspector is not found
- if(!webdeveloper_isDOMInspectorAvailable())
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
-
- webdeveloper_configureElement(menu, "disabled", disableAllStylesChecked);
- webdeveloper_configureElementByAppliedStyle(menu, "checked", "webdeveloper-view-style-information");
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-add-user-style-sheet-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-individual-style-sheet-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-display-media-type-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-use-border-box-model-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-add-user-style-sheet-" + suffix), "checked", "webdeveloper-add-user-style-sheet");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-use-border-box-model-" + suffix), "checked", "webdeveloper-use-border-box-model");
-}
-
-// Updates the CSS media type menu
-function webdeveloper_updateCSSMediaTypeMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-handheld-css-" + suffix), "checked", "webdeveloper-display-handheld-css");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-print-css-" + suffix), "checked", "webdeveloper-display-print-css");
-}
-
-// Updates the disable styles menu
-function webdeveloper_updateDisableStylesMenu(suffix)
-{
- var currentDocument = webdeveloper_getContentDocument();
- var disableAllStylesChecked = webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-disable-all-styles");
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-all-styles-" + suffix), "checked", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-browser-default-styles-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-embedded-styles-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-inline-styles-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-linked-styles-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-print-styles-" + suffix), "disabled", disableAllStylesChecked);
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-disable-browser-default-styles-" + suffix), "checked", "webdeveloper-disable-browser-default-styles");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-disable-embedded-styles-" + suffix), "checked", "webdeveloper-disable-embedded-styles");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-disable-inline-styles-" + suffix), "checked", "webdeveloper-disable-inline-styles");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-disable-linked-styles-" + suffix), "checked", "webdeveloper-disable-linked-styles");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-disable-print-styles-" + suffix), "checked", "webdeveloper-disable-print-styles");
-}
-
-// View CSS
-function webdeveloper_viewCSS()
-{
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var inlineStylesText = "";
- var linkElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var preElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleSheet = null;
- var styleSheetHref = null;
- var styleSheetList = new Array();
- var styleSheetLength = null;
- var title = stringBundle.getFormattedString("webdeveloper_viewCSSTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- headerElement = generatedDocument.createElement("h2");
- inlineStylesText = "";
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- styleSheetList = pageDocument.getElementsByTagName("style");
- styleSheetLength = styleSheetList.length;
-
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // Loop through the inline style sheets
- for(var j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If this is a valid style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet.sheet) && (!styleSheet.hasAttribute("id") || styleSheet.getAttribute("id").indexOf("webdeveloper-") != 0))
- {
- inlineStylesText += styleSheet.innerHTML.trim() + "\n\n";
- }
- }
-
- // If there are inline styles
- if(inlineStylesText != "")
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h3");
- preElement = generatedDocument.createElement("pre");
- spanElement = generatedDocument.createElement("span");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- headerElement.appendChild(generatedDocument.createTextNode(stringBundle.getFormattedString("webdeveloper_embeddedStylesFrom", [documentURL])));
- bodyElement.appendChild(headerElement);
-
- preElement.appendChild(generatedDocument.createTextNode(inlineStylesText));
- divElement.setAttribute("class", "output");
- divElement.appendChild(preElement);
- bodyElement.appendChild(divElement);
- }
-
- styleSheetList = webdeveloper_getStyleSheetsForDocument(pageDocument, true, true);
- styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(j = 0; j < styleSheetLength; j++)
- {
- styleSheet = styleSheetList[j];
-
- // If this is a valid style sheet and is not an inline style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && styleSheet.href != documentURL)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h3");
- linkElement = generatedDocument.createElement("a");
- preElement = generatedDocument.createElement("pre");
- spanElement = generatedDocument.createElement("span");
- styleSheetHref = styleSheet.href;
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", styleSheetHref);
- linkElement.appendChild(generatedDocument.createTextNode(styleSheetHref));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
- preElement.appendChild(generatedDocument.createTextNode(webdeveloper_retrieveSource(styleSheetHref).replace(new RegExp("\r", "gi"), "\n")));
- divElement.setAttribute("class", "output");
- divElement.appendChild(preElement);
- bodyElement.appendChild(divElement);
- }
- }
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-// Closes the selected dashboard tab
-function webdeveloper_closeDashboardTab()
-{
- var tabBox = document.getElementById("webdeveloper-dashboard-tab-box");
- var selectedTabPanel = tabBox.selectedPanel;
- var tabPanels = document.getElementById("webdeveloper-dashboard-tab-panels");
- var tabs = document.getElementById("webdeveloper-dashboard-tabs");
-
- // If the selected tab panel is set
- if(selectedTabPanel)
- {
- tabPanels.removeChild(selectedTabPanel);
- }
- else
- {
- tabPanels.removeChild(tabPanels.childNodes[tabBox.selectedIndex]);
- }
-
- tabs.removeChild(tabBox.selectedTab);
-
- // If there are no tab panels remaining
- if(tabPanels.childNodes.length == 0)
- {
- document.getElementById("webdeveloper-dashboard").hidden = true;
- document.getElementById("webdeveloper-dashboard-splitter").hidden = true;
- }
- else
- {
- tabs.selectedIndex = 0;
- }
-}
-
-// Closes the given tab in the dashboard
-function webdeveloper_closeInDashboard(title)
-{
- var position = 0;
- var tab = null;
- var tabPanels = document.getElementById("webdeveloper-dashboard-tab-panels");
- var tabs = document.getElementById("webdeveloper-dashboard-tabs");
- var tabElements = tabs.childNodes;
- var tabsLength = tabElements.length;
-
- // Loop through the tabs
- for(var i = 0; i < tabsLength; i++)
- {
- tab = tabElements.item(i);
-
- // If this is a tab
- if(tab.nodeName == "tab")
- {
- // If the tab has a matching label attribute
- if(tab.hasAttribute("label") && tab.getAttribute("label") == title)
- {
- break;
- }
-
- position++;
- }
- }
-
- // If a tab was matched
- if(position < tabsLength)
- {
- tabPanels.removeChild(tabPanels.childNodes[position]);
- tabs.removeItemAt(position);
-
- // If there are no tab panels remaining
- if(tabPanels.childNodes.length == 0)
- {
- document.getElementById("webdeveloper-dashboard").hidden = true;
- document.getElementById("webdeveloper-dashboard-splitter").hidden = true;
- }
- else
- {
- tabs.selectedIndex = 0;
- }
- }
-}
-
-// Returns the document for given tab in the dashboard
-function webdeveloper_getDocumentInDashboard(title)
-{
- var position = 0;
- var tab = null;
- var tabPanels = document.getElementById("webdeveloper-dashboard-tab-panels");
- var tabs = document.getElementById("webdeveloper-dashboard-tabs");
- var tabElements = tabs.childNodes;
- var tabsLength = tabElements.length;
-
- // Loop through the tabs
- for(var i = 0; i < tabsLength; i++)
- {
- tab = tabElements.item(i);
-
- // If this is a tab
- if(tab.nodeName == "tab")
- {
- // If the tab has a matching label attribute
- if(tab.hasAttribute("label") && tab.getAttribute("label") == title)
- {
- break;
- }
-
- position++;
- }
- }
-
- // If a tab was matched
- if(position < tabsLength)
- {
- return tabPanels.childNodes[position].childNodes[0].contentDocument;
- }
-
- return null;
-}
-
-// Is the given tab open in the dashboard
-function webdeveloper_isOpenInDashboard(title)
-{
- var tab = null;
- var tabs = document.getElementById("webdeveloper-dashboard-tabs").childNodes;
- var tabsLength = tabs.length;
-
- // Loop through the tabs
- for(var i = 0; i < tabsLength; i++)
- {
- tab = tabs.item(i);
-
- // If this is a tab and it has a matching label attribute
- if(tab.nodeName == "tab" && tab.hasAttribute("label") && tab.getAttribute("label") == title)
- {
- return true;
- }
- }
-
- return false;
-}
-
-// Opens the given URL in the dashboard
-function webdeveloper_openInDashboard(title, url)
-{
- var browser = document.createElement("browser");
- var tab = document.createElement("tab");
- var tabCount = 0;
- var tabPanel = document.createElement("tabpanel");
- var tabPanels = document.getElementById("webdeveloper-dashboard-tab-panels");
- var tabs = document.getElementById("webdeveloper-dashboard-tabs");
-
- browser.setAttribute("flex", "1");
- browser.setAttribute("src", url);
- tabPanel.appendChild(browser);
- tab.setAttribute("label", title);
-
- tabPanels.appendChild(tabPanel);
- tabs.insertBefore(tab, document.getElementById("webdeveloper-dashboard-spacer"));
-
- tabCount = tabPanels.childNodes.length - 1;
- tabs.selectedIndex = tabCount;
-
- // If this is the only tab
- if(tabCount == 0)
- {
- var dashboard = document.getElementById("webdeveloper-dashboard");
-
- // If the dashboard height is less than 100
- if(dashboard.height < 100)
- {
- dashboard.height = 100;
- }
-
- // If the dashboard width is less than 100
- if(dashboard.width < 100)
- {
- dashboard.width = 100;
- }
-
- dashboard.hidden = false;
- document.getElementById("webdeveloper-dashboard-splitter").hidden = false;
- }
-}
-
-// Positions the dashboard
-function webdeveloper_positionDashboard()
-{
- var currentPosition = webdeveloper_getStringPreference("webdeveloper.dashboard.position", true);
- var dashboard = document.getElementById("webdeveloper-dashboard");
- var dashboardSplitter = document.getElementById("webdeveloper-dashboard-splitter");
-
- dashboard.hidden = true;
- dashboardSplitter.hidden = true;
-
- // If the current position is bottom
- if(currentPosition == "bottom")
- {
- webdeveloper_setStringPreference("webdeveloper.dashboard.position", "left");
- webdeveloper_setupDashboardPosition("left");
- }
- else if(currentPosition == "left")
- {
- webdeveloper_setStringPreference("webdeveloper.dashboard.position", "top");
- webdeveloper_setupDashboardPosition("top");
- }
- else if(currentPosition == "right")
- {
- webdeveloper_setStringPreference("webdeveloper.dashboard.position", "bottom");
- webdeveloper_setupDashboardPosition("bottom");
- }
- else if(currentPosition == "top")
- {
- webdeveloper_setStringPreference("webdeveloper.dashboard.position", "right");
- webdeveloper_setupDashboardPosition("right");
- }
-
- dashboard.hidden = false;
- dashboardSplitter.hidden = false;
-}
-
-// Selects the given tab in the dashboard
-function webdeveloper_selectInDashboard(title)
-{
- var tab = null;
- var tabs = document.getElementById("webdeveloper-dashboard-tabs").childNodes;
- var tabsLength = tabs.length;
-
- // Loop through the tabs
- for(var i = 0; i < tabsLength; i++)
- {
- tab = tabs.item(i);
-
- // If this is a tab and it has a matching label attribute
- if(tab.nodeName == "tab" && tab.hasAttribute("label") && tab.getAttribute("label") == title)
- {
- tabs.selectedIndex = i;
-
- break;
- }
- }
-}
-
-// Sets up the dashboard position
-function webdeveloper_setupDashboardPosition(position)
-{
- var appContent = document.getElementById("appcontent");
- var dashboard = document.getElementById("webdeveloper-dashboard");
- var dashboardSplitter = document.getElementById("webdeveloper-dashboard-splitter");
-
- // If the current position is bottom
- if(position == "bottom")
- {
- appContent.appendChild(dashboardSplitter);
- appContent.appendChild(dashboard);
- }
- else if(position == "left")
- {
- var browser = appContent.parentNode;
-
- browser.insertBefore(dashboard, appContent);
- browser.insertBefore(dashboardSplitter, appContent);
- }
- else if(position == "right")
- {
- webdeveloper_insertAfter(dashboard, appContent);
- webdeveloper_insertAfter(dashboardSplitter, appContent);
- }
- else if(position == "top")
- {
- webdeveloper_insertAsFirstChild(appContent, dashboardSplitter);
- webdeveloper_insertAsFirstChild(appContent, dashboard);
- }
-
- // If the position is bottom or top
- if(position == "bottom" || position == "top")
- {
- dashboardSplitter.setAttribute("orient", "vertical");
- }
- else if((position == "left" || position == "right") && dashboardSplitter.hasAttribute("orient"))
- {
- dashboardSplitter.removeAttribute("orient");
- }
-}
\ No newline at end of file
+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-#webdeveloper-edit-css-tab-box, #webdeveloper-edit-css-tab-panels, #webdeveloper-edit-css-tab-panels > textbox
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-#webdeveloper-edit-css-tab-panels textbox
-{
- -moz-appearance: none !important;
- font-family: monospace !important;
-}
-
-#webdeveloper-edit-css-tabs
-{
- display: block !important;
-}
-
-#webdeveloper-edit-css-tabs > tab
-{
- display: inline !important;
-}
+++ /dev/null
-var webdeveloper_editCSSIntervalId = null;
-var webdeveloper_editCSSOldStyleText = new Array();
-var webdeveloper_editCSSSelectedTab = 0;
-var webdeveloper_editCSSUpdateFrequency = 500;
-
-// Applies the CSS
-function webdeveloper_applyCSS()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var headElement = webdeveloper_getDocumentHeadElement(contentDocument);
- var styleElement = null;
- var styleText = null;
- var textBox = null;
- var textBoxes = document.getElementById("webdeveloper-edit-css-tab-panels").getElementsByTagName("textbox");
- var textBoxesLength = textBoxes.length;
-
- // Loop through the text boxes
- for(var i = 0; i < textBoxesLength; i++)
- {
- styleElement = contentDocument.getElementById("webdeveloper-edit-css-style-" + i);
- textBox = textBoxes[i];
- styleText = textBox.value;
-
- // If the strip import preference is not set or is set to true
- if(!webdeveloper_isPreferenceSet("webdeveloper.edit.css.import.strip") || webdeveloper_getBooleanPreference("webdeveloper.edit.css.import.strip", true))
- {
- styleText = styleText.replace(new RegExp("@import.*?;", "gi"), "");
- }
-
- // If the style element does not exist
- if(!styleElement)
- {
- styleElement = contentDocument.createElement("style");
-
- styleElement.setAttribute("id", "webdeveloper-edit-css-style-" + i);
- styleElement.setAttribute("type", "text/css");
- styleElement.setAttribute("xml:base", textBox.getAttribute("webdeveloper-base"));
- headElement.appendChild(styleElement);
-
- // Make the styles different to make sure they get written if not there already
- webdeveloper_editCSSOldStyleText[i] = styleText + " ";
- }
-
- // If the style text is not the same as the old style text
- if(styleText != webdeveloper_editCSSOldStyleText[i])
- {
- webdeveloper_editCSSOldStyleText[i] = styleText;
-
- webdeveloper_removeAllChildElements(styleElement);
- styleElement.appendChild(contentDocument.createTextNode(styleText));
- }
- }
-}
-
-// Clear the CSS
-function webdeveloper_clearCSS()
-{
- webdeveloper_getSelectedPanel().firstChild.value = "";
-}
-
-// Reinitializes the dashboard when the page changes
-function webdeveloper_editCSSContentPageLoad(event)
-{
- var eventTarget = event.target;
-
- // Try to get the original target
- try
- {
- var originalTarget = event.originalTarget;
-
- // If the page is the target and the URI matches
- if(originalTarget && eventTarget && eventTarget.contentDocument && eventTarget.hasAttribute && eventTarget.hasAttribute("id") && eventTarget.getAttribute("id").toLowerCase() == "content" && originalTarget.documentURI == eventTarget.contentDocument.documentURI)
- {
- // If the CSS stick preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.edit.stick", true))
- {
- webdeveloper_resetCSS();
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-}
-
-// Handles a browser tab being selected
-function webdeveloper_editCSSMainTabSelect(event)
-{
- var browser = window.top.getBrowser();
- var selectedTab = browser.mTabBox.selectedIndex;
-
- // If the selected tab is different
- if(selectedTab != webdeveloper_editCSSSelectedTab)
- {
- var browsers = browser.browsers;
- var browserLength = browsers.length;
-
- // If the previous selected tab equals the browser length
- if(webdeveloper_editCSSSelectedTab == browserLength)
- {
- webdeveloper_editCSSSelectedTab = browserLength - 1;
- }
-
- webdeveloper_resetDocument(browsers[webdeveloper_editCSSSelectedTab].contentDocument);
-
- webdeveloper_editCSSSelectedTab = selectedTab;
-
- // If the CSS stick preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.edit.stick", true))
- {
- webdeveloper_resetCSS();
- }
- }
-}
-
-// Returns the selected panel
-function webdeveloper_getSelectedPanel()
-{
- var selectedPanel = document.getElementById("webdeveloper-edit-css-tab-box").selectedPanel;
-
- // If the selected panel is not set
- if(!selectedPanel)
- {
- selectedPanel = document.getElementById("webdeveloper-edit-css-tab-panels").firstChild;
- }
-
- return selectedPanel;
-}
-
-// Returns the selected tab
-function webdeveloper_getSelectedTab()
-{
- var selectedTab = document.getElementById("webdeveloper-edit-css-tab-box").selectedTab;
-
- // If the selected tab is not set
- if(!selectedTab)
- {
- selectedTab = document.getElementById("webdeveloper-edit-css-tabs").firstChild;
- }
-
- return selectedTab;
-}
-
-// Initializes the edit CSS dashboard
-function webdeveloper_initializeEditCSS()
-{
- var mainTabBox = window.top.getBrowser().mTabBox;
-
- webdeveloper_editCSSSelectedTab = mainTabBox.selectedIndex;
- webdeveloper_editCSSUpdateFrequency = webdeveloper_getIntegerPreference("webdeveloper.edit.update.frequency", true);
-
- document.getElementById("webdeveloper-search-dashboard-text").addEventListener("keypress", webdeveloper_searchTextKeyPress, false);
- mainTabBox.addEventListener("select", webdeveloper_editCSSMainTabSelect, false);
- window.top.addEventListener("load", webdeveloper_editCSSContentPageLoad, true);
-
- webdeveloper_updateStickCSS();
- webdeveloper_retrieveCSS();
-
- // If the update frequency is greater than 0
- if(webdeveloper_editCSSUpdateFrequency > 0)
- {
- webdeveloper_editCSSIntervalId = window.setInterval(webdeveloper_applyCSS, webdeveloper_editCSSUpdateFrequency);
- }
-}
-
-// Opens new CSS
-function webdeveloper_openCSS()
-{
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- filePicker.appendFilter(stringBundle.getString("webdeveloper_styleSheetDescription"), "*.css");
- filePicker.init(window, stringBundle.getString("webdeveloper_openStyleSheet"), filePicker.modeOpen);
-
- // If the user selected a style sheet
- if(filePicker.show() == filePicker.returnOK)
- {
- var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
- var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
-
- inputStream.init(filePicker.file, 0x01, 00444, null);
- scriptableStream.init(inputStream);
-
- webdeveloper_getSelectedPanel().firstChild.value = scriptableStream.read(scriptableStream.available());
-
- scriptableStream.close();
- inputStream.close();
- }
-}
-
-// Resets the edited CSS
-function webdeveloper_resetCSS()
-{
- webdeveloper_removeAllChildElements(document.getElementById("webdeveloper-edit-css-tab-panels"));
- webdeveloper_removeAllChildElements(document.getElementById("webdeveloper-edit-css-tabs"));
- webdeveloper_resetDocument(webdeveloper_getContentDocument());
- webdeveloper_retrieveCSS();
-}
-
-// Resets the specified document
-function webdeveloper_resetDocument(contentDocument)
-{
- var styleElement = null;
- var styleElements = contentDocument.getElementsByTagName("style");
- var styleSheet = null;
- var styleSheetList = webdeveloper_getStyleSheetsForDocument(contentDocument, true, false);
- var styleSheetLength = styleSheetList.length;
-
- // Loop through the style elements
- for(var i = 0; i < styleElements.length; i++)
- {
- styleElement = styleElements[i];
-
- // If the style element has an id starting with webdeveloper-edit-css-style-
- if(styleElement.hasAttribute("id") && styleElement.getAttribute("id").indexOf("webdeveloper-edit-css-style-") == 0)
- {
- webdeveloper_removeElement(styleElement);
- i--;
- }
- }
-
- // Loop through the style sheets
- for(i = 0; i < styleSheetLength; i++)
- {
- styleSheet = styleSheetList[i];
-
- // If the style sheet is a valid style sheet, is for the screen and is not an alternate style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && webdeveloper_isMediaStyleSheet(styleSheet, "screen") && !webdeveloper_isAlternateStyleSheet(styleSheet))
- {
- styleSheet.disabled = false;
- }
- }
-
-}
-
-// Retrieves the CSS from the current page
-function webdeveloper_retrieveCSS()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var documentURL = contentDocument.documentURI;
- var inlineStylesText = "";
- var result = null;
- var results = new Array();
- var resultsLength = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleElement = null;
- var styleSheet = null;
- var styleSheetList = webdeveloper_getStyleSheetsForDocument(contentDocument, true, false);
- var styleSheetLength = styleSheetList.length;
- var tab = null;
- var tabPanel = null;
- var tabs = document.getElementById("webdeveloper-edit-css-tabs");
- var tabPanels = document.getElementById("webdeveloper-edit-css-tab-panels");
- var textBox = null;
- var textBoxStyle = "";
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
-
- url.spec = documentURL;
-
- // If the edit CSS background color preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.background"))
- {
- textBoxStyle += "background-color: " + webdeveloper_getStringPreference("webdeveloper.edit.color.background", true) + " !important; ";
- }
-
- // If the edit CSS text color preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.text"))
- {
- textBoxStyle += "color: " + webdeveloper_getStringPreference("webdeveloper.edit.color.text", true) + " !important; ";
- }
-
- // If the edit CSS font preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.font.size"))
- {
- textBoxStyle += "font-size: " + webdeveloper_getIntegerPreference("webdeveloper.edit.font.size", true) + "px !important; ";
- }
-
- textBoxStyle = textBoxStyle.trim();
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetLength; i++)
- {
- styleSheet = styleSheetList[i];
-
- // If this is a valid style sheet, is for the screen, is not an alternate style sheet, is not disabled and is not an inline style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet) && webdeveloper_isMediaStyleSheet(styleSheet, "screen") && !webdeveloper_isAlternateStyleSheet(styleSheet) && !styleSheet.disabled && styleSheet.href != documentURL)
- {
- results = webdeveloper_retrieveStyleSheetDetails(styleSheet, textBoxStyle, results);
- }
- }
-
- styleSheetList = contentDocument.getElementsByTagName("style");
- styleSheetLength = styleSheetList.length;
-
- // Loop through the inline style sheets
- for(i = 0; i < styleSheetLength; i++)
- {
- styleElement = styleSheetList[i];
- styleSheet = styleElement.sheet;
-
- // If this is a valid style sheet, is for the screen and is not disabled
- if(webdeveloper_isValidStyleSheet(styleSheet) && (!styleElement.hasAttribute("id") || styleElement.getAttribute("id").indexOf("webdeveloper-") != 0) && webdeveloper_isMediaStyleSheet(styleSheet, "screen") && !styleSheet.disabled)
- {
- inlineStylesText += styleElement.innerHTML.trim() + "\n\n";
-
- styleSheet.disabled = true;
- }
- }
-
- // If there are inline styles
- if(inlineStylesText != "")
- {
- tab = document.createElement("tab");
- tabPanel = document.createElement("tabpanel");
- textBox = document.createElement("textbox");
-
- tab.setAttribute("label", stringBundle.getString("webdeveloper_embeddedStyles"));
- textBox.setAttribute("flex", "1");
- textBox.setAttribute("multiline", "true");
- textBox.setAttribute("style", textBoxStyle);
- textBox.setAttribute("value", inlineStylesText);
- textBox.setAttribute("webdeveloper-base", url.directory);
-
- // If the edit CSS wrap preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.edit.wrap", true))
- {
- textBox.setAttribute("wrap", "off");
- }
-
- tabPanel.appendChild(textBox);
- results.push(new Array(tab, tabPanel));
- }
-
- resultsLength = results.length;
-
- // Loop through the results
- for(i = 0; i < resultsLength; i++)
- {
- result = results[i];
-
- tabPanels.appendChild(result[1]);
- tabs.appendChild(result[0]);
- }
-
- // If there are no tabs
- if(tabs.childNodes.length == 0)
- {
- tab = document.createElement("tab");
- tabPanel = document.createElement("tabpanel");
- textBox = document.createElement("textbox");
-
- tab.setAttribute("label", stringBundle.getString("webdeveloper_editCSS"));
- textBox.setAttribute("flex", "1");
- textBox.setAttribute("multiline", "true");
- textBox.setAttribute("style", textBoxStyle);
- textBox.setAttribute("webdeveloper-base", url.directory);
-
- // If the edit CSS wrap preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.edit.wrap", true))
- {
- textBox.setAttribute("wrap", "off");
- }
-
- tabPanel.appendChild(textBox);
- tabPanels.appendChild(tabPanel);
- tabs.appendChild(tab);
- }
-
- tabs.selectedIndex = 0;
-
- webdeveloper_applyCSS();
-}
-
-// Retrieves the style sheet details
-function webdeveloper_retrieveStyleSheetDetails(styleSheet, textBoxStyle, results)
-{
- var styleSheetHref = styleSheet.href;
- var position = styleSheetHref.lastIndexOf("/");
- var stylesText = webdeveloper_retrieveSource(styleSheetHref);
- var tab = document.createElement("tab");
- var tabPanel = document.createElement("tabpanel");
- var textBox = document.createElement("textbox");
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
-
- url.spec = styleSheetHref;
-
- tab.setAttribute("label", url.fileName);
- textBox.setAttribute("flex", "1");
- textBox.setAttribute("multiline", "true");
- textBox.setAttribute("style", textBoxStyle);
- textBox.setAttribute("value", stylesText);
- textBox.setAttribute("webdeveloper-base", url.directory);
-
- // If the edit CSS wrap preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.edit.wrap", true))
- {
- textBox.setAttribute("wrap", "off");
- }
-
- tabPanel.appendChild(textBox);
- results.push(new Array(tab, tabPanel));
-
- styleSheet.disabled = true;
-
- return results;
-}
-
-// Saves the CSS
-function webdeveloper_saveCSS()
-{
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
- var result = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleText = webdeveloper_getSelectedPanel().firstChild.value;
-
- filePicker.defaultExtension = "css";
- filePicker.defaultString = webdeveloper_getSelectedTab().getAttribute("label");
-
- filePicker.appendFilter(stringBundle.getString("webdeveloper_styleSheetDescription"), "*.css");
- filePicker.init(window, stringBundle.getString("webdeveloper_saveStyleSheet"), filePicker.modeSave);
-
- result = filePicker.show();
-
- // If the user selected a style sheet
- if(result == filePicker.returnOK || result == filePicker.returnReplace)
- {
- var file = filePicker.file;
- var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
-
- // If the file does not exist
- if(!file.exists())
- {
- file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 00644);
- }
-
- outputStream.init(file, 0x04 | 0x08 | 0x20, 00644, null);
- outputStream.write(styleText, styleText.length);
- outputStream.close();
- }
-}
-
-// Searches the CSS
-function webdeveloper_searchCSS()
-{
- var searchText = document.getElementById("webdeveloper-search-dashboard-text").value;
-
- // If the search text is set
- if(searchText)
- {
- webdeveloper_getSelectedPanel().firstChild.focus();
-
- // If the search failed to find a match
- if(!window.find(searchText, false, false, true, false, false, false))
- {
- webdeveloper_getSelectedPanel().firstChild.setSelectionRange(0, 0);
- window.find(searchText, false, false, true, false, false, false);
- }
- }
-}
-
-// Searches the CSS when the enter key is pressed
-function webdeveloper_searchTextKeyPress(event)
-{
- var keyCode = event.keyCode;
-
- // If the key code is set and is 13
- if(keyCode && keyCode == 13)
- {
- webdeveloper_searchCSS();
- }
-}
-
-// Toggles sticking the CSS
-function webdeveloper_toggleStickCSS()
-{
- webdeveloper_setBooleanPreference("webdeveloper.edit.stick", !webdeveloper_getBooleanPreference("webdeveloper.edit.stick", true));
-
- webdeveloper_updateStickCSS();
-}
-
-// Unloads edit CSS
-function webdeveloper_unloadEditCSS()
-{
- webdeveloper_editCSSOldStyleText = new Array();
-
- webdeveloper_resetDocument(webdeveloper_getContentDocument());
- window.clearInterval(webdeveloper_editCSSIntervalId);
-
- // Try to remove the event listener
- try
- {
- document.getElementById("webdeveloper-search-dashboard-text").removeEventListener("keypress", webdeveloper_searchTextKeyPress, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- window.top.getBrowser().mTabBox.removeEventListener("select", webdeveloper_editCSSMainTabSelect, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- window.top.removeEventListener("load", webdeveloper_editCSSContentPageLoad, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-}
-
-// Updates the stick CSS button
-function webdeveloper_updateStickCSS()
-{
- var element = document.getElementById("webdeveloper-stick-dashboard");
- var labelValue = null;
- var stick = webdeveloper_getBooleanPreference("webdeveloper.edit.stick", true);
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the element exists
- if(element)
- {
- // If sticking the CSS
- if(stick)
- {
- labelValue = stringBundle.getString("webdeveloper_unstick");
-
- element.setAttribute("class", "unstick webdeveloper-dashboard-button");
- }
- else
- {
- labelValue = stringBundle.getString("webdeveloper_stick");
-
- element.setAttribute("class", "webdeveloper-dashboard-button");
- }
-
- element.setAttribute("tooltiptext", labelValue);
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/dashboard/edit_css.css" type="text/css"?>
-<?xml-stylesheet href="chrome://webdeveloper/skin/webdeveloper.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://webdeveloper/locale/dashboard.dtd">
-
-<window id="webdeveloper-edit-css-dashboard"
- onload="webdeveloper_initializeEditCSS()"
- onunload="webdeveloper_unloadEditCSS()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/css.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/dom.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/file.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dashboard/edit_css.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <toolbar>
- <toolbarbutton id="webdeveloper-open-dashboard" tooltiptext="&webdeveloper.open.label;" oncommand="webdeveloper_openCSS()"/>
- <toolbarbutton id="webdeveloper-save-dashboard" tooltiptext="&webdeveloper.save.label;" oncommand="webdeveloper_saveCSS()"/>
- <toolbarseparator/>
- <toolbarbutton id="webdeveloper-clear-dashboard" tooltiptext="&webdeveloper.clear.label;" oncommand="webdeveloper_clearCSS()"/>
- <toolbarbutton id="webdeveloper-reset-dashboard" tooltiptext="&webdeveloper.reset.label;" oncommand="webdeveloper_resetCSS()"/>
- <toolbarseparator/>
- <toolbarbutton id="webdeveloper-apply-css-dashboard" tooltiptext="&webdeveloper.apply.label;" oncommand="webdeveloper_applyCSS()"/>
- <toolbarbutton id="webdeveloper-stick-dashboard" tooltiptext="&webdeveloper.stick.label;" oncommand="webdeveloper_toggleStickCSS()"/>
- <toolbarseparator/>
- <textbox id="webdeveloper-search-dashboard-text" size="20"/>
- <toolbarbutton id="webdeveloper-search-dashboard" tooltiptext="&webdeveloper.search.label;" oncommand="webdeveloper_searchCSS()"/>
- </toolbar>
- <tabbox id="webdeveloper-edit-css-tab-box" flex="1">
- <tabs id="webdeveloper-edit-css-tabs"/>
- <tabpanels id="webdeveloper-edit-css-tab-panels" flex="1"/>
- </tabbox>
-</window>
\ No newline at end of file
+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-#webdeveloper-edit-html-dashboard > textbox
-{
- -moz-appearance: none !important;
- font-family: monospace !important;
- margin: 0 !important;
- padding: 0 !important;
-}
+++ /dev/null
-var webdeveloper_editHTMLIntervalId = null;
-var webdeveloper_editHTMLOldHTML = null;
-var webdeveloper_editHTMLSelectedTab = 0;
-var webdeveloper_editHTMLUpdateFrequency = 500;
-
-// Applies the HTML
-function webdeveloper_applyHTML()
-{
- var contentBody = webdeveloper_getDocumentBodyElement(webdeveloper_getContentDocument());
- var newHTML = document.getElementById("webdeveloper-edit-html-text-box").value;
-
- // If the content body is set and the new HTML is not the same as the old HTML
- if(contentBody && newHTML != webdeveloper_editHTMLOldHTML)
- {
- contentBody.innerHTML = newHTML;
- webdeveloper_editHTMLOldHTML = newHTML;
- }
-}
-
-// Clear the HTML
-function webdeveloper_clearHTML()
-{
- document.getElementById("webdeveloper-edit-html-text-box").value = "";
-}
-
-// Reinitializes the dashboard when the page changes
-function webdeveloper_editHTMLContentPageLoad(event)
-{
- var eventTarget = event.target;
-
- // Try to get the original target
- try
- {
- var originalTarget = event.originalTarget;
-
- // If the page is the target and the URI matches
- if(originalTarget && eventTarget && eventTarget.contentDocument && eventTarget.hasAttribute && eventTarget.hasAttribute("id") && eventTarget.getAttribute("id").toLowerCase() == "content" && originalTarget.documentURI == eventTarget.contentDocument.documentURI)
- {
- // If the page is generated
- if(originalTarget.documentURI == "about:blank")
- {
- window.clearInterval(webdeveloper_editHTMLIntervalId);
- window.setTimeout(webdeveloper_retrieveHTML, 1000);
- window.setTimeout(webdeveloper_updateHTML, 1000);
- }
- else
- {
- webdeveloper_retrieveHTML();
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-}
-
-// Handles a browser tab being selected
-function webdeveloper_editHTMLMainTabSelect(event)
-{
- var browser = window.top.getBrowser();
- var selectedTab = browser.mTabBox.selectedIndex;
-
- // If the selected tab is different
- if(selectedTab != webdeveloper_editHTMLSelectedTab)
- {
- browser.browsers[webdeveloper_editHTMLSelectedTab].contentDocument.location.reload(false);
-
- webdeveloper_editHTMLSelectedTab = selectedTab;
-
- webdeveloper_retrieveHTML();
- }
-}
-
-// Initializes the edit HTML dashboard
-function webdeveloper_initializeEditHTML()
-{
- var mainTabBox = window.top.getBrowser().mTabBox;
- var textBox = document.getElementById("webdeveloper-edit-html-text-box");
- var textBoxStyle = "";
-
- webdeveloper_editHTMLSelectedTab = mainTabBox.selectedIndex;
- webdeveloper_editHTMLUpdateFrequency = webdeveloper_getIntegerPreference("webdeveloper.edit.update.frequency", true);
-
- document.getElementById("webdeveloper-search-dashboard-text").addEventListener("keypress", webdeveloper_searchTextKeyPress, false);
- mainTabBox.addEventListener("select", webdeveloper_editHTMLMainTabSelect, false);
- window.top.addEventListener("load", webdeveloper_editHTMLContentPageLoad, true);
-
- // If the edit CSS background color preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.background"))
- {
- textBoxStyle += "background-color: " + webdeveloper_getStringPreference("webdeveloper.edit.color.background", true) + " !important; ";
- }
-
- // If the edit CSS text color preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.text"))
- {
- textBoxStyle += "color: " + webdeveloper_getStringPreference("webdeveloper.edit.color.text", true) + " !important; ";
- }
-
- // If the edit CSS font preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.edit.font.size"))
- {
- textBoxStyle += "font-size: " + webdeveloper_getIntegerPreference("webdeveloper.edit.font.size", true) + "px !important; ";
- }
-
- textBox.setAttribute("style", textBoxStyle.trim());
-
- webdeveloper_retrieveHTML();
- webdeveloper_updateHTML();
-}
-
-// Resets the edited HTML
-function webdeveloper_resetHTML()
-{
- window.top.BrowserReload();
-}
-
-// Retrieves the HTML
-function webdeveloper_retrieveHTML()
-{
- var contentBody = webdeveloper_getDocumentBodyElement(webdeveloper_getContentDocument());
- var textBox = document.getElementById("webdeveloper-edit-html-text-box");
-
- // If the content body is set
- if(contentBody)
- {
- textBox.value = contentBody.innerHTML;
- }
-
- webdeveloper_applyHTML();
-}
-
-// Saves the HTML
-function webdeveloper_saveHTML()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
- var result = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
-
- url.spec = contentDocument.documentURI;
- filePicker.defaultExtension = url.fileExtension;
- filePicker.defaultString = url.fileName;
-
- filePicker.init(window, stringBundle.getString("webdeveloper_saveHTML"), filePicker.modeSave);
-
- result = filePicker.show();
-
- // If the user selected a file
- if(result == filePicker.returnOK || result == filePicker.returnReplace)
- {
- var file = filePicker.file;
- var webBrowserPersistInterface = Components.interfaces.nsIWebBrowserPersist;
- var webBrowserPersist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(webBrowserPersistInterface);
-
- webBrowserPersist.persistFlags = webBrowserPersistInterface.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION | webBrowserPersistInterface.PERSIST_FLAGS_FROM_CACHE | webBrowserPersistInterface.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
-
- // If the file does not exist
- if(!file.exists())
- {
- file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 00644);
- }
-
- webBrowserPersist.saveDocument(contentDocument, file, null, contentDocument.contentType, webBrowserPersistInterface.ENCODE_FLAGS_ENCODE_BASIC_ENTITIES, 0);
- }
-}
-
-// Searches the HTML
-function webdeveloper_searchHTML()
-{
- var searchText = document.getElementById("webdeveloper-search-dashboard-text").value;
-
- // If the search text is set
- if(searchText)
- {
- document.getElementById("webdeveloper-edit-html-text-box").focus();
-
- // If the search failed to find a match
- if(!window.find(searchText, false, false, true, false, false, false))
- {
- document.getElementById("webdeveloper-edit-html-text-box").setSelectionRange(0, 0);
- window.find(searchText, false, false, true, false, false, false);
- }
- }
-}
-
-// Searches the HTML when the enter key is pressed
-function webdeveloper_searchTextKeyPress(event)
-{
- var keyCode = event.keyCode;
-
- // If the key code is set and is 13
- if(keyCode && keyCode == 13)
- {
- webdeveloper_searchHTML();
- }
-}
-
-// Unloads edit HTML
-function webdeveloper_unloadEditHTML()
-{
- var browser = window.top.getBrowser();
- var mainTabBox = browser.mTabBox;
-
- webdeveloper_editHTMLOldHTML = null;
-
- window.clearInterval(webdeveloper_editHTMLIntervalId);
-
- // Try to remove the event listener
- try
- {
- document.getElementById("webdeveloper-search-dashboard-text").removeEventListener("keypress", webdeveloper_searchTextKeyPress, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- mainTabBox.removeEventListener("select", webdeveloper_editHTMLMainTabSelect, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- window.top.removeEventListener("load", webdeveloper_editHTMLContentPageLoad, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- window.top.BrowserReload();
-}
-
-// Updates the HTML
-function webdeveloper_updateHTML()
-{
- // If the update frequency is greater than 0
- if(webdeveloper_editHTMLUpdateFrequency > 0)
- {
- webdeveloper_editHTMLIntervalId = window.setInterval(webdeveloper_applyHTML, webdeveloper_editHTMLUpdateFrequency);
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/dashboard/edit_html.css" type="text/css"?>
-<?xml-stylesheet href="chrome://webdeveloper/skin/webdeveloper.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://webdeveloper/locale/dashboard.dtd">
-
-<window id="webdeveloper-edit-html-dashboard"
- onload="webdeveloper_initializeEditHTML()"
- onunload="webdeveloper_unloadEditHTML()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/dom.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dashboard/edit_html.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <toolbar>
- <toolbarbutton id="webdeveloper-save-dashboard" tooltiptext="&webdeveloper.save.label;" oncommand="webdeveloper_saveHTML()"/>
- <toolbarseparator/>
- <toolbarbutton id="webdeveloper-clear-dashboard" tooltiptext="&webdeveloper.clear.label;" oncommand="webdeveloper_clearHTML()"/>
- <toolbarbutton id="webdeveloper-reset-dashboard" tooltiptext="&webdeveloper.reset.label;" oncommand="webdeveloper_resetHTML()"/>
- <toolbarseparator/>
- <toolbarbutton id="webdeveloper-apply-html-dashboard" tooltiptext="&webdeveloper.apply.label;" oncommand="webdeveloper_applyHTML()"/>
- <toolbarseparator/>
- <textbox id="webdeveloper-search-dashboard-text" size="20"/>
- <toolbarbutton id="webdeveloper-search-dashboard" tooltiptext="&webdeveloper.search.label;" oncommand="webdeveloper_searchHTML()"/>
- </toolbar>
- <label control="webdeveloper-edit-html-text-box" value="&webdeveloper.html.body.label;"/>
- <textbox flex="1" id="webdeveloper-edit-html-text-box" multiline="true"/>
-</window>
\ No newline at end of file
+++ /dev/null
-// Initializes the cookie dialog
-function webdeveloper_initializeCookie()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the first argument equals add
- if(window.arguments[0] == "add")
- {
- var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
- var windowContent = window.opener.document.getElementById("content");
-
- document.title = stringBundle.getString("webdeveloper_addCookie");
- url.spec = windowContent.browsers[windowContent.mTabBox.selectedIndex].contentDocument.documentURI;
-
- document.getElementById("webdeveloper-cookie-expires").value = new Date().toUTCString();
- document.getElementById("webdeveloper-cookie-host").value = url.host;
- document.getElementById("webdeveloper-cookie-path").value = url.path;
- }
- else
- {
- document.title = stringBundle.getString("webdeveloper_editCookie");
-
- document.getElementById("webdeveloper-cookie-name").value = window.arguments[1];
- document.getElementById("webdeveloper-cookie-value").value = window.arguments[2];
- document.getElementById("webdeveloper-cookie-host").value = window.arguments[3];
- document.getElementById("webdeveloper-cookie-path").value = window.arguments[4];
-
- // If the cookie is a session cookie
- if(window.arguments[5] == stringBundle.getString("webdeveloper_viewCookieInformationSession"))
- {
- document.getElementById("webdeveloper-cookie-expires").disabled = true;
- document.getElementById("webdeveloper-cookie-session").checked = true;
- }
- else
- {
- document.getElementById("webdeveloper-cookie-expires").value = window.arguments[5];
- }
-
- // If the cookie is secure
- if(window.arguments[6] == "true")
- {
- document.getElementById("webdeveloper-cookie-secure").checked = true;
- }
- }
-}
-
-// Saves the cookie
-function webdeveloper_saveCookie()
-{
- var host = document.getElementById("webdeveloper-cookie-host").value.trim();
- var errors = "";
- var expires = document.getElementById("webdeveloper-cookie-expires").value.trim();
- var expiresDate = new Date(expires);
- var name = document.getElementById("webdeveloper-cookie-name").value.trim();
- var path = document.getElementById("webdeveloper-cookie-path").value.trim();
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the name is empty
- if(!name)
- {
- errors += stringBundle.getString("webdeveloper_emptyName") + "\n";
- }
-
- // If the host is empty
- if(!host)
- {
- errors += stringBundle.getString("webdeveloper_emptyHost") + "\n";
- }
-
- // If the path is empty
- if(!path)
- {
- errors += stringBundle.getString("webdeveloper_emptyPath") + "\n";
- }
-
- // If this is not a session cookie
- if(!document.getElementById("webdeveloper-cookie-session").checked)
- {
- // If the expires is empty
- if(!expires)
- {
- errors += stringBundle.getString("webdeveloper_emptyExpires") + "\n";
- }
- else if(expiresDate && expiresDate == "Invalid Date")
- {
- errors += stringBundle.getString("webdeveloper_invalidExpires") + "\n";
- }
- }
-
- // If there are errors
- if(errors)
- {
- webdeveloper_error(errors.trim());
-
- return false;
- }
- else
- {
- var cookie = name + "=" + document.getElementById("webdeveloper-cookie-value").value.trim() + ";";
- var cookieService = Components.classes["@mozilla.org/cookieService;1"].getService().QueryInterface(Components.interfaces.nsICookieService);
- var scheme = "http://";
- var secure = document.getElementById("webdeveloper-cookie-secure").checked;
- var session = document.getElementById("webdeveloper-cookie-session").checked;
- var uri = null;
-
- // If the first argument equals edit
- if(window.arguments[0] == "edit")
- {
- Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager).remove(window.arguments[3], window.arguments[1], window.arguments[4], false);
- }
-
- // If the host is a domain
- if(host.charAt(0) == ".")
- {
- cookie += "domain=" + host + ";";
- }
-
- cookie += "path=" + path + ";";
-
- // If this is not a session cookie
- if(!session)
- {
- cookie += "expires=" + expiresDate + ";";
- }
-
- // If the cookie is secure
- if(secure)
- {
- cookie += "secure;";
- scheme = "https://";
- }
-
- uri = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(scheme + host + path, null, null);
-
- cookieService.setCookieString(uri, null, cookie, null);
- }
-
- return true;
-}
-
-// Updates the expiry status
-function webdeveloper_updateExpiryStatus()
-{
- var disabled = false;
- var expires = new Date();
-
- // If session cookie is checked
- if(document.getElementById("webdeveloper-cookie-session").checked)
- {
- disabled = true;
- expires = "";
- }
-
- document.getElementById("webdeveloper-cookie-expires").disabled = disabled;
- document.getElementById("webdeveloper-cookie-expires").value = expires;
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-cookie-dialog"
- ondialogaccept="return webdeveloper_saveCookie()"
- onload="webdeveloper_initializeCookie()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dialogs/cookie.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <vbox>
- <grid>
- <columns>
- <column/>
- <column/>
- </columns>
- <rows>
- <row align="center">
- <label control="webdeveloper-cookie-name" value="&webdeveloper.name.label;"/>
- <textbox flex="1" id="webdeveloper-cookie-name" size="35"/>
- </row>
- <row align="center">
- <label control="webdeveloper-cookie-value" value="&webdeveloper.value.label;"/>
- <textbox flex="1" id="webdeveloper-cookie-value" size="35"/>
- </row>
- <row align="center">
- <label control="webdeveloper-cookie-host" value="&webdeveloper.host.label;"/>
- <textbox flex="1" id="webdeveloper-cookie-host" size="35"/>
- </row>
- <row align="center">
- <label control="webdeveloper-cookie-path" value="&webdeveloper.path.label;"/>
- <textbox flex="1" id="webdeveloper-cookie-path" size="35"/>
- </row>
- <row align="center">
- <label control="webdeveloper-cookie-expires" value="&webdeveloper.cookie.expires.label;"/>
- <textbox flex="1" id="webdeveloper-cookie-expires" size="35"/>
- </row>
- </rows>
- </grid>
- <checkbox id="webdeveloper-cookie-session" label="&webdeveloper.cookie.session.label;" oncommand="webdeveloper_updateExpiryStatus()"/>
- <checkbox id="webdeveloper-cookie-secure" label="&webdeveloper.cookie.secure.label;"/>
- </vbox>
-</dialog>
\ No newline at end of file
+++ /dev/null
-// Cancels the outline elements
-function webdeveloper_cancelOutlineElements()
-{
- window.opener.document.getElementById("webdeveloper-outline-custom-elements-menu").checked = false;
-
- window.close();
-}
-
-// Initializes the outline elements dialog
-function webdeveloper_initializeOutlineElements()
-{
- var color = null;
- var element = null;
-
- // Loop through the possible custom elements
- for(var i = 1; i <= 5; i++)
- {
- color = "webdeveloper.custom." + i + ".color";
- element = "webdeveloper.custom." + i + ".element";
-
- // If the color is set
- if(webdeveloper_isPreferenceSet(color))
- {
- document.getElementById(color).color = webdeveloper_getStringPreference(color, true);
- }
-
- // If the element is set
- if(webdeveloper_isPreferenceSet(element))
- {
- document.getElementById(element).value = webdeveloper_getStringPreference(element, true);
- }
- }
-}
-
-// Saves the list of colors and elements to outline
-function webdeveloper_saveOutlineElements()
-{
- var color = null;
- var element = null;
-
- // Loop through the possible custom elements
- for(var i = 1; i <= 5; i++)
- {
- color = "webdeveloper.custom." + i + ".color";
- element = "webdeveloper.custom." + i + ".element";
-
- webdeveloper_setStringPreference(color, document.getElementById(color).color);
- webdeveloper_setStringPreference(element, document.getElementById(element).value.trim());
- }
-
- window.arguments[0].push(true);
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-outline-elements-dialog"
- ondialogaccept="webdeveloper_saveOutlineElements()"
- ondialogcancel="webdeveloper_cancelOutlineElements()"
- onload="webdeveloper_initializeOutlineElements()"
- title="&webdeveloper.outline.elements.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dialogs/outline_elements.js"/>
-
- <description value="&webdeveloper.outline.elements.description;"/>
- <groupbox>
- <caption label="&webdeveloper.outline.element.1.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.custom.1.element" size="25"/>
- <colorpicker id="webdeveloper.custom.1.color" palettename="standard" type="button"/>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.outline.element.2.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.custom.2.element" size="25"/>
- <colorpicker id="webdeveloper.custom.2.color" palettename="standard" type="button"/>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.outline.element.3.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.custom.3.element" size="25"/>
- <colorpicker id="webdeveloper.custom.3.color" palettename="standard" type="button"/>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.outline.element.4.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.custom.4.element" size="25"/>
- <colorpicker id="webdeveloper.custom.4.color" palettename="standard" type="button"/>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.outline.element.5.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.custom.5.element" size="25"/>
- <colorpicker id="webdeveloper.custom.5.color" palettename="standard" type="button"/>
- </hbox>
- </groupbox>
-</dialog>
\ No newline at end of file
+++ /dev/null
-// Initializes the resize dialog
-function webdeveloper_initializeResize()
-{
- var resizeViewport = webdeveloper_getBooleanPreference("webdeveloper.resize.viewport", true);
-
- document.getElementById("webdeveloper-resize-viewport").checked = resizeViewport;
-
- // If resizing the viewport
- if(resizeViewport)
- {
- document.getElementById("webdeveloper-resize-width").value = window.arguments[2];
- document.getElementById("webdeveloper-resize-height").value = window.arguments[3];
- }
- else
- {
- document.getElementById("webdeveloper-resize-width").value = window.arguments[0];
- document.getElementById("webdeveloper-resize-height").value = window.arguments[1];
- }
-}
-
-// Resizes the parent window to the given width and height
-function webdeveloper_resizeParentWindow()
-{
- var height = document.getElementById("webdeveloper-resize-height").value.trim();
- var width = document.getElementById("webdeveloper-resize-width").value.trim();
-
- // If the width and height are valid
- if(width && height && (width == "*" || (parseInt(width) == width && width > 0)) && (height == "*" || (parseInt(height) == height && height > 0)))
- {
- var contentWindow = window.opener.content;
- var windowX = window.opener.screenX;
- var windowY = window.opener.screenY;
-
- // If resizing the view port
- if(document.getElementById("webdeveloper-resize-viewport").checked)
- {
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.resize.viewport", true);
-
- // If the width is not a wildcard
- if(width != "*")
- {
- contentWindow.innerWidth = width;
- }
-
- // If the height is not a wildcard
- if(height != "*")
- {
- contentWindow.innerHeight = height;
- }
- }
- else
- {
- // If the resize viewport preference is set
- if(webdeveloper_isPreferenceSet("webdeveloper.resize.viewport"))
- {
- webdeveloper_deletePreference("webdeveloper.resize.viewport");
- }
-
- // If the width is a wildcard
- if(width == "*")
- {
- width = contentWindow.outerWidth;
- }
-
- // If the height is a wildcard
- if(height == "*")
- {
- height = contentWindow.outerHeight;
- }
-
- window.opener.resizeTo(width, height);
- }
-
- window.opener.screenX = windowX;
- window.opener.screenY = windowY;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-resize-dialog"
- ondialogaccept="webdeveloper_resizeParentWindow()"
- onload="webdeveloper_initializeResize()"
- title="&webdeveloper.resize.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dialogs/resize.js"/>
-
- <groupbox>
- <caption label="&webdeveloper.resize.caption;"/>
- <grid>
- <columns>
- <column/>
- <column/>
- </columns>
- <rows>
- <row align="center">
- <label control="webdeveloper-resize-width" flex="1" value="&webdeveloper.width.label;"/>
- <textbox id="webdeveloper-resize-width" size="5"/>
- </row>
- <row align="center">
- <label control="webdeveloper-resize-height" flex="1" value="&webdeveloper.height.label;"/>
- <textbox id="webdeveloper-resize-height" size="5"/>
- </row>
- </rows>
- </grid>
- <checkbox id="webdeveloper-resize-viewport" label="&webdeveloper.resize.viewport.label;"/>
- </groupbox>
-</dialog>
\ No newline at end of file
+++ /dev/null
-// Toggles the cache
-function webdeveloper_toggleCache(element)
-{
- webdeveloper_disablePreference(element, "browser.cache.disk.enable");
- webdeveloper_disablePreference(element, "browser.cache.memory.enable");
-}
-
-// Toggles Java
-function webdeveloper_toggleJava(element)
-{
- webdeveloper_disablePreference(element, "security.enable_java");
-}
-
-// Toggle JavaScript
-function webdeveloper_toggleJavaScript(element)
-{
- var javaScriptButton = document.getElementById("webdeveloper-javascript-statusbar");
-
- webdeveloper_disablePreference(element, "javascript.enabled");
-
- // If the JavaScript button exists
- if(javaScriptButton)
- {
- // If disabling JavaScript
- if(element.getAttribute("checked"))
- {
- javaScriptButton.setAttribute("class", "disabled");
- javaScriptButton.setAttribute("tooltiptext", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_javaScriptDisabledTooltip"));
- }
- else
- {
- // If the JavaScript button has a class attribute
- if(javaScriptButton.hasAttribute("class"))
- {
- javaScriptButton.removeAttribute("class");
- }
-
- // If the JavaScript button has a tooltip text attribute
- if(javaScriptButton.hasAttribute("tooltiptext"))
- {
- javaScriptButton.removeAttribute("tooltiptext");
- }
- }
- }
-}
-
-// Toggles meta redirects
-function webdeveloper_toggleMetaRedirects(element)
-{
- var allowMetaRedirects = true;
- var browsers = getBrowser().browsers;
- var browserLength = browsers.length;
-
- // If the element is checked
- if(element.getAttribute("checked"))
- {
- allowMetaRedirects = false;
- }
-
- // Loop through the browsers
- for(var i = 0; i < browserLength; i++)
- {
- browsers[i].docShell.allowMetaRedirects = allowMetaRedirects;
- }
-
- webdeveloper_enablePreference(element, "webdeveloper.meta.redirects.disable");
-}
-
-// Toggles the minimum font size
-function webdeveloper_toggleMinimumFontSize(element)
-{
- var defaultFontSize = 10;
- var minimumFontSize = null;
-
- // If disabling the minimum font size
- if(element.getAttribute("checked"))
- {
- minimumFontSize = webdeveloper_getIntegerPreference("font.minimum-size.x-western", true);
-
- // If the minimum font size is not set
- if(minimumFontSize == 0)
- {
- minimumFontSize = defaultFontSize;
- }
-
- webdeveloper_deletePreference("font.minimum-size.x-western");
- webdeveloper_setIntegerPreference("webdeveloper.font.minimum.size", minimumFontSize);
- }
- else
- {
- minimumFontSize = webdeveloper_getIntegerPreference("webdeveloper.font.minimum.size", true);
-
- // If the minimum font size is not set
- if(minimumFontSize == 0)
- {
- minimumFontSize = defaultFontSize;
- }
-
- webdeveloper_deletePreference("webdeveloper.font.minimum.size");
- webdeveloper_setIntegerPreference("font.minimum-size.x-western", minimumFontSize);
- }
-
- BrowserReload();
-}
-
-// Toggles the page colors
-function webdeveloper_togglePageColors(element)
-{
- webdeveloper_disablePreference(element, "browser.display.use_document_colors");
- BrowserReload();
-}
-
-// Toggles the proxy settings
-function webdeveloper_toggleProxy(element)
-{
- // If disabling the proxy
- if(element.getAttribute("checked"))
- {
- webdeveloper_setIntegerPreference("webdeveloper.proxy.type", webdeveloper_getIntegerPreference("network.proxy.type", true));
- webdeveloper_deletePreference("network.proxy.type");
- }
- else
- {
- webdeveloper_setIntegerPreference("network.proxy.type", webdeveloper_getIntegerPreference("webdeveloper.proxy.type", true));
- webdeveloper_deletePreference("webdeveloper.proxy.type");
- }
-}
-
-// Toggles referrers
-function webdeveloper_toggleReferrers(element)
-{
- var sendReferrer = 2;
-
- // If disabling referrers
- if(element.getAttribute("checked"))
- {
- sendReferrer = 0;
- }
-
- webdeveloper_setIntegerPreference("network.http.sendRefererHeader", sendReferrer);
-}
-
-// Updates the disable menu
-function webdeveloper_updateDisableMenu(suffix)
-{
- var checked = !webdeveloper_getBooleanPreference("browser.cache.disk.enable", false) && !webdeveloper_getBooleanPreference("browser.cache.memory.enable", false);
- var menu = document.getElementById("webdeveloper-disable-proxy-" + suffix);
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-cache-" + suffix), "checked", checked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-java-" + suffix), "checked", !webdeveloper_getBooleanPreference("security.enable_java", false));
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-javascript-" + suffix), "checked", !webdeveloper_getBooleanPreference("javascript.enabled", false));
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-meta-redirects-" + suffix), "checked", webdeveloper_getBooleanPreference("webdeveloper.meta.redirects.disable", true));
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-minimum-font-size-" + suffix), "checked", webdeveloper_getIntegerPreference("font.minimum-size.x-western", true) == 0);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-page-colors-" + suffix), "checked", !webdeveloper_getBooleanPreference("browser.display.use_document_colors", false));
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-popup-blocker-" + suffix), "checked", !webdeveloper_getBooleanPreference("dom.disable_open_during_load", false));
-
- // If the menu is set
- if(menu)
- {
- var proxyConfigured = webdeveloper_isPreferenceSet("network.proxy.type");
- var proxyDisabled = webdeveloper_isPreferenceSet("webdeveloper.proxy.type");
-
- webdeveloper_configureElement(menu, "checked", !proxyConfigured && proxyDisabled);
- webdeveloper_configureElement(menu, "disabled", !proxyConfigured && !proxyDisabled);
- }
-
- // If the referrer preference is set to 0
- if(webdeveloper_getIntegerPreference("network.http.sendRefererHeader", false) == 0)
- {
- checked = true;
- }
- else
- {
- checked = false;
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-referrers-" + suffix), "checked", checked);
-}
-
-// Updates the disable JavaScript menu
-function webdeveloper_updateDisableJavaScriptMenu(suffix)
-{
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-all-javascript-" + suffix), "checked", !webdeveloper_getBooleanPreference("javascript.enabled", false));
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-strict-javascript-warnings-" + suffix), "checked", !webdeveloper_getBooleanPreference("javascript.options.strict", false));
-}
+++ /dev/null
-var webdeveloper_elementInformationBlockSelected = false;
-var webdeveloper_informationElement = null;
-
-// Creates the element information block
-function webdeveloper_createElementInformationBlock(ownerDocument)
-{
- var definitionElement = ownerDocument.createElement("dd");
- var divElement = ownerDocument.createElement("div");
- var headerElement = ownerDocument.createElement("h2");
- var listElement = ownerDocument.createElement("dl");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var termElement = ownerDocument.createElement("dt");
-
- headerElement.addEventListener("mousedown", webdeveloper_selectElementInformation, false);
- headerElement.addEventListener("mouseup", webdeveloper_deselectElementInformation, false);
- headerElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_elementInformation")));
- divElement.appendChild(headerElement);
-
- termElement.addEventListener("click", webdeveloper_toggleElementInformationBlock, false);
- termElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_attributes")));
- definitionElement.setAttribute("id", "webdeveloper-element-information-attributes");
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
- divElement.appendChild(listElement);
-
- definitionElement = ownerDocument.createElement("dd");
- listElement = ownerDocument.createElement("dl");
- termElement = ownerDocument.createElement("dt");
-
- termElement.addEventListener("click", webdeveloper_toggleElementInformationBlock, false);
- termElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_position")));
- definitionElement.setAttribute("id", "webdeveloper-element-information-position");
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
- divElement.appendChild(listElement);
-
- definitionElement = ownerDocument.createElement("dd");
- listElement = ownerDocument.createElement("dl");
- termElement = ownerDocument.createElement("dt");
-
- termElement.addEventListener("click", webdeveloper_toggleElementInformationBlock, false);
- termElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_other")));
- definitionElement.setAttribute("id", "webdeveloper-element-information-other");
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
- divElement.appendChild(listElement);
-
- definitionElement = ownerDocument.createElement("dd");
- listElement = ownerDocument.createElement("dl");
- termElement = ownerDocument.createElement("dt");
-
- termElement.addEventListener("click", webdeveloper_toggleElementInformationBlock, false);
- termElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_ancestors")));
- definitionElement.setAttribute("id", "webdeveloper-element-information-ancestors");
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
- divElement.appendChild(listElement);
-
- definitionElement = ownerDocument.createElement("dd");
- listElement = ownerDocument.createElement("dl");
- termElement = ownerDocument.createElement("dt");
-
- termElement.addEventListener("click", webdeveloper_toggleElementInformationBlock, false);
- termElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_children")));
- definitionElement.setAttribute("id", "webdeveloper-element-information-children");
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
- divElement.appendChild(listElement);
-
- divElement.setAttribute("id", "webdeveloper-element-information");
- webdeveloper_getDocumentBodyElement(ownerDocument).appendChild(divElement);
-}
-
-// Called when the element information is deselected
-function webdeveloper_deselectElementInformation(event)
-{
- webdeveloper_elementInformationBlockSelected = false;
-}
-
-// Displays information about the element
-function webdeveloper_displayElementInformation(element)
-{
- var checked = true;
- var contentDocument = webdeveloper_getContentDocument();
- var contentWindow = webdeveloper_getContentWindow();
- var divElement = null;
- var documentList = webdeveloper_getDocuments(contentWindow);
- var documentLength = documentList.length;
- var leftOffset = contentWindow.pageXOffset;
- var pageDocument = null;
- var topOffset = contentWindow.pageYOffset;
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
- else
- {
- var currentDocument = contentWindow.document;
-
- element = document.getElementById("webdeveloper-display-element-information-menu");
-
- // If the display element information element is set
- if(currentDocument.getElementById("webdeveloper-display-element-information"))
- {
- checked = false;
- }
-
- webdeveloper_configureElement(element, "checked", checked);
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", !checked);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // If displaying element information
- if(checked)
- {
- webdeveloper_createElementInformationBlock(pageDocument);
-
- // If this is the content document
- if(pageDocument == contentDocument)
- {
- divElement = pageDocument.getElementById("webdeveloper-element-information");
-
- // If the div element was found
- if(divElement)
- {
- divElement.style.left = (leftOffset + 5) + "px";
- divElement.style.top = (topOffset + 5) + "px";
- }
- }
-
- pageDocument.addEventListener("click", webdeveloper_displayElementInformationForElement, false);
- pageDocument.addEventListener("keypress", webdeveloper_displayElementInformationKeyPress, false);
- pageDocument.addEventListener("mousemove", webdeveloper_displayElementInformationMouseMove, false);
- pageDocument.addEventListener("mouseover", webdeveloper_displayElementInformationMouseOver, false);
- }
- else
- {
- divElement = pageDocument.getElementById("webdeveloper-element-information");
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("click", webdeveloper_displayElementInformationForElement, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("keypress", webdeveloper_displayElementInformationKeyPress, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mousemove", webdeveloper_displayElementInformationMouseMove, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mouseover", webdeveloper_displayElementInformationMouseOver, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_removeElement(divElement);
- webdeveloper_removeElementOutline(webdeveloper_informationElement);
- }
- }
-
- // If not displaying element information
- if(!checked)
- {
- webdeveloper_elementInformationBlockSelected = false;
- webdeveloper_informationElement = null;
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_element_information.css", "webdeveloper-display-element-information");
-}
-
-// Displays information about the specific element
-function webdeveloper_displayElementInformationForElement(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var elementName = element.tagName;
- var ownerDocument = element.ownerDocument;
-
- // If the element has a name and it is not scrollbar and it has an owner document
- if(elementName && elementName != "scrollbar" && ownerDocument)
- {
- var divElement = ownerDocument.getElementById("webdeveloper-element-information");
-
- // If the div element was found
- if(divElement)
- {
- // If the element is not the div element and the div element is not an ancestor of the element
- if(element != divElement && !webdeveloper_isAncestor(element, divElement))
- {
- var definitionElement = ownerDocument.getElementById("webdeveloper-element-information-attributes");
- var headerElements = divElement.getElementsByTagName("h2");
- var outlineElement = null;
- var pElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var tableElement = null;
- var tableCellElement = null;
- var tableRowElement = null;
-
- webdeveloper_removeElementOutline(element);
-
- // If header elements were found
- if(headerElements.length > 0)
- {
- var headerElement = headerElements[0];
-
- // If the header element is set
- if(headerElement)
- {
- webdeveloper_removeAllChildElements(headerElement);
-
- headerElement.appendChild(ownerDocument.createTextNode(webdeveloper_getElementDescription(element)));
- }
- }
-
- // If the definition element is set
- if(definitionElement)
- {
- var elementAttribute = null;
- var elementAttributes = element.attributes;
- var elementAttributesLength = elementAttributes.length;
-
- webdeveloper_removeAllChildElements(definitionElement);
-
- // If there are no attributes
- if(elementAttributesLength == 0)
- {
- definitionElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_none")));
- }
- else
- {
- // Loop through the attributes
- for(var i = 0; i < elementAttributesLength; i++)
- {
- elementAttribute = elementAttributes[i];
- pElement = ownerDocument.createElement("p");
-
- pElement.appendChild(ownerDocument.createTextNode(elementAttribute.name + " = " + elementAttribute.value));
- definitionElement.appendChild(pElement);
- }
- }
- }
-
- definitionElement = ownerDocument.getElementById("webdeveloper-element-information-position");
-
- // If the definition element is set
- if(definitionElement)
- {
- tableElement = ownerDocument.createElement("table");
- tableCellElement = ownerDocument.createElement("td");
- tableRowElement = ownerDocument.createElement("tr");
-
- webdeveloper_removeAllChildElements(definitionElement);
-
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_left") + ": " + webdeveloper_getElementPositionX(element) + "px"));
- tableRowElement.appendChild(tableCellElement);
-
- tableCellElement = ownerDocument.createElement("td");
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_top") + ": " + webdeveloper_getElementPositionY(element) + "px"));
- tableRowElement.appendChild(tableCellElement);
- tableElement.appendChild(tableRowElement);
-
- tableCellElement = ownerDocument.createElement("td");
- tableRowElement = ownerDocument.createElement("tr");
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_width") + ": " + element.clientWidth + "px"));
- tableRowElement.appendChild(tableCellElement);
-
- tableCellElement = ownerDocument.createElement("td");
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_height") + ": " + element.clientHeight + "px"));
- tableRowElement.appendChild(tableCellElement);
- tableElement.appendChild(tableRowElement);
- definitionElement.appendChild(tableElement);
- }
-
- definitionElement = ownerDocument.getElementById("webdeveloper-element-information-other");
-
- // If the definition element is set
- if(definitionElement)
- {
- var fontFamily = element.ownerDocument.defaultView.getComputedStyle(element, null).getPropertyCSSValue("font-family");
- var fontSize = element.ownerDocument.defaultView.getComputedStyle(element, null).getPropertyCSSValue("font-size");
-
- tableElement = ownerDocument.createElement("table");
-
- webdeveloper_removeAllChildElements(definitionElement);
-
- // If this element has a font family
- if(fontFamily)
- {
- tableCellElement = ownerDocument.createElement("td");
- tableRowElement = ownerDocument.createElement("tr");
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_fontFamily") + ":"));
- tableRowElement.appendChild(tableCellElement);
-
- tableCellElement = ownerDocument.createElement("td");
- tableCellElement.appendChild(ownerDocument.createTextNode(fontFamily.cssText));
- tableRowElement.appendChild(tableCellElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If this element has a font size
- if(fontSize)
- {
- tableCellElement = ownerDocument.createElement("td");
- tableRowElement = ownerDocument.createElement("tr");
- tableCellElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_fontSize") + ":"));
- tableRowElement.appendChild(tableCellElement);
-
- tableCellElement = ownerDocument.createElement("td");
- tableCellElement.appendChild(ownerDocument.createTextNode(fontSize.cssText));
- tableRowElement.appendChild(tableCellElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If the table has child nodes
- if(tableElement.hasChildNodes())
- {
- definitionElement.appendChild(tableElement);
- }
- }
-
- definitionElement = ownerDocument.getElementById("webdeveloper-element-information-ancestors");
-
- // If the definition element is set
- if(definitionElement)
- {
- var ancestorList = webdeveloper_getElementAncestors(element);
- var ancestorLength = ancestorList.length;
-
- webdeveloper_removeAllChildElements(definitionElement);
-
- // If there are no ancestors
- if(ancestorLength == 0)
- {
- definitionElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_none")));
- }
- else
- {
- // Loop through the ancestors
- for(i = 0; i < ancestorLength; i++)
- {
- pElement = ownerDocument.createElement("p");
-
- pElement.appendChild(ownerDocument.createTextNode(webdeveloper_getElementDescription(ancestorList[i])));
- definitionElement.appendChild(pElement);
- }
- }
- }
-
- definitionElement = ownerDocument.getElementById("webdeveloper-element-information-children");
-
- // If the definition element is set
- if(definitionElement)
- {
- var children = webdeveloper_getElementChildren(element);
- var childLength = children.length;
-
- webdeveloper_removeAllChildElements(definitionElement);
-
- // If there are no children
- if(childLength == 0)
- {
- definitionElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_none")));
- }
- else
- {
- // Loop through the children
- for(i = 0; i < childLength; i++)
- {
- pElement = ownerDocument.createElement("p");
-
- pElement.appendChild(ownerDocument.createTextNode(webdeveloper_getElementDescription(children[i])));
- definitionElement.appendChild(pElement);
- }
- }
- }
-
- element.style.MozOutline = "1px solid #ff0000";
-
- // Force the style sheet to refresh
- divElement.setAttribute("class", "force-width");
- divElement.removeAttribute("class");
-
- event.preventDefault();
- }
- }
- }
- }
-}
-
-// Keypress event for display element information
-function webdeveloper_displayElementInformationKeyPress(event)
-{
- webdeveloper_copyElementAncestors(event);
-}
-
-// Move event for display element information
-function webdeveloper_displayElementInformationMouseMove(event)
-{
- // If the element information block is selected
- if(webdeveloper_elementInformationBlockSelected)
- {
- webdeveloper_moveElementInformationBlock(event);
- }
- else
- {
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the owner document is set
- if(ownerDocument)
- {
- var divElement = ownerDocument.getElementById("webdeveloper-element-information");
-
- // If the div element was found
- if(divElement)
- {
- // If the element is not the div element and the div element is not an ancestor of the element
- if(element != divElement && !webdeveloper_isAncestor(element, divElement))
- {
- var outlineElement = webdeveloper_addElementOutline(event, webdeveloper_informationElement);
-
- // If the outline element is set
- if(outlineElement)
- {
- webdeveloper_informationElement = outlineElement;
- }
- }
-
- }
- }
- }
- }
-}
-
-// Mouseover event for display element information
-function webdeveloper_displayElementInformationMouseOver(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the owner document is set
- if(ownerDocument)
- {
- var divElement = ownerDocument.getElementById("webdeveloper-element-information");
-
- // If the div element was found
- if(divElement)
- {
- // If the element is not the div element and the div element is not an ancestor of the element
- if(element != divElement && !webdeveloper_isAncestor(element, divElement))
- {
- webdeveloper_displayElementAncestors(event);
- }
-
- }
- }
- }
-}
-
-// Move the element information block
-function webdeveloper_moveElementInformationBlock(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the target has an owner document
- if(ownerDocument)
- {
- var divElement = ownerDocument.getElementById("webdeveloper-element-information");
-
- // If the div element was found
- if(divElement)
- {
- divElement.style.left = (event.pageX - 5) + "px";
- divElement.style.top = (event.pageY - 5) + "px";
- }
- }
- }
-}
-
-// Called when the element information is selected
-function webdeveloper_selectElementInformation(event)
-{
- // If the click was not a right click
- if(event.button != 2)
- {
- webdeveloper_elementInformationBlockSelected = true;
- }
-}
-
-// Toggles an element information block
-function webdeveloper_toggleElementInformationBlock(event)
-{
- var element = event.target;
-
- // If there is a target element
- if(element)
- {
- // If the element has a class attribute
- if(element.hasAttribute("class"))
- {
- element.removeAttribute("class");
- }
- else
- {
- element.setAttribute("class", "collapsed");
- }
- }
-}
+++ /dev/null
-var webdeveloper_lineGuideSelected = null;
-
-// Adds a horizontal line guide
-function webdeveloper_addHorizontalLineGuide()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var contentWindow = webdeveloper_getContentWindow();
- var documentHeight = contentDocument.height;
- var lineGuide = contentDocument.createElement("div");
- var lineGuidePositions = webdeveloper_getHorizontalLineGuidePositions(contentDocument);
- var spacing = contentWindow.pageYOffset + 100;
-
- lineGuide.style.backgroundColor = webdeveloper_getStringPreference("webdeveloper.line.guides.color");
- lineGuide.style.top = 0;
-
- lineGuide.addEventListener("mousedown", webdeveloper_selectLineGuide, false);
- lineGuide.addEventListener("mouseout", webdeveloper_mouseoutLineGuide, false);
- lineGuide.addEventListener("mouseover", webdeveloper_mouseoverLineGuide, false);
- lineGuide.addEventListener("mouseup", webdeveloper_deselectLineGuide, false);
-
- webdeveloper_sizeHorizontalLineGuide(lineGuide, contentDocument);
-
- // While the spacing is less than the document height
- while(spacing < documentHeight)
- {
- // If there is already a line guide at this position
- if(webdeveloper_contains(lineGuidePositions, spacing + "px"))
- {
- spacing += 100;
- }
- else
- {
- lineGuide.style.top = spacing + "px";
- break;
- }
- }
-
- lineGuide.setAttribute("class", "webdeveloper-line-guide webdeveloper-horizontal-line-guide");
- webdeveloper_getDocumentBodyElement(contentDocument).appendChild(lineGuide);
-}
-
-// Adds a vertical line guide
-function webdeveloper_addVerticalLineGuide()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var contentWindow = webdeveloper_getContentWindow();
- var documentWidth = contentDocument.width;
- var lineGuide = contentDocument.createElement("div");
- var lineGuidePositions = webdeveloper_getVerticalLineGuidePositions(contentDocument);
- var spacing = contentWindow.pageXOffset + 100;
-
- lineGuide.style.backgroundColor = webdeveloper_getStringPreference("webdeveloper.line.guides.color");
- lineGuide.style.left = 0;
-
- lineGuide.addEventListener("mousedown", webdeveloper_selectLineGuide, false);
- lineGuide.addEventListener("mouseout", webdeveloper_mouseoutLineGuide, false);
- lineGuide.addEventListener("mouseover", webdeveloper_mouseoverLineGuide, false);
- lineGuide.addEventListener("mouseup", webdeveloper_deselectLineGuide, false);
-
- webdeveloper_sizeVerticalLineGuide(lineGuide, contentDocument);
-
- // While the spacing is less than the document width
- while(spacing < documentWidth)
- {
- // If there is already a line guide at this position
- if(webdeveloper_contains(lineGuidePositions, spacing + "px"))
- {
- spacing += 100;
- }
- else
- {
- lineGuide.style.left = spacing + "px";
- break;
- }
- }
-
- lineGuide.setAttribute("class", "webdeveloper-line-guide webdeveloper-vertical-line-guide");
- webdeveloper_getDocumentBodyElement(contentDocument).appendChild(lineGuide);
-}
-
-// Called when a line guide is deselected
-function webdeveloper_deselectLineGuide(event)
-{
- webdeveloper_lineGuideSelected = null;
-}
-
-// Displays line guides
-function webdeveloper_displayLineGuides(element)
-{
- // If the page has frames
- if(webdeveloper_pageHasFrames())
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_framesNotSupported"));
- }
- else
- {
- var checked = false;
- var contentDocument = webdeveloper_getContentDocument();
- var divElement = null;
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-line-guides-toolbar"), "hidden", !checked);
-
- // If displaying line guides
- if(checked)
- {
- divElement = contentDocument.createElement("div");
-
- document.getElementById("webdeveloper.line.guides.color").color = webdeveloper_getStringPreference("webdeveloper.line.guides.color");
-
- webdeveloper_addHorizontalLineGuide();
- webdeveloper_addVerticalLineGuide();
-
- divElement.setAttribute("id", "webdeveloper-line-guide-information");
- webdeveloper_getDocumentBodyElement(contentDocument).appendChild(divElement);
-
- contentDocument.addEventListener("mousemove", webdeveloper_moveLineGuide, false);
- window.addEventListener("resize", webdeveloper_resizeLineGuides, false);
- }
- else
- {
- divElement = contentDocument.getElementById("webdeveloper-line-guide-information");
-
- webdeveloper_removeElement(divElement);
- webdeveloper_removeLineGuides(contentDocument);
-
- // Try to remove the event listener
- try
- {
- contentDocument.removeEventListener("mousemove", webdeveloper_moveLineGuide, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- window.removeEventListener("resize", webdeveloper_resizeLineGuides, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_lineGuideSelected = null;
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_line_guides.css", "webdeveloper-display-line-guides");
- }
-}
-
-// Returns an array containing the horizontal line guide positions
-function webdeveloper_getHorizontalLineGuidePositions(contentDocument)
-{
- return webdeveloper_getLineGuidePositions(contentDocument, true);
-}
-
-// Returns the line guide position nearest to the given line guide position
-function webdeveloper_getLineGuidePosition(contentDocument, horizontal, lineGuidePosition, next)
-{
- var lineGuidePositions = webdeveloper_getLineGuidePositions(contentDocument, horizontal);
- var lineGuidesLength = lineGuidePositions.length;
- var otherLineGuidePosition = 0;
- var position = 0;
-
- // Loop through the line guide positions
- for(var i = 0; i < lineGuidesLength; i++)
- {
- otherLineGuidePosition = lineGuidePositions[i];
- otherLineGuidePosition = otherLineGuidePosition.substring(0, otherLineGuidePosition.length - 2);
-
- // If looking for the next line guide position, the other line guide position is greater than the line guide position and the other line guide position is greater than the saved position
- if(next && otherLineGuidePosition > lineGuidePosition && otherLineGuidePosition > position)
- {
- position = otherLineGuidePosition;
- }
- else if(!next && otherLineGuidePosition < lineGuidePosition && otherLineGuidePosition > position)
- {
- position = otherLineGuidePosition;
- }
- }
-
- return position;
-}
-
-// Returns an array containing the line guide positions
-function webdeveloper_getLineGuidePositions(contentDocument, horizontal)
-{
- var divElement = null;
- var divElementClass = null;
- var divElements = contentDocument.getElementsByTagName("div");
- var divElementsLength = divElements.length;
- var lineGuidePositions = new Array();
-
- // Loop through the div elements
- for(var i = 0; i < divElementsLength; i++)
- {
- divElement = divElements[i];
-
- // If the div element is set
- if(divElement)
- {
- divElementClass = divElement.getAttribute("class");
-
- // If the class exists and contains webdeveloper-line-guide
- if(divElementClass && divElementClass.indexOf("webdeveloper-line-guide") != -1)
- {
- // If looking for horizontal line guides and the class contains webdeveloper-horizontal-line-guide
- if(horizontal && divElementClass.indexOf("webdeveloper-horizontal-line-guide") != -1)
- {
- lineGuidePositions.push(divElement.style.top);
- }
- else if(!horizontal && divElementClass.indexOf("webdeveloper-vertical-line-guide") != -1)
- {
- lineGuidePositions.push(divElement.style.left);
- }
- }
- }
- }
-
- return lineGuidePositions;
-}
-
-// Returns an array containing the vertical line guide positions
-function webdeveloper_getVerticalLineGuidePositions(contentDocument)
-{
- return webdeveloper_getLineGuidePositions(contentDocument, false);
-}
-
-// Called when the mouse is not over a line guide
-function webdeveloper_mouseoutLineGuide(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the element has an owner document
- if(ownerDocument)
- {
- var lineGuideInformation = ownerDocument.getElementById("webdeveloper-line-guide-information");
-
- // If the line guide information is found
- if(lineGuideInformation)
- {
- lineGuideInformation.style.display = "none";
- }
- }
- }
-}
-
-// Called when the mouse is over a line guide
-function webdeveloper_mouseoverLineGuide(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the element has an owner document
- if(ownerDocument)
- {
- var lineGuideInformation = ownerDocument.getElementById("webdeveloper-line-guide-information");
-
- // If the line guide information is found
- if(lineGuideInformation)
- {
- var headerElement = ownerDocument.createElement("h1");
- var horizontalLineGuide = true;
- var lineGuidePositions = null;
- var pElement = ownerDocument.createElement("p");
- var position = 0;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var xPosition = event.pageX;
- var yPosition = event.pageY;
-
- // If the line guide has a class attribute and it contains webdeveloper-vertical-line-guide
- if(element.hasAttribute("class") && element.getAttribute("class").indexOf("webdeveloper-vertical-line-guide") != -1)
- {
- horizontalLineGuide = false;
- }
-
- // If this is a horizontal line guide
- if(horizontalLineGuide)
- {
- position = yPosition;
- }
- else
- {
- position = xPosition;
- }
-
- webdeveloper_removeAllChildElements(lineGuideInformation);
-
- headerElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_position") + " = " + position));
- lineGuideInformation.appendChild(headerElement);
-
- pElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_previousLineGuide") + " = " + webdeveloper_getLineGuidePosition(ownerDocument, horizontalLineGuide, position, false)));
- lineGuideInformation.appendChild(pElement);
-
- pElement = ownerDocument.createElement("p");
- pElement.appendChild(ownerDocument.createTextNode(stringBundle.getString("webdeveloper_nextLineGuide") + " = " + webdeveloper_getLineGuidePosition(ownerDocument, horizontalLineGuide, position, true)));
- lineGuideInformation.appendChild(pElement);
-
- webdeveloper_adjustElementPosition(lineGuideInformation, xPosition, yPosition, 10);
-
- // Show the line guide information
- lineGuideInformation.style.display = "block";
- }
- }
- }
-}
-
-// Called when a line guide is moved
-function webdeveloper_moveLineGuide(event)
-{
- // If a line guide is selected
- if(webdeveloper_lineGuideSelected)
- {
- // If the line guide has a class attribute and it contains webdeveloper-horizontal-line-guide
- if(webdeveloper_lineGuideSelected.hasAttribute("class") && webdeveloper_lineGuideSelected.getAttribute("class").indexOf("webdeveloper-horizontal-line-guide") != -1)
- {
- webdeveloper_lineGuideSelected.style.top = event.pageY + "px";
- }
- else
- {
- webdeveloper_lineGuideSelected.style.left = event.pageX + "px";
- }
- }
-}
-
-// Remove the line guides from the document
-function webdeveloper_removeLineGuides(ownerDocument)
-{
- var divElement = null;
- var divElements = ownerDocument.getElementsByTagName("div");
- var divElementsLength = divElements.length;
-
- // Loop through the div elements
- for(var i = 0; i < divElementsLength; i++)
- {
- divElement = divElements[i];
-
- // If the div element is set and the class exists and contains webdeveloper-line-guide
- if(divElement && divElement.hasAttribute("class") && divElement.getAttribute("class").indexOf("webdeveloper-line-guide") != -1)
- {
- webdeveloper_removeElement(divElement);
- i--;
- }
- }
-}
-
-// Resizes the line guides when the window is resized
-function webdeveloper_resizeLineGuides(event)
-{
- var contentDocument = webdeveloper_getContentDocument();
- var divElement = null;
- var divElementClass = null;
- var divElements = contentDocument.getElementsByTagName("div");
- var divElementsLength = divElements.length;
-
- // Loop through the div elements
- for(var i = 0; i < divElementsLength; i++)
- {
- divElement = divElements[i];
-
- // If the div element is set
- if(divElement)
- {
- divElementClass = divElement.getAttribute("class");
-
- // If the class exists and contains webdeveloper-line-guide
- if(divElementClass && divElementClass.indexOf("webdeveloper-line-guide") != -1)
- {
- // If the class contains webdeveloper-horizontal-line-guide
- if(divElementClass.indexOf("webdeveloper-horizontal-line-guide") != -1)
- {
- webdeveloper_sizeHorizontalLineGuide(divElement, contentDocument);
- }
- else
- {
- webdeveloper_sizeVerticalLineGuide(divElement, contentDocument);
- }
- }
- }
- }
-}
-
-// Called when a line guide is selected
-function webdeveloper_selectLineGuide(event)
-{
- // If the click was not a right click
- if(event.button != 2)
- {
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- webdeveloper_lineGuideSelected = element;
- }
- }
-}
-
-// Sets the size of a horizontal line guide
-function webdeveloper_sizeHorizontalLineGuide(lineGuide, contentDocument)
-{
- webdeveloper_sizeLineGuide(lineGuide, contentDocument, true);
-}
-
-// Sets the size of a line guide
-function webdeveloper_sizeLineGuide(lineGuide, contentDocument, horizontal)
-{
- // If the line guide and page document are set
- if(lineGuide && contentDocument)
- {
- var contentWindow = webdeveloper_getContentWindow();
-
- // If sizing a horizontal line guide
- if(horizontal)
- {
- var documentWidth = contentDocument.width;
- var viewportWidth = contentWindow.innerWidth;
-
- // If the viewport width is greater than the document width
- if(viewportWidth > documentWidth)
- {
- lineGuide.style.width = viewportWidth + "px";
- }
- else
- {
- lineGuide.style.width = documentWidth + "px";
- }
- }
- else
- {
- var documentHeight = contentDocument.height;
- var viewportHeight = contentWindow.innerHeight;
-
- // If the viewport height is greater than the document height
- if(viewportHeight > documentHeight)
- {
- lineGuide.style.height = viewportHeight + "px";
- }
- else
- {
- lineGuide.style.height = documentHeight + "px";
- }
- }
- }
-}
-
-// Sets the size of a vertical line guide
-function webdeveloper_sizeVerticalLineGuide(lineGuide, contentDocument)
-{
- webdeveloper_sizeLineGuide(lineGuide, contentDocument, false);
-}
-
-// Updates the line guides color
-function webdeveloper_updateLineGuideColor(colorPicker)
-{
- // If the color picker is set
- if(colorPicker)
- {
- var color = colorPicker.color;
- var divElement = null;
- var divElements = webdeveloper_getContentDocument().getElementsByTagName("div");
- var divElementsLength = divElements.length;
-
- webdeveloper_setStringPreference("webdeveloper.line.guides.color", color);
-
- // Loop through the div elements
- for(var i = 0; i < divElementsLength; i++)
- {
- divElement = divElements[i];
-
- // If the div element is set and the class exists and contains webdeveloper-line-guide
- if(divElement && divElement.hasAttribute("class") && divElement.getAttribute("class").indexOf("webdeveloper-line-guide") != -1)
- {
- divElement.style.backgroundColor = color;
- }
- }
- }
-}
+++ /dev/null
-// Displays the page magnifier
-function webdeveloper_displayPageMagnifier(element)
-{
- var canvas = document.getElementById("webdeveloper-page-magnifier");
-
- // If the canvas is not set or has no context
- if(!canvas || !canvas.getContext)
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_firefox15Required"));
- }
- else
- {
- var checked = false;
- var container = document.getElementById("webdeveloper-page-magnifier-container");
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-page-magnifier-toolbar"), "hidden", !checked);
-
- // If displaying page validation
- if(checked)
- {
- var browserBoxObject = webdeveloper_getSelectedBrowser().boxObject;
-
- document.getElementById("webdeveloper.magnification.level").value = webdeveloper_getStringPreference("webdeveloper.magnification.level", true);
- webdeveloper_updatePageMagnifier(0, 0);
-
- container.addEventListener("DOMMouseScroll", webdeveloper_scrollPageMagnifier, false);
- window.addEventListener("mousemove", webdeveloper_movePageMagnifier, false);
-
- container.style.left = (browserBoxObject.x + 10) + "px";
- container.style.top = (browserBoxObject.y + 10) + "px";
- container.hidden = false;
- }
- else
- {
- // Try to remove the event listener
- try
- {
- container.removeEventListener("DOMMouseScroll", webdeveloper_scrollPageMagnifier, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- window.removeEventListener("mousemove", webdeveloper_movePageMagnifier, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- container.hidden = true;
- }
-
- webdeveloper_toggleAppliedStyle(element, "webdeveloper-display-page-magnifier");
- }
-}
-
-// Called when the page magnifier is moved
-function webdeveloper_movePageMagnifier(event)
-{
- var canvas = document.getElementById("webdeveloper-page-magnifier");
- var eventTarget = event.target;
-
- // If the canvas and event target are set and the canvas is the event target
- if(canvas && eventTarget && canvas == eventTarget)
- {
- var container = document.getElementById("webdeveloper-page-magnifier-container");
-
- // If the container is set
- if(container)
- {
- var browserBoxObject = webdeveloper_getSelectedBrowser().boxObject;
- var browserXPosition = browserBoxObject.x;
- var browserYPosition = browserBoxObject.y;
- var canvasHalfHeight = canvas.height / 2;
- var canvasHalfWidth = canvas.width / 2;
- var containerXPosition = event.clientX - canvasHalfWidth;
- var containerYPosition = event.clientY - canvasHalfHeight;
- var documentElement = webdeveloper_getContentDocument().documentElement;
- var magnificationLevel = parseFloat(webdeveloper_getStringPreference("webdeveloper.magnification.level", true));
- var magnifierXPosition = event.clientX - browserXPosition - (canvasHalfWidth / magnificationLevel) + documentElement.scrollLeft;
- var magnifierYPosition = event.clientY - browserYPosition - (canvasHalfHeight / magnificationLevel) + documentElement.scrollTop;
-
- // If the container X position is less than the browser X position
- if(containerXPosition < browserXPosition)
- {
- containerXPosition = browserXPosition;
- }
-
- // If the container Y position is less than the browser Y position
- if(containerYPosition < browserYPosition)
- {
- containerYPosition = browserYPosition;
- }
-
- // If the magnifier X position is less than 0
- if(magnifierXPosition < 0)
- {
- magnifierXPosition = 0;
- }
-
- // If the magnifier Y position is less than 0
- if(magnifierYPosition < 0)
- {
- magnifierYPosition = 0;
- }
-
- container.style.left = containerXPosition + "px";
- container.style.top = containerYPosition + "px";
-
- webdeveloper_updatePageMagnifier(magnifierXPosition, magnifierYPosition);
- }
- }
-}
-
-// Called when the page magnifier is scrolled with the mouse wheel
-function webdeveloper_scrollPageMagnifier(event)
-{
- var eventDetail = event.detail;
-
- // If the event detail is set
- if(eventDetail)
- {
- var magnificationLevel = parseFloat(webdeveloper_getStringPreference("webdeveloper.magnification.level", true));
-
- // If the event detail is greater than zero (scroll down)
- if(eventDetail > 0)
- {
- // If the magnification level is greater than one
- if(magnificationLevel > 1)
- {
- magnificationLevel -= 1;
- }
- }
- else
- {
- magnificationLevel += 1;
- }
-
- document.getElementById("webdeveloper.magnification.level").value = magnificationLevel;
-
- webdeveloper_setStringPreference("webdeveloper.magnification.level", magnificationLevel);
- webdeveloper_updatePageMagnifier(0, 0);
-
- event.preventDefault();
- }
-}
-
-// Updates the magnification level
-function webdeveloper_updateMagnificationLevel(element)
-{
- var magnificationLevel = element.value;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the magnification level is empty or not a number or less than zero
- if(!magnificationLevel || parseFloat(magnificationLevel) != magnificationLevel || magnificationLevel <= 0)
- {
- webdeveloper_error(stringBundle.getString("webdeveloper_invalidWidth"));
- }
- else
- {
- webdeveloper_setStringPreference("webdeveloper.magnification.level", magnificationLevel);
- webdeveloper_updatePageMagnifier(0, 0);
- }
-}
-
-// Updates the page magnifier
-function webdeveloper_updatePageMagnifier(xPosition, yPosition)
-{
- var canvas = document.getElementById("webdeveloper-page-magnifier");
-
- // If the canvas was found
- if(canvas)
- {
- var context = canvas.getContext("2d");
- var height = canvas.height;
- var magnificationLevel = parseFloat(webdeveloper_getStringPreference("webdeveloper.magnification.level", true));
- var width = canvas.width;
-
- context.save();
- context.scale(magnificationLevel, magnificationLevel);
- context.drawWindow(webdeveloper_getContentWindow(), xPosition, yPosition, (xPosition + width) / magnificationLevel, (yPosition + height) / magnificationLevel, "rgb(255, 255, 255)");
- context.restore();
- }
-}
\ No newline at end of file
+++ /dev/null
-var webdeveloper_accessibilityValidator = new WebDeveloperValidateAccessibility();
-var webdeveloper_cssValidator = new WebDeveloperValidateCSS();
-var webdeveloper_htmlValidator = new WebDeveloperValidateHTML();
-var webdeveloper_selectedValidationTab = -1;
-
-// Clears the accessibility validation details for the page
-function webdeveloper_clearPageAccessibilityValidation()
-{
- var validationButton = document.getElementById("webdeveloper-accessibility-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- validationButton.label = "";
-
- // If the validation button has a class attribute
- if(validationButton.hasAttribute("class"))
- {
- validationButton.removeAttribute("class");
- }
- }
-
- webdeveloper_accessibilityValidator.cleanUp();
-}
-
-// Clears the CSS validation details for the page
-function webdeveloper_clearPageCSSValidation()
-{
- var validationButton = document.getElementById("webdeveloper-css-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- validationButton.label = "";
-
- // If the validation button has a class attribute
- if(validationButton.hasAttribute("class"))
- {
- validationButton.removeAttribute("class");
- }
- }
-
- webdeveloper_cssValidator.cleanUp();
-}
-
-// Clears the HTML validation details for the page
-function webdeveloper_clearPageHTMLValidation()
-{
- var validationButton = document.getElementById("webdeveloper-html-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- validationButton.label = "";
-
- // If the validation button has a class attribute
- if(validationButton.hasAttribute("class"))
- {
- validationButton.removeAttribute("class");
- }
- }
-
- webdeveloper_htmlValidator.cleanUp();
-}
-
-// Displays page validation
-function webdeveloper_displayPageValidation(element)
-{
- var checked = false;
- var windowContent = window.document.getElementById("content");
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-page-validation-toolbar"), "hidden", !checked);
-
- // If the window content is set
- if(windowContent)
- {
- var tabBox = windowContent.mTabBox;
-
- webdeveloper_clearPageAccessibilityValidation();
- webdeveloper_clearPageCSSValidation();
- webdeveloper_clearPageHTMLValidation();
-
- // If displaying page validation
- if(checked)
- {
- var contentDocument = webdeveloper_getContentDocument();
-
- webdeveloper_updatePageAccessibilityValidation(contentDocument);
- webdeveloper_updatePageCSSValidation(contentDocument);
- webdeveloper_updatePageHTMLValidation(contentDocument);
-
- windowContent.addEventListener("load", webdeveloper_pageValidationLoad, true);
- windowContent.addEventListener("unload", webdeveloper_pageValidationUnload, true);
-
- // If the tab box is set
- if(tabBox)
- {
- tabBox.addEventListener("select", webdeveloper_tabValidationSelect, false);
- }
- }
- else
- {
- // Try to remove the event listener
- try
- {
- windowContent.removeEventListener("load", webdeveloper_pageValidationLoad, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- windowContent.removeEventListener("unload", webdeveloper_pageValidationUnload, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // If the tab box is set
- if(tabBox)
- {
- // Try to remove the event listener
- try
- {
- tabBox.removeEventListener("select", webdeveloper_tabValidationSelect, false);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
- }
-
- webdeveloper_toggleAppliedStyle(element, "webdeveloper-display-page-validation");
-}
-
-// Checks if the page is validatable
-function webdeveloper_isValidatablePage(uri)
-{
- // If the URI is set and is validatable
- if(uri && uri != "about:blank" && uri != "http://www.hermish.com/check_this.cfm" && uri != "http://jigsaw.w3.org/css-validator/validator" && uri != "http://validator.w3.org/check")
- {
- return true;
- }
-
- return false;
-}
-
-// Handles the page being loaded
-function webdeveloper_pageValidationLoad(event)
-{
- var eventTarget = event.target;
-
- // If the page is the target
- if(eventTarget && eventTarget.hasAttribute && eventTarget.hasAttribute("id") && eventTarget.getAttribute("id").toLowerCase() == "content")
- {
- var contentDocument = eventTarget.contentDocument;
-
- // Try to get the original target
- try
- {
- var loadedDocument = event.originalTarget;
-
- // If the content document is set, the loaded document is set and has the same URI as the content document
- if(contentDocument && loadedDocument && contentDocument.documentURI == loadedDocument.documentURI)
- {
- webdeveloper_clearPageAccessibilityValidation();
- webdeveloper_clearPageCSSValidation();
- webdeveloper_clearPageHTMLValidation();
-
- // If the page is validatable
- if(webdeveloper_isValidatablePage(contentDocument.documentURI))
- {
- webdeveloper_updatePageAccessibilityValidation(contentDocument);
- webdeveloper_updatePageCSSValidation(contentDocument);
- webdeveloper_updatePageHTMLValidation(contentDocument);
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-}
-
-// Handles the page being unloaded
-function webdeveloper_pageValidationUnload(event)
-{
- var eventTarget = event.target;
-
- // Try to get the original target
- try
- {
- var originalTarget = event.originalTarget;
-
- // If the page is the target and the URI matches
- if(eventTarget && originalTarget && eventTarget.contentDocument && eventTarget.hasAttribute && eventTarget.hasAttribute("id") && eventTarget.getAttribute("id").toLowerCase() == "content" && eventTarget.contentDocument.documentURI == originalTarget.documentURI)
- {
- webdeveloper_clearPageAccessibilityValidation();
- webdeveloper_clearPageCSSValidation();
- webdeveloper_clearPageHTMLValidation();
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-}
-
-// Handles a tab being selected
-function webdeveloper_tabValidationSelect(event)
-{
- var selectedTab = getBrowser().mTabBox.selectedIndex;
-
- // If the selected tab is different
- if(selectedTab != webdeveloper_selectedValidationTab)
- {
- var contentDocument = webdeveloper_getContentDocument();
-
- webdeveloper_selectedValidationTab = selectedTab;
-
- webdeveloper_clearPageAccessibilityValidation();
- webdeveloper_clearPageCSSValidation();
- webdeveloper_clearPageHTMLValidation();
- webdeveloper_updatePageAccessibilityValidation(contentDocument);
- webdeveloper_updatePageCSSValidation(contentDocument);
- webdeveloper_updatePageHTMLValidation(contentDocument);
- }
-}
-
-// Updates the accessibility validation for the page
-function webdeveloper_updatePageAccessibilityValidation(contentDocument)
-{
- var validationButton = document.getElementById("webdeveloper-accessibility-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- webdeveloper_accessibilityValidator.cleanUp();
- webdeveloper_accessibilityValidator.validateBackgroundAccessibility(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(contentDocument.documentURI, null, null));
-
- validationButton.label = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_validating");
- }
-}
-
-// Updates the accessibility validation details for the page
-function webdeveloper_updatePageAccessibilityValidationDetails()
-{
- // If the accessibility validation request is set and is ready
- if(webdeveloper_accessibilityValidator.validationRequest && webdeveloper_accessibilityValidator.validationRequest.readyState == 4)
- {
- // Try to check the accessibility validation status
- try
- {
- // If the accessibility validation status is set to success
- if(webdeveloper_accessibilityValidator.validationRequest.status == 200)
- {
- var errors = webdeveloper_accessibilityValidator.parseValidationResultsByType("violation");
- var validationButton = document.getElementById("webdeveloper-accessibility-validation");
- var warnings = webdeveloper_accessibilityValidator.parseValidationResultsByType("caution");
-
- // If the validation button is set
- if(validationButton)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If there are errors
- if(errors > 0)
- {
- var labelValue = stringBundle.getString("webdeveloper_invalid") + ": " + errors + " " + stringBundle.getString("webdeveloper_errors").toLowerCase();
-
- // If there are warnings
- if(warnings > 0)
- {
- labelValue += ", " + warnings + " " + stringBundle.getString("webdeveloper_warnings").toLowerCase();
- }
-
- validationButton.label = labelValue;
-
- validationButton.setAttribute("class", "error");
- }
- else if(warnings > 0)
- {
- validationButton.label = stringBundle.getString("webdeveloper_warning") + ": " + warnings + " " + stringBundle.getString("webdeveloper_warnings").toLowerCase();
-
- validationButton.setAttribute("class", "warning");
- }
- else
- {
- validationButton.label = stringBundle.getString("webdeveloper_valid");
-
- validationButton.setAttribute("class", "valid");
- }
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_accessibilityValidator.cleanUp();
- }
-}
-
-// Updates the CSS validation for the page
-function webdeveloper_updatePageCSSValidation(contentDocument)
-{
- var validationButton = document.getElementById("webdeveloper-css-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- webdeveloper_cssValidator.cleanUp();
- webdeveloper_cssValidator.validateBackgroundCSS(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(contentDocument.documentURI, null, null), webdeveloper_getDocuments(webdeveloper_getContentWindow()));
-
- validationButton.label = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_validating");
- }
-}
-
-// Updates the CSS validation details for the page
-function webdeveloper_updatePageCSSValidationDetails()
-{
- // If the CSS validation request is set and is ready
- if(webdeveloper_cssValidator.validationRequest && webdeveloper_cssValidator.validationRequest.readyState == 4)
- {
- // Try to check the CSS validation status
- try
- {
- // If the CSS validation status is set to success
- if(webdeveloper_cssValidator.validationRequest.status == 200)
- {
- var errors = webdeveloper_cssValidator.parseValidationResultsByType("errors");
- var validationButton = document.getElementById("webdeveloper-css-validation");
- var warnings = webdeveloper_cssValidator.parseValidationResultsByType("warnings");
-
- // If the validation button is set
- if(validationButton)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If there are errors
- if(errors > 0)
- {
- var labelValue = stringBundle.getString("webdeveloper_invalid") + ": " + errors + " " + stringBundle.getString("webdeveloper_errors").toLowerCase();
-
- // If there are warnings
- if(warnings > 0)
- {
- labelValue += ", " + warnings + " " + stringBundle.getString("webdeveloper_warnings").toLowerCase();
- }
-
- validationButton.label = labelValue;
-
- validationButton.setAttribute("class", "error");
- }
- else if(warnings > 0)
- {
- validationButton.label = stringBundle.getString("webdeveloper_warning") + ": " + warnings + " " + stringBundle.getString("webdeveloper_warnings").toLowerCase();
-
- validationButton.setAttribute("class", "warning");
- }
- else
- {
- validationButton.label = stringBundle.getString("webdeveloper_valid");
-
- validationButton.setAttribute("class", "valid");
- }
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_cssValidator.cleanUp();
- }
-}
-
-// Updates the HTML validation for the page
-function webdeveloper_updatePageHTMLValidation(contentDocument)
-{
- var validationButton = document.getElementById("webdeveloper-html-validation");
-
- // If the validation button is set
- if(validationButton)
- {
- webdeveloper_htmlValidator.cleanUp();
- webdeveloper_htmlValidator.validateBackgroundHTML(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(contentDocument.documentURI, null, null));
-
- validationButton.label = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_validating");
- }
-}
-
-// Updates the HTML validation details for the page
-function webdeveloper_updatePageHTMLValidationDetails()
-{
- // If the HTML validation request is set and is ready
- if(webdeveloper_htmlValidator.validationRequest && webdeveloper_htmlValidator.validationRequest.readyState == 4)
- {
- // Try to check the HTML validation status
- try
- {
- // If the HTML validation status is set to success
- if(webdeveloper_htmlValidator.validationRequest.status == 200)
- {
- var validationButton = document.getElementById("webdeveloper-html-validation");
- var validationStatus = webdeveloper_htmlValidator.validationRequest.getResponseHeader("X-W3C-Validator-Status");
-
- // If the validation button and validation status are set
- if(validationButton && validationStatus)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the validation status is valid
- if(validationStatus == "Valid")
- {
- validationButton.label = stringBundle.getString("webdeveloper_valid");
-
- validationButton.setAttribute("class", "valid");
- }
- else
- {
- validationButton.label = stringBundle.getString("webdeveloper_invalid") + ": " + webdeveloper_htmlValidator.validationRequest.getResponseHeader("X-W3C-Validator-Errors") + " " + stringBundle.getString("webdeveloper_errors").toLowerCase();
-
- validationButton.setAttribute("class", "invalid");
- }
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_htmlValidator.cleanUp();
- }
-}
+++ /dev/null
-var webdeveloper_rulerDrag = false;
-var webdeveloper_rulerEndX = 0;
-var webdeveloper_rulerEndY = 0;
-var webdeveloper_rulerMove = false;
-var webdeveloper_rulerMoveX = 0;
-var webdeveloper_rulerMoveY = 0;
-var webdeveloper_rulerResize = false;
-var webdeveloper_rulerStartX = 0;
-var webdeveloper_rulerStartY = 0;
-
-// Creates the ruler block
-function webdeveloper_createRuler(ownerDocument)
-{
- var containerElement = ownerDocument.createElement("div");
- var resizeElement = ownerDocument.createElement("div");
- var rulerElement = ownerDocument.createElement("div");
-
- resizeElement.setAttribute("id", "webdeveloper-ruler-north-west");
- containerElement.appendChild(resizeElement);
-
- resizeElement = ownerDocument.createElement("div");
- resizeElement.setAttribute("id", "webdeveloper-ruler-north-east");
- containerElement.appendChild(resizeElement);
-
- resizeElement = ownerDocument.createElement("div");
- resizeElement.setAttribute("id", "webdeveloper-ruler-south-east");
- containerElement.appendChild(resizeElement);
-
- resizeElement = ownerDocument.createElement("div");
- resizeElement.setAttribute("id", "webdeveloper-ruler-south-west");
- containerElement.appendChild(resizeElement);
-
- containerElement.setAttribute("id", "webdeveloper-ruler-container");
- rulerElement.appendChild(containerElement);
-
- rulerElement.setAttribute("id", "webdeveloper-ruler");
- webdeveloper_getDocumentBodyElement(ownerDocument).appendChild(rulerElement);
-}
-
-// Called when the ruler is deselected
-function webdeveloper_deselectRuler(event)
-{
- // If not moving the ruler
- if(!webdeveloper_rulerMove)
- {
- var xPosition = event.pageX;
- var yPosition = event.pageY;
-
- // If the X position is greater than the start X position
- if(xPosition > webdeveloper_rulerStartX)
- {
- webdeveloper_rulerEndX = xPosition;
- }
- else
- {
- webdeveloper_rulerEndX = webdeveloper_rulerStartX;
- webdeveloper_rulerStartX = xPosition;
- }
-
- // If the Y position is greater than the start Y position
- if(yPosition > webdeveloper_rulerStartY)
- {
- webdeveloper_rulerEndY = yPosition;
- }
- else
- {
- webdeveloper_rulerEndY = webdeveloper_rulerStartY;
- webdeveloper_rulerStartY = yPosition;
- }
- }
-
- webdeveloper_rulerDrag = false;
- webdeveloper_rulerMove = false;
- webdeveloper_rulerMoveX = 0;
- webdeveloper_rulerMoveY = 0;
- webdeveloper_rulerResize = false;
-
- webdeveloper_updateRulerEnd();
- webdeveloper_updateRulerStart();
-}
-
-// Displays a ruler
-function webdeveloper_displayRuler(element)
-{
- // If the page has frames
- if(webdeveloper_pageHasFrames())
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_framesNotSupported"));
- }
- else
- {
- var checked = false;
- var contentDocument = webdeveloper_getContentDocument();
- var divElement = null;
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-ruler-toolbar"), "hidden", !checked);
-
- // If displaying a ruler
- if(checked)
- {
- webdeveloper_updateRulerEnd();
- webdeveloper_updateRulerStart();
- webdeveloper_createRuler(contentDocument);
-
- contentDocument.addEventListener("mousedown", webdeveloper_selectRuler, false);
- contentDocument.addEventListener("mousemove", webdeveloper_moveRuler, false);
- contentDocument.addEventListener("mouseup", webdeveloper_deselectRuler, false);
- }
- else
- {
- var rulerHeightElement = document.getElementById("webdeveloper-ruler-height");
- var rulerWidthElement = document.getElementById("webdeveloper-ruler-width");
-
- webdeveloper_removeRuler(contentDocument);
-
- // Try to remove the event listener
- try
- {
- contentDocument.removeEventListener("mousedown", webdeveloper_selectRuler, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- contentDocument.removeEventListener("mousemove", webdeveloper_moveRuler, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- contentDocument.removeEventListener("mouseup", webdeveloper_deselectRuler, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // If the ruler height element is set
- if(rulerHeightElement)
- {
- rulerHeightElement.value = "";
- }
-
- // If the ruler width element is set
- if(rulerWidthElement)
- {
- rulerWidthElement.value = "";
- }
-
- webdeveloper_rulerDrag = false;
- webdeveloper_rulerEndX = 0;
- webdeveloper_rulerEndY = 0;
- webdeveloper_rulerMove = false;
- webdeveloper_rulerMoveX = 0;
- webdeveloper_rulerMoveY = 0;
- webdeveloper_rulerResize = false;
- webdeveloper_rulerStartX = 0;
- webdeveloper_rulerStartY = 0;
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_ruler.css", "webdeveloper-display-ruler");
- }
-}
-
-// Called when the ruler is moved
-function webdeveloper_moveRuler(event)
-{
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var ownerDocument = element.ownerDocument;
-
- // If the element has an owner document
- if(ownerDocument)
- {
- var rulerElement = ownerDocument.getElementById("webdeveloper-ruler");
-
- // If the ruler element is set
- if(rulerElement)
- {
- var xPosition = event.pageX;
- var yPosition = event.pageY;
-
- // If the ruler is being dragged or resized
- if(webdeveloper_rulerDrag || webdeveloper_rulerResize)
- {
- var height = 0;
- var rulerHeightElement = document.getElementById("webdeveloper-ruler-height");
- var rulerWidthElement = document.getElementById("webdeveloper-ruler-width");
- var width = 0;
-
- webdeveloper_rulerEndX = xPosition;
- webdeveloper_rulerEndY = yPosition;
-
- // If the start x position is greater than the end x position
- if(webdeveloper_rulerStartX > webdeveloper_rulerEndX)
- {
- width = webdeveloper_rulerStartX - webdeveloper_rulerEndX;
-
- rulerElement.style.left = xPosition + "px";
- }
- else
- {
- width = webdeveloper_rulerEndX - webdeveloper_rulerStartX;
-
- rulerElement.style.left = webdeveloper_rulerStartX + "px";
- }
-
- // If the start y position is greater than the end y position
- if(webdeveloper_rulerStartY > webdeveloper_rulerEndY)
- {
- height = webdeveloper_rulerStartY - webdeveloper_rulerEndY;
-
- rulerElement.style.top = webdeveloper_rulerEndY + "px";
- }
- else
- {
- height = webdeveloper_rulerEndY - webdeveloper_rulerStartY;
-
- rulerElement.style.top = webdeveloper_rulerStartY + "px";
- }
-
- rulerElement.style.height = height + "px";
- rulerElement.style.width = width + "px";
-
- // If the ruler height element is set
- if(rulerHeightElement)
- {
- rulerHeightElement.value = height;
- }
-
- // If the ruler width element is set
- if(rulerWidthElement)
- {
- rulerWidthElement.value = width;
- }
- }
- else if(webdeveloper_rulerMove)
- {
- var newXPosition = xPosition - webdeveloper_rulerMoveX;
- var newYPosition = yPosition - webdeveloper_rulerMoveY;
-
- rulerElement.style.left = newXPosition + "px";
- rulerElement.style.top = newYPosition + "px";
-
- webdeveloper_rulerEndX = newXPosition + rulerElement.clientWidth;
- webdeveloper_rulerEndY = newYPosition + rulerElement.clientHeight;
- webdeveloper_rulerStartX = newXPosition;
- webdeveloper_rulerStartY = newYPosition;
- }
-
- webdeveloper_updateRulerEnd();
- webdeveloper_updateRulerStart();
- }
- }
- }
-}
-
-// Remove the ruler from the document
-function webdeveloper_removeRuler(ownerDocument)
-{
- webdeveloper_removeElement(ownerDocument.getElementById("webdeveloper-ruler"));
-}
-
-// Called when the ruler is selected
-function webdeveloper_selectRuler(event)
-{
- // If the click was not a right click
- if(event.button != 2)
- {
- var element = event.target;
-
- // If the element is set
- if(element)
- {
- var elementName = element.tagName;
- var ownerDocument = element.ownerDocument;
-
- // If the element has a name and it is not scrollbar and it has an owner document
- if(elementName && elementName != "scrollbar" && ownerDocument)
- {
- var rulerElement = ownerDocument.getElementById("webdeveloper-ruler");
- var xPosition = event.pageX;
- var yPosition = event.pageY;
-
- // If the ruler element is set
- if(rulerElement)
- {
- // If element is the container element
- if(element == ownerDocument.getElementById("webdeveloper-ruler-container"))
- {
- webdeveloper_rulerMove = true;
- webdeveloper_rulerMoveX = xPosition - rulerElement.offsetLeft;
- webdeveloper_rulerMoveY = yPosition - rulerElement.offsetTop;
- }
- else if(element == ownerDocument.getElementById("webdeveloper-ruler-north-east"))
- {
- webdeveloper_rulerResize = true;
- webdeveloper_rulerStartX = rulerElement.offsetLeft;
- webdeveloper_rulerStartY = rulerElement.offsetTop + rulerElement.clientHeight;
- }
- else if(element == ownerDocument.getElementById("webdeveloper-ruler-north-west"))
- {
- webdeveloper_rulerResize = true;
- webdeveloper_rulerStartX = rulerElement.offsetLeft + rulerElement.clientWidth;
- webdeveloper_rulerStartY = rulerElement.offsetTop + rulerElement.clientHeight;
- }
- else if(element == ownerDocument.getElementById("webdeveloper-ruler-south-east"))
- {
- webdeveloper_rulerResize = true;
- webdeveloper_rulerStartX = rulerElement.offsetLeft;
- webdeveloper_rulerStartY = rulerElement.offsetTop;
- }
- else if(element == ownerDocument.getElementById("webdeveloper-ruler-south-west"))
- {
- webdeveloper_rulerResize = true;
- webdeveloper_rulerStartX = rulerElement.offsetLeft + rulerElement.clientWidth;
- webdeveloper_rulerStartY = rulerElement.offsetTop;
- }
- else
- {
- webdeveloper_rulerDrag = true;
- webdeveloper_rulerEndX = 0;
- webdeveloper_rulerEndY = 0;
- webdeveloper_rulerStartX = xPosition;
- webdeveloper_rulerStartY = yPosition;
-
- webdeveloper_updateRulerEnd();
- webdeveloper_updateRulerStart();
- }
- }
- }
- }
-
- event.preventDefault();
- }
-}
-
-// Update the ruler end information
-function webdeveloper_updateRulerEnd()
-{
- var endXElement = document.getElementById("webdeveloper-ruler-end-x");
- var endYElement = document.getElementById("webdeveloper-ruler-end-y");
-
- // If the end X element is set
- if(endXElement)
- {
- endXElement.value = webdeveloper_rulerEndX;
- }
-
- // If the end Y element is set
- if(endYElement)
- {
- endYElement.value = webdeveloper_rulerEndY;
- }
-}
-
-// Update the ruler height
-function webdeveloper_updateRulerHeight(element)
-{
- var height = element.value;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the height is empty or not a number or less than zero
- if(!height || parseInt(height) != height || height <= 0)
- {
- webdeveloper_error(stringBundle.getString("webdeveloper_invalidHeight"));
- }
- else
- {
- var rulerElement = webdeveloper_getContentDocument().getElementById("webdeveloper-ruler");
-
- // If the ruler element is set
- if(rulerElement)
- {
- height = parseInt(height);
- rulerElement.style.height = height + "px";
- webdeveloper_rulerEndY = webdeveloper_rulerStartY + height;
-
- webdeveloper_updateRulerEnd();
- }
- }
-}
-
-// Update the ruler start information
-function webdeveloper_updateRulerStart()
-{
- var startXElement = document.getElementById("webdeveloper-ruler-start-x");
- var startYElement = document.getElementById("webdeveloper-ruler-start-y");
-
- // If the start X element is set
- if(startXElement)
- {
- startXElement.value = webdeveloper_rulerStartX;
- }
-
- // If the start Y element is set
- if(startYElement)
- {
- startYElement.value = webdeveloper_rulerStartY;
- }
-}
-
-// Update the ruler width
-function webdeveloper_updateRulerWidth(element)
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var width = element.value;
-
- // If the width is empty or not a number or less than zero
- if(!width || parseInt(width) != width || width <= 0)
- {
- webdeveloper_error(stringBundle.getString("webdeveloper_invalidWidth"));
- }
- else
- {
- var rulerElement = webdeveloper_getContentDocument().getElementById("webdeveloper-ruler");
-
- // If the ruler element is set
- if(rulerElement)
- {
- width = parseInt(width);
- rulerElement.style.width = width + "px";
- webdeveloper_rulerEndX = webdeveloper_rulerStartX + width;
-
- webdeveloper_updateRulerEnd();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-var webdeveloper_lastCommentShown = null;
-
-// Clears the comments from the page
-function webdeveloper_clearComments(pageDocument)
-{
- var commentDiv = null;
- var commentDivList = webdeveloper_evaluateXPath(pageDocument, "//div[@class='webdeveloper-comment-icon'] | //div[@class='webdeveloper-comment-text']");
- var commentDivsLength = commentDivList.length;
-
- webdeveloper_lastCommentShown = null;
-
- // Loop through the comment divs
- for(var i = 0; i < commentDivsLength; i++)
- {
- webdeveloper_removeElement(commentDivList[i]);
- }
-}
-
-// Shows the comment text
-function webdeveloper_showCommentText(event)
-{
- var target = event.target;
-
- // If there is an event target
- if(target)
- {
- var currentDocument = webdeveloper_getContentDocument();
- var lastCommentElement = null;
- var targetComment = target.id.replace(new RegExp("icon", "gi"), "text");
- var targetCommentElement = currentDocument.getElementById(targetComment);
-
- // If this is not the last comment shown
- if(webdeveloper_lastCommentShown && webdeveloper_lastCommentShown != targetComment)
- {
- lastCommentElement = currentDocument.getElementById(webdeveloper_lastCommentShown);
-
- // If the last comment element exists
- if(lastCommentElement)
- {
- lastCommentElement.style.display = "none";
- }
- }
-
- // If the element is currently hidden
- if(targetCommentElement.style.display == "none")
- {
- targetCommentElement.style.display = "block";
- }
- else
- {
- targetCommentElement.style.display = "none";
- }
-
- webdeveloper_lastCommentShown = targetComment;
- }
-}
-
-// Toggles comments
-function webdeveloper_toggleComments(element)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var show = element.getAttribute("checked");
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- webdeveloper_toggleCommentsForDocument(documentList[i], show);
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/show_comments.css", "webdeveloper-show-comments");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-show-comments-tooltips", "div.webdeveloper-comment-icon, div.webdeveloper-comment-text, div.webdeveloper-comment-text *");
-}
-
-// Toggles the comments for a document
-function webdeveloper_toggleCommentsForDocument(pageDocument, show)
-{
- var bodyElement = webdeveloper_getDocumentBodyElement(pageDocument);
- var bodyOffsetWidth = bodyElement.offsetWidth;
- var comment = null;
- var commentsLength = 0;
- var commentsList = new Array();
- var parentElement = null;
- var treeWalker = pageDocument.createTreeWalker(pageDocument, NodeFilter.SHOW_COMMENT, null, false);
-
- webdeveloper_lastCommentShown = null;
-
- // While the tree walker has more nodes
- while((comment = treeWalker.nextNode()) != null)
- {
- commentsList.push(comment);
- }
-
- // Remove XML declaration
- if(commentsList.length > 0 && commentsList[0].nodeValue.indexOf("encoding") != -1)
- {
- commentsList.shift();
- }
-
- // Remove DOCTYPE
- if(commentsList.length > 0 && commentsList[0].nodeValue.indexOf("DOCTYPE") != -1)
- {
- commentsList.shift();
- }
-
- commentsLength = commentsList.length;
-
- // If showing comments
- if(show)
- {
- var commentDiv = null;
- var commentIconDiv = null;
- var commentLeft = 0;
- var commentParent = null;
- var commentParentOffsetLeft = 0;
- var commentParentOffsetTop = 0;
- var commentText = null;
- var commentTop = 0;
- var iconSize = 17;
-
- // Loop through the comments
- for(var i = 0; i < commentsLength; i++)
- {
- comment = commentsList[i];
- commentLeft = 0;
- commentParent = comment.parentNode;
- commentText = comment.nodeValue;
- commentTop = 0;
-
- commentText = commentText.replace(new RegExp("<!--[\s]*", "gi"), "");
- commentText = commentText.replace(new RegExp("[\s]*-->", "gi"), "");
- commentText = commentText.replace(new RegExp("<([^\/][^>]*)class=\"[^\"]*\">", "gi"), "<$1>");
- commentText = commentText.replace(new RegExp("<([^\/][^>]*)class=[^ >]*>", "gi"), "<$1>");
-
- // While the comment has a parent
- while(commentParent)
- {
- // If the parent node is not a document node or a table row
- if(commentParent.nodeType != Node.DOCUMENT_NODE && commentParent.tagName && commentParent.tagName.toLowerCase() != "tr")
- {
- commentParentOffsetLeft = commentParent.offsetLeft;
- commentParentOffsetTop = commentParent.offsetTop;
-
- // If the parent node has a left offset
- if(commentParentOffsetLeft)
- {
- commentLeft += commentParentOffsetLeft;
- }
-
- // If the parent node has a top offset
- if(commentParentOffsetTop)
- {
- commentTop += commentParentOffsetTop;
- }
- }
-
- commentParent = commentParent.parentNode;
- }
-
- // If the comment left offset is 0
- if(commentLeft == 0)
- {
- commentLeft = 1;
- }
- else if(commentLeft + iconSize > bodyOffsetWidth)
- {
- commentLeft = bodyOffsetWidth;
- }
-
- // If the comment top offset is 0
- if(commentTop == 0)
- {
- commentTop = 1;
- }
-
- // If this is not the first comment
- if(i > 0)
- {
- // Loop through previous comments
- for(var j = 0; j < i; j++)
- {
- // If the top off set of a previous comment matches this comment
- if(parseInt(pageDocument.getElementById("webdeveloper-comment-icon" + j).style.top) == commentTop)
- {
- commentTop += iconSize;
- }
- }
- }
-
- commentIconDiv = pageDocument.createElement("div");
- commentIconDiv.style.left = commentLeft + "px";
- commentIconDiv.style.top = commentTop + "px";
-
- commentIconDiv.addEventListener("click", webdeveloper_showCommentText, false);
- commentIconDiv.appendChild(pageDocument.createTextNode("!"));
- commentIconDiv.setAttribute("class", "webdeveloper-comment-icon");
- commentIconDiv.setAttribute("id", "webdeveloper-comment-icon" + i);
-
- bodyElement.appendChild(commentIconDiv);
-
- commentDiv = pageDocument.createElement("div");
- commentDiv.style.left = commentLeft + iconSize + "px";
- commentDiv.style.top = commentTop + "px";
-
- commentDiv.appendChild(pageDocument.createTextNode(commentText));
- commentDiv.setAttribute("class", "webdeveloper-comment-text");
- commentDiv.setAttribute("id", "webdeveloper-comment-text" + i);
-
- bodyElement.appendChild(commentDiv);
-
- // If the offset width is greater than 200
- if(commentDiv.offsetWidth > 200)
- {
- commentDiv.style.width = "200px";
- }
-
- // If the offset height is greater than 100
- if(commentDiv.offsetHeight > 100)
- {
- commentDiv.style.height = "100px";
- commentDiv.style.overflow = "auto";
- }
-
- // If the comment is positioned outside the document
- if(commentLeft + iconSize + commentDiv.offsetWidth > bodyOffsetWidth)
- {
- commentDiv.style.left = commentLeft - commentDiv.offsetWidth - iconSize + "px";
- }
-
- commentDiv.style.display = "none";
- }
- }
- else
- {
- webdeveloper_clearComments(pageDocument);
- }
-}
\ No newline at end of file
+++ /dev/null
-// Displays the size of the page
-function webdeveloper_viewDocumentSize()
-{
- var calculatedFileSize = 0;
- var calculatedUncompressedFileSize = 0;
- var countCellDataElement = null;
- var documentCount = 0;
- var documentList = webdeveloper_tidyDocuments(webdeveloper_getDocuments(webdeveloper_getContentWindow())).sort(webdeveloper_sortDocumentsByFileSize);
- var documentLength = documentList.length;
- var documentURL = null;
- var fileSize = 0;
- var image = null;
- var imageLength = null;
- var imageList = new Array();
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var cellDataElement = generatedDocument.createElement("td");
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var linkElement = generatedDocument.createElement("link");
- var object = null;
- var objectLength = null;
- var objectList = new Array();
- var pageDocument = null;
- var scriptElement = null;
- var scriptLength = null;
- var scriptList = new Array();
- var src = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleSheet = null;
- var styleSheetLength = null;
- var styleSheetList = new Array();
- var tableElement = generatedDocument.createElement("table");
- var tableRowElement = generatedDocument.createElement("tr");
- var title = stringBundle.getFormattedString("webdeveloper_viewDocumentSizeTitle", [oldURL]);
- var totalCellDataElement = null;
- var totalFileSize = 0;
- var totalUncompressedFileSize = 0;
- var uncompressedLabel = stringBundle.getString("webdeveloper_uncompressed").toLowerCase();
- var uncompressedFileSize = 0;
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- linkElement.setAttribute("href", "chrome://webdeveloper/content/stylesheets/generated/view_document_size.css");
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
- headElement.appendChild(linkElement);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- cellDataElement.setAttribute("class", "pivot");
- tableRowElement.appendChild(cellDataElement);
-
- countCellDataElement = generatedDocument.createElement("td");
-
- tableRowElement.appendChild(countCellDataElement);
-
- totalCellDataElement = generatedDocument.createElement("td");
-
- totalCellDataElement.setAttribute("class", "size");
- tableRowElement.appendChild(totalCellDataElement);
- tableRowElement.setAttribute("class", "collapsed");
- tableElement.appendChild(tableRowElement);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- imageList = imageList.concat(webdeveloper_getImagesForDocument(pageDocument, true, true));
- objectList = objectList.concat(webdeveloper_getObjectsForDocument(pageDocument));
- scriptList = scriptList.concat(webdeveloper_getScriptsForDocument(pageDocument, false));
- styleSheetList = styleSheetList.concat(webdeveloper_getStyleSheetsForDocument(pageDocument, false, true));
-
- // If the document is not in the image and object lists
- if(!webdeveloper_mediaArrayContains(imageList, documentURL) && !webdeveloper_mediaArrayContains(objectList, documentURL))
- {
- cellDataElement = generatedDocument.createElement("td");
- fileSize = webdeveloper_getFileSize(documentURL);
- linkElement = generatedDocument.createElement("a");
- tableRowElement = generatedDocument.createElement("tr");
- uncompressedFileSize = webdeveloper_getUncompressedFileSize(documentURL);
-
- documentCount++;
-
- // If the file size is set
- if(fileSize)
- {
- calculatedFileSize += fileSize;
- }
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- calculatedUncompressedFileSize += uncompressedFileSize;
- }
- else
- {
- calculatedUncompressedFileSize += fileSize;
- }
-
- // If this is an even row
- if(i % 2 == 0)
- {
- tableRowElement.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRowElement.setAttribute("class", "hidden");
- }
-
- cellDataElement.setAttribute("class", "indent");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize) + " (" + webdeveloper_formatFileSize(uncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
- }
-
- // If there is one document
- if(documentCount == 1)
- {
- countCellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_documents") + " (" + documentCount + " " + stringBundle.getString("webdeveloper_file").toLowerCase() + ")"));
- }
- else
- {
- countCellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_documents") + " (" + documentCount + " " + stringBundle.getString("webdeveloper_files").toLowerCase() + ")"));
- }
-
- // If the calculated file size and calculated uncompressed file size are set and different
- if(calculatedFileSize && calculatedUncompressedFileSize && calculatedFileSize != calculatedUncompressedFileSize)
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize) + " (" + webdeveloper_formatFileSize(calculatedUncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize)));
- }
-
- totalFileSize += calculatedFileSize;
- totalUncompressedFileSize += calculatedUncompressedFileSize;
-
- calculatedFileSize = 0;
- cellDataElement = generatedDocument.createElement("td");
- imageList = webdeveloper_setImageFileSizes(webdeveloper_tidyImages(imageList)).sort(webdeveloper_sortImagesByFileSize);
- imageLength = imageList.length;
- tableRowElement = generatedDocument.createElement("tr");
-
- cellDataElement.setAttribute("class", "pivot");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- // If there is one image
- if(imageLength == 1)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_images") + " (" + imageLength + " " + stringBundle.getString("webdeveloper_file").toLowerCase() + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_images") + " (" + imageLength + " " + stringBundle.getString("webdeveloper_files").toLowerCase() + ")"));
- }
-
- tableRowElement.appendChild(cellDataElement);
-
- totalCellDataElement = generatedDocument.createElement("td");
-
- totalCellDataElement.setAttribute("class", "size");
- tableRowElement.appendChild(totalCellDataElement);
- tableRowElement.setAttribute("class", "collapsed");
- tableElement.appendChild(tableRowElement);
-
- // Loop through the images
- for(i = 0; i < imageLength; i++)
- {
- cellDataElement = generatedDocument.createElement("td");
- image = imageList[i];
- linkElement = generatedDocument.createElement("a");
- src = image.src;
- fileSize = image.fileSize;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If the file size is set
- if(fileSize)
- {
- calculatedFileSize += fileSize;
- }
-
- // If this is an even row
- if(i % 2 == 0)
- {
- tableRowElement.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRowElement.setAttribute("class", "hidden");
- }
-
- cellDataElement.setAttribute("class", "indent");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- linkElement.setAttribute("href", src);
- linkElement.appendChild(generatedDocument.createTextNode(src));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize)));
-
- totalFileSize += calculatedFileSize;
- totalUncompressedFileSize += calculatedFileSize;
-
- calculatedFileSize = 0;
- cellDataElement = generatedDocument.createElement("td");
- objectList = webdeveloper_setScriptFileSizes(webdeveloper_tidyScripts(objectList)).sort(webdeveloper_sortScriptsByFileSize);
- objectLength = objectList.length;
- tableRowElement = generatedDocument.createElement("tr");
-
- cellDataElement.setAttribute("class", "pivot");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- // If there is one object
- if(objectLength == 1)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_objects") + " (" + objectLength + " " + stringBundle.getString("webdeveloper_file").toLowerCase() + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_objects") + " (" + objectLength + " " + stringBundle.getString("webdeveloper_files").toLowerCase() + ")"));
- }
-
- tableRowElement.appendChild(cellDataElement);
-
- totalCellDataElement = generatedDocument.createElement("td");
-
- totalCellDataElement.setAttribute("class", "size");
- tableRowElement.appendChild(totalCellDataElement);
- tableRowElement.setAttribute("class", "collapsed");
- tableElement.appendChild(tableRowElement);
-
- // Loop through the objects
- for(i = 0; i < objectLength; i++)
- {
- cellDataElement = generatedDocument.createElement("td");
- linkElement = generatedDocument.createElement("a");
- object = objectList[i];
- src = object.src;
- fileSize = object.fileSize;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If the file size is set
- if(fileSize)
- {
- calculatedFileSize += fileSize;
- }
-
- // If this is an even row
- if(i % 2 == 0)
- {
- tableRowElement.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRowElement.setAttribute("class", "hidden");
- }
-
- cellDataElement.setAttribute("class", "indent");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- linkElement.setAttribute("href", src);
- linkElement.appendChild(generatedDocument.createTextNode(src));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize)));
-
- totalFileSize += calculatedFileSize;
- totalUncompressedFileSize += calculatedFileSize;
-
- calculatedFileSize = 0;
- calculatedUncompressedFileSize = 0;
- cellDataElement = generatedDocument.createElement("td");
- scriptList = webdeveloper_setScriptFileSizes(webdeveloper_tidyScripts(scriptList)).sort(webdeveloper_sortScriptsByFileSize);
- scriptLength = scriptList.length;
- tableRowElement = generatedDocument.createElement("tr");
-
- cellDataElement.setAttribute("class", "pivot");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- // If there is one script
- if(scriptLength == 1)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_scripts") + " (" + scriptLength + " " + stringBundle.getString("webdeveloper_file").toLowerCase() + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_scripts") + " (" + scriptLength + " " + stringBundle.getString("webdeveloper_files").toLowerCase() + ")"));
- }
-
- tableRowElement.appendChild(cellDataElement);
-
- totalCellDataElement = generatedDocument.createElement("td");
-
- totalCellDataElement.setAttribute("class", "size");
- tableRowElement.appendChild(totalCellDataElement);
- tableRowElement.setAttribute("class", "collapsed");
- tableElement.appendChild(tableRowElement);
-
- // Loop through the scripts
- for(i = 0; i < scriptLength; i++)
- {
- cellDataElement = generatedDocument.createElement("td");
- linkElement = generatedDocument.createElement("a");
- scriptElement = scriptList[i];
- src = scriptElement.src;
- fileSize = scriptElement.fileSize;
- tableRowElement = generatedDocument.createElement("tr");
- uncompressedFileSize = scriptElement.uncompressedFileSize;
-
- // If the file size is set
- if(fileSize)
- {
- calculatedFileSize += fileSize;
- }
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- calculatedUncompressedFileSize += uncompressedFileSize;
- }
- else
- {
- calculatedUncompressedFileSize += fileSize;
- }
-
- // If this is an even row
- if(i % 2 == 0)
- {
- tableRowElement.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRowElement.setAttribute("class", "hidden");
- }
-
- cellDataElement.setAttribute("class", "indent");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- linkElement.setAttribute("href", src);
- linkElement.appendChild(generatedDocument.createTextNode(src));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize) + " (" + webdeveloper_formatFileSize(uncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If the calculated file size and calculated uncompressed file size are set and different
- if(calculatedFileSize && calculatedUncompressedFileSize && calculatedFileSize != calculatedUncompressedFileSize)
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize) + " (" + webdeveloper_formatFileSize(calculatedUncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize)));
- }
-
- totalFileSize += calculatedFileSize;
- totalUncompressedFileSize += calculatedUncompressedFileSize;
-
- calculatedFileSize = 0;
- calculatedUncompressedFileSize = 0;
- cellDataElement = generatedDocument.createElement("td");
- styleSheetList = webdeveloper_setStyleSheetFileSizes(webdeveloper_tidyStyleSheets(styleSheetList)).sort(webdeveloper_sortStyleSheetsByFileSize);
- styleSheetLength = styleSheetList.length;
- tableRowElement = generatedDocument.createElement("tr");
-
- cellDataElement.setAttribute("class", "pivot");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- // If there is one style sheet
- if(styleSheetLength == 1)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_styleSheets") + " (" + styleSheetLength + " " + stringBundle.getString("webdeveloper_file").toLowerCase() + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_styleSheets") + " (" + styleSheetLength + " " + stringBundle.getString("webdeveloper_files").toLowerCase() + ")"));
- }
-
- tableRowElement.appendChild(cellDataElement);
-
- totalCellDataElement = generatedDocument.createElement("td");
-
- totalCellDataElement.setAttribute("class", "size");
- tableRowElement.appendChild(totalCellDataElement);
- tableRowElement.setAttribute("class", "collapsed");
- tableElement.appendChild(tableRowElement);
-
- // Loop through the style sheets
- for(i = 0; i < styleSheetLength; i++)
- {
- cellDataElement = generatedDocument.createElement("td");
- linkElement = generatedDocument.createElement("a");
- styleSheet = styleSheetList[i];
- src = styleSheet.href;
- fileSize = styleSheet.fileSize;
- tableRowElement = generatedDocument.createElement("tr");
- uncompressedFileSize = styleSheet.uncompressedFileSize;
-
- // If the file size is set
- if(fileSize)
- {
- calculatedFileSize += fileSize;
- }
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- calculatedUncompressedFileSize += uncompressedFileSize;
- }
- else
- {
- calculatedUncompressedFileSize += fileSize;
- }
-
- // If this is an even row
- if(i % 2 == 0)
- {
- tableRowElement.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRowElement.setAttribute("class", "hidden");
- }
-
- cellDataElement.setAttribute("class", "indent");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- linkElement.setAttribute("href", src);
- linkElement.appendChild(generatedDocument.createTextNode(src));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
-
- // If the uncompressed file size is set and different from the file size
- if(uncompressedFileSize && uncompressedFileSize != fileSize)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize) + " (" + webdeveloper_formatFileSize(uncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If the calculated file size and calculated uncompressed file size are set and different
- if(calculatedFileSize && calculatedUncompressedFileSize && calculatedFileSize != calculatedUncompressedFileSize)
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize) + " (" + webdeveloper_formatFileSize(calculatedUncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- totalCellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(calculatedFileSize)));
- }
-
- totalFileSize += calculatedFileSize;
- totalUncompressedFileSize += calculatedUncompressedFileSize;
-
- cellDataElement = generatedDocument.createElement("td");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellDataElement.setAttribute("class", "total-indent");
- tableRowElement.setAttribute("class", "total");
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_total")));
- tableRowElement.appendChild(cellDataElement);
-
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.setAttribute("class", "size");
-
- // If the total file size and total uncompressed file size are set and different
- if(totalFileSize && totalUncompressedFileSize && totalFileSize != totalUncompressedFileSize)
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(totalFileSize) + " (" + webdeveloper_formatFileSize(totalUncompressedFileSize) + " " + uncompressedLabel + ")"));
- }
- else
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(totalFileSize)));
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- bodyElement.appendChild(tableElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/table_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-var webdeveloper_styleElement = null;
-
-// Output style information for an element
-function webdeveloper_outputStyleInformationForElement(displayInDashboard, styleSheetArray, title)
-{
- var bodyElement = null;
- var cssElement = null;
- var divElement = null;
- var generatedDocument = null;
- var headElement = null;
- var headerElement = null;
- var linkElement = null;
- var preElement = null;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleInformationFound = false;
- var styleSheet = null;
-
- // If displaying in the dashboard
- if(displayInDashboard)
- {
- var parent = null;
-
- generatedDocument = webdeveloper_getDocumentInDashboard(stringBundle.getString("webdeveloper_styleInformation"));
- bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
-
- webdeveloper_removeAllChildElements(bodyElement);
- webdeveloper_removeAllChildElements(headElement);
- }
- else
- {
- generatedDocument = webdeveloper_generateDocument("");
- bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- headerElement = generatedDocument.createElement("h1");
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
- }
-
- generatedDocument.title = title;
- linkElement = generatedDocument.createElement("link");
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- linkElement.setAttribute("href", "chrome://webdeveloper/content/stylesheets/generated/view_style_information.css");
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
- headElement.appendChild(linkElement);
-
- // Loop through the style sheets
- for(styleSheet in styleSheetArray)
- {
- cssElement = generatedDocument.createElement("div");
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- spanElement = generatedDocument.createElement("span");
- styleInformationFound = true;
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", styleSheet);
- linkElement.appendChild(generatedDocument.createTextNode(styleSheet));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- cssElement.setAttribute("class", "css");
- divElement.setAttribute("class", "output");
- divElement.appendChild(cssElement);
- bodyElement.appendChild(divElement);
-
- cssElement.innerHTML = styleSheetArray[styleSheet];
- }
-
- // If style information was found
- if(styleInformationFound)
- {
- var scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
- }
- else
- {
- var pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_noStyleInformation")));
- bodyElement.appendChild(pElement);
- }
-}
-
-// View style information
-function webdeveloper_viewStyleInformation(element)
-{
- // If the DOM Inspector is available
- if(webdeveloper_isDOMInspectorAvailable())
- {
- var checked = true;
- var contentWindow = webdeveloper_getContentWindow();
- var documentList = webdeveloper_getDocuments(contentWindow);
- var documentLength = documentList.length;
- var pageDocument = null;
-
- // If the element is set
- if(element)
- {
- checked = element.getAttribute("checked");
- }
- else
- {
- var currentDocument = contentWindow.document;
-
- element = document.getElementById("webdeveloper-view-style-information-menu");
-
- // If the view style information element is set
- if(currentDocument.getElementById("webdeveloper-view-style-information"))
- {
- checked = false;
- }
-
- webdeveloper_configureElement(element, "checked", checked);
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", !checked);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // If viewing style information
- if(checked)
- {
- pageDocument.addEventListener("click", webdeveloper_viewStyleInformationForElement, false);
- pageDocument.addEventListener("keypress", webdeveloper_viewStyleInformationKeyPress, false);
- pageDocument.addEventListener("mousemove", webdeveloper_viewStyleInformationMouseMove, false);
- pageDocument.addEventListener("mouseover", webdeveloper_viewStyleInformationMouseOver, false);
- }
- else
- {
- var title = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_styleInformation");
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("click", webdeveloper_viewStyleInformationForElement, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("keypress", webdeveloper_viewStyleInformationKeyPress, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mousemove", webdeveloper_viewStyleInformationMouseMove, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mouseover", webdeveloper_viewStyleInformationMouseOver, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // If view style information is open in the dashboard
- if(webdeveloper_isOpenInDashboard(title))
- {
- webdeveloper_closeInDashboard(title);
- }
-
- webdeveloper_removeElementOutline(webdeveloper_styleElement);
- }
- }
-
- // If not viewing style information
- if(!checked)
- {
- webdeveloper_styleElement = null;
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/view_style_information.css", "webdeveloper-view-style-information");
- }
- else
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_domInspectorRequired"), "http://chrispederick.com/work/web-developer/documentation/faq/#dom-inspector");
- }
-}
-
-// View style information for an element
-function webdeveloper_viewStyleInformationForElement(event)
-{
- var eventTarget = event.target;
-
- // If there is an event target and the click was not a right click
- if(eventTarget && event.button != 2)
- {
- var displayInDashboard = webdeveloper_getBooleanPreference("webdeveloper.style.information.dashboard", true);
- var domUtils = Components.classes["@mozilla.org/inspector/dom-utils;1"].getService(Components.interfaces.inIDOMUtils);
- var elementRule = null;
- var headerElement = null;
- var line = null;
- var oldURL = getBrowser().currentURI.spec;
- var ruleList = domUtils.getCSSStyleRules(eventTarget);
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var styleRule = null;
- var styleRuleLength = null;
- var styleRuleList = null;
- var styleSheet = null;
- var styleSheetArray = new Array();
- var styleSheetHref = null;
- var styleText = null;
-
- // Loop through the element rules
- for(var i = 0; i < ruleList.Count(); i++)
- {
- elementRule = ruleList.GetElementAt(i).QueryInterface(Components.interfaces.nsIDOMCSSStyleRule);
- line = domUtils.getRuleLine(elementRule);
-
- // If there is a parent style sheet
- if(elementRule.parentStyleSheet)
- {
- styleSheet = elementRule.parentStyleSheet;
- }
-
- // If this is a valid style sheet
- if(webdeveloper_isValidStyleSheet(styleSheet))
- {
- styleRuleList = elementRule.style;
- styleRuleLength = styleRuleList.length;
- styleSheetHref = styleSheet.href;
- styleText = '<p class="selector">' + elementRule.selectorText + ' <span>(' + stringBundle.getString("webdeveloper_line").toLowerCase() + " " + line + ")</span></p>";
-
- styleText += "<p>{</p>";
-
- // Loop through the style rules
- for(var j = 0; j < styleRuleLength; j++)
- {
- styleRule = styleRuleList[j];
-
- // If this is a valid style rule
- if(webdeveloper_isValidStyleRule(styleRuleList, styleRule))
- {
- styleText += '<p class="rule"><span class="property">' + webdeveloper_formatStyleRuleProperty(styleRule) + '</span>: <span class="value">' + webdeveloper_formatStyleRuleValue(styleRuleList.getPropertyValue(styleRule)) + "</span>;</p>";
- }
- }
-
- styleText += "<p>}</p>";
-
- // If this style sheet has rules already stored
- if(styleSheetArray[styleSheetHref])
- {
- styleSheetArray[styleSheetHref] += styleText;
- }
- else
- {
- styleSheetArray[styleSheetHref] = styleText;
- }
- }
- }
-
- // If displaying in the dashboard
- if(displayInDashboard)
- {
- var title = stringBundle.getString("webdeveloper_styleInformation");
-
- // If view style information is already open in the dashboard
- if(webdeveloper_isOpenInDashboard(title))
- {
- webdeveloper_outputStyleInformationForElement(displayInDashboard, styleSheetArray, stringBundle.getFormattedString("webdeveloper_viewStyleInformationTitle", [oldURL]));
- webdeveloper_selectInDashboard(title);
- }
- else
- {
- webdeveloper_openInDashboard(title, "");
-
- // This sets a small timeout to guarantee the dashboard is open
- window.setTimeout(webdeveloper_outputStyleInformationForElement, 500, displayInDashboard, styleSheetArray, stringBundle.getFormattedString("webdeveloper_viewStyleInformationTitle", [oldURL]));
- }
- }
- else
- {
- var oldTab = getBrowser().selectedTab;
-
- webdeveloper_outputStyleInformationForElement(displayInDashboard, styleSheetArray, stringBundle.getFormattedString("webdeveloper_viewStyleInformationTitle", [oldURL]));
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
- }
-
- event.preventDefault();
- }
-}
-
-// Keypress event for view style information
-function webdeveloper_viewStyleInformationKeyPress(event)
-{
- webdeveloper_copyElementAncestors(event);
-}
-
-// Move event for view style information
-function webdeveloper_viewStyleInformationMouseMove(event)
-{
- var outlineElement = webdeveloper_addElementOutline(event, webdeveloper_styleElement);
-
- // If the outline element is set
- if(outlineElement)
- {
- webdeveloper_styleElement = outlineElement;
- }
-}
-
-// Mouseover event for view style information
-function webdeveloper_viewStyleInformationMouseOver(event)
-{
- webdeveloper_displayElementAncestors(event);
-}
+++ /dev/null
-// Clears all radio buttons
-function webdeveloper_clearRadioButtons()
-{
- var clearedRadioButtons = 0;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var inputElement = null;
- var inputElementList = null;
- var inputElementsLength = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
-
- // If the element is a radio button
- if(inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "radio")
- {
- inputElement.checked = false;
-
- clearedRadioButtons++;
- }
- else
- {
- // This stops the fields reordering
- inputElement.setAttribute("type", inputElement.getAttribute("type"));
- }
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_clearRadioButtons");
-
- // If one radio button was cleared
- if(clearedRadioButtons == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_clearRadioButtonsSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_clearRadioButtonsMultipleResult", [clearedRadioButtons]));
- }
- }
-}
-
-// Converts form methods
-function webdeveloper_convertFormMethods(method)
-{
- var convertedForms = 0;
- var displayFormDetailsMenu = document.getElementById("webdeveloper-display-form-details-menu");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var form = null;
- var formLength = null;
- var formList = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- formList = pageDocument.forms;
- formLength = formList.length;
-
- // Loop through all the forms
- for(var j = 0; j < formLength; j++)
- {
- form = formList[j];
-
- // If this form is not already the right method
- if((!form.hasAttribute("method") && method == "post") || (form.hasAttribute("method") && form.getAttribute("method").toLowerCase() != method))
- {
- form.setAttribute("method", method);
- convertedForms++;
- }
- }
- }
-
- // Reapply the display form details style sheet if it is currently on - fixes bug with form method not updating
- if(displayFormDetailsMenu.getAttribute("checked"))
- {
- webdeveloper_removeStyleSheet("webdeveloper-display-form-details", false);
- webdeveloper_displayFormDetails(displayFormDetailsMenu, false);
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_convertFormMethods");
-
- // If one form was converted
- if(convertedForms == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_convertFormMethodsSingleResult", [method.toUpperCase()]));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_convertFormMethodsMultipleResult", [convertedForms, method.toUpperCase()]));
- }
- }
-}
-
-// Converts select elements to text inputs
-function webdeveloper_convertSelectElementsToTextInputs()
-{
- var convertedSelectElements = 0;
- var displayFormDetailsMenu = document.getElementById("webdeveloper-display-form-details-menu");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var inputElement = null;
- var pageDocument = null;
- var parentNode = null;
- var selectElement = null;
- var selectElements = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- selectElements = pageDocument.getElementsByTagName("select");
-
- // While there are select elements
- while(selectElements.length > 0)
- {
- inputElement = pageDocument.createElement("input");
- selectElement = selectElements[0];
- parentNode = selectElement.parentNode;
-
- inputElement.value = selectElement.value;
-
- // If the select element has an id attribute
- if(selectElement.hasAttribute("id"))
- {
- inputElement.setAttribute("id", selectElement.getAttribute("id"));
- }
-
- // If the select element has a name attribute
- if(selectElement.hasAttribute("name"))
- {
- inputElement.setAttribute("name", selectElement.getAttribute("name"));
- }
-
- inputElement.setAttribute("type", "text");
-
- parentNode.insertBefore(inputElement, selectElement);
- webdeveloper_removeElement(selectElement);
- convertedSelectElements++;
- }
- }
-
- // Reapply the display form details style sheet if it is currently on - fixes bug with form method not updating
- if(displayFormDetailsMenu.getAttribute("checked"))
- {
- webdeveloper_removeStyleSheet("webdeveloper-display-form-details", false);
- webdeveloper_displayFormDetails(displayFormDetailsMenu, false);
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_convertSelectElementsToTextInputs");
-
- // If one select element was converted
- if(convertedSelectElements == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_convertSelectElementsToTextInputsSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_convertSelectElementsToTextInputsMultipleResult", [convertedSelectElements]));
- }
- }
-}
-
-// Displays/hides the form details for the page
-function webdeveloper_displayFormDetails(element)
-{
- var buttonElement = null;
- var buttonElementList = null;
- var buttonElementsLength = null;
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var inputElement = null;
- var inputElementList = null;
- var inputElementsLength = null;
- var pageDocument = null;
- var selectElement = null;
- var selectElementList = null;
- var selectElementsLength = null;
- var spanElement = null;
- var text = null;
- var textAreaElement = null;
- var textAreaElementList = null;
- var textAreaElementsLength = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-form-details']");
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
-
- // If the input element is unhidden - need to do this to stop it running twice
- if(inputElement.className.indexOf("webdeveloper-unhidden") != -1)
- {
- inputElement.className = webdeveloper_removeSubstring(inputElement.className, "webdeveloper-unhidden");
-
- inputElement.setAttribute("type", "hidden");
- }
-
- // If displaying
- if(display)
- {
- spanElement = pageDocument.createElement("span");
- text = "<input";
-
- // If the element is hidden
- if(inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "hidden")
- {
- inputElement.className += " webdeveloper-unhidden";
-
- inputElement.setAttribute("type", "text");
- }
-
- // This stops the fields reordering
- inputElement.setAttribute("type", inputElement.getAttribute("type"));
-
- // If the element has an id attribute
- if(inputElement.hasAttribute("id"))
- {
- text += ' id="' + inputElement.getAttribute("id") + '"';
- }
-
- // If the element has an name attribute
- if(inputElement.hasAttribute("name"))
- {
- text += ' name="' + inputElement.getAttribute("name") + '"';
- }
-
- // If the element is a checkbox or radio button
- if(inputElement.hasAttribute("type") && (inputElement.getAttribute("type").toLowerCase() == "checkbox" || inputElement.getAttribute("type").toLowerCase() == "radio"))
- {
- text += ' value="' + inputElement.value + '"';
- }
-
- // If the element has a size attribute
- if(inputElement.hasAttribute("size"))
- {
- text += ' size="' + inputElement.getAttribute("size") + '"';
- }
-
- // If the element has a maxlength attribute
- if(inputElement.hasAttribute("maxlength"))
- {
- text += ' maxlength="' + inputElement.getAttribute("maxlength") + '"';
- }
-
- text += ">";
-
- spanElement.setAttribute("class", "webdeveloper-display-form-details");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- inputElement.parentNode.insertBefore(spanElement, inputElement);
- }
- }
-
- // If displaying
- if(display)
- {
- buttonElementList = pageDocument.getElementsByTagName("button");
- buttonElementsLength = buttonElementList.length;
- selectElementList = pageDocument.getElementsByTagName("select");
- selectElementsLength = selectElementList.length;
- textAreaElementList = pageDocument.getElementsByTagName("textarea");
- textAreaElementsLength = textAreaElementList.length;
-
- // Loop through all the button tags
- for(j = 0; j < buttonElementsLength; j++)
- {
- buttonElement = buttonElementList[j];
- spanElement = pageDocument.createElement("span");
- text = "<button";
-
- // If the element has an id attribute
- if(buttonElement.hasAttribute("id"))
- {
- text += ' id="' + buttonElement.getAttribute("id") + '"';
- }
-
- // If the element has an name attribute
- if(buttonElement.hasAttribute("name"))
- {
- text += ' name="' + buttonElement.getAttribute("name") + '"';
- }
-
- text += ">";
-
- spanElement.setAttribute("class", "webdeveloper-display-form-details");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- buttonElement.parentNode.insertBefore(spanElement, buttonElement);
- }
-
- // Loop through all the select tags
- for(j = 0; j < selectElementsLength; j++)
- {
- selectElement = selectElementList[j];
- spanElement = pageDocument.createElement("span");
- text = "<select";
-
- // If the element has an id attribute
- if(selectElement.hasAttribute("id"))
- {
- text += ' id="' + selectElement.getAttribute("id") + '"';
- }
-
- // If the element has an name attribute
- if(selectElement.hasAttribute("name"))
- {
- text += ' name="' + selectElement.getAttribute("name") + '"';
- }
-
- text += ">";
-
- spanElement.setAttribute("class", "webdeveloper-display-form-details");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- selectElement.parentNode.insertBefore(spanElement, selectElement);
- }
-
- // Loop through all the textarea tags
- for(j = 0; j < textAreaElementsLength; j++)
- {
- textAreaElement = textAreaElementList[j];
- spanElement = pageDocument.createElement("span");
- text = "<textarea";
-
- // If the element has an id attribute
- if(textAreaElement.hasAttribute("id"))
- {
- text += ' id="' + textAreaElement.getAttribute("id") + '"';
- }
-
- // If the element has an name attribute
- if(textAreaElement.hasAttribute("name"))
- {
- text += ' name="' + textAreaElement.getAttribute("name") + '"';
- }
-
- text += ">";
-
- spanElement.setAttribute("class", "webdeveloper-display-form-details");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- textAreaElement.parentNode.insertBefore(spanElement, textAreaElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_form_details.css", "webdeveloper-display-form-details");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-form-details-tooltips", "*:before, span.webdeveloper-display-form-details");
-}
-
-// Enables form auto completion
-function webdeveloper_enableFormAutoCompletion()
-{
- var autoCompleteElements = null;
- var autoCompleteElementsLength = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var enabledElements = 0;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- autoCompleteElements = webdeveloper_evaluateXPath(documentList[i], "//*[@autocomplete]");
- autoCompleteElementsLength = autoCompleteElements.length;
-
- // Loop through the auto complete elements
- for(var j = 0; j < autoCompleteElementsLength; j++)
- {
- autoCompleteElements[j].removeAttribute("autocomplete");
- enabledElements++;
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_enableAutoCompletion");
-
- // If one element was enabled
- if(enabledElements == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_enableAutoCompletionSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_enableAutoCompletionMultipleResult", [enabledElements]));
- }
- }
-}
-
-// Enables all the form fields
-function webdeveloper_enableFormFields()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var enabledFields = 0;
- var form = null;
- var formElement = null;
- var formElementList = null;
- var formElements = null;
- var formElementsLength = null;
- var formLength = null;
- var formList = null;
- var imageInputElement = null;
- var imageInputElements = null;
- var imageInputElementsLength = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- formList = documentList[i].forms;
- formLength = formList.length;
-
- // Loop through the forms
- for(var j = 0; j < formLength; j++)
- {
- form = formList[j];
- formElementList = new Array();
- formElements = form.elements;
- formElementsLength = formElements.length;
- imageInputElements = webdeveloper_evaluateXPath(form, "//input[@type='image']");
- imageInputElementsLength = imageInputElements.length;
-
- // Loop through the form elements
- for(var k = 0; k < formElementsLength; k++)
- {
- formElementList.push(formElements[k]);
- }
-
- // Loop through the image input elements
- for(k = 0; k < imageInputElementsLength; k++)
- {
- formElementList.push(imageInputElements[k]);
- }
-
- formElementsLength = formElementList.length;
-
- // Loop through the form elements
- for(k = 0; k < formElementsLength; k++)
- {
- formElement = formElementList[k];
-
- // If the form element is disabled
- if(formElement.disabled)
- {
- formElement.disabled = false;
- enabledFields++;
- }
- }
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_enableFormFields");
-
- // If one field was enabled
- if(enabledFields == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_enableFormFieldsSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_enableFormFieldsMultipleResult", [enabledFields]));
- }
- }
-}
-
-// Makes all the form fields writable
-function webdeveloper_makeFormFieldsWritable()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var readOnlyElements = null;
- var readOnlyElementsLength = null;
- var writableFields = 0;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- readOnlyElements = webdeveloper_evaluateXPath(documentList[i], "//*[@readonly]");
- readOnlyElementsLength = readOnlyElements.length;
-
- // Loop through all the input tags
- for(var j = 0; j < readOnlyElementsLength; j++)
- {
- readOnlyElements[j].removeAttribute("readonly");
- writableFields++;
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_makeFormFieldsWritable");
-
- // If one field was made writable
- if(writableFields == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_makeFormFieldsWritableSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_makeFormFieldsWritableMultipleResult", [writableFields]));
- }
- }
-}
-
-// Populates the form fields on the page
-function webdeveloper_populateFormFields()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var inputElement = null;
- var inputElementList = null;
- var inputElementName = null;
- var inputElementsLength = null;
- var inputElementType = null;
- var option = null;
- var options = null;
- var optionsLength = null;
- var pageDocument = null;
- var selectElement = null;
- var selectElementList = null;
- var selectElementsLength = null;
- var textAreaElement = null;
- var textAreaElementList = null;
- var textAreaElementsLength = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
- selectElementList = pageDocument.getElementsByTagName("select");
- selectElementsLength = selectElementList.length;
- textAreaElementList = pageDocument.getElementsByTagName("textarea");
- textAreaElementsLength = textAreaElementList.length;
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
- inputElementType = inputElement.getAttribute("type");
-
- // If the input element is not disabled
- if(!inputElement.disabled)
- {
- // If the input element value is not set and the type is not set or is password or text
- if(inputElement.value.trim() == "" && (!inputElementType || inputElementType == "password" || inputElementType == "text"))
- {
- inputElementName = inputElement.getAttribute("name");
-
- // If the input element type is text, the name contains email and the populate form fields email preference is set
- if(inputElementType == "text" && inputElementName.toLowerCase().indexOf("email") != -1 && webdeveloper_isPreferenceSet("webdeveloper.populate.form.fields.email"))
- {
- inputElement.value = webdeveloper_getStringPreference("webdeveloper.populate.form.fields.email", true);
- }
- else if(inputElementType == "password")
- {
- inputElement.value = "password";
- }
- else
- {
- inputElement.value = inputElementName;
- }
- }
- else if(inputElementType == "checkbox" || inputElementType == "radio")
- {
- inputElement.checked = true;
- }
- }
- }
-
- // Loop through all the select tags
- for(j = 0; j < selectElementsLength; j++)
- {
- selectElement = selectElementList[j];
-
- // If the select element is not disabled and the value is not set
- if(!selectElement.disabled && selectElement.value.trim() == "")
- {
- options = selectElement.options;
- optionsLength = options.length;
-
- // Loop through the options
- for(var k = 0; k < optionsLength; k++)
- {
- option = options.item(k);
-
- // If the optionis set and the option text and option value are not empty
- if(option && option.text.trim() != "" && option.value.trim() != "")
- {
- selectElement.selectedIndex = k;
-
- break;
- }
- }
- }
- }
-
- // Loop through all the text area tags
- for(j = 0; j < textAreaElementsLength; j++)
- {
- textAreaElement = textAreaElementList[j];
-
- // If the text area element is not disabled and the value is not set
- if(!textAreaElement.disabled && textAreaElement.value.trim() == "")
- {
- textAreaElement.value = textAreaElement.getAttribute("name");
- }
- }
- }
-}
-
-// Removes all maximum lengths on form elements
-function webdeveloper_removeMaximumLengths()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var maximumLengthElements = null;
- var maximumLengthElementsLength = null;
- var removed = 0;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- maximumLengthElements = webdeveloper_evaluateXPath(documentList[i], "//input[@maxlength]");
- maximumLengthElementsLength = maximumLengthElements.length;
-
- // Loop through all the input tags
- for(var j = 0; j < maximumLengthElementsLength; j++)
- {
- maximumLengthElements[j].removeAttribute("maxlength");
- removed++;
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_removeMaximumLengths");
-
- // If one maxlength was removed
- if(removed == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_removeMaximumLengthsSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_removeMaximumLengthsMultipleResult", [removed]));
- }
- }
-}
-
-// Shows all passwords on a form
-function webdeveloper_showPasswords()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var inputElement = null;
- var inputElementList = null;
- var inputElementsLength = null;
- var pageDocument = null;
- var shownPasswords = 0;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
-
- // If the element is password
- if(inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "password")
- {
- inputElement.setAttribute("type", "text");
- shownPasswords++;
- }
- else
- {
- // This stops the fields reordering
- inputElement.setAttribute("type", inputElement.getAttribute("type"));
- }
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_showPasswords");
-
- // If one password was shown
- if(shownPasswords == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_showPasswordsSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_showPasswordsMultipleResult", [shownPasswords]));
- }
- }
-}
-
-// Updates the forms menu
-function webdeveloper_updateFormsMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-form-details-" + suffix), "checked", "webdeveloper-display-form-details");
-}
-
-// Displays all the forms for the page
-function webdeveloper_viewFormInformation()
-{
- var cellDataElement = null;
- var cellHeaderElement = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var elementStates = null;
- var elementStatesLength = null;
- var elementType = null;
- var elementValue = null;
- var form = null;
- var formElement = null;
- var formElementId = null;
- var formElementList = null;
- var formElements = null;
- var formElementsLength = null;
- var formLength = null;
- var formList = null;
- var imageInputElements = null;
- var imageInputElementsLength = null;
- var labelElement = null;
- var labelLength = null;
- var labelList = null;
- var labelValue = null;
- var linkElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var preElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var tableElement = null;
- var tableRowElement = null;
- var title = stringBundle.getFormattedString("webdeveloper_viewFormInformationTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- formList = pageDocument.forms;
- formLength = formList.length;
- labelList = pageDocument.getElementsByTagName("label");
- labelLength = labelList.length;
- spanElement = generatedDocument.createElement("span");
-
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- headerElement = generatedDocument.createElement("h3");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
-
- // If there is one form
- if(formLength == 1)
- {
- headerElement.appendChild(generatedDocument.createTextNode(formLength + " " + stringBundle.getString("webdeveloper_form").toLowerCase()));
- }
- else
- {
- headerElement.appendChild(generatedDocument.createTextNode(formLength + " " + stringBundle.getString("webdeveloper_forms").toLowerCase()));
- }
-
- bodyElement.appendChild(headerElement);
-
- // Loop through the forms
- for(var j = 0; j < formLength; j++)
- {
- form = formList[j];
- formElementList = new Array();
- formElements = form.elements;
- formElementsLength = formElements.length;
- headerElement = generatedDocument.createElement("h3");
- imageInputElements = webdeveloper_evaluateXPath(form, "//input[@type='image']");
- imageInputElementsLength = imageInputElements.length;
- tableElement = generatedDocument.createElement("table");
- tableRowElement = generatedDocument.createElement("tr");
-
- // Loop through the form elements
- for(var k = 0; k < formElementsLength; k++)
- {
- formElementList.push(formElements[k]);
- }
-
- // Loop through the image input elements
- for(k = 0; k < imageInputElementsLength; k++)
- {
- formElementList.push(imageInputElements[k]);
- }
-
- formElementsLength = formElementList.length;
-
- headerElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_form")));
- divElement.appendChild(headerElement);
-
- // Form id heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_id")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Form name heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_name")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Form method heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_method")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Form action heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_action")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- tableRowElement = generatedDocument.createElement("tr");
-
- // Form id
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(form.getAttribute("id")));
- tableRowElement.appendChild(cellDataElement);
-
- // Form name
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(form.getAttribute("name")));
- tableRowElement.appendChild(cellDataElement);
-
- // Form method
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(form.getAttribute("method")));
- tableRowElement.appendChild(cellDataElement);
-
- // Form action
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(form.getAttribute("action")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- divElement.appendChild(tableElement);
-
- pElement = generatedDocument.createElement("p");
-
- divElement.appendChild(pElement);
-
- headerElement = generatedDocument.createElement("h3");
- tableElement = generatedDocument.createElement("table");
- tableRowElement = generatedDocument.createElement("tr");
-
- headerElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_elements")));
- divElement.appendChild(headerElement);
-
- // Element index heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_index")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Element id heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_id")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Element name heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_name")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Element type heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_type")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Element value heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_value")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Element label heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_label")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Element size heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_size")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Element maximum length heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_maximumLength")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Element state heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_state")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Loop through the form elements
- for(k = 0; k < formElementsLength; k++)
- {
- elementStates = new Array();
- elementValue = "";
- formElement = formElementList[k];
- formElementId = formElement.getAttribute("id");
- elementType = formElement.tagName.toLowerCase();
- labelElement = "";
- labelValue = "";
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this is an even row
- if(k % 2 != 0)
- {
- tableRowElement.setAttribute("class", "shaded");
- }
-
- // If the element has an id
- if(formElementId)
- {
- // Loop through the labels
- for(var l = 0; l < labelLength; l++)
- {
- labelElement = labelList[l];
-
- // If this is the label for the element
- if(labelElement.hasAttribute("for") && labelElement.getAttribute("for") == formElementId)
- {
- labelValue = labelElement.innerHTML;
- }
- }
- }
-
- // If this is an input element
- if(elementType == "input")
- {
- elementType = formElement.getAttribute("type");
- elementValue = formElement.value;
- }
- else if(elementType == "textarea")
- {
- elementValue = formElement.value;
- }
-
- // If the element is checked
- if(formElement.checked)
- {
- elementStates.push("Checked");
- }
-
- // If the element is disabled
- if(formElement.disabled)
- {
- elementStates.push("Disabled");
- }
-
- // If the element is read only
- if(formElement.readOnly)
- {
- elementStates.push("Readonly");
- }
-
- elementStatesLength = elementStates.length;
-
- // Element index
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(k));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element id
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(formElementId));
- tableRowElement.appendChild(cellDataElement);
-
- // Element name
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(formElement.getAttribute("name")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element type
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(elementType));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element value
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(elementValue));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element label
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(labelValue));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element size
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(formElement.getAttribute("size")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element maximum length
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(formElement.getAttribute("maxlength")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // Element state
- cellDataElement = generatedDocument.createElement("td");
-
- // Loop through the element states
- for(l = 0; l < elementStatesLength; l++)
- {
- pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(elementStates[l]));
- cellDataElement.appendChild(pElement);
- }
-
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- tableElement.setAttribute("class", "sortable");
- divElement.setAttribute("class", "output");
- divElement.appendChild(tableElement);
- divElement.appendChild(generatedDocument.createElement("hr"));
- bodyElement.appendChild(divElement);
- }
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/dom.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/table_sort.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-// Collapses all output
-function webdeveloper_collapseAllOutput(event)
-{
- webdeveloper_pivotAllOutput(event, false);
-}
-
-// Expands all output
-function webdeveloper_expandAllOutput(event)
-{
- webdeveloper_pivotAllOutput(event, true);
-}
-
-// Makes all output on the page pivotable
-function webdeveloper_makeOutputPivotable()
-{
- var collapseAll = document.getElementById("webdeveloper-generated-tool-collapse-all");
- var expandAll = document.getElementById("webdeveloper-generated-tool-expand-all");
- var spanElementList = webdeveloper_evaluateXPath(document, "//span[@class='expanded pivot']");
- var spanElementLength = spanElementList.length;
-
- // Loop through the span elements
- for(var i = 0; i < spanElementLength; i++)
- {
- spanElementList[i].addEventListener("click", webdeveloper_pivotOutput, false);
- }
-
- // If the collapse all element is found
- if(collapseAll)
- {
- collapseAll.addEventListener("click", webdeveloper_collapseAllOutput, false);
- }
-
- // If the expand all element is found
- if(expandAll)
- {
- expandAll.addEventListener("click", webdeveloper_expandAllOutput, false);
- }
-}
-
-// Pivots all output
-function webdeveloper_pivotAllOutput(event, expand)
-{
- var divElementList = null;
- var divElementLength = null;
- var spanElementList = null;
- var spanElementLength = null;
-
- // If expanding
- if(expand)
- {
- divElementList = webdeveloper_evaluateXPath(document, "//div[@class='collapsed output']");
- divElementLength = divElementList.length;
- spanElementList = webdeveloper_evaluateXPath(document, "//span[@class='collapsed pivot']");
- spanElementLength = spanElementList.length;
-
- // Loop through the div elements
- for(var i = 0; i < divElementLength; i++)
- {
- divElementList[i].setAttribute("class", "output");
- }
-
- // Loop through the span elements
- for(i = 0; i < spanElementLength; i++)
- {
- spanElementList[i].setAttribute("class", "expanded pivot");
- }
- }
- else
- {
- divElementList = webdeveloper_evaluateXPath(document, "//div[@class='output']");
- divElementLength = divElementList.length;
- spanElementList = webdeveloper_evaluateXPath(document, "//span[@class='expanded pivot']");
- spanElementLength = spanElementList.length;
-
- // Loop through the div elements
- for(var i = 0; i < divElementLength; i++)
- {
- divElementList[i].setAttribute("class", "collapsed output");
- }
-
- // Loop through the span elements
- for(i = 0; i < spanElementLength; i++)
- {
- spanElementList[i].setAttribute("class", "collapsed pivot");
- }
- }
-
- event.preventDefault();
-}
-
-// Pivots output
-function webdeveloper_pivotOutput(event)
-{
- // If the event is set
- if(event)
- {
- var pivot = event.target;
- var output = pivot.parentNode.nextSibling;
-
- // If the output element is found
- if(output)
- {
- // If the output class attribute is set to collapsed
- if(output.getAttribute("class") == "collapsed output")
- {
- output.setAttribute("class", "output");
- pivot.setAttribute("class", "expanded pivot");
- }
- else if(output.getAttribute("class") == "output")
- {
- output.setAttribute("class", "collapsed output");
- pivot.setAttribute("class", "collapsed pivot");
- }
- }
- }
-}
-
-webdeveloper_makeOutputPivotable();
+++ /dev/null
-// Makes all tables on the page with a cell with a pivot class pivotable
-function webdeveloper_makeTablesPivotable()
-{
- var tableCellList = webdeveloper_evaluateXPath(document, "//td[@class='pivot']");
- var tableCellLength = tableCellList.length;
-
- // Loop through the table cells
- for(var i = 0; i < tableCellLength; i++)
- {
- tableCellList[i].addEventListener("click", webdeveloper_pivotTable, false);
- }
-}
-
-// Pivots a table
-function webdeveloper_pivotTable(event)
-{
- // If the event is set
- if(event)
- {
- var hide = true;
- var pivotRow = event.target.parentNode;
- var tableCell = null;
- var tableRow = pivotRow;
-
- // If the pivot row class attribute is set to collapsed
- if(pivotRow.getAttribute("class") == "collapsed")
- {
- hide = false;
-
- pivotRow.setAttribute("class", "expanded");
- }
- else
- {
- pivotRow.setAttribute("class", "collapsed");
- }
-
- // Loop through the table rows
- while((tableRow = tableRow.nextSibling) != null)
- {
- tableCell = tableRow.firstChild;
-
- // If the table cell is set and has a class attribute set to indent
- if(tableCell && tableCell.hasAttribute("class") && tableCell.getAttribute("class") == "indent")
- {
- // If the table row has a class attribute that contains shaded
- if(tableRow.hasAttribute("class") && tableRow.getAttribute("class").indexOf("shaded") != -1)
- {
- // If hiding the row
- if(hide)
- {
- tableRow.setAttribute("class", "hidden shaded");
- }
- else
- {
- tableRow.setAttribute("class", "shaded");
- }
- }
- else
- {
- // If hiding the row
- if(hide)
- {
- tableRow.setAttribute("class", "hidden");
- }
- else
- {
- tableRow.removeAttribute("class");
- }
- }
- }
- else
- {
- break;
- }
- }
- }
-}
-
-webdeveloper_makeTablesPivotable();
+++ /dev/null
-var webdeveloper_currentTableSortColumn = 0;
-var webdeveloper_previousTableSortColumn = 0;
-var webdeveloper_sortAscending = false;
-
-// Makes all tables on the page with a sortable class sortable
-function webdeveloper_makeTablesSortable()
-{
- var tableHeaderLength = null;
- var tableHeaderList = null;
- var tableList = webdeveloper_evaluateXPath(document, "//table[@class='sortable']");
- var tableLength = tableList.length;
-
- // Loop through the tables
- for(var i = 0; i < tableLength; i++)
- {
- tableHeaderList = tableList[i].getElementsByTagName("th");
- tableHeaderLength = tableHeaderList.length;
-
- // Loop through the table headers
- for(var j = 0; j < tableHeaderLength; j++)
- {
- tableHeaderList[j].addEventListener("click", webdeveloper_sortTable, false);
- }
- }
-}
-
-// Sorts a table
-function webdeveloper_sortTable(event)
-{
- // If the event is set
- if(event)
- {
- var newTableRowList = new Array();
- var tableHeader = event.target;
- var node = tableHeader;
- var styleSheet = document.getElementById("webdeveloper-generated-content-stylesheet");
- var tableHeaderRow = tableHeader.parentNode;
- var table = tableHeaderRow.parentNode;
- var tableRow = null;
- var tableRowList = table.childNodes;
- var tableRowLength = tableRowList.length;
-
- webdeveloper_currentTableSortColumn = 0;
-
- // Loop through the previous siblings
- while((node = node.previousSibling) != null)
- {
- webdeveloper_currentTableSortColumn++;
- }
-
- // If the current sort column is the same as the previous sort column
- if(webdeveloper_currentTableSortColumn == webdeveloper_previousTableSortColumn)
- {
- webdeveloper_sortAscending = !webdeveloper_sortAscending;
- }
- else
- {
- var previousTableHeader = tableHeaderRow.cells[webdeveloper_previousTableSortColumn];
-
- webdeveloper_previousTableSortColumn = webdeveloper_currentTableSortColumn;
- webdeveloper_sortAscending = true;
-
- // If the previous table header has a class attribute
- if(previousTableHeader.hasAttribute("class"))
- {
- previousTableHeader.removeAttribute("class");
- }
- }
-
- // If sorting in ascending order
- if(webdeveloper_sortAscending)
- {
- tableHeader.setAttribute("class", "sort-ascending");
- }
- else
- {
- tableHeader.setAttribute("class", "sort-descending");
- }
-
- // Loop through the table rows excluding the header row
- for(var i = 1; i < tableRowLength; i++)
- {
- newTableRowList[i - 1] = tableRowList[i];
- }
-
- newTableRowList.sort(webdeveloper_sortTableRows);
- webdeveloper_removeAllChildElements(table);
- table.appendChild(tableHeaderRow);
-
- // Loop through the sorted table rows
- for(i = 0; i < newTableRowList.length; i++)
- {
- tableRow = newTableRowList[i];
-
- // If this is an even row
- if(i % 2 == 0)
- {
- // If this row has a class attribute
- if(tableRow.hasAttribute("class"))
- {
- tableRow.removeAttribute("class");
- }
- }
- else
- {
- tableRow.setAttribute("class", "shaded");
- }
-
- table.appendChild(tableRow);
- }
-
- // Disable and enable the style sheet to force the styles to reapply
- if(styleSheet)
- {
- styleSheet.disabled = true;
- styleSheet.disabled = false;
- }
- }
-}
-
-// Sorts two table rows
-function webdeveloper_sortTableRows(rowOne, rowTwo)
-{
- var sortValue = 1;
-
- // If row one and row two are set
- if(rowOne && rowTwo)
- {
- var columnOne = webdeveloper_getElementText(rowOne.cells[webdeveloper_currentTableSortColumn]);
- var columnTwo = webdeveloper_getElementText(rowTwo.cells[webdeveloper_currentTableSortColumn]);
-
- // If the columns are equal
- if(columnOne == columnTwo)
- {
- return 0;
- }
- else if(columnOne < columnTwo)
- {
- sortValue = -1;
- }
- }
-
- // If sorting in descending order
- if(!webdeveloper_sortAscending)
- {
- sortValue *= -1;
- }
-
- return sortValue;
-}
-
-webdeveloper_makeTablesSortable();
\ No newline at end of file
+++ /dev/null
-// Displays all alt attributes
-function webdeveloper_displayAltAttributes(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var pageDocument = null;
- var spanElement = null;
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-alt-attributes']");
-
- // If the element is checked
- if(checked)
- {
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the image elements
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
-
- // If the alt attribute is set
- if(imageElement.hasAttribute("alt"))
- {
- spanElement = pageDocument.createElement("span");
- text = "Alt=" + imageElement.getAttribute("alt");
-
- spanElement.setAttribute("class", "webdeveloper-display-alt-attributes");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- imageElement.parentNode.insertBefore(spanElement, imageElement);
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-alt-attributes");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-alt-attributes-tooltips", "span.webdeveloper-display-alt-attributes");
-}
-
-// Displays all image dimensions
-function webdeveloper_displayImageDimensions(element)
-{
- var checked = element.getAttribute("checked");
- var dimensions = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var height = null;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var pageDocument = null;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var heightText = stringBundle.getString("webdeveloper_height");
- var width = null;
- var widthText = stringBundle.getString("webdeveloper_width");
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-image-dimensions']");
-
- // If the element is checked
- if(checked)
- {
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the image elements
- for(var j = 0; j < imageElementsLength; j++)
- {
- dimensions = null;
- imageElement = imageElementList[j];
- height = imageElement.height;
- width = imageElement.width;
-
- // If the width and height are set
- if(width && height)
- {
- dimensions = width + "x" + height;
- }
- else if(width)
- {
- dimensions = widthText + "=" + width;
- }
- else if(height)
- {
- dimensions = heightText + "=" + height;
- }
-
- // If the dimensions are set
- if(dimensions)
- {
- spanElement = pageDocument.createElement("span");
-
- spanElement.setAttribute("class", "webdeveloper-display-image-dimensions");
- spanElement.setAttribute("title", dimensions);
- spanElement.appendChild(pageDocument.createTextNode(dimensions));
- imageElement.parentNode.insertBefore(spanElement, imageElement);
- }
-
- height = null;
- width = null;
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-image-dimensions");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-image-dimensions-tooltips", "span.webdeveloper-display-image-dimensions");
-}
-
-// Displays all image file sizes
-function webdeveloper_displayImageFileSizes(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var fileSize = null;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var pageDocument = null;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var fileSizeText = stringBundle.getString("webdeveloper_fileSize");
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-image-file-sizes']");
-
- // If the element is checked
- if(checked)
- {
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the image elements
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
- fileSize = webdeveloper_getFileSize(imageElement.src);
-
- // If there is a file size
- if(fileSize)
- {
- spanElement = pageDocument.createElement("span");
- text = fileSizeText + "=" + webdeveloper_formatFileSize(fileSize);
-
- spanElement.setAttribute("class", "webdeveloper-display-image-file-sizes");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- imageElement.parentNode.insertBefore(spanElement, imageElement);
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-image-file-sizes");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-image-file-sizes-tooltips", "span.webdeveloper-display-image-file-sizes");
-}
-
-// Displays all image paths
-function webdeveloper_displayImagePaths(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var pageDocument = null;
- var spanElement = null;
- var src = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var srcText = stringBundle.getString("webdeveloper_src");
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-image-paths']");
-
- // If the element is checked
- if(checked)
- {
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the image elements
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
- spanElement = pageDocument.createElement("span");
- src = imageElement.getAttribute("src");
-
- // If the src is set
- if(src)
- {
- text = srcText + "=" + src;
-
- spanElement.setAttribute("class", "webdeveloper-display-image-paths");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- imageElement.parentNode.insertBefore(spanElement, imageElement);
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-image-paths");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-image-paths-tooltips", "span.webdeveloper-display-image-paths");
-}
-
-// Finds all the broken images on the page
-function webdeveloper_findBrokenImages()
-{
- var cacheDisabled = !webdeveloper_getBooleanPreference("browser.cache.disk.enable", false) && !webdeveloper_getBooleanPreference("browser.cache.memory.enable", false);
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var image = null;
- var imageLength = null;
- var imageList = null;
- var imageSrc = null;
- var linkElement = null;
- var listElement = null;
- var listItemElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_findBrokenImagesTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- listElement = generatedDocument.createElement("ol");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- imageList = webdeveloper_getImagesForDocument(pageDocument, !cacheDisabled, false);
- imageLength = imageList.length;
- spanElement = generatedDocument.createElement("span");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // Loop through all the images
- for(var j = 0; j < imageLength; j++)
- {
- image = imageList[j];
- imageSrc = image.src;
-
- // If the image is broken
- if(!image.naturalWidth && !image.naturalHeight)
- {
- listItemElement = generatedDocument.createElement("li");
- linkElement = generatedDocument.createElement("a");
-
- linkElement.setAttribute("href", imageSrc);
- linkElement.appendChild(generatedDocument.createTextNode(imageSrc));
- listItemElement.appendChild(linkElement);
- listElement.appendChild(listItemElement);
- }
- }
-
- // If there are no broken images
- if(listElement.hasChildNodes())
- {
- divElement.appendChild(listElement);
- }
- else
- {
- pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_noBrokenImages")));
- divElement.appendChild(pElement);
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Hides/shows all background images
-function webdeveloper_hideBackgroundImages(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/hide_background_images.css", "webdeveloper-hide-background-images");
-}
-
-// Hides/shows all the images
-function webdeveloper_hideImages(element, id)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var hide = element.getAttribute("checked");
- var inputElement = null;
- var inputElementList = null;
- var inputElementsLength = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
-
- // If hiding images and the element is an image
- if(hide && inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "image")
- {
- inputElement.className += " webdeveloper-image";
-
- inputElement.setAttribute("type", "submit");
- }
- else if(inputElement.className.indexOf("webdeveloper-image") != -1)
- {
- inputElement.className = webdeveloper_removeSubstring(inputElement.className, "webdeveloper-image");
-
- inputElement.setAttribute("type", "image");
- }
- else
- {
- // This stops the fields reordering
- inputElement.setAttribute("type", inputElement.getAttribute("type"));
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/hide_images.css", id);
-}
-
-// Makes all the images full size
-function webdeveloper_makeImagesFullSize()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var image = null;
- var imageLength = null;
- var imageList = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- imageList = pageDocument.images;
- imageLength = imageList.length;
-
- // Loop through all the images
- for(var j = 0; j < imageLength; j++)
- {
- image = imageList[j];
-
- // If the image width is set
- if(image.hasAttribute("width"))
- {
- image.removeAttribute("width");
- }
-
- // If the image height is set
- if(image.hasAttribute("height"))
- {
- image.removeAttribute("height");
- }
- }
- }
-}
-
-// Makes all the images invisible
-function webdeveloper_makeImagesInvisible(element, id)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var image = null;
- var imageLength = null;
- var imageList = null;
- var inputElement = null;
- var inputElementList = null;
- var inputElementsLength = null;
- var invisible = element.getAttribute("checked");
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- imageList = pageDocument.images;
- imageLength = imageList.length;
- inputElementList = pageDocument.getElementsByTagName("input");
- inputElementsLength = inputElementList.length;
-
- // Loop through all the input tags
- for(var j = 0; j < inputElementsLength; j++)
- {
- inputElement = inputElementList[j];
-
- // If making images invisible and the element is an image
- if(invisible && inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "image")
- {
- inputElement.className += " webdeveloper-image";
-
- inputElement.setAttribute("type", "submit");
- }
- else if(inputElement.className.indexOf("webdeveloper-image") != -1)
- {
- inputElement.className = webdeveloper_removeSubstring(inputElement.className, "webdeveloper-image");
-
- inputElement.setAttribute("type", "image");
- }
- else
- {
- // This stops the fields reordering
- inputElement.setAttribute("type", inputElement.getAttribute("type"));
- }
- }
-
- // Loop through all the images
- for(j = 0; j < imageLength; j++)
- {
- image = imageList[j];
-
- // If making images invisible
- if(invisible)
- {
- // If the image width is not set and the image is not broken
- if(!image.hasAttribute("width") && image.naturalWidth)
- {
- image.setAttribute("width", image.naturalWidth);
- }
-
- // If the image height is not set and the image is not broken
- if(!image.hasAttribute("height") && image.naturalHeight)
- {
- image.setAttribute("height", image.naturalHeight);
- }
-
- image.setAttribute("src", "chrome://webdeveloper/content/images/spacer.gif?" + image.getAttribute("src"));
- }
- else
- {
- image.setAttribute("src", webdeveloper_removeSubstring(image.getAttribute("src"), "chrome://webdeveloper/content/images/spacer.gif?"));
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/make_images_invisible.css", id);
-}
-
-// Outlines all images
-function webdeveloper_outlineAllImages(element)
-{
- webdeveloper_outlineBackgroundImages(element, false);
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_all_images.css", "webdeveloper-outline-all-images");
-}
-
-// Outlines all background images
-function webdeveloper_outlineBackgroundImages(element, toggleStyleSheet)
-{
- var backgroundImage = null;
- var checked = element.getAttribute("checked");
- var cssURI = CSSPrimitiveValue.CSS_URI;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var node = null;
- var pageDocument = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- treeWalker = pageDocument.createTreeWalker(webdeveloper_getDocumentBodyElement(pageDocument), NodeFilter.SHOW_ELEMENT, null, false);
-
- // While the tree walker has more nodes
- while((node = treeWalker.nextNode()) != null)
- {
- backgroundImage = node.ownerDocument.defaultView.getComputedStyle(node, null).getPropertyCSSValue("background-image");
-
- // If this element has a background image and it is a URL
- if(backgroundImage && backgroundImage.primitiveType == cssURI)
- {
- // If the element is checked
- if(checked)
- {
- // If the style sheet should be toggled
- if(toggleStyleSheet)
- {
- node.style.MozOutline = "1px solid #ff0000";
- }
- else
- {
- node.style.MozOutline = "1px solid #0000ff";
- }
- }
- else
- {
- webdeveloper_removeElementOutline(node);
- }
- }
- }
- }
-
- // If the style sheet should be toggled
- if(toggleStyleSheet)
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-outline-background-images");
- }
-}
-
-// Outlines all the images with adjusted dimensions
-function webdeveloper_outlineImagesWithAdjustedDimensions(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var naturalHeight = null;
- var naturalWidth = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the img tags
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
- naturalHeight = imageElement.naturalHeight;
- naturalWidth = imageElement.naturalWidth;
-
- // If outlining
- if(checked)
- {
- // If the width or height has been adjusted
- if((naturalWidth && imageElement.hasAttribute("width") && imageElement.getAttribute("width") != naturalWidth)
- || (naturalHeight && imageElement.hasAttribute("height") && imageElement.getAttribute("height") != naturalHeight))
- {
- imageElement.className += " webdeveloper-adjusted-image";
- }
- }
- else if(imageElement.className.indexOf("webdeveloper-adjusted-image") != -1)
- {
- imageElement.className = webdeveloper_removeSubstring(imageElement.className, "webdeveloper-adjusted-image");
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_with_adjusted_dimensions.css", "webdeveloper-outline-images-with-adjusted-dimensions");
-}
-
-// Outlines all the images with oversized dimensions
-function webdeveloper_outlineImagesWithOversizedDimensions(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var naturalHeight = null;
- var naturalWidth = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the img tags
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
- naturalHeight = imageElement.naturalHeight;
- naturalWidth = imageElement.naturalWidth;
-
- // If outlining
- if(checked)
- {
- // If the width or height has been oversized
- if((naturalWidth && imageElement.hasAttribute("width") && imageElement.getAttribute("width") > naturalWidth)
- || (naturalHeight && imageElement.hasAttribute("height") && imageElement.getAttribute("height") > naturalHeight))
- {
- imageElement.className += " webdeveloper-oversized-image";
- }
- }
- else if(imageElement.className.indexOf("webdeveloper-oversized-image") != -1)
- {
- imageElement.className = webdeveloper_removeSubstring(imageElement.className, "webdeveloper-oversized-image");
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_with_oversized_dimensions.css", "webdeveloper-outline-images-with-oversized-dimensions");
-}
-
-// Outlines all the images with empty alt attributes
-function webdeveloper_outlineImagesWithEmptyAltAttributes(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_with_empty_alt_attributes.css", "webdeveloper-outline-images-with-empty-alt-attributes");
-}
-
-// Outlines all the images without alt attributes
-function webdeveloper_outlineImagesWithoutAltAttributes(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_without_alt_attributes.css", "webdeveloper-outline-images-without-alt-attributes");
-}
-
-// Outlines all the images without dimensions
-function webdeveloper_outlineImagesWithoutDimensions(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_without_dimensions.css", "webdeveloper-outline-images-without-dimensions");
-}
-
-// Outlines all the images without title attributes
-function webdeveloper_outlineImagesWithoutTitleAttributes(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_images_without_title_attributes.css", "webdeveloper-outline-images-without-title-attributes");
-}
-
-// Replaces all images with their alt attributes
-function webdeveloper_replaceImagesWithAltAttributes(element)
-{
- var altAttribute = null;
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var imageElement = null;
- var imageElementList = null;
- var imageElementsLength = null;
- var pageDocument = null;
- var previousElement = null;
- var spanElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-replace-images-with-alt-attributes']");
-
- // If the element is checked
- if(checked)
- {
- imageElementList = pageDocument.images;
- imageElementsLength = imageElementList.length;
-
- // Loop through all the img tags
- for(var j = 0; j < imageElementsLength; j++)
- {
- imageElement = imageElementList[j];
- altAttribute = imageElement.getAttribute("alt");
- spanElement = pageDocument.createElement("span");
-
- // If the alt attribute is set
- if(altAttribute)
- {
- spanElement.setAttribute("class", "webdeveloper-replace-images-with-alt-attributes");
- spanElement.appendChild(pageDocument.createTextNode(altAttribute));
- imageElement.parentNode.insertBefore(spanElement, imageElement);
- }
- }
- }
- }
-
- webdeveloper_hideImages(element, "webdeveloper-replace-images-with-alt-attributes");
-}
-
-// Toggles external site images
-function webdeveloper_toggleExternalSiteImages(element)
-{
- var imageBehavior = 1;
- var legacyImageBehavior = 0;
-
- // If disabling external images
- if(element.getAttribute("checked"))
- {
- imageBehavior = 3;
- legacyImageBehavior = 1;
- }
-
- webdeveloper_setIntegerPreference("network.image.imageBehavior", legacyImageBehavior);
- webdeveloper_setIntegerPreference("permissions.default.image", imageBehavior);
- BrowserReload();
-}
-
-// Toggles image animations
-function webdeveloper_toggleImageAnimations(element)
-{
- var imageBehavior = "normal";
-
- // If disabling images
- if(element.getAttribute("checked"))
- {
- imageBehavior = "none";
- }
-
- webdeveloper_setStringPreference("image.animation_mode", imageBehavior);
- BrowserReload();
-}
-
-// Toggles images
-function webdeveloper_toggleImages(element)
-{
- var imageBehavior = 1;
- var legacyImageBehavior = 0;
-
- // If disabling images
- if(element.getAttribute("checked"))
- {
- imageBehavior = 2;
- legacyImageBehavior = 2;
- }
-
- webdeveloper_setIntegerPreference("network.image.imageBehavior", legacyImageBehavior);
- webdeveloper_setIntegerPreference("permissions.default.image", imageBehavior);
- BrowserReload();
-}
-
-// Updates the disable images menu
-function webdeveloper_updateDisableImagesMenu(suffix)
-{
- var checked = false;
- var disableExternalSiteImagesChecked = false;
- var disableExternalSiteImagesMenu = document.getElementById("webdeveloper-disable-external-site-images-" + suffix);
- var disableImagesChecked = false;
- var disableImagesPreferenceValue = webdeveloper_getIntegerPreference("permissions.default.image", true);
-
- // If the image preference value is set to 2
- if(disableImagesPreferenceValue == 2)
- {
- disableImagesChecked = true;
- }
- else if(disableImagesPreferenceValue == 3)
- {
- disableExternalSiteImagesChecked = true;
- }
-
- // If the image animation preference is set to none
- if(webdeveloper_getStringPreference("image.animation_mode", false) == "none")
- {
- checked = true;
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-all-images-" + suffix), "checked", disableImagesChecked);
- webdeveloper_configureElement(disableExternalSiteImagesMenu, "checked", disableExternalSiteImagesChecked);
- webdeveloper_configureElement(disableExternalSiteImagesMenu, "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-disable-image-animations-" + suffix), "checked", checked);
-}
-
-// Updates the images menu
-function webdeveloper_updateImagesMenu(suffix)
-{
- var disableImagesChecked = false;
- var disableImagesPreferenceValue = webdeveloper_getIntegerPreference("permissions.default.image", true);
-
- // If the image preference value is set to 2
- if(disableImagesPreferenceValue == 2)
- {
- disableImagesChecked = true;
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-find-broken-images-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-hide-background-images-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-hide-images-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-make-images-full-size-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-make-images-invisible-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElement(document.getElementById("webdeveloper-view-image-information-" + suffix), "disabled", disableImagesChecked);
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-alt-attributes-" + suffix), "checked", "webdeveloper-display-alt-attributes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-image-dimensions-" + suffix), "checked", "webdeveloper-display-image-dimensions");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-image-file-sizes-" + suffix), "checked", "webdeveloper-display-image-file-sizes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-image-paths-" + suffix), "checked", "webdeveloper-display-image-paths");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-hide-background-images-" + suffix), "checked", "webdeveloper-hide-background-images");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-hide-images-" + suffix), "checked", "webdeveloper-hide-images");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-make-images-invisible-" + suffix), "checked", "webdeveloper-make-images-invisible");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-replace-images-with-alt-attributes-" + suffix), "checked", "webdeveloper-replace-images-with-alt-attributes");
-}
-
-// Updates the outline images menu
-function webdeveloper_updateOutlineImagesMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-all-images-" + suffix), "checked", "webdeveloper-outline-all-images");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-background-images-" + suffix), "checked", "webdeveloper-outline-background-images");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-images-with-adjusted-dimensions-" + suffix), "checked", "webdeveloper-outline-images-with-adjusted-dimensions");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-images-with-empty-alt-attributes-" + suffix), "checked", "webdeveloper-outline-images-with-empty-alt-attributes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-images-without-alt-attributes-" + suffix), "checked", "webdeveloper-outline-images-without-alt-attributes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-images-without-dimensions-" + suffix), "checked", "webdeveloper-outline-images-without-dimensions");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-images-without-title-attributes-" + suffix), "checked", "webdeveloper-outline-images-without-title-attributes");
-}
-
-// Displays all the images for the page
-function webdeveloper_viewImageInformation()
-{
- var cellDataElement = null;
- var cellHeaderElement = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var fileSize = null;
- var height = 0;
- var image = null;
- var imageElement = null;
- var imageLength = null;
- var imageList = new Array();
- var imageSrc = null;
- var linkElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var shade = false;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_viewImageInformationTitle", [oldURL]);
- var tableElement = null;
- var tableRowElement = null;
- var width = 0;
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- imageList = webdeveloper_getImagesForDocument(pageDocument, true, true);
- spanElement = generatedDocument.createElement("span");
-
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // If the tidy information preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.information.tidy", true))
- {
- imageList = webdeveloper_tidyImages(imageList);
- }
-
- headerElement = generatedDocument.createElement("h3");
- imageLength = imageList.length;
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
-
- // If there is one image
- if(imageLength == 1)
- {
- headerElement.appendChild(generatedDocument.createTextNode(imageLength + " " + stringBundle.getString("webdeveloper_image").toLowerCase()));
- }
- else
- {
- headerElement.appendChild(generatedDocument.createTextNode(imageLength + " " + stringBundle.getString("webdeveloper_images").toLowerCase()));
- }
-
- bodyElement.appendChild(headerElement);
-
- // Loop through the images
- for(var j = 0; j < imageLength; j++)
- {
- image = imageList[j];
- height = image.naturalHeight;
- imageElement = generatedDocument.createElement("img");
- imageSrc = image.src;
- fileSize = webdeveloper_getFileSize(imageSrc);
- pElement = generatedDocument.createElement("p");
- shade = true;
- tableElement = generatedDocument.createElement("table");
- width = image.naturalWidth;
-
- imageElement.setAttribute("src", imageSrc);
- pElement.appendChild(imageElement);
- divElement.appendChild(pElement);
-
- // Src
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- linkElement = generatedDocument.createElement("a");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_src")));
- tableRowElement.appendChild(cellHeaderElement);
- linkElement.setAttribute("href", imageSrc);
- linkElement.appendChild(generatedDocument.createTextNode(imageSrc));
- cellDataElement.appendChild(linkElement);
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
-
- // If there is a width
- if(width)
- {
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- tableRowElement = generatedDocument.createElement("tr");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_width")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.setAttribute("class", "shaded");
- cellDataElement.appendChild(generatedDocument.createTextNode(width));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If there is a height
- if(height)
- {
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- shade = !shade;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this cell should be shaded
- if(shade)
- {
- cellDataElement.setAttribute("class", "shaded");
- }
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_height")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(height));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If there is a file size
- if(fileSize)
- {
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- shade = !shade;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this cell should be shaded
- if(shade)
- {
- cellDataElement.setAttribute("class", "shaded");
- }
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_fileSize")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(webdeveloper_formatFileSize(fileSize)));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If there is an alt attribute
- if(image.hasAttribute("alt"))
- {
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- shade = !shade;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this cell should be shaded
- if(shade)
- {
- cellDataElement.setAttribute("class", "shaded");
- }
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_alt")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(image.getAttribute("alt")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- // If there is a title attribute
- if(image.hasAttribute("title"))
- {
- cellDataElement = generatedDocument.createElement("td");
- cellHeaderElement = generatedDocument.createElement("th");
- shade = !shade;
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this cell should be shaded
- if(shade)
- {
- cellDataElement.setAttribute("class", "shaded");
- }
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_title")));
- tableRowElement.appendChild(cellHeaderElement);
- cellDataElement.appendChild(generatedDocument.createTextNode(image.getAttribute("title")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- divElement.appendChild(tableElement);
- divElement.appendChild(generatedDocument.createElement("hr"));
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-// Adds colors from the specified property of the element to the given list
-function webdeveloper_addColor(element, property, colorList)
-{
- // If the element, property and color list are set
- if(element && property && colorList)
- {
- var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element, null);
- var color = computedStyle.getPropertyCSSValue(property);
-
- // If the color is set and it is a color
- if(color && color.primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR)
- {
- color = color.getRGBColorValue();
-
- colorList.push("#" + webdeveloper_formatColor(color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)) + webdeveloper_formatColor(color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)) + webdeveloper_formatColor(color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)));
- }
- }
-}
-
-// Displays all abbreviations
-function webdeveloper_displayAbbreviations(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_abbreviations.css", "webdeveloper-display-abbreviations");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-abbreviations-tooltips", "*:before");
-}
-
-// Displays all access keys
-function webdeveloper_displayAccessKeys(element)
-{
- var accessKeyElement = null;
- var accessKeyElementList = null;
- var accessKeyElementsLength = null;
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var spanElement = null;
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-access-keys']");
-
- // If displaying
- if(display)
- {
- accessKeyElementList = webdeveloper_evaluateXPath(pageDocument, "//*[@accesskey]");
- accessKeyElementsLength = accessKeyElementList.length;
-
- // Loop through all the access key elements
- for(var j = 0; j < accessKeyElementsLength; j++)
- {
- accessKeyElement = accessKeyElementList[j];
- spanElement = pageDocument.createElement("span");
- text = "Accesskey=" + accessKeyElement.getAttribute("accesskey");
-
- spanElement.setAttribute("class", "webdeveloper-display-access-keys");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- accessKeyElement.parentNode.insertBefore(spanElement, accessKeyElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-access-keys");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-access-keys-tooltips", "span.webdeveloper-display-access-keys");
-}
-
-// Displays all anchors
-function webdeveloper_displayAnchors(element)
-{
- var anchorElement = null;
- var anchorElementList = null;
- var anchorElementsLength = null;
- var anchorText = null;
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var linkElement = null;
- var pageDocument = null;
- var spanElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-anchors']");
-
- // If displaying
- if(display)
- {
- anchorElementList = webdeveloper_evaluateXPath(pageDocument, "//*[@id] | //a[@name]");
- anchorElementsLength = anchorElementList.length;
-
- // Loop through all the anchor elements
- for(var j = 0; j < anchorElementsLength; j++)
- {
- anchorElement = anchorElementList[j];
- linkElement = pageDocument.createElement("a");
- spanElement = pageDocument.createElement("span");
-
- // If the anchor element has an id attribute
- if(anchorElement.hasAttribute("id"))
- {
- anchorText = "#" + anchorElement.getAttribute("id");
- }
- else if(anchorElement.hasAttribute("name"))
- {
- anchorText = "#" + anchorElement.getAttribute("name");
- }
-
- linkElement.setAttribute("href", anchorText);
- linkElement.setAttribute("title", anchorText);
- linkElement.appendChild(pageDocument.createTextNode(anchorText));
-
- spanElement.setAttribute("class", "webdeveloper-display-anchors");
- spanElement.setAttribute("title", anchorText);
- spanElement.appendChild(linkElement);
-
-
- // Try to insert the anchor element
- try
- {
- anchorElement.parentNode.insertBefore(spanElement, anchorElement);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_anchors.css", "webdeveloper-display-anchors");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-anchors-tooltips", "span.webdeveloper-display-anchors, span.webdeveloper-display-anchors a");
-}
-
-// Displays all block sizes
-function webdeveloper_displayBlockSize(element)
-{
- var blockSizeElement = null;
- var blockSizeElementList = null;
- var blockSizeElementsLength = null;
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var height = null;
- var left = null;
- var pageDocument = null;
- var spanElement = null;
- var text = null;
- var top = null;
- var width = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-block-size']");
-
- // If displaying
- if(display)
- {
- blockSizeElementList = webdeveloper_evaluateXPath(pageDocument, "//div | //form | //table");
- blockSizeElementsLength = blockSizeElementList.length;
-
- // Loop through the block size elements
- for(var j = 0; j < blockSizeElementsLength; j++)
- {
- blockSizeElement = blockSizeElementList[j];
- height = blockSizeElement.offsetHeight;
- left = blockSizeElement.offsetLeft;
- spanElement = pageDocument.createElement("span");
- top = blockSizeElement.offsetTop;
- width = blockSizeElement.offsetWidth;
- text = webdeveloper_getElementDescription(blockSizeElement) + " " + width + "x" + height;
-
- spanElement.style.left = left + "px";
- spanElement.style.position = "absolute";
- spanElement.style.top = top + "px";
-
- spanElement.setAttribute("class", "webdeveloper-display-block-size");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
-
- webdeveloper_insertAsFirstChild(blockSizeElement, spanElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_block_size.css", "webdeveloper-display-block-size");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-block-size-tooltips", "span.webdeveloper-display-block-size");
-}
-
-// Displays the order of the divs on the page
-function webdeveloper_displayDivOrder(element)
-{
- var display = element.getAttribute("checked");
- var divElement = null;
- var divElementList = null;
- var divElementsLength = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var spanElement = null;
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-div-order']");
-
- // If displaying
- if(display)
- {
- divElementList = pageDocument.getElementsByTagName("div");
- divElementsLength = divElementList.length;
-
- // Loop through the div elements
- for(var j = 0; j < divElementsLength; j++)
- {
- divElement = divElementList[j];
- spanElement = pageDocument.createElement("span");
- text = webdeveloper_getElementDescription(divElement) + " " + (j + 1);
-
- spanElement.setAttribute("class", "webdeveloper-display-div-order");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
-
- webdeveloper_insertAsFirstChild(divElement, spanElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_div_order.css", "webdeveloper-display-div-order");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-div-order-tooltips", "span.webdeveloper-display-div-order");
-}
-
-// Displays id and class details for the page
-function webdeveloper_displayIdClassDetails(element)
-{
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var idClassElement = null;
- var idClassElementList = null;
- var idClassElementsLength = null;
- var idClassElementText = null;
- var pageDocument = null;
- var spanElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-id-class-details']");
-
- // If displaying
- if(display)
- {
- idClassElementList = webdeveloper_evaluateXPath(pageDocument, "//*[@class] | //*[@id]");
- idClassElementsLength = idClassElementList.length;
-
- // Loop through all the id class elements
- for(var j = 0; j < idClassElementsLength; j++)
- {
- idClassElement = idClassElementList[j];
-
- // If the id class element is a Web Developer element
- if((idClassElement.hasAttribute("class") && idClassElement.getAttribute("class").indexOf("webdeveloper-")) || (idClassElement.hasAttribute("id") && idClassElement.getAttribute("id").indexOf("webdeveloper-")))
- {
- idClassElementText = "";
- spanElement = pageDocument.createElement("span");
-
- // If the id class element has an id attribute
- if(idClassElement.hasAttribute("id"))
- {
- idClassElementText += " #" + idClassElement.getAttribute("id");
- }
-
- // If the id class element has a class attribute
- if(idClassElement.hasAttribute("class"))
- {
- idClassElementText += " ." + idClassElement.getAttribute("class");
- }
-
- spanElement.setAttribute("class", "webdeveloper-display-id-class-details");
- spanElement.setAttribute("title", idClassElementText);
- spanElement.appendChild(pageDocument.createTextNode(idClassElementText));
-
- // Try to insert the id class element
- try
- {
- idClassElement.parentNode.insertBefore(spanElement, idClassElement);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-id-class-details");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-id-class-details-tooltips", "span.webdeveloper-display-id-class-details");
-}
-
-// Displays all link details
-function webdeveloper_displayLinkDetails(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_link_details.css", "webdeveloper-display-link-details");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-link-details-tooltips", "*:before");
-}
-
-// Displays object information
-function webdeveloper_displayObjectInformation(element)
-{
- var checked = element.getAttribute("checked");
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var objectAttributes = null;
- var objectElement = null;
- var objectElementList = null;
- var objectElementsLength = null;
- var pageDocument = null;
- var paramAttributes = null;
- var paramElement = null;
- var paramElementList = null;
- var paramElementsLength = null;
- var pElement = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//div[@class='webdeveloper-display-object-information']");
-
- // If the element is checked
- if(checked)
- {
- objectElementList = pageDocument.getElementsByTagName("object");
- objectElementsLength = objectElementList.length;
-
- // Loop through all the object elements
- for(var j = 0; j < objectElementsLength; j++)
- {
- divElement = pageDocument.createElement("div");
- objectAttributes = "";
- objectElement = objectElementList[j];
- paramElementList = objectElement.getElementsByTagName("param");
- paramElementsLength = paramElementList.length;
- pElement = pageDocument.createElement("p");
-
- // If the object has an width attribute
- if(objectElement.hasAttribute("width"))
- {
- objectAttributes += ' width="' + objectElement.getAttribute("width") + '"';
- }
-
- // If the object has an height attribute
- if(objectElement.hasAttribute("height"))
- {
- objectAttributes += ' height="' + objectElement.getAttribute("height") + '"';
- }
-
- // If the object has an archive attribute
- if(objectElement.hasAttribute("archive"))
- {
- objectAttributes += ' archive="' + objectElement.getAttribute("archive") + '"';
- }
-
- // If the object has an classid attribute
- if(objectElement.hasAttribute("classid"))
- {
- objectAttributes += ' classid="' + objectElement.getAttribute("classid") + '"';
- }
-
- // If the object has an codebase attribute
- if(objectElement.hasAttribute("codebase"))
- {
- objectAttributes += ' codebase="' + objectElement.getAttribute("codebase") + '"';
- }
-
- // If the object has an codetype attribute
- if(objectElement.hasAttribute("codetype"))
- {
- objectAttributes += ' codetype="' + objectElement.getAttribute("codetype") + '"';
- }
-
- // If the object has an data attribute
- if(objectElement.hasAttribute("data"))
- {
- objectAttributes += ' data="' + objectElement.getAttribute("data") + '"';
- }
-
- // If the object has an standby attribute
- if(objectElement.hasAttribute("standby"))
- {
- objectAttributes += ' standby="' + objectElement.getAttribute("standby") + '"';
- }
-
- // If the object has an type attribute
- if(objectElement.hasAttribute("type"))
- {
- objectAttributes += ' type="' + objectElement.getAttribute("type") + '"';
- }
-
- pElement.appendChild(document.createTextNode("<object" + objectAttributes + ">"));
- divElement.appendChild(pElement);
-
- // Loop through all the param elements
- for(var k = 0; k < paramElementsLength; k++)
- {
- paramAttributes = "";
- paramElement = paramElementList[k];
- pElement = pageDocument.createElement("p");
-
- // If the param has a name attribute
- if(paramElement.hasAttribute("name"))
- {
- paramAttributes += ' name="' + paramElement.getAttribute("name") + '"';
- }
-
- // If the param has a value attribute
- if(paramElement.hasAttribute("value"))
- {
- paramAttributes += ' value="' + paramElement.getAttribute("value") + '"';
- }
-
- pElement.appendChild(document.createTextNode("<param" + paramAttributes + " />"));
- pElement.setAttribute("class", "param");
- divElement.appendChild(pElement);
- }
-
- pElement = pageDocument.createElement("p");
- pElement.appendChild(document.createTextNode("</object>"));
- divElement.appendChild(pElement);
-
- divElement.setAttribute("class", "webdeveloper-display-object-information");
- objectElement.parentNode.insertBefore(divElement, objectElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_object_information.css", "webdeveloper-display-object-information");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-object-information-tooltips", "div.webdeveloper-display-object-information");
-}
-
-// Displays the stack level of all elements on the page
-function webdeveloper_displayStackLevels(element)
-{
- var display = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var pageElement = null;
- var spanElement = null;
- var text = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-stack-levels']");
-
- // If displaying
- if(display)
- {
- treeWalker = pageDocument.createTreeWalker(pageDocument, NodeFilter.SHOW_ELEMENT, webdeveloper_stackLevelFilter, false);
-
- // While the tree walker has more nodes
- while((pageElement = treeWalker.nextNode()) != null)
- {
- spanElement = pageDocument.createElement("span");
- text = webdeveloper_getElementDescription(pageElement) + " Z-index=" + pageElement.ownerDocument.defaultView.getComputedStyle(pageElement, null).getPropertyCSSValue("z-index").cssText;
-
- spanElement.setAttribute("class", "webdeveloper-display-stack-levels");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
-
- webdeveloper_insertAsFirstChild(pageElement, spanElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-stack-levels");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-stack-levels-tooltips", "span.webdeveloper-display-stack-levels");
-}
-
-// Displays all tab indices
-function webdeveloper_displayTabIndex(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var spanElement = null;
- var tabIndexElement = null;
- var tabIndexElementList = null;
- var tabIndexElementsLength = null;
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-tab-index']");
-
- // If the element is checked
- if(checked)
- {
- tabIndexElementList = webdeveloper_evaluateXPath(pageDocument, "//*[@tabindex]");
- tabIndexElementsLength = tabIndexElementList.length;
-
- // Loop through all the tab index elements
- for(var j = 0; j < tabIndexElementsLength; j++)
- {
- spanElement = pageDocument.createElement("span");
- tabIndexElement = tabIndexElementList[j];
- text = "Tabindex=" + tabIndexElement.getAttribute("tabindex");
-
- spanElement.setAttribute("class", "webdeveloper-display-tab-index");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(document.createTextNode(text));
- tabIndexElement.parentNode.insertBefore(spanElement, tabIndexElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-tab-index");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-tab-index-tooltips", "span.webdeveloper-display-tab-index");
-}
-
-// Displays the depth of all tables
-function webdeveloper_displayTableDepth(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var tableElement = null;
- var tableElementList = null;
- var tableElementsLength = null;
- var text = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-table-depth']");
-
- // If the element is checked
- if(checked)
- {
- tableElementList = pageDocument.getElementsByTagName("table");
- tableElementsLength = tableElementList.length;
-
- // Loop through all the table elements
- for(var j = 0; j < tableElementsLength; j++)
- {
- spanElement = pageDocument.createElement("span");
- tableElement = tableElementList[j];
- text = stringBundle.getString("webdeveloper_depth") + "=" + webdeveloper_getTableDepth(tableElement);
-
- spanElement.setAttribute("class", "webdeveloper-display-table-depth");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(document.createTextNode(text));
- tableElement.parentNode.insertBefore(spanElement, tableElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-table-depth");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-table-depth-tooltips", "span.webdeveloper-display-table-depth");
-}
-
-// Displays table information
-function webdeveloper_displayTableInformation(element)
-{
- var checked = element.getAttribute("checked");
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var tableCellElementList = null;
- var tableCellElementsLength = null;
- var tableElement = null;
- var tableElementList = null;
- var tableElementsLength = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//div[@class='webdeveloper-display-table-information']");
-
- // If the element is checked
- if(checked)
- {
- tableElementList = pageDocument.getElementsByTagName("table");
- tableElementsLength = tableElementList.length;
-
- // Loop through all the table elements
- for(var j = 0; j < tableElementsLength; j++)
- {
- tableElement = tableElementList[j];
- tableCellElementList = tableElement.getElementsByTagName("th");
- tableCellElementsLength = tableCellElementList.length;
-
- // If the table has a summary attribute
- if(tableElement.hasAttribute("summary"))
- {
- divElement = pageDocument.createElement("div");
-
- divElement.setAttribute("class", "webdeveloper-display-table-information");
- divElement.appendChild(pageDocument.createTextNode("Summary=" + tableElement.getAttribute("summary")));
- tableElement.parentNode.insertBefore(divElement, tableElement);
- }
-
- // Loop through the cell elements
- for(var k = 0; k < tableCellElementsLength; k++)
- {
- webdeveloper_outputTableCellInformation(tableCellElementList[k], pageDocument);
- }
-
- tableCellElementList = tableElement.getElementsByTagName("td");
- tableCellElementsLength = tableCellElementList.length;
-
- // Loop through the cell elements
- for(k = 0; k < tableCellElementsLength; k++)
- {
- webdeveloper_outputTableCellInformation(tableCellElementList[k], pageDocument);
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_table_information.css", "webdeveloper-display-table-information");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-table-information-tooltips", "div.webdeveloper-display-table-information");
-}
-
-// Displays all title attributes
-function webdeveloper_displayTitleAttributes(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var spanElement = null;
- var text = null;
- var titleAttributeElement = null;
- var titleAttributeElementList = null;
- var titleAttributeElementsLength = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // Need to do this to stop the feature running twice
- webdeveloper_removeAllElementsByXPath(pageDocument, "//span[@class='webdeveloper-display-title-attributes']");
-
- // If the element is checked
- if(checked)
- {
- titleAttributeElementList = webdeveloper_evaluateXPath(pageDocument, "//*[@title]");
- titleAttributeElementsLength = titleAttributeElementList.length;
-
- // Loop through all the title attribute elements
- for(var j = 0; j < titleAttributeElementsLength; j++)
- {
- spanElement = pageDocument.createElement("span");
- titleAttributeElement = titleAttributeElementList[j];
- text = "Title=" + titleAttributeElement.getAttribute("title");
-
- spanElement.setAttribute("class", "webdeveloper-display-title-attributes");
- spanElement.setAttribute("title", text);
- spanElement.appendChild(pageDocument.createTextNode(text));
- titleAttributeElement.parentNode.insertBefore(spanElement, titleAttributeElement);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/tooltips.css", "webdeveloper-display-title-attributes");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-display-title-attributes-tooltips", "span.webdeveloper-display-title-attributes");
-}
-
-// Displays the topographic information for all elements
-function webdeveloper_displayTopographicInformation(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/display_topographic_information.css", "webdeveloper-display-topographic-information");
-}
-
-// Formats a CSS color
-function webdeveloper_formatColor(color)
-{
- var formattedColor = color.toString(16);
-
- // If the formatted color is less than 2 characters long
- if(formattedColor.length < 2)
- {
- return "0" + formattedColor;
- }
- else
- {
- return formattedColor;
- }
-}
-
-// Returns the depth of the table
-function webdeveloper_getTableDepth(table)
-{
- var depth = 1;
-
- // If the table is set
- if(table)
- {
- var ancestorList = webdeveloper_getElementAncestors(table);
- var ancestorLength = ancestorList.length;
- var tagName = null;
-
- // Loop through the ancestors
- for(var i = 0; i < ancestorLength; i++)
- {
- tagName = ancestorList[i].tagName;
-
- // If the tag name is set and equals table
- if(tagName && tagName.toLowerCase() == "table")
- {
- depth++;
- }
- }
- }
-
- return depth;
-}
-
-// Returns the text from a table heading
-function webdeveloper_getTableHeadingText(headingNode, headingText)
-{
- // If the heading node is set
- if(headingNode)
- {
- var childNode = null;
- var childNodeList = headingNode.childNodes;
- var childNodeLength = childNodeList.length;
- var childNodeType = null;
-
- // Loop through the child nodes
- for(var i = 0; i < childNodeLength; i++)
- {
- childNode = childNodeList[i];
- childNodeType = childNode.nodeType;
-
- // If the child node type is an element and it does not have a webdeveloper-table-information class
- if(childNodeType == Node.ELEMENT_NODE && (!childNode.hasAttribute("class") || childNode.getAttribute("class") != "webdeveloper-table-information"))
- {
- headingText = webdeveloper_getTableHeadingText(childNode, headingText);
- }
- else if(childNodeType == Node.TEXT_NODE)
- {
- headingText += childNode.nodeValue + " ";
- }
- }
- }
-
- return headingText.trim();
-}
-
-// Outputs the information for a table cell
-function webdeveloper_outputTableCellInformation(tableCellElement, pageDocument)
-{
- // If the table cell element is set
- if(tableCellElement)
- {
- var divElement = null;
- var pElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the table cell has a headers attribute
- if(tableCellElement.hasAttribute("headers"))
- {
- var definitionElement = pageDocument.createElement("dd");
- var headerList = tableCellElement.getAttribute("headers").split(" ");
- var headersLength = headerList.length;
-
- // Loop through the headers
- for(var i = 0; i < headersLength; i++)
- {
- pElement = pageDocument.createElement("p");
- pElement.appendChild(pageDocument.createTextNode(webdeveloper_getTableHeadingText(pageDocument.getElementById(headerList[i]), "")));
- definitionElement.appendChild(pElement);
- }
-
- // If the definition element has child nodes
- if(definitionElement.childNodes.length > 0)
- {
- var listElement = pageDocument.createElement("dl");
- var termElement = pageDocument.createElement("dt");
-
- divElement = pageDocument.createElement("div");
-
- termElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_headers")));
- listElement.appendChild(termElement);
- listElement.appendChild(definitionElement);
-
- divElement.setAttribute("class", "webdeveloper-table-information");
- divElement.appendChild(listElement);
- tableCellElement.appendChild(divElement);
- }
- }
-
- divElement = pageDocument.createElement("div");
-
- // If the table cell has a scope attribute
- if(tableCellElement.hasAttribute("scope"))
- {
- var scope = tableCellElement.getAttribute("scope");
-
- pElement = pageDocument.createElement("p");
-
- // If the scope is col
- if(scope == "col")
- {
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_tableInformationHeadingColumn")));
- }
- else if(scope == "colgroup")
- {
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_tableInformationHeadingColumnGroup")));
- }
- else if(scope == "row")
- {
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_tableInformationHeadingRow")));
- }
- else if(scope == "rowgroup")
- {
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_tableInformationHeadingRowGroup")));
- }
-
- divElement.appendChild(pElement);
- }
-
- // If the table cell has an abbr attribute
- if(tableCellElement.hasAttribute("abbr"))
- {
- pElement = pageDocument.createElement("p");
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_abbreviation") + "=" + tableCellElement.getAttribute("abbr")));
- divElement.appendChild(pElement);
- }
-
- // If the table cell has an axis attribute
- if(tableCellElement.hasAttribute("axis"))
- {
- pElement = pageDocument.createElement("p");
- pElement.appendChild(pageDocument.createTextNode(stringBundle.getString("webdeveloper_axis") + "=" + tableCellElement.getAttribute("axis")));
- divElement.appendChild(pElement);
- }
-
- // If the div element has child nodes
- if(divElement.childNodes.length > 0)
- {
- divElement.setAttribute("class", "webdeveloper-table-information");
- tableCellElement.appendChild(divElement);
- }
- }
-}
-
-// Sets the image file sizes for a list of images
-function webdeveloper_setImageFileSizes(imageList)
-{
- var image = null;
- var imageListLength = imageList.length;
- var newImageList = new Array();
-
- // Loop through the images
- for(var i = 0; i < imageListLength; i++)
- {
- image = imageList[i];
- image.fileSize = webdeveloper_getFileSize(image.src);
-
- newImageList.push(image);
- }
-
- return newImageList;
-}
-
-// Sets the script file sizes for a list of scripts
-function webdeveloper_setScriptFileSizes(scriptList)
-{
- var script = null;
- var scriptListLength = scriptList.length;
- var newScriptList = new Array();
-
- // Loop through the images
- for(var i = 0; i < scriptListLength; i++)
- {
- script = scriptList[i];
- script.fileSize = webdeveloper_getFileSize(script.src);
- script.uncompressedFileSize = webdeveloper_getUncompressedFileSize(script.src);
-
- newScriptList.push(script);
- }
-
- return newScriptList;
-}
-
-// Sets the style sheet file sizes for a list of style sheets
-function webdeveloper_setStyleSheetFileSizes(styleSheetList)
-{
- var styleSheet = null;
- var styleSheetListLength = styleSheetList.length;
- var newStyleSheetList = new Array();
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetListLength; i++)
- {
- styleSheet = styleSheetList[i];
- styleSheet.fileSize = webdeveloper_getFileSize(styleSheet.href);
- styleSheet.uncompressedFileSize = webdeveloper_getUncompressedFileSize(styleSheet.href);
-
- newStyleSheetList.push(styleSheet);
- }
-
- return newStyleSheetList;
-}
-
-// Sorts two anchors
-function webdeveloper_sortAnchors(anchorOne, anchorTwo)
-{
- // If both anchors are set
- if(anchorOne && anchorTwo)
- {
- var anchorOneLink = null;
- var anchorTwoLink = null;
-
- // If the first anchor has an id attribute
- if(anchorOne.hasAttribute("id"))
- {
- anchorOneLink = anchorOne.getAttribute("id");
- }
- else if(anchorOne.hasAttribute("name"))
- {
- anchorOneLink = anchorOne.getAttribute("name");
- }
-
- // If the second anchor has an id attribute
- if(anchorTwo.hasAttribute("id"))
- {
- anchorTwoLink = anchorTwo.getAttribute("id");
- }
- else if(anchorTwo.hasAttribute("name"))
- {
- anchorTwoLink = anchorTwo.getAttribute("name");
- }
-
- // If the anchor links are equal
- if(anchorOneLink == anchorTwoLink)
- {
- return 0;
- }
- else if(anchorOneLink < anchorTwoLink)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two documents
-function webdeveloper_sortDocuments(documentOne, documentTwo)
-{
- // If both documents are set
- if(documentOne && documentTwo)
- {
- var documentOneURL = documentOne.documentURI;
- var documentTwoURL = documentTwo.documentURI;
-
- // If the documents are equal
- if(documentOneURL == documentTwoURL)
- {
- return 0;
- }
- else if(documentOneURL < documentTwoURL)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two documents by file size
-function webdeveloper_sortDocumentsByFileSize(documentOne, documentTwo)
-{
- // If both documents and their URLs are set
- if(documentOne && documentTwo && documentOne.documentURI && documentTwo.documentURI)
- {
- var documentOneFileSize = webdeveloper_getFileSize(documentOne.documentURI);
- var documentTwoFileSize = webdeveloper_getFileSize(documentTwo.documentURI);
-
- // If the document file sizes are equal
- if(documentOneFileSize == documentTwoFileSize)
- {
- return webdeveloper_sortDocuments(documentOne, documentTwo);
- }
- else if(documentOneFileSize > documentTwoFileSize)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two images by file size
-function webdeveloper_sortImagesByFileSize(imageOne, imageTwo)
-{
- // If both images and their file sizes are set
- if(imageOne && imageTwo && imageOne.fileSize && imageTwo.fileSize)
- {
- var imageOneFileSize = imageOne.fileSize;
- var imageTwoFileSize = imageTwo.fileSize;
-
- // If the image file sizes are equal
- if(imageOneFileSize == imageTwoFileSize)
- {
- return webdeveloper_sortImages(imageOne, imageTwo);
- }
- else if(imageOneFileSize > imageTwoFileSize)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two links
-function webdeveloper_sortLinks(linkOne, linkTwo)
-{
- // If both links are set
- if(linkOne && linkTwo)
- {
- var linkOneHref = linkOne.href;
- var linkTwoHref = linkTwo.href;
-
- // If the links are equal
- if(linkOneHref == linkTwoHref)
- {
- return 0;
- }
- else if(linkOneHref < linkTwoHref)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two scripts
-function webdeveloper_sortScripts(scriptOne, scriptTwo)
-{
- // If both scripts and src are set
- if(scriptOne && scriptTwo && scriptOne.src && scriptTwo.src)
- {
- var scriptOneSrc = scriptOne.src;
- var scriptTwoSrc = scriptTwo.src;
-
- // If the scripts are equal
- if(scriptOneSrc == scriptTwoSrc)
- {
- return 0;
- }
- else if(scriptOneSrc < scriptTwoSrc)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two scripts by file size
-function webdeveloper_sortScriptsByFileSize(scriptOne, scriptTwo)
-{
- // If both scripts and src are set
- if(scriptOne && scriptTwo && scriptOne.src && scriptTwo.src)
- {
- var scriptOneFileSize = webdeveloper_getFileSize(scriptOne.src);
- var scriptTwoFileSize = webdeveloper_getFileSize(scriptTwo.src);
-
- // If the script file sizes are equal
- if(scriptOneFileSize == scriptTwoFileSize)
- {
- return webdeveloper_sortScripts(scriptOne, scriptTwo);
- }
- else if(scriptOneFileSize > scriptTwoFileSize)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two style sheets
-function webdeveloper_sortStyleSheets(styleSheetOne, styleSheetTwo)
-{
- // If both style sheets and href are set
- if(styleSheetOne && styleSheetTwo && styleSheetOne.href && styleSheetTwo.href)
- {
- var styleSheetOneSrc = styleSheetOne.href;
- var styleSheetTwoSrc = styleSheetTwo.href;
-
- // If the style sheets are equal
- if(styleSheetOneSrc == styleSheetTwoSrc)
- {
- return 0;
- }
- else if(styleSheetOneSrc < styleSheetTwoSrc)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Sorts two style sheets by file size
-function webdeveloper_sortStyleSheetsByFileSize(styleSheetOne, styleSheetTwo)
-{
- // If both style sheets and href are set
- if(styleSheetOne && styleSheetTwo && styleSheetOne.href && styleSheetTwo.href)
- {
- var styleSheetOneFileSize = webdeveloper_getFileSize(styleSheetOne.href);
- var styleSheetTwoFileSize = webdeveloper_getFileSize(styleSheetTwo.href);
-
- // If the style sheet file sizes are equal
- if(styleSheetOneFileSize == styleSheetTwoFileSize)
- {
- return webdeveloper_sortStyleSheets(styleSheetOne, styleSheetTwo);
- }
- else if(styleSheetOneFileSize > styleSheetTwoFileSize)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Filter for stack level tree walker
-function webdeveloper_stackLevelFilter(node)
-{
- // If the node has a class attribute and it starts with webdeveloper
- if(node && (!node.hasAttribute("class") || node.getAttribute("class").indexOf("webdeveloper-") != 0))
- {
- var zIndex = node.ownerDocument.defaultView.getComputedStyle(node, null).getPropertyCSSValue("z-index").cssText;
-
- // If the node has a z-index and it is not set to auto
- if(zIndex && zIndex != "auto")
- {
- return NodeFilter.FILTER_ACCEPT;
- }
- }
-
- return NodeFilter.FILTER_SKIP;
-}
-
-// Tidies a list of anchors by removing duplicates and sorting
-function webdeveloper_tidyAnchors(anchorList)
-{
- var anchor = null;
- var anchorLink = null;
- var anchorListLength = anchorList.length;
- var newAnchorList = new Array();
- var newAnchorListLength = null;
- var nextAnchor = null;
- var nextAnchorLink = null;
- var tidiedAnchorList = new Array();
-
- // Loop through the anchors
- for(var i = 0; i < anchorListLength; i++)
- {
- newAnchorList.push(anchorList[i]);
- }
-
- newAnchorList.sort(webdeveloper_sortAnchors);
-
- newAnchorListLength = newAnchorList.length;
-
- // Loop through the anchors
- for(i = 0; i < newAnchorListLength; i++)
- {
- anchor = newAnchorList[i];
-
- // If the anchor has an id attribute
- if(anchor.hasAttribute("id"))
- {
- anchorLink = anchor.getAttribute("id");
- }
- else
- {
- anchorLink = anchor.getAttribute("name");
- }
-
- // If this is not the last anchor
- if(i + 1 < newAnchorListLength)
- {
- nextAnchor = newAnchorList[i + 1];
-
- // If the next anchor has an id attribute
- if(nextAnchor.hasAttribute("id"))
- {
- nextAnchorLink = nextAnchor.getAttribute("id");
- }
- else
- {
- nextAnchorLink = nextAnchor.getAttribute("name");
- }
-
- // If the anchor link is the same as the next anchor link
- if(anchorLink == nextAnchorLink)
- {
- continue;
- }
- }
-
- tidiedAnchorList.push(anchor);
- }
-
- return tidiedAnchorList;
-}
-
-// Tidies a list of colors by removing duplicates and sorting
-function webdeveloper_tidyColors(colorList)
-{
- var color = null;
- var colorListLength = colorList.length;
- var newColorList = new Array();
- var newColorListLength = null;
- var tidiedColorList = new Array();
-
- // Loop through the colors
- for(var i = 0; i < colorListLength; i++)
- {
- newColorList.push(colorList[i]);
- }
-
- newColorList.sort();
-
- newColorListLength = newColorList.length;
-
- // Loop through the colors
- for(i = 0; i < newColorListLength; i++)
- {
- color = newColorList[i];
-
- // If this is not the last color and the color is the same as the next color
- if(i + 1 < newColorListLength && color == newColorList[i + 1])
- {
- continue;
- }
-
- tidiedColorList.push(color);
- }
-
- return tidiedColorList;
-}
-
-// Tidies a list of documents by removing duplicates and sorting
-function webdeveloper_tidyDocuments(documentList)
-{
- var documentListLength = documentList.length;
- var documentURL = null;
- var newDocumentList = new Array();
- var newDocumentListLength = null;
- var pageDocument = null;
- var tidiedDocumentList = new Array();
-
- // Loop through the documents
- for(var i = 0; i < documentListLength; i++)
- {
- newDocumentList.push(documentList[i]);
- }
-
- newDocumentList.sort(webdeveloper_sortDocuments);
-
- newDocumentListLength = newDocumentList.length;
-
- // Loop through the documents
- for(i = 0; i < newDocumentListLength; i++)
- {
- pageDocument = newDocumentList[i];
-
- // If this is not the last document and the document is the same as the next document
- if(i + 1 < newDocumentListLength && pageDocument.documentURI == newDocumentList[i + 1].documentURI)
- {
- continue;
- }
-
- tidiedDocumentList.push(pageDocument);
- }
-
- return tidiedDocumentList;
-}
-
-// Tidies a list of links by removing duplicates and sorting
-function webdeveloper_tidyLinks(linkList)
-{
- var link = null;
- var linkListLength = linkList.length;
- var newLinkList = new Array();
- var newLinkListLength = null;
- var tidiedLinkList = new Array();
-
- // Loop through the links
- for(var i = 0; i < linkListLength; i++)
- {
- link = linkList[i];
-
- // If this link is set
- if(link.href)
- {
- newLinkList.push(link);
- }
- }
-
- newLinkList.sort(webdeveloper_sortLinks);
-
- newLinkListLength = newLinkList.length;
-
- // Loop through the links
- for(i = 0; i < newLinkListLength; i++)
- {
- link = newLinkList[i];
-
- // If this is not the last link and the link is the same as the next link
- if(i + 1 < newLinkListLength && link.href == newLinkList[i + 1].href)
- {
- continue;
- }
-
- tidiedLinkList.push(link);
- }
-
- return tidiedLinkList;
-}
-
-// Tidies a list of scripts by removing duplicates and sorting
-function webdeveloper_tidyScripts(scriptList)
-{
- var script = null;
- var scriptListLength = scriptList.length;
- var newScriptList = new Array();
- var newScriptListLength = null;
- var tidiedScriptList = new Array();
-
- // Loop through the scripts
- for(var i = 0; i < scriptListLength; i++)
- {
- script = scriptList[i];
-
- // If this script and the src is set
- if(script && script.src)
- {
- newScriptList.push(script);
- }
- }
-
- newScriptList.sort(webdeveloper_sortScripts);
-
- newScriptListLength = newScriptList.length;
-
- // Loop through the scripts
- for(i = 0; i < newScriptListLength; i++)
- {
- script = newScriptList[i];
-
- // If this is not the last script and the script is the same as the next script
- if(i + 1 < newScriptListLength && script.src == newScriptList[i + 1].src)
- {
- continue;
- }
-
- tidiedScriptList.push(script);
- }
-
- return tidiedScriptList;
-}
-
-// Tidies a list of style sheets by removing duplicates and sorting
-function webdeveloper_tidyStyleSheets(styleSheetList)
-{
- var styleSheet = null;
- var styleSheetListLength = styleSheetList.length;
- var newStyleSheetList = new Array();
- var newStyleSheetListLength = null;
- var tidiedStyleSheetList = new Array();
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetListLength; i++)
- {
- styleSheet = styleSheetList[i];
-
- // If this style sheet and the href is set
- if(styleSheet && styleSheet.href)
- {
- newStyleSheetList.push(styleSheet);
- }
- }
-
- newStyleSheetList.sort(webdeveloper_sortStyleSheets);
-
- newStyleSheetListLength = newStyleSheetList.length;
-
- // Loop through the style sheets
- for(i = 0; i < newStyleSheetListLength; i++)
- {
- styleSheet = newStyleSheetList[i];
-
- // If this is not the last style sheet and the style sheet is the same as the next style sheet
- if(i + 1 < newStyleSheetListLength && styleSheet.href == newStyleSheetList[i + 1].href)
- {
- continue;
- }
-
- tidiedStyleSheetList.push(styleSheet);
- }
-
- return tidiedStyleSheetList;
-}
-
-// Updates the information menu
-function webdeveloper_updateInformationMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-abbreviations-" + suffix), "checked", "webdeveloper-display-abbreviations");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-access-keys-" + suffix), "checked", "webdeveloper-display-access-keys");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-anchors-" + suffix), "checked", "webdeveloper-display-anchors");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-block-size-" + suffix), "checked", "webdeveloper-display-block-size");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-div-order-" + suffix), "checked", "webdeveloper-display-div-order");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-element-information-" + suffix), "checked", "webdeveloper-display-element-information");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-id-class-details-" + suffix), "checked", "webdeveloper-display-id-class-details");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-link-details-" + suffix), "checked", "webdeveloper-display-link-details");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-object-information-" + suffix), "checked", "webdeveloper-display-object-information");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-stack-levels-" + suffix), "checked", "webdeveloper-display-stack-levels");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-tab-index-" + suffix), "checked", "webdeveloper-display-tab-index");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-table-depth-" + suffix), "checked", "webdeveloper-display-table-depth");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-table-information-" + suffix), "checked", "webdeveloper-display-table-information");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-title-attributes-" + suffix), "checked", "webdeveloper-display-title-attributes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-topographic-information-" + suffix), "checked", "webdeveloper-display-topographic-information");
-}
-
-// Displays all the anchors for the page
-function webdeveloper_viewAnchorInformation()
-{
- var anchor = null;
- var anchorLength = null;
- var anchorLink = null;
- var anchorList = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var linkElement = null;
- var linkHref = null;
- var linkLength = null;
- var listElement = null;
- var listItemElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_viewAnchorInformationTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- anchorList = webdeveloper_evaluateXPath(pageDocument, "//*[@id] | //a[@name]");
- documentURL = pageDocument.documentURI;
- spanElement = generatedDocument.createElement("span");
-
- // If the tidy information preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.information.tidy", true))
- {
- anchorList = webdeveloper_tidyAnchors(anchorList);
- }
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- anchorLength = anchorList.length;
-
- // If there are no anchors
- if(anchorLength == 0)
- {
- pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_noAnchors")));
- divElement.appendChild(pElement);
- }
- else
- {
- listElement = generatedDocument.createElement("ol");
-
- // Loop through the links
- for(var j = 0; j < anchorLength; j++)
- {
- anchor = anchorList[j];
-
- // If the anchor has an id attribute
- if(anchor.hasAttribute("id"))
- {
- anchorLink = "#" + anchor.getAttribute("id");
- }
- else
- {
- anchorLink = "#" + anchor.getAttribute("name");
- }
-
- linkElement = generatedDocument.createElement("a");
- listItemElement = generatedDocument.createElement("li");
-
- linkElement.setAttribute("href", documentURL + anchorLink);
- linkElement.appendChild(generatedDocument.createTextNode(anchorLink));
- listItemElement.appendChild(linkElement);
- listElement.appendChild(listItemElement);
- }
-
- divElement.appendChild(listElement);
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Displays all the colors on the page
-function webdeveloper_viewColorInformation()
-{
- var color = null;
- var colorList = null;
- var colorsLength = null;
- var definitionElement = null;
- var definitionListElement = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var element = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var linkElement = generatedDocument.createElement("link");
- var pageDocument = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var termElement = null;
- var title = document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_viewColorInformationTitle", [oldURL]);
- var treeWalker = null;
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- linkElement.setAttribute("href", "chrome://webdeveloper/content/stylesheets/generated/view_color_information.css");
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
- headElement.appendChild(linkElement);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- colorList = new Array();
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- spanElement = generatedDocument.createElement("span");
- treeWalker = pageDocument.createTreeWalker(webdeveloper_getDocumentBodyElement(pageDocument), NodeFilter.SHOW_ELEMENT, null, false);
-
- // Loop through the anchor elements
- while((element = treeWalker.nextNode()) != null)
- {
- webdeveloper_addColor(element, "background-color", colorList);
- webdeveloper_addColor(element, "border-bottom-color", colorList);
- webdeveloper_addColor(element, "border-left-color", colorList);
- webdeveloper_addColor(element, "border-right-color", colorList);
- webdeveloper_addColor(element, "border-top-color", colorList);
- webdeveloper_addColor(element, "color", colorList);
- }
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- colorList = webdeveloper_tidyColors(colorList);
- colorsLength = colorList.length;
-
- // Loop through the colors
- for(var j = 0; j < colorsLength; j++)
- {
- color = colorList[j];
- definitionElement = generatedDocument.createElement("dd");
- definitionListElement = generatedDocument.createElement("dl");
- termElement = generatedDocument.createElement("dt");
-
- termElement.appendChild(generatedDocument.createTextNode(color));
- definitionListElement.appendChild(termElement);
-
- definitionElement.setAttribute("style", "background-color: " + color);
- definitionListElement.appendChild(definitionElement);
- divElement.appendChild(definitionListElement);
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Displays an outline of the page
-function webdeveloper_viewDocumentOutline()
-{
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var headerElementList = null;
- var headerElementsLength = null;
- var headerLevel = null;
- var headerTagName = null;
- var headerText = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var linkElement = generatedDocument.createElement("link");
- var outlineElement = null;
- var pageDocument = null;
- var previousHeaderLevel = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_viewDocumentOutlineTitle", [oldURL]);
- var treeWalker = null;
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- linkElement.setAttribute("href", "chrome://webdeveloper/content/stylesheets/generated/view_document_outline.css");
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
- headElement.appendChild(linkElement);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- headerElementList = webdeveloper_evaluateXPath(pageDocument, "//h1 | //h2 | //h3 | //h4 | //h5 | //h6");
- headerElementsLength = headerElementList.length;
- previousHeaderLevel = 0;
- spanElement = generatedDocument.createElement("span");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // Loop through the heading elements
- for(var j = 0; j < headerElementsLength; j++)
- {
- headerElement = headerElementList[j];
- headerTagName = headerElement.tagName.toLowerCase();
- headerText = webdeveloper_getElementText(headerElement).trim();
- headerLevel = parseInt(headerTagName.substring(1));
-
- // Loop through any missing headers
- for(var k = previousHeaderLevel + 1; k < headerLevel; k++)
- {
- outlineElement = generatedDocument.createElement("h" + k);
-
- outlineElement.setAttribute("class", "webdeveloper-document-outline webdeveloper-document-outline-missing");
- outlineElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_viewDocumentOutlineMissingHeading")));
- divElement.appendChild(outlineElement);
- }
-
- // If there is no header text
- if(!headerText)
- {
- headerText = stringBundle.getString("webdeveloper_viewDocumentOutlineEmptyHeading");
- }
-
- outlineElement = generatedDocument.createElement(headerTagName);
-
- outlineElement.setAttribute("class", "webdeveloper-document-outline");
- outlineElement.appendChild(generatedDocument.createTextNode(headerText));
- divElement.appendChild(outlineElement);
-
- previousHeaderLevel = headerLevel;
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// View JavaScript
-function webdeveloper_viewJavaScript()
-{
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var linkElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var preElement = null;
- var scriptElement = null;
- var scriptLength = null;
- var scriptList = new Array();
- var scriptSource = null;
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_viewJavaScriptTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- scriptList = pageDocument.getElementsByTagName("script");
- scriptLength = scriptList.length;
-
- linkElement.setAttribute("href", pageDocument.documentURI);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // Loop through the scripts
- for(var j = 0; j < scriptLength; j++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h3");
- preElement = generatedDocument.createElement("pre");
- scriptElement = scriptList[j];
- scriptSource = scriptElement.src;
- spanElement = generatedDocument.createElement("span");
-
- // If the script is external
- if(scriptSource)
- {
- // If this is a not chrome script
- if(scriptSource.indexOf("chrome://") != 0)
- {
- linkElement = generatedDocument.createElement("a");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", scriptSource);
- linkElement.appendChild(generatedDocument.createTextNode(scriptSource));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- preElement.appendChild(generatedDocument.createTextNode(webdeveloper_retrieveSource(scriptSource).replace(new RegExp("\r", "gi"), "\n")));
- divElement.setAttribute("class", "output");
- divElement.appendChild(preElement);
- bodyElement.appendChild(divElement);
- }
- }
- else
- {
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- headerElement.appendChild(generatedDocument.createTextNode(stringBundle.getFormattedString("webdeveloper_inlineScript", [documentURL])));
- bodyElement.appendChild(headerElement);
-
- preElement.appendChild(generatedDocument.createTextNode(scriptElement.innerHTML));
- divElement.setAttribute("class", "output");
- divElement.appendChild(preElement);
- bodyElement.appendChild(divElement);
- }
- }
- }
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Displays all the links for the page
-function webdeveloper_viewLinkInformation()
-{
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var link = null;
- var linkElement = null;
- var linkHref = null;
- var linkLength = null;
- var links = null;
- var listElement = null;
- var listItemElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getFormattedString("webdeveloper_viewLinkInformationTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- links = pageDocument.links;
- spanElement = generatedDocument.createElement("span");
-
- // If the tidy information preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.information.tidy", true))
- {
- links = webdeveloper_tidyLinks(links);
- }
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- linkLength = links.length;
-
- // If there are no links
- if(linkLength == 0)
- {
- pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_noLinks")));
- divElement.appendChild(pElement);
- }
- else
- {
- listElement = generatedDocument.createElement("ol");
-
- // Loop through the links
- for(var j = 0; j < linkLength; j++)
- {
- link = links[j];
- linkHref = link.href;
-
- // If the link is set
- if(linkHref)
- {
- linkElement = generatedDocument.createElement("a");
- listItemElement = generatedDocument.createElement("li");
-
- linkElement.setAttribute("href", linkHref);
- linkElement.appendChild(generatedDocument.createTextNode(linkHref));
- listItemElement.appendChild(linkElement);
- listElement.appendChild(listItemElement);
- }
- }
-
- divElement.appendChild(listElement);
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Displays all the meta tags for the page
-function webdeveloper_viewMetaTagInformation()
-{
- var cellDataElement = null;
- var cellHeaderElement = null;
- var divElement = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var documentURL = null;
- var linkElement = null;
- var metaTag = null;
- var metaTags = null;
- var metaTagsLength = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var headerElement = generatedDocument.createElement("h1");
- var pageDocument = null;
- var pElement = null;
- var scriptElement = generatedDocument.createElement("script");
- var spanElement = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var tableElement = null;
- var tableRowElement = null;
- var title = stringBundle.getFormattedString("webdeveloper_viewMetaTagInformationTitle", [oldURL]);
-
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- webdeveloper_addGeneratedTools(generatedDocument);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- divElement = generatedDocument.createElement("div");
- headerElement = generatedDocument.createElement("h2");
- linkElement = generatedDocument.createElement("a");
- pageDocument = documentList[i];
- documentURL = pageDocument.documentURI;
- metaTags = pageDocument.getElementsByTagName("meta");
- metaTagsLength = metaTags.length;
- spanElement = generatedDocument.createElement("span");
-
- spanElement.setAttribute("class", "expanded pivot");
- headerElement.appendChild(spanElement);
- linkElement.setAttribute("href", documentURL);
- linkElement.appendChild(generatedDocument.createTextNode(documentURL));
- headerElement.appendChild(linkElement);
- bodyElement.appendChild(headerElement);
-
- // If there are no meta tags
- if(metaTagsLength == 0)
- {
- pElement = generatedDocument.createElement("p");
-
- pElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_noMetaTags")));
- divElement.appendChild(pElement);
- }
- else
- {
- tableElement = generatedDocument.createElement("table");
- tableRowElement = generatedDocument.createElement("tr");
-
- // Name heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_name")));
- tableRowElement.appendChild(cellHeaderElement);
-
- // Content heading
- cellHeaderElement = generatedDocument.createElement("th");
-
- cellHeaderElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_content")));
- tableRowElement.appendChild(cellHeaderElement);
- tableElement.appendChild(tableRowElement);
-
- // Loop through the meta tags
- for(var j = 0; j < metaTagsLength; j++)
- {
- metaTag = metaTags[j];
- tableRowElement = generatedDocument.createElement("tr");
-
- // If this is an even row
- if(j % 2 != 0)
- {
- tableRowElement.setAttribute("class", "shaded");
- }
-
- cellDataElement = generatedDocument.createElement("td");
-
- // If the meta tag has a name attribute
- if(metaTag.hasAttribute("name"))
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(metaTag.getAttribute("name")));
- }
- else if(metaTag.hasAttribute("http-equiv"))
- {
- cellDataElement.appendChild(generatedDocument.createTextNode(metaTag.getAttribute("http-equiv")));
- }
-
- tableRowElement.appendChild(cellDataElement);
-
- // Content
- cellDataElement = generatedDocument.createElement("td");
-
- cellDataElement.appendChild(generatedDocument.createTextNode(metaTag.getAttribute("content")));
- tableRowElement.appendChild(cellDataElement);
- tableElement.appendChild(tableRowElement);
- }
-
- tableElement.setAttribute("class", "sortable");
- divElement.appendChild(tableElement);
- }
-
- divElement.setAttribute("class", "output");
- bodyElement.appendChild(divElement);
- }
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/dom.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/common/xpath.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/output_pivot.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- scriptElement = generatedDocument.createElement("script");
-
- scriptElement.setAttribute("defer", "defer");
- scriptElement.setAttribute("src", "chrome://webdeveloper/content/generated/table_sort.js");
- scriptElement.setAttribute("type", "text/javascript");
- headElement.appendChild(scriptElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// View page information
-function webdeveloper_viewPageInformation(chromeLocation)
-{
- window.openDialog(chromeLocation, "webdeveloper-page-information-dialog", "chrome,dialog=no,resizable");
-}
-
-// View the response headers
-function webdeveloper_viewResponseHeaders()
-{
- var headerElement = null;
- var oldTab = getBrowser().selectedTab;
- var oldURL = getBrowser().currentURI.spec;
- var generatedDocument = webdeveloper_generateDocument("");
- var bodyElement = webdeveloper_getDocumentBodyElement(generatedDocument);
- var preElement = null;
- var request = new XMLHttpRequest();
- var responseHeaders = null;
- var title = document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_viewResponseHeadersTitle", [oldURL]);
-
- request.open("get", oldURL, false);
- request.send(null);
-
- responseHeaders = request.getAllResponseHeaders();
- generatedDocument.title = title;
-
- webdeveloper_addGeneratedStyles(generatedDocument);
-
- headerElement = generatedDocument.createElement("h1");
- headerElement.appendChild(generatedDocument.createTextNode(title));
- bodyElement.appendChild(headerElement);
-
- preElement = generatedDocument.createElement("pre");
- preElement.appendChild(generatedDocument.createTextNode(responseHeaders + "\n" + request.status + " " + request.statusText));
- bodyElement.appendChild(preElement);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-separator, #webdeveloper-message-dialog
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-#webdeveloper-message
-{
- font-weight: bold !important;
- padding-right: 35px !important;
-}
-
-#webdeveloper-message-details
-{
- background-color: #ffffff !important;
- color: #000000 !important;
- padding: 0.5em !important;
-}
-
-#webdeveloper-message-details box
-{
- background-image: url("chrome://webdeveloper/content/images/logo/large.png") !important;
- background-position: top right !important;
- background-repeat: no-repeat !important;
- min-height: 35px !important;
-}
-
-.url
-{
- color: #0000ff !important;
- cursor: pointer !important;
- text-decoration: underline !important;
-}
-.url:hover
-{
- color: #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-// Initializes the message dialog
-function webdeveloper_initializeMessage()
-{
- document.getElementById("webdeveloper-message").value = window.arguments[0];
-
- // If the second window argument is not set
- if(!window.arguments[1])
- {
- document.getElementById("webdeveloper-more-information").style.display = "none";
- }
-}
-
-// Loads the more information link in a new tab
-function webdeveloper_moreInformation()
-{
- var parentWindow = null;
-
- // If there is a parent window
- if(window.opener)
- {
- // If there is a grand parent window
- if(window.opener.opener)
- {
- parentWindow = window.opener.opener;
- }
- else
- {
- parentWindow = window.opener;
- }
- }
-
- // If a parent window was found
- if(parentWindow)
- {
- // If the open in windows preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true))
- {
- var newTab = parentWindow.getBrowser().addTab(window.arguments[1]);
-
- // If the open tabs in background preference is not set or is set to false
- if(!webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- parentWindow.getBrowser().selectedTab = newTab;
- }
- }
- else
- {
- parentWindow.open(window.arguments[1]);
- }
-
- window.close();
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/message/message.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept"
- id="webdeveloper-message-dialog"
- onload="webdeveloper_initializeMessage()"
- title="&webdeveloper.message.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/message/message.js"/>
-
- <vbox id="webdeveloper-message-details">
- <box>
- <description id="webdeveloper-message"/>
- </box>
- <description id="webdeveloper-more-information" value="&webdeveloper.more.information;" onclick="webdeveloper_moreInformation()" class="url"/>
- </vbox>
- <separator class="groove"/>
-</dialog>
\ No newline at end of file
+++ /dev/null
-// Clears all private data
-function webdeveloper_clearAllPrivateData()
-{
- // If the browser glue is found
- if(Components.classes["@mozilla.org/browser/browserglue;1"])
- {
- Components.classes["@mozilla.org/browser/browserglue;1"].getService(nsCI.nsIBrowserGlue).sanitize(window || null);
- }
- else
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_firefox15Required"));
- }
-}
-
-// Clears the cache
-function webdeveloper_clearCache()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the clearing is confirmed
- if(webdeveloper_clearConfirmation(stringBundle.getString("webdeveloper_clearCacheConfirmation")))
- {
- var cacheInterface = Components.interfaces.nsICache;
- var cacheService = Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService);
-
- try
- {
- cacheService.evictEntries(cacheInterface.STORE_ON_DISK);
- cacheService.evictEntries(cacheInterface.STORE_IN_MEMORY);
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- webdeveloper_informationalDialog(stringBundle.getString("webdeveloper_clearCache"), stringBundle.getString("webdeveloper_clearCacheResult"));
- }
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-}
-
-// Clears the history
-function webdeveloper_clearHistory()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the clearing is confirmed
- if(webdeveloper_clearConfirmation(stringBundle.getString("webdeveloper_clearHistoryConfirmation")))
- {
- webdeveloper_removeAllFromHistory();
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- webdeveloper_informationalDialog(stringBundle.getString("webdeveloper_clearHistory"), stringBundle.getString("webdeveloper_clearHistoryResult"));
- }
- }
-}
-
-// Clears the HTTP authentication
-function webdeveloper_clearHTTPAuthentication()
-{
- var authenticationManager = Components.classes["@mozilla.org/network/http-auth-manager;1"].getService(Components.interfaces.nsIHttpAuthManager);
-
- authenticationManager.clearAll();
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- webdeveloper_informationalDialog(stringBundle.getString("webdeveloper_clearHTTPAuthentication"), stringBundle.getString("webdeveloper_clearHTTPAuthenticationResult"));
- }
-}
-
-// Allows the user to edit the HTML of the current page
-function webdeveloper_editHTML()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var editHTML = stringBundle.getString("webdeveloper_editHTML");
-
- // If edit HTML is open in the dashboard
- if(webdeveloper_isOpenInDashboard(editHTML))
- {
- webdeveloper_closeInDashboard(editHTML);
- }
- else if(webdeveloper_pageHasFrames())
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", stringBundle.getString("webdeveloper_framesNotSupported"));
- }
- else
- {
- webdeveloper_openInDashboard(editHTML, "chrome://webdeveloper/content/dashboard/edit_html.xul");
- }
-}
-
-// Linearizes all elements
-function webdeveloper_linearizePage(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/linearize_page.css", "webdeveloper-linearize-page");
-}
-
-// Makes all the frames resizable
-function webdeveloper_makeFramesResizable()
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var frame = null;
- var framesList = null;
- var framesLength = null;
- var pageDocument = null;
- var resizableFrames = 0;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- framesList = pageDocument.getElementsByTagName("frame");
- framesLength = framesList.length;
-
- // Loop through all the frames
- for(var j = 0; j < framesLength; j++)
- {
- frame = framesList[j];
-
- // If the frame has a no resize attribute
- if(frame.hasAttribute("noresize"))
- {
- frame.removeAttribute("noresize");
- resizableFrames++;
- }
- }
- }
-
- // If the hide informational dialogs preference is not set
- if(!webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true))
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var title = stringBundle.getString("webdeveloper_makeFramesResizable");
-
- // If one frame was made resizable
- if(resizableFrames == 1)
- {
- webdeveloper_informationalDialog(title, stringBundle.getString("webdeveloper_makeFramesResizableSingleResult"));
- }
- else
- {
- webdeveloper_informationalDialog(title, stringBundle.getFormattedString("webdeveloper_makeFramesResizableMultipleResult", [resizableFrames]));
- }
- }
-}
-
-// Shows all hidden elements
-function webdeveloper_showHiddenElements()
-{
- var computedStyle = null;
- var display = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var element = null;
- var hiddenElements = new Array("area", "base", "basefont", "head", "meta", "param", "script", "style", "title");
- var pageDocument = null;
- var tagName = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- treeWalker = pageDocument.createTreeWalker(webdeveloper_getDocumentBodyElement(pageDocument), NodeFilter.SHOW_ELEMENT, null, false);
-
- // While the tree walker has more nodes
- while((element = treeWalker.nextNode()) != null)
- {
- computedStyle = element.ownerDocument.defaultView.getComputedStyle(element, null);
-
- // If the computed style is set
- if(computedStyle)
- {
- display = computedStyle.getPropertyCSSValue("display");
- tagName = element.tagName;
-
- // If this element has a display and tag name, the display is set to none and the tag name is not script
- if(display && tagName && display.cssText == "none" && !webdeveloper_contains(hiddenElements, tagName.toLowerCase()))
- {
- element.style.display = "";
- }
- }
- }
- }
-}
-
-// Shows the window chrome
-function webdeveloper_showWindowChrome()
-{
- var browserWindow = null;
- var windowEnumeration = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator("navigator:browser");
-
- // Loop through the open windows
- while(windowEnumeration.hasMoreElements())
- {
- browserWindow = windowEnumeration.getNext();
-
- browserWindow.locationbar.visible = true;
- browserWindow.menubar.visible = true;
- browserWindow.personalbar.visible = true;
- browserWindow.statusbar.visible = true;
- browserWindow.toolbar.visible = true;
- }
-}
-
-// Renders the page for a small screen
-function webdeveloper_smallScreenRendering(element)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var styleSheetList = new Array();
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- styleSheetList = styleSheetList.concat(webdeveloper_getStyleSheetsForDocument(documentList[i], false, false));
- }
-
- // If there is a handheld style sheet
- if(webdeveloper_hasStyleSheetForMedia(styleSheetList, "handheld"))
- {
- webdeveloper_displayCSSMediaType("handheld", !element.getAttribute("checked"));
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-small-screen-rendering");
- }
- else
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/small_screen_rendering.css", "webdeveloper-small-screen-rendering");
- }
-}
-
-// Toggles all links on the page between visited and unvisited
-function webdeveloper_toggleVisitedLinks(visited)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var href = null;
- var link = null;
- var linkLength = null;
- var linkList = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- linkList = pageDocument.links;
- linkLength = linkList.length;
-
- // Loop through all the links
- for(var j = 0; j < linkLength; j++)
- {
- link = linkList[j];
- href = link.href;
-
- // If this link has an href
- if(href)
- {
- // If marking links as visited
- if(visited)
- {
- webdeveloper_addToHistory(href);
- }
- else
- {
- webdeveloper_removeFromHistory(href);
- }
-
- // Force the browser to recheck the history by changing the href
- link.href = "";
- link.href = href;
- }
- }
- }
-}
-// Updates the clear private data menu
-function webdeveloper_updateClearPrivateDataMenu(suffix)
-{
- var menu = document.getElementById("webdeveloper-clear-all-private-data-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- // If the browser glue is not found
- if(!Components.classes["@mozilla.org/browser/browserglue;1"])
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
- }
-}
-
-// Updates the miscellaneous menu
-function webdeveloper_updateMiscellaneousMenu(suffix)
-{
- var menu = document.getElementById("webdeveloper-edit-html-" + suffix);
- var pageHasFrames = webdeveloper_pageHasFrames();
-
- // If the menu exists
- if(menu)
- {
- var editHTMLOpen = webdeveloper_isOpenInDashboard(document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_editHTML"));
-
- webdeveloper_configureElement(menu, "checked", editHTMLOpen);
-
- // If edit HTML is not open and the page has frames
- if(!editHTMLOpen && pageHasFrames)
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
- }
-
- menu = document.getElementById("webdeveloper-display-line-guides-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- // If the page has frames
- if(pageHasFrames)
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
- }
-
- menu = document.getElementById("webdeveloper-display-page-magnifier-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- var canvas = document.getElementById("webdeveloper-page-magnifier");
-
- // If the canvas is not set or has no context
- if(!canvas || !canvas.getContext)
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
- }
-
- menu = document.getElementById("webdeveloper-display-ruler-" + suffix);
-
- // If the menu exists
- if(menu)
- {
- // If the page has frames
- if(pageHasFrames)
- {
- menu.setAttribute("class", "menuitem-iconic");
- }
- else if(menu.hasAttribute("class"))
- {
- menu.removeAttribute("class");
- }
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-display-page-magnifier-" + suffix), "checked", !document.getElementById("webdeveloper-page-magnifier-toolbar").hidden);
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-line-guides-" + suffix), "checked", "webdeveloper-display-line-guides");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-ruler-" + suffix), "checked", "webdeveloper-display-ruler");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-linearize-page-" + suffix), "checked", "webdeveloper-linearize-page");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-show-comments-" + suffix), "checked", "webdeveloper-show-comments");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-small-screen-rendering-" + suffix), "checked", "webdeveloper-small-screen-rendering");
-}
+++ /dev/null
-// Clears the resize options
-function webdeveloper_clearResize()
-{
- window.opener.webdeveloper_resizeDescription = null;
- window.opener.webdeveloper_resizeHeight = null;
- window.opener.webdeveloper_resizeViewport = false;
- window.opener.webdeveloper_resizeWidth = null;
-}
-
-// Initializes the resize dialog box
-function webdeveloper_initializeResize()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the first argument equals add
- if(window.arguments[0] == "add")
- {
- document.title = stringBundle.getString("webdeveloper_addResize");
- }
- else
- {
- document.title = stringBundle.getString("webdeveloper_editResize");
-
- document.getElementById("webdeveloper.resize.description").value = window.arguments[1];
- document.getElementById("webdeveloper.resize.width").value = window.arguments[2];
- document.getElementById("webdeveloper.resize.height").value = window.arguments[3];
- document.getElementById("webdeveloper.resize.viewport").checked = window.arguments[4];
- }
-}
-
-// Saves the resize option
-function webdeveloper_saveResize()
-{
- var description = document.getElementById("webdeveloper.resize.description").value.trim();
- var errors = "";
- var height = document.getElementById("webdeveloper.resize.height").value.trim();
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var viewport = document.getElementById("webdeveloper.resize.viewport").checked;
- var width = document.getElementById("webdeveloper.resize.width").value.trim();
-
- // If the description is empty
- if(!description)
- {
- errors += stringBundle.getString("webdeveloper_emptyDescription") + "\n";
- }
-
- // If the width is empty or not a number or less than zero
- if(!width || parseInt(width) != width || width <= 0)
- {
- errors += stringBundle.getString("webdeveloper_invalidWidth") + "\n";
- }
-
- // If the height is empty or not a number or less than zero
- if(!height || parseInt(height) != height || height <= 0)
- {
- errors += stringBundle.getString("webdeveloper_invalidHeight") + "\n";
- }
-
- // If there are errors
- if(errors)
- {
- webdeveloper_error(errors.trim());
-
- return false;
- }
- else
- {
- window.opener.webdeveloper_resizeDescription = description;
- window.opener.webdeveloper_resizeHeight = height;
- window.opener.webdeveloper_resizeViewport = viewport;
- window.opener.webdeveloper_resizeWidth = width;
-
- return true;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-resize-dialog"
- ondialogaccept="return webdeveloper_saveResize()"
- ondialogcancel="webdeveloper_clearResize()"
- onload="webdeveloper_initializeResize()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/options/dialogs/resize.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <vbox>
- <grid>
- <columns>
- <column/>
- <column/>
- </columns>
- <rows>
- <row align="center">
- <label control="webdeveloper.resize.description" value="&webdeveloper.description.label;"/>
- <textbox id="webdeveloper.resize.description" size="50"/>
- </row>
- <row align="center">
- <label control="webdeveloper.resize.width" value="&webdeveloper.width.label;"/>
- <hbox>
- <textbox id="webdeveloper.resize.width" size="4"/>
- <spacer flex="1"/>
- </hbox>
- </row>
- <row align="center">
- <label control="webdeveloper.resize.height" value="&webdeveloper.height.label;"/>
- <hbox>
- <textbox id="webdeveloper.resize.height" size="4"/>
- <spacer flex="1"/>
- </hbox>
- </row>
- </rows>
- </grid>
- <checkbox id="webdeveloper.resize.viewport" label="&webdeveloper.resize.viewport.label;"/>
- </vbox>
-</dialog>
+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-hbox > label, row > label
-{
- margin-left: 0 !important;
-}
+++ /dev/null
-// Open a dialog to choose an application
-function webdeveloper_chooseApplication()
-{
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
-
- filePicker.init(window, document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_chooseApplication"), filePicker.modeOpen);
-
- // If the user selected an application
- if(filePicker.show() == filePicker.returnOK)
- {
- var applicationPath = filePicker.file.path;
- var executable = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- executable.initWithPath(applicationPath);
-
- // If the executable exists, is a file and is executable
- if(executable.exists() && executable.isFile() && executable.isExecutable())
- {
- document.getElementById("webdeveloper.tool.path").value = applicationPath;
- }
- else
- {
- webdeveloper_error(document.getElementById("webdeveloper-string-bundle").getFormattedString("webdeveloper_invalidApplication", [applicationPath]));
- }
- }
-}
-
-// Clears the tool
-function webdeveloper_clearTool()
-{
- window.opener.webdeveloper_toolDescription = null;
- window.opener.webdeveloper_toolKey = null;
- window.opener.webdeveloper_toolPath = null;
- window.opener.webdeveloper_toolURL = null;
-}
-
-// Initializes the tool dialog box
-function webdeveloper_initializeTool()
-{
- var modifiers = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If running on a Mac
- if(webdeveloper_isMac())
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiersMac");
- }
- else
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiers");
- }
-
- document.getElementById("webdeveloper-keyboard-shortcut-modifiers").value = modifiers;
-
- // If the first argument equals add
- if(window.arguments[0] == "add")
- {
- document.title = stringBundle.getString("webdeveloper_addTool");
- }
- else
- {
- document.title = stringBundle.getString("webdeveloper_editTool");
-
- document.getElementById("webdeveloper.tool.description").value = window.arguments[1];
- document.getElementById("webdeveloper.tool.key").value = window.arguments[2];
-
- // If the last argument equals the application tool type
- if(window.arguments[4] == stringBundle.getString("webdeveloper_application"))
- {
- document.getElementById("webdeveloper.tool.path").value = window.arguments[3];
- }
- else if(window.arguments[4] == stringBundle.getString("webdeveloper_bookmarklet"))
- {
- var bookmarkletRadio = document.getElementById("webdeveloper-bookmarklet-radio");
-
- document.getElementById("webdeveloper.tool.bookmarklet").value = window.arguments[3];
- bookmarkletRadio.radioGroup.selectedItem = bookmarkletRadio;
-
- document.getElementById("webdeveloper-application-options").setAttribute("hidden", true);
- document.getElementById("webdeveloper-bookmarklet-options").setAttribute("hidden", false);
- }
- else
- {
- var urlRadio = document.getElementById("webdeveloper-url-radio");
-
- document.getElementById("webdeveloper.tool.url").value = window.arguments[3];
- urlRadio.radioGroup.selectedItem = urlRadio;
-
- document.getElementById("webdeveloper-application-options").setAttribute("hidden", true);
- document.getElementById("webdeveloper-url-options").setAttribute("hidden", false);
- }
- }
-}
-
-// Saves the tool
-function webdeveloper_saveTool()
-{
- var bookmarklet = document.getElementById("webdeveloper.tool.bookmarklet").value.trim();
- var description = document.getElementById("webdeveloper.tool.description").value.trim();
- var errors = "";
- var key = document.getElementById("webdeveloper.tool.key").value.trim();
- var path = document.getElementById("webdeveloper.tool.path").value.trim();
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var url = document.getElementById("webdeveloper.tool.url").value.trim();
-
- // If the description is empty
- if(!description)
- {
- errors += stringBundle.getString("webdeveloper_emptyDescription") + "\n";
- }
-
- // If the application type is selected and the path is empty
- if(document.getElementById("webdeveloper-application-radio").selected && !path)
- {
- errors += stringBundle.getString("webdeveloper_applicationPath") + "\n";
- }
- /*else if(document.getElementById("webdeveloper-bookmarklet-radio").selected && !bookmarklet)
- {
- errors += stringBundle.getString("webdeveloper_emptyBookmarklet") + "\n";
- }*/
- else if(document.getElementById("webdeveloper-url-radio").selected && !url)
- {
- errors += stringBundle.getString("webdeveloper_emptyURL") + "\n";
- }
-
- // If there are errors
- if(errors)
- {
- webdeveloper_error(errors.trim());
-
- return false;
- }
- else
- {
- window.opener.webdeveloper_toolDescription = description;
- window.opener.webdeveloper_toolKey = key;
-
- // If the application type is selected
- if(document.getElementById("webdeveloper-application-radio").selected)
- {
- window.opener.webdeveloper_toolBookmarklet = null;
- window.opener.webdeveloper_toolPath = path;
- window.opener.webdeveloper_toolURL = null;
- }
- /*else if(document.getElementById("webdeveloper-bookmarklet-radio").selected)
- {
- window.opener.webdeveloper_toolBookmarklet = bookmarklet;
- window.opener.webdeveloper_toolPath = null;
- window.opener.webdeveloper_toolURL = null;
- }*/
- else
- {
- window.opener.webdeveloper_toolBookmarklet = null;
- window.opener.webdeveloper_toolPath = null;
- window.opener.webdeveloper_toolURL = url;
- }
-
- return true;
- }
-}
-
-// Toggles the tool type
-function webdeveloper_toggleToolType()
-{
- document.getElementById("webdeveloper-application-options").setAttribute("hidden", !document.getElementById("webdeveloper-application-radio").selected);
- /*document.getElementById("webdeveloper-bookmarklet-options").setAttribute("hidden", !document.getElementById("webdeveloper-bookmarklet-radio").selected);*/
- document.getElementById("webdeveloper-url-options").setAttribute("hidden", !document.getElementById("webdeveloper-url-radio").selected);
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/dialogs/tool.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-tool-dialog"
- ondialogaccept="return webdeveloper_saveTool()"
- ondialogcancel="webdeveloper_clearTool()"
- onload="webdeveloper_initializeTool()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/platform.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/options/dialogs/tool.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <vbox>
- <grid>
- <columns>
- <column/>
- <column/>
- </columns>
- <rows>
- <row align="center">
- <label control="webdeveloper.tool.description" value="&webdeveloper.description.label;"/>
- <textbox id="webdeveloper.tool.description" size="50"/>
- </row>
- <row align="center">
- <label control="webdeveloper.tool.key" value="&webdeveloper.keyboard.shortcut.label;"/>
- <hbox align="center">
- <description id="webdeveloper-keyboard-shortcut-modifiers"/>
- <textbox id="webdeveloper.tool.key" maxlength="1" size="1"/>
- <spacer flex="1"/>
- </hbox>
- </row>
- <row align="center">
- <description value="&webdeveloper.tool.type.label;"/>
- <radiogroup align="center" orient="horizontal">
- <radio id="webdeveloper-application-radio" selected="true" label="&webdeveloper.tool.application.label;" oncommand="webdeveloper_toggleToolType()"/>
- <!--radio id="webdeveloper-bookmarklet-radio" label="&webdeveloper.tool.bookmarklet.label;" oncommand="webdeveloper_toggleToolType()"/-->
- <radio id="webdeveloper-url-radio" label="&webdeveloper.tool.url.label;" oncommand="webdeveloper_toggleToolType()"/>
- </radiogroup>
- </row>
- </rows>
- </grid>
- <separator class="groove"/>
- <vbox id="webdeveloper-application-options">
- <description value="&webdeveloper.tool.application.description;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.tool.path"/>
- <button label="&webdeveloper.tool.application.choose.label;" oncommand="webdeveloper_chooseApplication()"/>
- </hbox>
- <separator/>
- </vbox>
- <vbox hidden="true" id="webdeveloper-bookmarklet-options">
- <description value="&webdeveloper.tool.bookmarklet.description;"/>
- <hbox align="center">
- <label control="webdeveloper.tool.bookmarklet" value="&webdeveloper.bookmarklet.label;"/>
- <textbox flex="1" id="webdeveloper.tool.bookmarklet"/>
- </hbox>
- </vbox>
- <vbox hidden="true" id="webdeveloper-url-options">
- <description value="&webdeveloper.tool.url.description;"/>
- <description value="&webdeveloper.tool.url.example;"/>
- <hbox align="center">
- <label control="webdeveloper.tool.url" value="&webdeveloper.url.label;"/>
- <textbox flex="1" id="webdeveloper.tool.url"/>
- </hbox>
- </vbox>
- </vbox>
-</dialog>
+++ /dev/null
-// Open a dialog to choose an application
-function webdeveloper_chooseApplication()
-{
- var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
-
- filePicker.init(window, document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_chooseApplication"), filePicker.modeOpen);
-
- // If the user selected an application
- if(filePicker.show() == filePicker.returnOK)
- {
- document.getElementById("webdeveloper.view.source.with.path").value = filePicker.file.path;
- }
-}
-
-// Clears the view source with option
-function webdeveloper_clearViewSourceWith()
-{
- window.opener.webdeveloper_viewSourceWithDescription = null;
- window.opener.webdeveloper_viewSourceWithKey = null;
- window.opener.webdeveloper_viewSourceWithPath = null;
-}
-
-// Initializes the view source with dialog box
-function webdeveloper_initializeViewSourceWith()
-{
- var modifiers = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If running on a Mac
- if(webdeveloper_isMac())
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiersMac");
- }
- else
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiers");
- }
-
- document.getElementById("webdeveloper-keyboard-shortcut-modifiers").value = modifiers;
-
- // If the first argument equals add
- if(window.arguments[0] == "add")
- {
- document.title = stringBundle.getString("webdeveloper_addViewSourceWith");
- }
- else
- {
- document.title = stringBundle.getString("webdeveloper_editViewSourceWith");
-
- document.getElementById("webdeveloper.view.source.with.description").value = window.arguments[1];
- document.getElementById("webdeveloper.view.source.with.path").value = window.arguments[2];
- document.getElementById("webdeveloper.view.source.with.key").value = window.arguments[3];
- }
-}
-
-// Saves the view source with option
-function webdeveloper_saveViewSourceWith()
-{
- var description = document.getElementById("webdeveloper.view.source.with.description").value.trim();
- var errors = "";
- var key = document.getElementById("webdeveloper.view.source.with.key").value.trim();
- var path = document.getElementById("webdeveloper.view.source.with.path").value.trim();
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the description is empty
- if(!description)
- {
- errors += stringBundle.getString("webdeveloper_emptyDescription") + "\n";
- }
-
- // If the path is empty
- if(!path)
- {
- errors += stringBundle.getString("webdeveloper_emptyPath") + "\n";
- }
-
- // If there are errors
- if(errors)
- {
- webdeveloper_error(errors.trim());
-
- return false;
- }
- else
- {
- window.opener.webdeveloper_viewSourceWithDescription = description;
- window.opener.webdeveloper_viewSourceWithKey = key;
- window.opener.webdeveloper_viewSourceWithPath = path;
-
- return true;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/dialogs.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-view-source-with-dialog"
- ondialogaccept="return webdeveloper_saveViewSourceWith()"
- ondialogcancel="webdeveloper_clearViewSourceWith()"
- onload="webdeveloper_initializeViewSourceWith()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/platform.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/options/dialogs/view_source_with.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <vbox>
- <grid>
- <columns>
- <column/>
- <column/>
- </columns>
- <rows>
- <row align="center">
- <label control="webdeveloper.view.source.with.description" value="&webdeveloper.description.label;"/>
- <textbox id="webdeveloper.view.source.with.description" size="50"/>
- </row>
- <row align="center">
- <label control="webdeveloper.view.source.with.path" value="&webdeveloper.application.label;"/>
- <hbox align="center">
- <textbox flex="1" id="webdeveloper.view.source.with.path"/>
- <button label="&webdeveloper.tool.application.choose.label;" oncommand="webdeveloper_chooseApplication()"/>
- </hbox>
- </row>
- <row align="center">
- <label control="webdeveloper.view.source.with.key" value="&webdeveloper.keyboard.shortcut.label;"/>
- <hbox align="center">
- <description id="webdeveloper-keyboard-shortcut-modifiers"/>
- <textbox id="webdeveloper.view.source.with.key" maxlength="1" size="1"/>
- <spacer flex="1"/>
- </hbox>
- </row>
- </rows>
- </grid>
- </vbox>
-</dialog>
+++ /dev/null
-@import url("chrome://global/skin/");
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-hbox > label
-{
- margin-left: 0 !important;
-}
-
-#webdeveloper-options-dialog
-{
- height: 40em !important;
- width: 60em !important;
-}
-
-#webdeveloper-options-page-list
-{
- width: 11em !important;
-}
-
-#webdeveloper-options-page-list listitem
-{
- padding: 0.25em !important;
-}
-
-spacer.large-spacer
-{
- width: 20px !important;
-}
-
-spacer.small-spacer
-{
- width: 10px !important;
-}
-
-.indent
-{
- margin-left: 25px !important;
-}
-
-.scroll
-{
- height: 25em !important;
- overflow: auto !important;
-}
+++ /dev/null
-var webdeveloper_optionsDataBoolean = new Array();
-var webdeveloper_optionsDataInteger = new Array();
-var webdeveloper_optionsDataString = new Array();
-var webdeveloper_resizeDescription = null;
-var webdeveloper_resizeHeight = null;
-var webdeveloper_resizeViewport = false;
-var webdeveloper_resizeWidth = null;
-var webdeveloper_toolBookmarklet = null;
-var webdeveloper_toolDescription = null;
-var webdeveloper_toolKey = null;
-var webdeveloper_toolPath = null;
-var webdeveloper_toolURL = null;
-var webdeveloper_viewSourceWithDescription = null;
-var webdeveloper_viewSourceWithKey = null;
-var webdeveloper_viewSourceWithPath = null;
-
-// Adds a resize option
-function webdeveloper_addResize()
-{
- window.openDialog("chrome://webdeveloper/content/options/dialogs/resize.xul", "webdeveloper-resize-dialog", "centerscreen,chrome,modal", "add");
-
- // If the description, height and width are set
- if(webdeveloper_resizeDescription && webdeveloper_resizeHeight && webdeveloper_resizeWidth)
- {
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var listCell = pageDocument.createElement("listcell");
- var listItem = pageDocument.createElement("listitem");
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- listCell.setAttribute("label", webdeveloper_resizeDescription);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_resizeWidth);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_resizeHeight);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If resizing the viewport
- if(webdeveloper_resizeViewport)
- {
- listCell.setAttribute("label", stringBundle.getString("webdeveloper_yes"));
- }
- else
- {
- listCell.setAttribute("label", stringBundle.getString("webdeveloper_no"));
- }
-
- listItem.appendChild(listCell);
-
- resizeBox.selectItem(resizeBox.appendChild(listItem));
- resizeBox.ensureElementIsVisible(resizeBox.selectedItem);
- }
-}
-
-// Adds a tool
-function webdeveloper_addTool()
-{
- window.openDialog("chrome://webdeveloper/content/options/dialogs/tool.xul", "webdeveloper-tool-dialog", "centerscreen,chrome,modal", "add");
-
- // If the description and the bookmarklet, path or URL are set
- if(webdeveloper_toolDescription && (webdeveloper_toolBookmarklet || webdeveloper_toolPath || webdeveloper_toolURL))
- {
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var listCell = pageDocument.createElement("listcell");
- var listItem = pageDocument.createElement("listitem");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
-
- listCell.setAttribute("label", webdeveloper_toolDescription);
-
- // If the bookmarklet is set
- if(webdeveloper_toolBookmarklet)
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_bookmarklet"));
- }
- else if(webdeveloper_toolPath)
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_application"));
- }
- else
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_url"));
- }
-
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the bookmarklet is set
- if(webdeveloper_toolBookmarklet)
- {
- listCell.setAttribute("label", webdeveloper_toolBookmarklet);
- }
- else if(webdeveloper_toolPath)
- {
- listCell.setAttribute("label", webdeveloper_toolPath);
- }
- else
- {
- listCell.setAttribute("label", webdeveloper_toolURL);
- }
-
- listCell.setAttribute("crop", "end");
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(webdeveloper_toolKey)
- {
- listCell.setAttribute("label", webdeveloper_toolKey);
- }
-
- listItem.appendChild(listCell);
-
- toolBox.selectItem(toolBox.appendChild(listItem));
- toolBox.ensureElementIsVisible(toolBox.selectedItem);
- }
-}
-
-// Adds a view source with option
-function webdeveloper_addViewSourceWith()
-{
- window.openDialog("chrome://webdeveloper/content/options/dialogs/view_source_with.xul", "webdeveloper-view-source-with-dialog", "centerscreen,chrome,modal", "add");
-
- // If the description and path are set
- if(webdeveloper_viewSourceWithDescription && webdeveloper_viewSourceWithPath)
- {
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var listCell = pageDocument.createElement("listcell");
- var listItem = pageDocument.createElement("listitem");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var viewSourceWithBox = pageDocument.getElementById("webdeveloper-listbox");
-
- listCell.setAttribute("label", webdeveloper_viewSourceWithDescription);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_viewSourceWithPath);
- listCell.setAttribute("crop", "end");
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(webdeveloper_viewSourceWithKey)
- {
- listCell.setAttribute("label", webdeveloper_viewSourceWithKey);
- }
-
- listItem.appendChild(listCell);
-
- viewSourceWithBox.selectItem(viewSourceWithBox.appendChild(listItem));
- viewSourceWithBox.ensureElementIsVisible(viewSourceWithBox.selectedItem);
- }
-}
-
-// Handles changing the options page
-function webdeveloper_changePage(pageList)
-{
- webdeveloper_storeOptions();
- webdeveloper_setIntegerPreference("webdeveloper.options.last.page", pageList.selectedIndex);
-
- document.getElementById("webdeveloper-options-iframe").setAttribute("src", pageList.selectedItem.value);
-}
-
-// Deletes a resize option
-function webdeveloper_deleteResize()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = resizeBox.selectedItem;
-
- // If an item is selected and the deletion is confirmed
- if(selectedItem && webdeveloper_deleteConfirmation(document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_resizeDeleteConfirmation")))
- {
- resizeBox.removeChild(selectedItem);
- }
-}
-
-// Deletes a tool
-function webdeveloper_deleteTool()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = toolBox.selectedItem;
-
- // If an item is selected and it is a separator or the deletion is confirmed
- if(selectedItem && (selectedItem.childNodes[0].tagName == "separator" || webdeveloper_deleteConfirmation(document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_toolDeleteConfirmation"))))
- {
- toolBox.removeChild(selectedItem);
- }
-}
-
-// Deletes a tool
-function webdeveloper_deleteViewSourceWith()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var viewSourceWithBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = viewSourceWithBox.selectedItem;
-
- // If an item is selected and the deletion is confirmed
- if(selectedItem && webdeveloper_deleteConfirmation(document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_viewSourceWithDeleteConfirmation")))
- {
- viewSourceWithBox.removeChild(selectedItem);
- }
-}
-
-// Edits a resize option
-function webdeveloper_editResize()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = resizeBox.selectedItem;
-
- // If an option is selected
- if(selectedItem)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var viewportValue = false;
-
- // If the viewport value is set to yes
- if(selectedItem.childNodes[3].getAttribute("label") == stringBundle.getString("webdeveloper_yes"))
- {
- viewportValue = true;
- }
-
- window.openDialog("chrome://webdeveloper/content/options/dialogs/resize.xul", "webdeveloper-resize-dialog", "centerscreen,chrome,modal", "edit", selectedItem.childNodes[0].getAttribute("label"), selectedItem.childNodes[1].getAttribute("label"), selectedItem.childNodes[2].getAttribute("label"), viewportValue);
-
- // If the description, height and width are set
- if(webdeveloper_resizeDescription && webdeveloper_resizeHeight && webdeveloper_resizeWidth)
- {
- var listCell = pageDocument.createElement("listcell");
-
- webdeveloper_removeAllChildElements(selectedItem);
-
- listCell.setAttribute("label", webdeveloper_resizeDescription);
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_resizeWidth);
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_resizeHeight);
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If resizing the viewport
- if(webdeveloper_resizeViewport)
- {
- listCell.setAttribute("label", stringBundle.getString("webdeveloper_yes"));
- }
- else
- {
- listCell.setAttribute("label", stringBundle.getString("webdeveloper_no"));
- }
-
- selectedItem.appendChild(listCell);
- resizeBox.ensureElementIsVisible(selectedItem);
- }
- }
-}
-
-// Edits a tool
-function webdeveloper_editTool()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = toolBox.selectedItem;
-
- // If an option is selected
- if(selectedItem)
- {
- var selectedCell = selectedItem.childNodes[0];
-
- // If this is not a separator
- if(selectedCell.tagName != "separator")
- {
- window.openDialog("chrome://webdeveloper/content/options/dialogs/tool.xul", "webdeveloper-tool-dialog", "centerscreen,chrome,modal", "edit", selectedCell.getAttribute("label"), selectedItem.childNodes[2].getAttribute("label"), selectedItem.childNodes[1].getAttribute("label"), selectedCell.getAttribute("type"));
-
- // If the description and the bookmarklet, path or URL are set
- if(webdeveloper_toolDescription && (webdeveloper_toolBookmarklet || webdeveloper_toolPath || webdeveloper_toolURL))
- {
- var listCell = pageDocument.createElement("listcell");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- webdeveloper_removeAllChildElements(selectedItem);
-
- listCell.setAttribute("label", webdeveloper_toolDescription);
-
- // If the bookmarklet is set
- if(webdeveloper_toolBookmarklet)
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_bookmarklet"));
- }
- else if(webdeveloper_toolPath)
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_application"));
- }
- else
- {
- listCell.setAttribute("type", stringBundle.getString("webdeveloper_url"));
- }
-
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the bookmarklet is set
- if(webdeveloper_toolBookmarklet)
- {
- listCell.setAttribute("label", webdeveloper_toolBookmarklet);
- }
- else if(webdeveloper_toolPath)
- {
- listCell.setAttribute("label", webdeveloper_toolPath);
- }
- else
- {
- listCell.setAttribute("label", webdeveloper_toolURL);
- }
-
- listCell.setAttribute("crop", "end");
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(webdeveloper_toolKey)
- {
- listCell.setAttribute("label", webdeveloper_toolKey);
- }
-
- selectedItem.appendChild(listCell);
- toolBox.ensureElementIsVisible(selectedItem);
- }
- }
- }
-}
-
-// Edits a view source with option
-function webdeveloper_editViewSourceWith()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var viewSourceWithBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = viewSourceWithBox.selectedItem;
-
- // If an option is selected
- if(selectedItem)
- {
- window.openDialog("chrome://webdeveloper/content/options/dialogs/view_source_with.xul", "webdeveloper-view-source-with-dialog", "centerscreen,chrome,modal", "edit", selectedItem.childNodes[0].getAttribute("label"), selectedItem.childNodes[1].getAttribute("label"), selectedItem.childNodes[2].getAttribute("label"));
-
- // If the description and path are set
- if(webdeveloper_viewSourceWithDescription && webdeveloper_viewSourceWithPath)
- {
- var listCell = pageDocument.createElement("listcell");
-
- webdeveloper_removeAllChildElements(selectedItem);
-
- listCell.setAttribute("label", webdeveloper_viewSourceWithDescription);
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", webdeveloper_viewSourceWithPath);
- listCell.setAttribute("crop", "end");
- selectedItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(webdeveloper_viewSourceWithKey)
- {
- listCell.setAttribute("label", webdeveloper_viewSourceWithKey);
- }
-
- selectedItem.appendChild(listCell);
- viewSourceWithBox.ensureElementIsVisible(selectedItem);
- }
- }
-}
-
-// Initializes the colors and fonts page
-function webdeveloper_initializeColorsAndFonts()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
-
- // If the generated content font size preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.generated.content.font.size"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.generated.content.font.size").value = webdeveloper_optionsDataInteger["webdeveloper.generated.content.font.size"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.generated.content.font.size"))
- {
- pageDocument.getElementById("webdeveloper.generated.content.font.size").value = webdeveloper_getIntegerPreference("webdeveloper.generated.content.font.size", true);
- }
-
- // If the feature tooltip text color is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.text"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.text").color = webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.text"].trim();
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.text"))
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.text").color = webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.text", true);
- }
-
- // If the feature tooltip background color is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.background"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.background").color = webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.background"].trim();
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.background"))
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.background").color = webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.background", true);
- }
-
- // If the feature tooltip border color is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.border"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.border").color = webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.border"].trim();
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.color.border"))
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.color.border").color = webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.border", true);
- }
-
- // If the feature tooltip opacity is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.feature.tooltip.opacity"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.opacity").value = webdeveloper_optionsDataString["webdeveloper.feature.tooltip.opacity"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.feature.tooltip.opacity"))
- {
- pageDocument.getElementById("webdeveloper.feature.tooltip.opacity").value = webdeveloper_getStringPreference("webdeveloper.feature.tooltip.opacity", true);
- }
-}
-
-// Initializes the dashboard page
-function webdeveloper_initializeDashboard()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
-
- // If the edit CSS text color is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.edit.color.text"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.edit.color.text").color = webdeveloper_optionsDataString["webdeveloper.edit.color.text"].trim();
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.text"))
- {
- pageDocument.getElementById("webdeveloper.edit.color.text").color = webdeveloper_getStringPreference("webdeveloper.edit.color.text", true);
- }
-
- // If the edit CSS background color is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.edit.color.background"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.edit.color.background").color = webdeveloper_optionsDataString["webdeveloper.edit.color.background"].trim();
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.edit.color.background"))
- {
- pageDocument.getElementById("webdeveloper.edit.color.background").color = webdeveloper_getStringPreference("webdeveloper.edit.color.background", true);
- }
-
- // If the edit CSS font preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.edit.font.size"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.edit.font.size").value = webdeveloper_optionsDataInteger["webdeveloper.edit.font.size"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.edit.font.size"))
- {
- pageDocument.getElementById("webdeveloper.edit.font.size").value = webdeveloper_getIntegerPreference("webdeveloper.edit.font.size", true);
- }
-
- // If the edit CSS update frequency preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.edit.update.frequency"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.edit.update.frequency").value = webdeveloper_optionsDataInteger["webdeveloper.edit.update.frequency"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.edit.update.frequency"))
- {
- pageDocument.getElementById("webdeveloper.edit.update.frequency").value = webdeveloper_getIntegerPreference("webdeveloper.edit.update.frequency", true);
- }
-
- // If the edit CSS wrap preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.edit.wrap"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.edit.wrap").checked = webdeveloper_optionsDataBoolean["webdeveloper.edit.wrap"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.edit.wrap"))
- {
- pageDocument.getElementById("webdeveloper.edit.wrap").checked = webdeveloper_getBooleanPreference("webdeveloper.edit.wrap", true);
- }
-
- // If the style information dashboard preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.style.information.dashboard"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.style.information.dashboard").checked = webdeveloper_optionsDataBoolean["webdeveloper.style.information.dashboard"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.style.information.dashboard"))
- {
- pageDocument.getElementById("webdeveloper.style.information.dashboard").checked = webdeveloper_getBooleanPreference("webdeveloper.style.information.dashboard", true);
- }
-
- // If the DOM Inspector dashboard preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.dom.inspector.dashboard"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.dom.inspector.dashboard").checked = webdeveloper_optionsDataBoolean["webdeveloper.dom.inspector.dashboard"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.dom.inspector.dashboard"))
- {
- pageDocument.getElementById("webdeveloper.dom.inspector.dashboard").checked = webdeveloper_getBooleanPreference("webdeveloper.dom.inspector.dashboard", true);
- }
-
- // If the error console dashboard preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.error.console.dashboard"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.error.console.dashboard").checked = webdeveloper_optionsDataBoolean["webdeveloper.error.console.dashboard"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.error.console.dashboard"))
- {
- pageDocument.getElementById("webdeveloper.error.console.dashboard").checked = webdeveloper_getBooleanPreference("webdeveloper.error.console.dashboard", true);
- }
-}
-
-// Initializes the general page
-function webdeveloper_initializeGeneral()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
-
- // If the hide menu preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.menu.hide"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.menu.hide").checked = webdeveloper_optionsDataBoolean["webdeveloper.menu.hide"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.menu.hide"))
- {
- pageDocument.getElementById("webdeveloper.menu.hide").checked = webdeveloper_getBooleanPreference("webdeveloper.menu.hide", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.menu.hide").checked = false;
- }
-
- // If the hide context menu preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.context.hide"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.context.hide").checked = webdeveloper_optionsDataBoolean["webdeveloper.context.hide"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.context.hide"))
- {
- pageDocument.getElementById("webdeveloper.context.hide").checked = webdeveloper_getBooleanPreference("webdeveloper.context.hide", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.context.hide").checked = false;
- }
-
- // If the hide confirmation dialogs preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.confirmation.dialogs.hide"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.confirmation.dialogs.hide").checked = webdeveloper_optionsDataBoolean["webdeveloper.confirmation.dialogs.hide"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.confirmation.dialogs.hide"))
- {
- pageDocument.getElementById("webdeveloper.confirmation.dialogs.hide").checked = webdeveloper_getBooleanPreference("webdeveloper.confirmation.dialogs.hide", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.confirmation.dialogs.hide").checked = false;
- }
-
- // If the hide informational dialogs preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.informational.dialogs.hide"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.informational.dialogs.hide").checked = webdeveloper_optionsDataBoolean["webdeveloper.informational.dialogs.hide"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.informational.dialogs.hide"))
- {
- pageDocument.getElementById("webdeveloper.informational.dialogs.hide").checked = webdeveloper_getBooleanPreference("webdeveloper.informational.dialogs.hide", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.informational.dialogs.hide").checked = false;
- }
-
- // If the toolbar icons preference is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.toolbar.icons"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.toolbar.icons").value = webdeveloper_optionsDataString["webdeveloper.toolbar.icons"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.toolbar.icons"))
- {
- pageDocument.getElementById("webdeveloper.toolbar.icons").value = webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.toolbar.icons").selectedIndex = 0;
- }
-
- // If the open tabs preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.open.tabs"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.open.tabs").checked = webdeveloper_optionsDataBoolean["webdeveloper.open.tabs"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.open.tabs"))
- {
- pageDocument.getElementById("webdeveloper.open.tabs").checked = webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true);
- }
-
- // If the open tabs background preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.open.tabs.background"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.open.tabs.background").checked = webdeveloper_optionsDataBoolean["webdeveloper.open.tabs.background"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.open.tabs.background"))
- {
- pageDocument.getElementById("webdeveloper.open.tabs.background").checked = webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.open.tabs.background").checked = false;
- }
-
- pageDocument.getElementById("webdeveloper.open.tabs.background").disabled = !pageDocument.getElementById("webdeveloper.open.tabs").checked;
-}
-
-// Initializes the keys page
-function webdeveloper_initializeKeys()
-{
- var mainDocument = null;
-
- // If there is a parent window
- if(window.opener)
- {
- // If there is a grand parent window
- if(window.opener.opener)
- {
- mainDocument = window.opener.opener.document;
- }
- else
- {
- mainDocument = window.opener.document;
- }
- }
- else
- {
- mainDocument = document;
- }
-
- // If a main document was found
- if(mainDocument)
- {
- var keySet = mainDocument.getElementById("mainKeyset");
-
- // If the key set was not found
- if(!keySet)
- {
- keySet = mainDocument.getElementById("navKeys");
- }
-
- // If the key set was found
- if(keySet)
- {
- var description = null;
- var horizontalBox = null;
- var id = null;
- var labelElement = null;
- var key = null;
- var keys = keySet.childNodes;
- var keysLength = keys.length;
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var row = null;
- var rows = pageDocument.getElementById("webdeveloper-key-rows");
- var spacer = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var modifiers = null;
- var textBox = null;
-
- // If running on a Mac
- if(webdeveloper_isMac())
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiersMac");
- }
- else
- {
- modifiers = stringBundle.getString("webdeveloper_keyboardShortcutModifiers");
- }
-
- // Loop through the keys
- for(var i = 0; i < keysLength; i++)
- {
- key = keys.item(i);
-
- // If the key has and id attribute starting with webdeveloper-
- if(key.hasAttribute("id") && key.getAttribute("id").indexOf("webdeveloper-") == 0)
- {
- description = pageDocument.createElement("description");
- horizontalBox = pageDocument.createElement("hbox");
- id = key.getAttribute("id").split("-").join(".");
- labelElement = pageDocument.createElement("label");
- row = pageDocument.createElement("row");
- textBox = pageDocument.createElement("textbox");
-
- labelElement.setAttribute("control", id);
- labelElement.setAttribute("value", key.getAttribute("label"));
- row.appendChild(labelElement);
-
- description.setAttribute("value", modifiers);
- horizontalBox.appendChild(description);
-
- // If the option is defined
- if(typeof webdeveloper_optionsDataString[id] != "undefined")
- {
- textBox.setAttribute("value", webdeveloper_optionsDataString[id].trim());
- }
- else if(webdeveloper_isPreferenceSet(id))
- {
- textBox.setAttribute("value", webdeveloper_getStringPreference(id, true));
- }
- else
- {
- textBox.setAttribute("value", key.getAttribute("key"));
- }
-
- textBox.setAttribute("id", id);
- textBox.setAttribute("size", "1");
- textBox.setAttribute("maxlength", "1");
- horizontalBox.appendChild(textBox);
-
- horizontalBox.setAttribute("align", "center");
- row.appendChild(horizontalBox);
-
- row.setAttribute("align", "center");
- rows.appendChild(row);
- }
- }
- }
- }
-}
-
-// Initializes the miscellaneous page
-function webdeveloper_initializeMiscellaneous()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
-
- // If the populate form fields email preference is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.populate.form.fields.email"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.populate.form.fields.email").value = webdeveloper_optionsDataString["webdeveloper.populate.form.fields.email"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.populate.form.fields.email"))
- {
- pageDocument.getElementById("webdeveloper.populate.form.fields.email").value = webdeveloper_getStringPreference("webdeveloper.populate.form.fields.email", true);
- }
-
- // If the tidy information preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.information.tidy"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.information.tidy").checked = webdeveloper_optionsDataBoolean["webdeveloper.information.tidy"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.information.tidy"))
- {
- pageDocument.getElementById("webdeveloper.information.tidy").checked = webdeveloper_getBooleanPreference("webdeveloper.information.tidy", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.information.tidy").checked = false;
- }
-
- // If the open CSS console error preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.open.css.console.error"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.open.css.console.error").checked = webdeveloper_optionsDataBoolean["webdeveloper.open.css.console.error"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.open.css.console.error"))
- {
- pageDocument.getElementById("webdeveloper.open.css.console.error").checked = webdeveloper_getBooleanPreference("webdeveloper.open.css.console.error", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.open.css.console.error").checked = false;
- }
-
- // If the open JavaScript console warning preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.warning"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.warning").checked = webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.warning"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.open.javascript.console.warning"))
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.warning").checked = webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.warning", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.warning").checked = false;
- }
-
- // If the open JavaScript console error preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.error"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.error").checked = webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.error"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.open.javascript.console.error"))
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.error").checked = webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.error", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.open.javascript.console.error").checked = false;
- }
-}
-
-// Initializes the options dialog
-function webdeveloper_initializeOptions(checkDialogParameters)
-{
- var pageList = document.getElementById("webdeveloper-options-page-list");
- var selectPage = 0;
-
- // If check dialog parameters and window arguments are set
- if(checkDialogParameters && window.arguments)
- {
- selectPage = webdeveloper_translatePageNameToIndex(window.arguments[0]);
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.options.last.page"))
- {
- selectPage = webdeveloper_getIntegerPreference("webdeveloper.options.last.page");
- }
-
- pageList.selectedIndex = selectPage;
-
- document.getElementById("webdeveloper-options-iframe").setAttribute("src", pageList.selectedItem.value);
-}
-
-// Initializes the resize page
-function webdeveloper_initializeResize()
-{
- var description = null;
- var descriptionValue = null;
- var height = null;
- var heightValue = null;
- var listCell = null;
- var listItem = null;
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var resizeCount = 0;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var no = stringBundle.getString("webdeveloper_no");
- var viewport = null;
- var viewportValue = false;
- var width = null;
- var widthValue = null;
- var yes = stringBundle.getString("webdeveloper_yes");
-
- // If the resize count preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.resize.count"] != "undefined")
- {
- resizeCount = webdeveloper_optionsDataInteger["webdeveloper.resize.count"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.resize.count"))
- {
- resizeCount = webdeveloper_getIntegerPreference("webdeveloper.resize.count", true);
- }
-
- // Loop through the possible resize options
- for(var i = 1; i <= resizeCount; i++)
- {
- description = "webdeveloper.resize." + i + ".description";
- height = "webdeveloper.resize." + i + ".height";
- viewport = "webdeveloper.resize." + i + ".viewport";
- width = "webdeveloper.resize." + i + ".width";
-
- // If the description is set
- if(typeof webdeveloper_optionsDataString[description] != "undefined")
- {
- descriptionValue = webdeveloper_optionsDataString[description].trim();
- }
- else if(webdeveloper_isPreferenceSet(description))
- {
- descriptionValue = webdeveloper_getStringPreference(description, true);
- }
- else
- {
- descriptionValue = null;
- }
-
- // If the width is set
- if(typeof webdeveloper_optionsDataInteger[width] != "undefined")
- {
- widthValue = webdeveloper_optionsDataInteger[width];
- }
- else if(webdeveloper_isPreferenceSet(width))
- {
- widthValue = webdeveloper_getIntegerPreference(width, true);
- }
- else
- {
- widthValue = null;
- }
-
- // If the height is set
- if(typeof webdeveloper_optionsDataInteger[height] != "undefined")
- {
- heightValue = webdeveloper_optionsDataInteger[height];
- }
- else if(webdeveloper_isPreferenceSet(height))
- {
- heightValue = webdeveloper_getIntegerPreference(height, true);
- }
- else
- {
- heightValue = null;
- }
-
- // If the viewport is set
- if(typeof webdeveloper_optionsDataBoolean[viewport] != "undefined")
- {
- viewportValue = webdeveloper_optionsDataBoolean[viewport];
- }
- else if(webdeveloper_isPreferenceSet(viewport))
- {
- viewportValue = webdeveloper_getBooleanPreference(viewport, true);
- }
- else
- {
- viewportValue = false;
- }
-
- // If the description, width and height are set
- if(descriptionValue && widthValue && heightValue)
- {
- listItem = pageDocument.createElement("listitem");
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", descriptionValue);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", widthValue);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", heightValue);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If resizing the viewport
- if(viewportValue)
- {
- listCell.setAttribute("label", yes);
- }
- else
- {
- listCell.setAttribute("label", no);
- }
-
- listItem.appendChild(listCell);
- resizeBox.appendChild(listItem);
- }
- }
-
- webdeveloper_listBoxSelected();
-}
-
-// Initializes the tools page
-function webdeveloper_initializeTools()
-{
- var bookmarklet = null;
- var bookmarkletValue = null;
- var description = null;
- var descriptionValue = null;
- var key = null;
- var keyValue = null;
- var listCell = null;
- var listItem = null;
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var path = null;
- var pathValue = null;
- var separator = null;
- var separatorValue = false;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var applicationType = stringBundle.getString("webdeveloper_application");
- var bookmarkletType = stringBundle.getString("webdeveloper_bookmarklet");
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
- var toolCount = 0;
- var url = null;
- var urlType = stringBundle.getString("webdeveloper_url");
- var urlValue = null;
-
- // If the tool count preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.tool.count"] != "undefined")
- {
- toolCount = webdeveloper_optionsDataInteger["webdeveloper.tool.count"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.tool.count"))
- {
- toolCount = webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
- }
-
- // Loop through the possible tools
- for(var i = 1; i <= toolCount; i++)
- {
- bookmarklet = "webdeveloper.tool." + i + ".bookmarklet";
- description = "webdeveloper.tool." + i + ".description";
- key = "webdeveloper.tool." + i + ".key";
- path = "webdeveloper.tool." + i + ".path";
- separator = "webdeveloper.tool." + i + ".separator";
- url = "webdeveloper.tool." + i + ".url";
-
- // If the bookmarklet is set
- if(typeof webdeveloper_optionsDataString[bookmarklet] != "undefined")
- {
- bookmarkletValue = webdeveloper_optionsDataString[bookmarklet].trim();
- }
- else if(webdeveloper_isPreferenceSet(bookmarklet))
- {
- bookmarkletValue = webdeveloper_getStringPreference(bookmarklet, true);
- }
- else
- {
- bookmarkletValue = null;
- }
-
- // If the description is set
- if(typeof webdeveloper_optionsDataString[description] != "undefined")
- {
- descriptionValue = webdeveloper_optionsDataString[description].trim();
- }
- else if(webdeveloper_isPreferenceSet(description))
- {
- descriptionValue = webdeveloper_getStringPreference(description, true);
- }
- else
- {
- descriptionValue = null;
- }
-
- // If the key is set
- if(typeof webdeveloper_optionsDataString[key] != "undefined")
- {
- keyValue = webdeveloper_optionsDataString[key].trim();
- }
- else if(webdeveloper_isPreferenceSet(key))
- {
- keyValue = webdeveloper_getStringPreference(key, true);
- }
- else
- {
- keyValue = null;
- }
-
- // If the path is set
- if(typeof webdeveloper_optionsDataString[path] != "undefined")
- {
- pathValue = webdeveloper_optionsDataString[path].trim();
- }
- else if(webdeveloper_isPreferenceSet(path))
- {
- pathValue = webdeveloper_getStringPreference(path, true);
- }
- else
- {
- pathValue = null;
- }
-
- // If the separator is set
- if(typeof webdeveloper_optionsDataBoolean[separator] != "undefined")
- {
- separatorValue = webdeveloper_optionsDataBoolean[separator];
- }
- else if(webdeveloper_isPreferenceSet(separator))
- {
- separatorValue = webdeveloper_getBooleanPreference(separator, true);
- }
- else
- {
- separatorValue = false;
- }
-
- // If the URL is set
- if(typeof webdeveloper_optionsDataString[url] != "undefined")
- {
- urlValue = webdeveloper_optionsDataString[url].trim();
- }
- else if(webdeveloper_isPreferenceSet(url))
- {
- urlValue = webdeveloper_getStringPreference(url, true);
- }
- else
- {
- urlValue = null;
- }
-
- // If the separator is set
- if(separatorValue)
- {
- listItem = pageDocument.createElement("listitem");
- separator = pageDocument.createElement("separator");
-
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- separator = pageDocument.createElement("separator");
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- separator = pageDocument.createElement("separator");
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- toolBox.appendChild(listItem);
- }
- else if(descriptionValue && (bookmarkletValue || pathValue || urlValue))
- {
- listItem = pageDocument.createElement("listitem");
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", descriptionValue);
-
- // If the bookmarklet is set
- if(bookmarkletValue)
- {
- listCell.setAttribute("type", bookmarkletType);
- }
- else if(pathValue)
- {
- listCell.setAttribute("type", applicationType);
- }
- else
- {
- listCell.setAttribute("type", urlType);
- }
-
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the bookmarklet is set
- if(bookmarkletValue)
- {
- listCell.setAttribute("label", bookmarkletValue);
- }
- else if(pathValue)
- {
- listCell.setAttribute("label", pathValue);
- }
- else
- {
- listCell.setAttribute("label", urlValue);
- }
-
- listCell.setAttribute("crop", "end");
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(keyValue)
- {
- listCell.setAttribute("label", keyValue);
- }
-
- listItem.appendChild(listCell);
- toolBox.appendChild(listItem);
- }
- }
-
- webdeveloper_listBoxSelected();
-}
-
-// Initializes the validation page
-function webdeveloper_initializeValidation()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var validateLocalCSSProfile = "css21";
- var validateLocalCSSProfileRadio = pageDocument.getElementById("webdeveloper-validate-local-css21-radio");
-
- // If the Section 508 preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.section508"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.section508").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.section508"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.section508"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.section508").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.section508", true);
- }
-
- // If the WAI priority 1 preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority1"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority1"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority1"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority1", true);
- }
-
- // If the WAI priority 2 preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority2"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority2"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority2"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority2", true);
- }
-
- // If the WAI priority 3 preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority3"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority3"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.accessibility.wai.priority3"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.accessibility.wai.priority3", true);
- }
-
- // If the CSS profile preference is set
- if(typeof webdeveloper_optionsDataString["webdeveloper.validate.local.css.profile"] != "undefined")
- {
- validateLocalCSSProfile = webdeveloper_optionsDataString["webdeveloper.validate.local.css.profile"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.css.profile"))
- {
- validateLocalCSSProfile = webdeveloper_getStringPreference("webdeveloper.validate.local.css.profile", true);
- }
-
- // If validate local CSS profile is set to CSS 3
- if(validateLocalCSSProfile == "css3")
- {
- validateLocalCSSProfileRadio = pageDocument.getElementById("webdeveloper-validate-local-css3-radio");
- }
-
- validateLocalCSSProfileRadio.radioGroup.selectedItem = validateLocalCSSProfileRadio;
-
- // If the show outline preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.outline"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.outline").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.outline"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.outline"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.outline").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.outline", true);
- }
-
- // If the show parse tree preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.parse.tree"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.parse.tree"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.parse.tree"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.parse.tree", true);
- }
-
- // If the show source preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.source"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.source").checked = webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.source"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.validate.local.html.show.source"))
- {
- pageDocument.getElementById("webdeveloper.validate.local.html.show.source").checked = webdeveloper_getBooleanPreference("webdeveloper.validate.local.html.show.source", true);
- }
-}
-
-// Initializes the view source page
-function webdeveloper_initializeViewSource()
-{
- var description = null;
- var descriptionValue = null;
- var key = null;
- var keyValue = null;
- var listCell = null;
- var listItem = null;
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var path = null;
- var pathValue = null;
- var viewSourceWithBox = pageDocument.getElementById("webdeveloper-listbox");
- var viewSourceWithCount = 0;
-
- // If the view source in tab preference is set
- if(typeof webdeveloper_optionsDataBoolean["webdeveloper.view.source.tab"] != "undefined")
- {
- pageDocument.getElementById("webdeveloper.view.source.tab").checked = webdeveloper_optionsDataBoolean["webdeveloper.view.source.tab"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.view.source.tab"))
- {
- pageDocument.getElementById("webdeveloper.view.source.tab").checked = webdeveloper_getBooleanPreference("webdeveloper.view.source.tab", true);
- }
- else
- {
- pageDocument.getElementById("webdeveloper.view.source.tab").checked = false;
- }
-
- // If the view source with count preference is set
- if(typeof webdeveloper_optionsDataInteger["webdeveloper.view.source.with.count"] != "undefined")
- {
- viewSourceWithCount = webdeveloper_optionsDataInteger["webdeveloper.view.source.with.count"];
- }
- else if(webdeveloper_isPreferenceSet("webdeveloper.view.source.with.count"))
- {
- viewSourceWithCount = webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
- }
-
- // Loop through the possible view source with options
- for(var i = 1; i <= viewSourceWithCount; i++)
- {
- description = "webdeveloper.view.source.with." + i + ".description";
- key = "webdeveloper.view.source.with." + i + ".key";
- path = "webdeveloper.view.source.with." + i + ".path";
-
- // If the description is set
- if(typeof webdeveloper_optionsDataString[description] != "undefined")
- {
- descriptionValue = webdeveloper_optionsDataString[description].trim();
- }
- else if(webdeveloper_isPreferenceSet(description))
- {
- descriptionValue = webdeveloper_getStringPreference(description, true);
- }
- else
- {
- descriptionValue = null;
- }
-
- // If the key is set
- if(typeof webdeveloper_optionsDataString[key] != "undefined")
- {
- keyValue = webdeveloper_optionsDataString[key].trim();
- }
- else if(webdeveloper_isPreferenceSet(key))
- {
- keyValue = webdeveloper_getStringPreference(key, true);
- }
- else
- {
- keyValue = null;
- }
-
- // If the path is set
- if(typeof webdeveloper_optionsDataString[path] != "undefined")
- {
- pathValue = webdeveloper_optionsDataString[path].trim();
- }
- else if(webdeveloper_isPreferenceSet(path))
- {
- pathValue = webdeveloper_getStringPreference(path, true);
- }
- else
- {
- pathValue = null;
- }
-
- // If the description and path are set
- if(descriptionValue && pathValue)
- {
- listItem = pageDocument.createElement("listitem");
- listCell = pageDocument.createElement("listcell");
-
- listCell.setAttribute("label", descriptionValue);
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
- listCell.setAttribute("label", pathValue);
- listCell.setAttribute("crop", "end");
- listItem.appendChild(listCell);
-
- listCell = pageDocument.createElement("listcell");
-
- // If the key is set
- if(keyValue)
- {
- listCell.setAttribute("label", keyValue);
- }
-
- listItem.appendChild(listCell);
- viewSourceWithBox.appendChild(listItem);
- }
- }
-
- webdeveloper_listBoxSelected();
-}
-
-// Called whenever a list box is selected
-function webdeveloper_listBoxSelected()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var deleteButton = pageDocument.getElementById("webdeveloper-delete");
- var editButton = pageDocument.getElementById("webdeveloper-edit");
- var listBox = pageDocument.getElementById("webdeveloper-listbox");
- var moveDownButton = pageDocument.getElementById("webdeveloper-move-down");
- var moveUpButton = pageDocument.getElementById("webdeveloper-move-up");
- var selectedIndex = listBox.selectedIndex;
-
- // If an item is selected
- if(listBox.selectedItem)
- {
- deleteButton.disabled = false;
- editButton.disabled = false;
-
- // If this is the first item
- if(selectedIndex == 0)
- {
- moveUpButton.disabled = true;
- }
- else
- {
- moveUpButton.disabled = false;
- }
-
- // If this is the last item
- if(selectedIndex == listBox.getRowCount() - 1)
- {
- moveDownButton.disabled = true;
- }
- else
- {
- moveDownButton.disabled = false;
- }
- }
- else
- {
- deleteButton.disabled = true;
- editButton.disabled = true;
- moveDownButton.disabled = true;
- moveUpButton.disabled = true;
- }
-}
-
-// Moves the selected item down
-function webdeveloper_moveDown()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = resizeBox.selectedItem;
-
- // If an item is selected and it is not at the bottom
- if(selectedItem && resizeBox.selectedIndex != resizeBox.getRowCount() - 1)
- {
- resizeBox.selectItem(resizeBox.insertBefore(selectedItem, resizeBox.getNextItem(selectedItem, 2)));
- }
-}
-
-// Moves the selected item up
-function webdeveloper_moveUp()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var selectedItem = resizeBox.selectedItem;
-
- // If an item is selected and it is not at the top
- if(selectedItem && resizeBox.selectedIndex != 0)
- {
- resizeBox.selectItem(resizeBox.insertBefore(selectedItem, resizeBox.getPreviousItem(selectedItem, 1)));
- }
-}
-
-// Adds a new separator
-function webdeveloper_newSeparator()
-{
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
- var listItem = pageDocument.createElement("listitem");
- var separator = pageDocument.createElement("separator");
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
-
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- separator = pageDocument.createElement("separator");
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- separator = pageDocument.createElement("separator");
- separator.setAttribute("class", "groove");
- listItem.appendChild(separator);
-
- toolBox.selectItem(toolBox.appendChild(listItem));
- toolBox.ensureElementIsVisible(toolBox.selectedItem);
-}
-
-// Resets the user's options
-function webdeveloper_resetOptions()
-{
- var promptServiceInterface = Components.interfaces.nsIPromptService;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the reset is confirmed
- if(Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(promptServiceInterface).confirmEx(null, stringBundle.getString("webdeveloper_resetConfirmation"), stringBundle.getString("webdeveloper_resetConfirmationMessage"), promptServiceInterface.BUTTON_TITLE_YES * promptServiceInterface.BUTTON_POS_0 + promptServiceInterface.BUTTON_TITLE_CANCEL * promptServiceInterface.BUTTON_POS_1, stringBundle.getString("webdeveloper_reset"), null, null, null, {}) == 0)
- {
- webdeveloper_optionsDataBoolean = new Array();
- webdeveloper_optionsDataInteger = new Array();
- webdeveloper_optionsDataString = new Array();
-
- webdeveloper_deletePreferenceBranch("webdeveloper.");
- webdeveloper_setStringPreference("webdeveloper.version", webdeveloper_parseVersion("1.1.4"));
-
- webdeveloper_configureKeyboardShortcuts(true);
- webdeveloper_setupDefaultOptions();
- webdeveloper_setupLocalizedOptions();
- webdeveloper_initializeOptions(false);
- }
-}
-
-// Saves the user's options
-function webdeveloper_saveOptions()
-{
- var parentWindow = null;
- var option = null;
- var optionValue = null;
-
- // Make sure current page is stored
- webdeveloper_storeOptions();
-
- // Loop through the boolean options
- for(option in webdeveloper_optionsDataBoolean)
- {
- webdeveloper_setBooleanPreference(option, webdeveloper_optionsDataBoolean[option]);
- }
-
- // Loop through the integer options
- for(option in webdeveloper_optionsDataInteger)
- {
- optionValue = webdeveloper_optionsDataInteger[option];
-
- // If the option value is set
- if(optionValue)
- {
- webdeveloper_setIntegerPreference(option, optionValue);
- }
- else if(webdeveloper_isPreferenceSet(option))
- {
- webdeveloper_deletePreference(option);
- }
- }
-
- // Loop through the string options
- for(option in webdeveloper_optionsDataString)
- {
- optionValue = webdeveloper_optionsDataString[option];
-
- // If the option value is set or the preference currently has a value
- if(optionValue || webdeveloper_isPreferenceSet(option))
- {
- webdeveloper_setStringPreference(option, optionValue);
- }
- }
-
- webdeveloper_changeOptions();
- webdeveloper_configureKeyboardShortcuts(false);
-}
-
-// Stores the user's options to be saved later
-function webdeveloper_storeOptions()
-{
- var childNodes = null;
- var description = null;
- var i = 0;
- var iFrame = document.getElementById("webdeveloper-options-iframe");
- var iFrameSrc = iFrame.getAttribute("src");
- var key = null;
- var listCell = null;
- var listItem = null;
- var pageDocument = iFrame.contentDocument;
- var path = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If this is the colors page
- if(iFrameSrc.indexOf("colors_fonts") != -1)
- {
- webdeveloper_optionsDataInteger["webdeveloper.generated.content.font.size"] = pageDocument.getElementById("webdeveloper.generated.content.font.size").value;
- webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.background"] = pageDocument.getElementById("webdeveloper.feature.tooltip.color.background").color;
- webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.border"] = pageDocument.getElementById("webdeveloper.feature.tooltip.color.border").color;
- webdeveloper_optionsDataString["webdeveloper.feature.tooltip.color.text"] = pageDocument.getElementById("webdeveloper.feature.tooltip.color.text").color;
- webdeveloper_optionsDataString["webdeveloper.feature.tooltip.opacity"] = pageDocument.getElementById("webdeveloper.feature.tooltip.opacity").value;
- }
- else if(iFrameSrc.indexOf("dashboard") != -1)
- {
- var updateFrequency = pageDocument.getElementById("webdeveloper.edit.update.frequency").value;
-
- webdeveloper_optionsDataBoolean["webdeveloper.dom.inspector.dashboard"] = pageDocument.getElementById("webdeveloper.dom.inspector.dashboard").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.edit.wrap"] = pageDocument.getElementById("webdeveloper.edit.wrap").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.error.console.dashboard"] = pageDocument.getElementById("webdeveloper.error.console.dashboard").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.style.information.dashboard"] = pageDocument.getElementById("webdeveloper.style.information.dashboard").checked;
- webdeveloper_optionsDataInteger["webdeveloper.edit.font.size"] = pageDocument.getElementById("webdeveloper.edit.font.size").value;
- webdeveloper_optionsDataString["webdeveloper.edit.color.background"] = pageDocument.getElementById("webdeveloper.edit.color.background").color;
- webdeveloper_optionsDataString["webdeveloper.edit.color.text"] = pageDocument.getElementById("webdeveloper.edit.color.text").color;
-
- // If the update frequency is set and is a valid integer and is positive
- if(updateFrequency && parseInt(updateFrequency) == updateFrequency && updateFrequency >= 0)
- {
- webdeveloper_optionsDataInteger["webdeveloper.edit.update.frequency"] = updateFrequency;
- }
- else
- {
- webdeveloper_optionsDataInteger["webdeveloper.edit.update.frequency"] = 0;
- }
- }
- else if(iFrameSrc.indexOf("general") != -1)
- {
- webdeveloper_optionsDataBoolean["webdeveloper.context.hide"] = pageDocument.getElementById("webdeveloper.context.hide").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.confirmation.dialogs.hide"] = pageDocument.getElementById("webdeveloper.confirmation.dialogs.hide").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.informational.dialogs.hide"] = pageDocument.getElementById("webdeveloper.informational.dialogs.hide").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.menu.hide"] = pageDocument.getElementById("webdeveloper.menu.hide").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.open.tabs"] = pageDocument.getElementById("webdeveloper.open.tabs").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.open.tabs.background"] = pageDocument.getElementById("webdeveloper.open.tabs.background").checked;
- webdeveloper_optionsDataString["webdeveloper.toolbar.icons"] = pageDocument.getElementById("webdeveloper.toolbar.icons").value;
- }
- else if(iFrameSrc.indexOf("keys") != -1)
- {
- var textBox = null;
- var textBoxes = pageDocument.getElementById("webdeveloper-key-rows").getElementsByTagName("textbox");
- var textBoxesLength = textBoxes.length;
-
- // Loop through the text boxes
- for(i = 0; i < textBoxesLength; i++)
- {
- textBox = textBoxes.item(i);
-
- webdeveloper_optionsDataString[textBox.getAttribute("id")] = textBox.value.trim();
- }
- }
- else if(iFrameSrc.indexOf("miscellaneous") != -1)
- {
- webdeveloper_optionsDataBoolean["webdeveloper.information.tidy"] = pageDocument.getElementById("webdeveloper.information.tidy").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.open.css.console.error"] = pageDocument.getElementById("webdeveloper.open.css.console.error").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.warning"] = pageDocument.getElementById("webdeveloper.open.javascript.console.warning").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.open.javascript.console.error"] = pageDocument.getElementById("webdeveloper.open.javascript.console.error").checked;
- webdeveloper_optionsDataString["webdeveloper.populate.form.fields.email"] = pageDocument.getElementById("webdeveloper.populate.form.fields.email").value;
- }
- else if(iFrameSrc.indexOf("resize") != -1)
- {
- var height = null;
- var resizeBox = pageDocument.getElementById("webdeveloper-listbox");
- var resizeCount = webdeveloper_getIntegerPreference("webdeveloper.resize.count", true);
- var viewport = null;
- var viewportValue = false;
- var width = null;
- var yes = stringBundle.getString("webdeveloper_yes");
-
- // Loop through the previous resize options
- for(i = 1; i <= resizeCount; i++)
- {
- description = "webdeveloper.resize." + i + ".description";
- height = "webdeveloper.resize." + i + ".height";
- width = "webdeveloper.resize." + i + ".width";
-
- webdeveloper_optionsDataInteger[height] = "";
- webdeveloper_optionsDataInteger[width] = "";
- webdeveloper_optionsDataString[description] = "";
- }
-
- resizeCount = resizeBox.getRowCount();
-
- // Loop through the possible resize options
- for(i = 1; i <= resizeCount; i++)
- {
- description = "webdeveloper.resize." + i + ".description";
- height = "webdeveloper.resize." + i + ".height";
- listItem = resizeBox.getItemAtIndex(i - 1);
- childNodes = listItem.childNodes;
- viewport = "webdeveloper.resize." + i + ".viewport";
- viewportValue = false;
- width = "webdeveloper.resize." + i + ".width";
-
- // If the viewport label is set to yes
- if(listItem.childNodes[3].getAttribute("label") == yes)
- {
- viewportValue = true;
- }
-
- webdeveloper_optionsDataBoolean[viewport] = viewportValue;
- webdeveloper_optionsDataInteger[width] = listItem.childNodes[1].getAttribute("label");
- webdeveloper_optionsDataInteger[height] = listItem.childNodes[2].getAttribute("label");
- webdeveloper_optionsDataString[description] = listItem.childNodes[0].getAttribute("label").trim();
- }
-
- webdeveloper_optionsDataInteger["webdeveloper.resize.count"] = resizeCount;
- }
- else if(iFrameSrc.indexOf("tools") != -1)
- {
- var applicationType = stringBundle.getString("webdeveloper_application");
- var bookmarklet = null;
- var bookmarkletType = stringBundle.getString("webdeveloper_bookmarklet");
- var separator = null;
- var toolBox = pageDocument.getElementById("webdeveloper-listbox");
- var toolCount = toolBox.getRowCount();
- var toolPreviousCount = webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
- var url = null;
-
- // Loop through the previous tools
- for(i = 1; i <= toolCount || i <= toolPreviousCount; i++)
- {
- bookmarklet = "webdeveloper.tool." + i + ".bookmarklet";
- description = "webdeveloper.tool." + i + ".description";
- key = "webdeveloper.tool." + i + ".key";
- path = "webdeveloper.tool." + i + ".path";
- separator = "webdeveloper.tool." + i + ".separator";
- url = "webdeveloper.tool." + i + ".url";
-
- webdeveloper_optionsDataBoolean[separator] = false;
- webdeveloper_optionsDataString[bookmarklet] = "";
- webdeveloper_optionsDataString[description] = "";
- webdeveloper_optionsDataString[key] = "";
- webdeveloper_optionsDataString[path] = "";
- webdeveloper_optionsDataString[url] = "";
- }
-
- // Loop through the possible tools
- for(i = 1; i <= toolCount; i++)
- {
- bookmarklet = "webdeveloper.tool." + i + ".bookmarklet";
- description = "webdeveloper.tool." + i + ".description";
- listItem = toolBox.getItemAtIndex(i - 1);
- childNodes = listItem.childNodes;
- listCell = listItem.childNodes[0];
- key = "webdeveloper.tool." + i + ".key";
- path = "webdeveloper.tool." + i + ".path";
- separator = "webdeveloper.tool." + i + ".separator";
- url = "webdeveloper.tool." + i + ".url";
-
- // If the first cell is a separator
- if(listCell.tagName == "separator")
- {
- webdeveloper_optionsDataBoolean[separator] = true;
- }
- else
- {
- webdeveloper_optionsDataString[description] = listCell.getAttribute("label").trim();
- webdeveloper_optionsDataString[key] = listItem.childNodes[2].getAttribute("label").trim();
-
- // If the tool type equals application
- if(listCell.getAttribute("type") == applicationType)
- {
- webdeveloper_optionsDataString[path] = listItem.childNodes[1].getAttribute("label").trim();
- }
- else if(listCell.getAttribute("type") == bookmarkletType)
- {
- webdeveloper_optionsDataString[bookmarklet] = listItem.childNodes[1].getAttribute("label").trim();
- }
- else
- {
- webdeveloper_optionsDataString[url] = listItem.childNodes[1].getAttribute("label").trim();
- }
- }
- }
-
- webdeveloper_optionsDataInteger["webdeveloper.tool.count"] = toolCount;
- }
- else if(iFrameSrc.indexOf("validation") != -1)
- {
- var validateLocalCSSProfile = "css21";
-
- // If the validate local CSS 3 radio button is selected
- if(pageDocument.getElementById("webdeveloper-validate-local-css3-radio").selected)
- {
- validateLocalCSSProfile = "css3";
- }
-
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.section508"] = pageDocument.getElementById("webdeveloper.validate.local.accessibility.section508").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority1"] = pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority1").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority2"] = pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority2").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.accessibility.wai.priority3"] = pageDocument.getElementById("webdeveloper.validate.local.accessibility.wai.priority3").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.outline"] = pageDocument.getElementById("webdeveloper.validate.local.html.show.outline").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.parse.tree"] = pageDocument.getElementById("webdeveloper.validate.local.html.show.parse.tree").checked;
- webdeveloper_optionsDataBoolean["webdeveloper.validate.local.html.show.source"] = pageDocument.getElementById("webdeveloper.validate.local.html.show.source").checked;
- webdeveloper_optionsDataString["webdeveloper.validate.local.css.profile"] = validateLocalCSSProfile;
- }
- else if(iFrameSrc.indexOf("view_source") != -1)
- {
- var viewSourceWithBox = pageDocument.getElementById("webdeveloper-listbox");
- var viewSourceWithCount = viewSourceWithBox.getRowCount();
- var viewSourceWithPreviousCount = webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
-
- // Loop through the previous view source with options
- for(i = 1; i <= viewSourceWithCount || i <= viewSourceWithPreviousCount; i++)
- {
- description = "webdeveloper.view.source.with." + i + ".description";
- key = "webdeveloper.view.source.with." + i + ".key";
- path = "webdeveloper.view.source.with." + i + ".path";
-
- webdeveloper_optionsDataString[description] = "";
- webdeveloper_optionsDataString[key] = "";
- webdeveloper_optionsDataString[path] = "";
- }
-
- // Loop through the possible view source with options
- for(i = 1; i <= viewSourceWithCount; i++)
- {
- description = "webdeveloper.view.source.with." + i + ".description";
- listItem = viewSourceWithBox.getItemAtIndex(i - 1);
- childNodes = listItem.childNodes;
- key = "webdeveloper.view.source.with." + i + ".key";
- path = "webdeveloper.view.source.with." + i + ".path";
-
- webdeveloper_optionsDataString[description] = listItem.childNodes[0].getAttribute("label").trim();
- webdeveloper_optionsDataString[key] = listItem.childNodes[2].getAttribute("label").trim();
- webdeveloper_optionsDataString[path] = listItem.childNodes[1].getAttribute("label").trim();
- }
-
- webdeveloper_optionsDataBoolean["webdeveloper.view.source.tab"] = pageDocument.getElementById("webdeveloper.view.source.tab").checked;
- webdeveloper_optionsDataInteger["webdeveloper.view.source.with.count"] = viewSourceWithCount;
- }
-}
-
-// Returns the index of the given page name
-function webdeveloper_translatePageNameToIndex(pageName)
-{
- // If the page name is set
- if(pageName)
- {
- // Switch on the page name
- switch(pageName)
- {
- case "general":
- return 0;
- case "colors-fonts":
- return 1;
- case "dashboard":
- return 2;
- case "keys":
- return 3;
- case "miscellaneous":
- return 4;
- case "resize":
- return 5;
- case "tools":
- return 6;
- case "validation":
- return 7;
- case "view-source":
- return 8;
- default:
- return 0;
- }
- }
-
- return 0;
-}
-
-// Updates the tab option status
-function webdeveloper_updateTabOptionStatus()
-{
- var disabled = true;
- var pageDocument = document.getElementById("webdeveloper-options-iframe").contentDocument;
-
- // If open tabs is checked
- if(pageDocument.getElementById("webdeveloper.open.tabs").checked)
- {
- disabled = false;
- }
-
- pageDocument.getElementById("webdeveloper.open.tabs.background").disabled = disabled;
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<dialog buttons="accept, cancel"
- id="webdeveloper-options-dialog"
- ondialogaccept="webdeveloper_saveOptions()"
- onload="webdeveloper_initializeOptions(true)"
- title="&webdeveloper.options.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/dom.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/platform.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/options/options.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/upgrade.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/webdeveloper.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <hbox flex="1">
- <listbox id="webdeveloper-options-page-list" onselect="webdeveloper_changePage(this)">
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/general.png" label="&webdeveloper.options.general.label;" selected="true" value="chrome://webdeveloper/content/options/pages/general.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/colors-fonts.png" label="&webdeveloper.options.colors.fonts.label;" value="chrome://webdeveloper/content/options/pages/colors_fonts.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/dashboard.png" label="&webdeveloper.options.dashboard.label;" value="chrome://webdeveloper/content/options/pages/dashboard.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/keys.png" label="&webdeveloper.options.keys.label;" value="chrome://webdeveloper/content/options/pages/keys.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/miscellaneous.png" label="&webdeveloper.options.miscellaneous.label;" value="chrome://webdeveloper/content/options/pages/miscellaneous.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/resize.png" label="&webdeveloper.options.resize.label;" value="chrome://webdeveloper/content/options/pages/resize.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/tools.png" label="&webdeveloper.options.tools.label;" value="chrome://webdeveloper/content/options/pages/tools.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/validation.png" label="&webdeveloper.options.validation.label;" value="chrome://webdeveloper/content/options/pages/validation.xul"/>
- <listitem class="listitem-iconic" image="chrome://webdeveloper/skin/options/view-source.png" label="&webdeveloper.options.view.source.label;" value="chrome://webdeveloper/content/options/pages/view_source.xul"/>
- </listbox>
- <vbox flex="1">
- <iframe flex="1" id="webdeveloper-options-iframe" src="chrome://webdeveloper/content/options/pages/general.xul"/>
- </vbox>
- </hbox>
-</dialog>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeColorsAndFonts()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.generated.content.caption;"/>
- <hbox align="center">
- <label control="webdeveloper.generated.content.font.size" value="&webdeveloper.font.size.label;"/>
- <menulist id="webdeveloper.generated.content.font.size">
- <menupopup>
- <menuitem value="8" label="8"/>
- <menuitem value="9" label="9"/>
- <menuitem value="10" label="10"/>
- <menuitem value="11" label="11"/>
- <menuitem value="12" label="12"/>
- <menuitem value="13" label="13"/>
- <menuitem value="14" label="14"/>
- <menuitem value="15" label="15"/>
- <menuitem value="16" label="16"/>
- <menuitem value="18" label="18"/>
- <menuitem value="20" label="20"/>
- <menuitem value="24" label="24"/>
- <menuitem value="26" label="26"/>
- <menuitem value="28" label="28"/>
- <menuitem value="32" label="32"/>
- <menuitem value="36" label="36"/>
- <menuitem value="40" label="40"/>
- <menuitem value="48" label="48"/>
- <menuitem value="56" label="56"/>
- <menuitem value="64" label="64"/>
- <menuitem value="72" label="72"/>
- </menupopup>
- </menulist>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.feature.tooltip.colors.caption;"/>
- <hbox align="center">
- <label control="webdeveloper.feature.tooltip.color.text" value="&webdeveloper.text.color.label;"/>
- <colorpicker id="webdeveloper.feature.tooltip.color.text" palettename="standard" type="button"/>
- <spacer class="small-spacer"/>
- <label control="webdeveloper.feature.tooltip.color.background" value="&webdeveloper.background.color.label;"/>
- <colorpicker id="webdeveloper.feature.tooltip.color.background" palettename="standard" type="button"/>
- <spacer class="small-spacer"/>
- <label control="webdeveloper.feature.tooltip.color.border" value="&webdeveloper.border.color.label;"/>
- <colorpicker id="webdeveloper.feature.tooltip.color.border" palettename="standard" type="button"/>
- </hbox>
- <separator/>
- <hbox align="center">
- <label control="webdeveloper.feature.tooltip.opacity" value="&webdeveloper.opacity.label;"/>
- <menulist id="webdeveloper.feature.tooltip.opacity">
- <menupopup>
- <menuitem value="1.0" label="1.0"/>
- <menuitem value="0.9" label="0.9"/>
- <menuitem value="0.8" label="0.8"/>
- <menuitem value="0.7" label="0.7"/>
- <menuitem value="0.6" label="0.6"/>
- <menuitem value="0.5" label="0.5"/>
- <menuitem value="0.4" label="0.4"/>
- <menuitem value="0.3" label="0.3"/>
- <menuitem value="0.2" label="0.2"/>
- <menuitem value="0.1" label="0.1"/>
- </menupopup>
- </menulist>
- </hbox>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeDashboard()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.edit.features;"/>
- <hbox align="center">
- <label control="webdeveloper.edit.color.text" value="&webdeveloper.text.color.label;"/>
- <colorpicker id="webdeveloper.edit.color.text" palettename="standard" type="button"/>
- <spacer class="small-spacer"/>
- <label control="webdeveloper.edit.color.background" value="&webdeveloper.background.color.label;"/>
- <colorpicker id="webdeveloper.edit.color.background" palettename="standard" type="button"/>
- </hbox>
- <separator/>
- <hbox align="center">
- <label control="webdeveloper.edit.font.size" value="&webdeveloper.font.size.label;"/>
- <menulist id="webdeveloper.edit.font.size">
- <menupopup>
- <menuitem value="8" label="8"/>
- <menuitem value="9" label="9"/>
- <menuitem value="10" label="10"/>
- <menuitem value="11" label="11"/>
- <menuitem value="12" label="12"/>
- <menuitem value="13" label="13"/>
- <menuitem value="14" label="14"/>
- <menuitem value="15" label="15"/>
- <menuitem value="16" label="16"/>
- <menuitem value="18" label="18"/>
- <menuitem value="20" label="20"/>
- <menuitem value="24" label="24"/>
- <menuitem value="26" label="26"/>
- <menuitem value="28" label="28"/>
- <menuitem value="32" label="32"/>
- <menuitem value="36" label="36"/>
- <menuitem value="40" label="40"/>
- <menuitem value="48" label="48"/>
- <menuitem value="56" label="56"/>
- <menuitem value="64" label="64"/>
- <menuitem value="72" label="72"/>
- </menupopup>
- </menulist>
- <spacer class="small-spacer"/>
- <checkbox id="webdeveloper.edit.wrap" label="&webdeveloper.edit.wrap;"/>
- </hbox>
- <separator/>
- <hbox align="center">
- <label control="webdeveloper.edit.update.frequency" value="&webdeveloper.edit.update.frequency;"/>
- <textbox id="webdeveloper.edit.update.frequency" size="4"/>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.open.dashboard;"/>
- <checkbox id="webdeveloper.style.information.dashboard" label="&webdeveloper.style.information.dashboard;"/>
- <checkbox id="webdeveloper.dom.inspector.dashboard" label="&webdeveloper.dom.inspector.dashboard;"/>
- <checkbox id="webdeveloper.error.console.dashboard" label="&webdeveloper.error.console.dashboard;"/>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeGeneral()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.general.caption;"/>
- <checkbox id="webdeveloper.context.hide" label="&webdeveloper.context.hide;"/>
- <checkbox id="webdeveloper.menu.hide" label="&webdeveloper.menu.hide;"/>
- <checkbox id="webdeveloper.confirmation.dialogs.hide" label="&webdeveloper.confirmation.dialogs.hide;"/>
- <checkbox id="webdeveloper.informational.dialogs.hide" label="&webdeveloper.informational.dialogs.hide;"/>
- <separator/>
- <hbox align="center">
- <label control="webdeveloper.toolbar.icons" value="&webdeveloper.toolbar.icons;"/>
- <menulist id="webdeveloper.toolbar.icons">
- <menupopup>
- <menuitem label="&webdeveloper.icons.text;" value="full"/>
- <menuitem label="&webdeveloper.icons;" value="icons"/>
- <menuitem label="&webdeveloper.text;" value="text"/>
- </menupopup>
- </menulist>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.tabs.windows.caption;"/>
- <checkbox id="webdeveloper.open.tabs" label="&webdeveloper.open.tabs;" oncommand="parent.webdeveloper_updateTabOptionStatus()"/>
- <checkbox id="webdeveloper.open.tabs.background" class="indent" label="&webdeveloper.open.tabs.background;"/>
- </groupbox>
- <separator/>
- <hbox>
- <button label="&webdeveloper.options.reset;" oncommand="parent.webdeveloper_resetOptions()"/>
- <spacer flex="1"/>
- </hbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeKeys()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.keyboard.shortcuts.caption;"/>
- <description value="&webdeveloper.keyboard.shortcuts.label;"/>
- <description value="&webdeveloper.tools.shortcuts.label;"/>
- <separator/>
- <grid class="scroll">
- <columns>
- <column/>
- <spacer class="small-spacer"/>
- <column/>
- </columns>
- <rows id="webdeveloper-key-rows"/>
- </grid>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeMiscellaneous()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.forms.caption;"/>
- <label control="webdeveloper.populate.form.fields.email" value="&webdeveloper.populate.form.fields.email.label;"/>
- <textbox id="webdeveloper.populate.form.fields.email"/>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.information.caption;"/>
- <checkbox id="webdeveloper.information.tidy" label="&webdeveloper.information.tidy;"/>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.warnings.errors.caption;"/>
- <checkbox id="webdeveloper.open.css.console.error" label="&webdeveloper.open.css.console.error;"/>
- <checkbox id="webdeveloper.open.javascript.console.warning" label="&webdeveloper.open.javascript.console.warning;"/>
- <checkbox id="webdeveloper.open.javascript.console.error" label="&webdeveloper.open.javascript.console.error;"/>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeResize()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.options.resize.label;"/>
- <hbox align="top">
- <listbox flex="1" id="webdeveloper-listbox" rows="18" onselect="parent.webdeveloper_listBoxSelected()">
- <listhead>
- <listheader label="&webdeveloper.description.header;"/>
- <listheader label="&webdeveloper.width.header;"/>
- <listheader label="&webdeveloper.height.header;"/>
- <listheader label="&webdeveloper.viewport.header;"/>
- </listhead>
- <listcols>
- <listcol flex="1"/>
- <listcol/>
- <listcol/>
- <listcol/>
- </listcols>
- </listbox>
- <vbox>
- <button id="webdeveloper-move-up" label="&webdeveloper.options.move.up;" oncommand="parent.webdeveloper_moveUp()"/>
- <button id="webdeveloper-move-down" label="&webdeveloper.options.move.down;" oncommand="parent.webdeveloper_moveDown()"/>
- </vbox>
- </hbox>
- <hbox>
- <button label="&webdeveloper.options.add;" oncommand="parent.webdeveloper_addResize()"/>
- <button id="webdeveloper-edit" label="&webdeveloper.options.edit;" oncommand="parent.webdeveloper_editResize()"/>
- <button id="webdeveloper-delete" label="&webdeveloper.options.delete;" oncommand="parent.webdeveloper_deleteResize()"/>
- </hbox>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeTools()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.options.tools.label;"/>
- <description value="&webdeveloper.keyboard.shortcuts.label;"/>
- <separator/>
- <hbox align="top">
- <listbox flex="1" id="webdeveloper-listbox" rows="16" onselect="parent.webdeveloper_listBoxSelected()">
- <listhead>
- <listheader label="&webdeveloper.description.header;"/>
- <listheader label="&webdeveloper.tool.header;"/>
- <listheader label="&webdeveloper.key.header;"/>
- </listhead>
- <listcols>
- <listcol/>
- <listcol flex="1"/>
- <listcol/>
- </listcols>
- </listbox>
- <vbox>
- <button id="webdeveloper-move-up" label="&webdeveloper.options.move.up;" oncommand="parent.webdeveloper_moveUp()"/>
- <button id="webdeveloper-move-down" label="&webdeveloper.options.move.down;" oncommand="parent.webdeveloper_moveDown()"/>
- </vbox>
- </hbox>
- <hbox>
- <button label="&webdeveloper.options.add;" oncommand="parent.webdeveloper_addTool()"/>
- <button id="webdeveloper-edit" label="&webdeveloper.options.edit;" oncommand="parent.webdeveloper_editTool()"/>
- <button id="webdeveloper-delete" label="&webdeveloper.options.delete;" oncommand="parent.webdeveloper_deleteTool()"/>
- <spacer class="large-spacer"/>
- <button label="&webdeveloper.options.new.separator;" oncommand="parent.webdeveloper_newSeparator()"/>
- </hbox>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeValidation()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.validate.local.accessibility.caption;"/>
- <grid>
- <rows>
- <row/>
- </rows>
- <columns>
- <column>
- <description value="&webdeveloper.validate.local.accessibility.section508;"/>
- <checkbox id="webdeveloper.validate.local.accessibility.section508" label="&webdeveloper.validate.local.accessibility.section508;"/>
- </column>
- <spacer class="large-spacer"/>
- <column>
- <description value="&webdeveloper.wai.label;"/>
- <checkbox id="webdeveloper.validate.local.accessibility.wai.priority1" label="&webdeveloper.validate.local.accessibility.wai.priority1;"/>
- <checkbox id="webdeveloper.validate.local.accessibility.wai.priority2" label="&webdeveloper.validate.local.accessibility.wai.priority2;"/>
- <checkbox id="webdeveloper.validate.local.accessibility.wai.priority3" label="&webdeveloper.validate.local.accessibility.wai.priority3;"/>
- </column>
- </columns>
- </grid>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.validate.local.css.caption;"/>
- <hbox align="center">
- <description value="&webdeveloper.profile.label;"/>
- <radiogroup align="center" orient="horizontal">
- <radio id="webdeveloper-validate-local-css21-radio" label="CSS 2.1"/>
- <radio id="webdeveloper-validate-local-css3-radio" label="CSS 3"/>
- </radiogroup>
- </hbox>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.validate.local.html.caption;"/>
- <checkbox id="webdeveloper.validate.local.html.show.outline" label="&webdeveloper.validate.local.html.show.outline;"/>
- <checkbox id="webdeveloper.validate.local.html.show.parse.tree" label="&webdeveloper.validate.local.html.show.parse.tree;"/>
- <checkbox id="webdeveloper.validate.local.html.show.source" label="&webdeveloper.validate.local.html.show.source;"/>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/options/options.css" type="text/css"?>
-
-<!DOCTYPE page SYSTEM "chrome://webdeveloper/locale/options.dtd">
-
-<page onload="parent.webdeveloper_initializeViewSource()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <groupbox>
- <caption label="&webdeveloper.view.source.caption;"/>
- <checkbox id="webdeveloper.view.source.tab" label="&webdeveloper.view.source.tab;"/>
- </groupbox>
- <groupbox>
- <caption label="&webdeveloper.view.source.with.label;"/>
- <description value="&webdeveloper.keyboard.shortcuts.label;"/>
- <separator/>
- <hbox align="top">
- <listbox flex="1" id="webdeveloper-listbox" rows="11" onselect="parent.webdeveloper_listBoxSelected()">
- <listhead>
- <listheader label="&webdeveloper.description.header;"/>
- <listheader label="&webdeveloper.application.header;"/>
- <listheader label="&webdeveloper.key.header;"/>
- </listhead>
- <listcols>
- <listcol/>
- <listcol flex="1"/>
- <listcol/>
- </listcols>
- </listbox>
- <vbox>
- <button id="webdeveloper-move-up" label="&webdeveloper.options.move.up;" oncommand="parent.webdeveloper_moveUp()"/>
- <button id="webdeveloper-move-down" label="&webdeveloper.options.move.down;" oncommand="parent.webdeveloper_moveDown()"/>
- </vbox>
- </hbox>
- <hbox>
- <button label="&webdeveloper.options.add;" oncommand="parent.webdeveloper_addViewSourceWith()"/>
- <button id="webdeveloper-edit" label="&webdeveloper.options.edit;" oncommand="parent.webdeveloper_editViewSourceWith()"/>
- <button id="webdeveloper-delete" label="&webdeveloper.options.delete;" oncommand="parent.webdeveloper_deleteViewSourceWith()"/>
- </hbox>
- </groupbox>
-</page>
\ No newline at end of file
+++ /dev/null
-// Outlines all block level element names
-function webdeveloper_outlineBlockLevelElementNames(element)
-{
- webdeveloper_removeStyleSheet("webdeveloper-outline-block-level-elements-before");
- webdeveloper_removeStyleSheet("webdeveloper-outline-block-level-elements-before-tooltips");
-
- // If the show outlined element names preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true))
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_block_level_elements_before.css", "webdeveloper-outline-block-level-elements-before");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-outline-block-level-elements-before-tooltips", "*:before");
- }
-}
-
-// Outlines all block level elements
-function webdeveloper_outlineBlockLevelElements(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_block_level_elements.css", "webdeveloper-outline-block-level-elements");
- webdeveloper_outlineBlockLevelElementNames(element);
-}
-
-// Outlines the current element
-function webdeveloper_outlineCurrentElement(element)
-{
- var checked = element.getAttribute("checked");
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", !checked);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
-
- // If outlining the element
- if(checked)
- {
- pageDocument.addEventListener("keypress", webdeveloper_outlineCurrentElementKeyPress, false);
- pageDocument.addEventListener("mousemove", webdeveloper_outlineCurrentElementMouseMove, false);
- pageDocument.addEventListener("mouseover", webdeveloper_outlineCurrentElementMouseOver, false);
- }
- else
- {
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("keypress", webdeveloper_outlineCurrentElementKeyPress, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mousemove", webdeveloper_outlineCurrentElementMouseMove, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- pageDocument.removeEventListener("mouseover", webdeveloper_outlineCurrentElementMouseOver, false);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- webdeveloper_removeElementOutline(webdeveloper_outlineElement);
- }
- }
-
- // If not outlining the element
- if(!checked)
- {
- webdeveloper_outlineElement = null;
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_current_element.css", "webdeveloper-outline-current-element");
-}
-
-// Keypress event for outline current element
-function webdeveloper_outlineCurrentElementKeyPress(event)
-{
- webdeveloper_copyElementAncestors(event);
-}
-
-// Mouseover event for outline current element
-function webdeveloper_outlineCurrentElementMouseMove(event)
-{
- var outlineElement = webdeveloper_addElementOutline(event, webdeveloper_outlineElement);
-
- // If the outline element is set
- if(outlineElement)
- {
- webdeveloper_outlineElement = outlineElement;
- }
-}
-
-// Mouseover event for outline current element
-function webdeveloper_outlineCurrentElementMouseOver(event)
-{
- webdeveloper_displayElementAncestors(event);
-}
-
-// Outlines the given element
-function webdeveloper_outlineCustomElements(element)
-{
- webdeveloper_outlinedElements = new Array();
-
- // If the menu is checked
- if(element.getAttribute("checked"))
- {
- window.openDialog("chrome://webdeveloper/content/dialogs/outline_elements.xul", "webdeveloper-outline-elements-dialog", "centerscreen,chrome,modal", webdeveloper_outlinedElements);
-
- // If the user clicked cancel in the dialog
- if(webdeveloper_outlinedElements.length == 0)
- {
- element.removeAttribute("checked");
- }
- }
-
- webdeveloper_outlineElements(element, true);
-}
-
-// Outlines all deprecated element names
-function webdeveloper_outlineDeprecatedElementNames(element)
-{
- webdeveloper_removeStyleSheet("webdeveloper-outline-deprecated-elements-before");
- webdeveloper_removeStyleSheet("webdeveloper-outline-deprecated-elements-before-tooltips");
-
- // If the show outlined element names preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true))
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_deprecated_elements_before.css", "webdeveloper-outline-deprecated-elements-before");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-outline-deprecated-elements-before-tooltips", "*:before");
- }
-}
-
-// Outlines all deprecated elements
-function webdeveloper_outlineDeprecatedElements(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_deprecated_elements.css", "webdeveloper-outline-deprecated-elements");
- webdeveloper_outlineDeprecatedElementNames(element);
-}
-
-// Outlines the given element
-function webdeveloper_outlineElements(element)
-{
- // If the menu is checked
- if(element.getAttribute("checked") && webdeveloper_outlinedElements.length > 0)
- {
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var outlineColor = null;
- var outlineColorPreference = null;
- var outlineElement = null;
- var outlineElementLength = null;
- var outlineElementList = null;
- var outlineElementPreference = null;
- var outlineElementValue = null;
- var pageDocument = null;
- var styleElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleElement = pageDocument.createElement("style");
-
- styleElement.setAttribute("id", "webdeveloper-outline-custom-elements");
- styleElement.setAttribute("type", "text/css");
-
- // Loop through outline colors and elements
- for(var j = 0; j <= 5; j++)
- {
- outlineColor = "webdeveloper.custom." + j + ".color";
- outlineColorPreference = webdeveloper_getStringPreference(outlineColor, true);
- outlineElement = "webdeveloper.custom." + j + ".element";
- outlineElementPreference = webdeveloper_getStringPreference(outlineElement, true);
-
- // If the color and element are set and not blank
- if(outlineColorPreference && outlineElementPreference)
- {
- outlineElementList = outlineElementPreference.split(",");
- outlineElementLength = outlineElementList.length;
-
- // Loop through the elements
- for(var k = 0; k < outlineElementLength; k++)
- {
- outlineElementValue = outlineElementList[k];
-
- styleElement.appendChild(pageDocument.createTextNode(outlineElementValue + " { -moz-outline: 1px solid " + outlineColorPreference + " !important; outline: 1px solid " + outlineColorPreference + " !important; }"));
-
- // If the show outlined element names preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true))
- {
- styleElement.appendChild(pageDocument.createTextNode(outlineElementValue + ":before { content: \"<" + outlineElementValue + ">\" !important; }"));
- }
- }
- }
- }
-
- webdeveloper_getDocumentHeadElement(pageDocument).appendChild(styleElement);
- }
-
- webdeveloper_addAppliedStyle("webdeveloper-outline-custom-elements");
- }
- else
- {
- webdeveloper_removeStyleSheet("webdeveloper-outline-custom-elements", true);
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/imports/before.css", "webdeveloper-outline-custom-elements-before");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-outline-custom-elements-before-tooltips", "*:before");
-}
-
-// Outlines all external links
-function webdeveloper_outlineExternalLinks(element)
-{
- // If the menu is checked
- if(element.getAttribute("checked"))
- {
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var location = null;
- var pageDocument = null;
- var protocol = null;
- var styleElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- location = pageDocument.location;
- protocol = location.protocol.replace(new RegExp(":", "gi"), "\\:");
- styleElement = pageDocument.createElement("style");
-
- styleElement.setAttribute("id", "webdeveloper-outline-external-links");
- styleElement.setAttribute("type", "text/css");
- styleElement.appendChild(pageDocument.createTextNode("a:not([href^=" + protocol + "\\/\\/" + location.hostname.replace(new RegExp("\\.", "gi"), "\\.") + "]) { -moz-outline: 1px solid #ff0000 !important; outline: 1px solid #ff0000 !important; }"));
- styleElement.appendChild(pageDocument.createTextNode("a:not([href^=" + protocol + "]) { -moz-outline-style: none !important; outline-style: none !important; }"));
-
- webdeveloper_getDocumentHeadElement(pageDocument).appendChild(styleElement);
- }
-
- webdeveloper_addAppliedStyle("webdeveloper-outline-external-links");
- }
- else
- {
- webdeveloper_removeStyleSheet("webdeveloper-outline-external-links", true);
- }
-}
-
-// Outlines all floated elements
-function webdeveloper_outlineFloatedElements(element)
-{
- var checked = element.getAttribute("checked");
- var className = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var floatValue = null;
- var pageDocument = null;
- var pageElement = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- treeWalker = pageDocument.createTreeWalker(pageDocument, NodeFilter.SHOW_ELEMENT, null, false);
-
- // While the tree walker has more nodes
- while((pageElement = treeWalker.nextNode()) != null)
- {
- // If the element is checked
- if(checked)
- {
- floatValue = pageElement.ownerDocument.defaultView.getComputedStyle(pageElement, null).getPropertyCSSValue("float").cssText;
-
- // If this element is floated and it is not set to none
- if(floatValue && floatValue != "none")
- {
- pageElement.className += " webdeveloper-floated-element";
- }
- }
- else
- {
- className = pageElement.className;
-
- // If the element has a class name and it contains webdeveloper-floated-element
- if(className && className.indexOf("webdeveloper-floated-element") != -1)
- {
- pageElement.className = webdeveloper_removeSubstring(className, "webdeveloper-floated-element");
- }
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_floated_elements.css", "webdeveloper-outline-floated-elements");
-}
-
-// Outlines all frames
-function webdeveloper_outlineFrames(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_frames.css", "webdeveloper-outline-frames");
-}
-
-// Outlines all heading names
-function webdeveloper_outlineHeadingNames(element)
-{
- webdeveloper_removeStyleSheet("webdeveloper-outline-headings-before");
- webdeveloper_removeStyleSheet("webdeveloper-outline-headings-before-tooltips");
-
- // If the show outlined element names preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true))
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_headings_before.css", "webdeveloper-outline-headings-before");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-outline-headings-before-tooltips", "*:before");
- }
-}
-
-// Outlines all headings
-function webdeveloper_outlineHeadings(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_headings.css", "webdeveloper-outline-headings");
- webdeveloper_outlineHeadingNames(element);
-}
-
-// Outlines all the links with ping attributes
-function webdeveloper_outlineLinksWithPingAttributes(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_links_with_ping_attributes.css", "webdeveloper-outline-links-with-ping-attributes");
-}
-
-// Outlines all the links without title attributes
-function webdeveloper_outlineLinksWithoutTitleAttributes(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_links_without_title_attributes.css", "webdeveloper-outline-links-without-title-attributes");
-}
-
-// Outlines all positioned elements of the specified position on the page
-function webdeveloper_outlinePositionedElements(position, element)
-{
- var attributeName = "webdeveloper-" + position + "-positioned-element";
- var checked = element.getAttribute("checked");
- var className = null;
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var pageDocument = null;
- var pageElement = null;
- var positionValue = null;
- var treeWalker = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- treeWalker = pageDocument.createTreeWalker(pageDocument, NodeFilter.SHOW_ELEMENT, null, false);
-
- // While the tree walker has more nodes
- while((pageElement = treeWalker.nextNode()) != null)
- {
- // If the element is checked
- if(checked)
- {
- positionValue = pageElement.ownerDocument.defaultView.getComputedStyle(pageElement, null).getPropertyCSSValue("position").cssText;
-
- // If this element is positioned and it is the specified position
- if(positionValue && positionValue == position)
- {
- pageElement.className += " " + attributeName;
- }
- }
- else if(pageElement.className.indexOf(attributeName) != -1)
- {
- pageElement.className = webdeveloper_removeSubstring(pageElement.className, attributeName);
- }
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_positioned_elements.css", "webdeveloper-outline-" + position + "-positioned-elements");
-}
-
-// Outlines all table captions
-function webdeveloper_outlineTableCaptions(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_table_captions.css", "webdeveloper-outline-table-captions");
-}
-
-// Outlines all table cells
-function webdeveloper_outlineTableCells(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_table_cells.css", "webdeveloper-outline-table-cells");
- webdeveloper_outlineTableCellNames(element);
-}
-
-// Outlines all table cell names
-function webdeveloper_outlineTableCellNames(element)
-{
- webdeveloper_removeStyleSheet("webdeveloper-outline-table-cells-before");
- webdeveloper_removeStyleSheet("webdeveloper-outline-table-cells-before-tooltips");
-
- // If the show outlined element names preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true))
- {
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_table_cells_before.css", "webdeveloper-outline-table-cells-before");
- webdeveloper_toggleFeatureTooltipStyles(element, "webdeveloper-outline-table-cells-before-tooltips", "*:before");
- }
-}
-
-// Outlines all tables
-function webdeveloper_outlineTables(element)
-{
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/outline_tables.css", "webdeveloper-outline-all-tables");
-}
-
-// Toggle showing of element names when outlining
-function webdeveloper_toggleShowElementNamesWhenOutlining(element)
-{
- var menu = document.getElementById("webdeveloper-outline-block-level-elements-menu");
-
- webdeveloper_enablePreference(element, "webdeveloper.outline.show.element.names");
-
- webdeveloper_configureElementByAppliedStyle(menu, "checked", "webdeveloper-outline-block-level-elements");
- webdeveloper_outlineBlockLevelElementNames(menu, true);
-
- menu = document.getElementById("webdeveloper-outline-deprecated-elements-menu");
- webdeveloper_configureElementByAppliedStyle(menu, "checked", "webdeveloper-outline-deprecated-elements");
- webdeveloper_outlineDeprecatedElementNames(menu, true);
-
- menu = document.getElementById("webdeveloper-outline-headings-menu");
- webdeveloper_configureElementByAppliedStyle(menu, "checked", "webdeveloper-outline-headings");
- webdeveloper_outlineHeadingNames(menu, true);
-
- menu = document.getElementById("webdeveloper-outline-table-cells-menu");
- webdeveloper_configureElementByAppliedStyle(menu, "checked", "webdeveloper-outline-table-cells");
- webdeveloper_outlineTableCellNames(menu, true);
-}
-
-// Updates the outline menu
-function webdeveloper_updateOutlineMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-block-level-elements-" + suffix), "checked", "webdeveloper-outline-block-level-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-current-element-" + suffix), "checked", "webdeveloper-outline-current-element");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-custom-elements-" + suffix), "checked", "webdeveloper-outline-custom-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-deprecated-elements-" + suffix), "checked", "webdeveloper-outline-deprecated-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-frames-" + suffix), "checked", "webdeveloper-outline-frames");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-headings-" + suffix), "checked", "webdeveloper-outline-headings");
- webdeveloper_configureElement(document.getElementById("webdeveloper-outline-show-element-names-" + suffix), "checked", webdeveloper_getBooleanPreference("webdeveloper.outline.show.element.names", true));
-}
-
-// Updates the outline links menu
-function webdeveloper_updateOutlineLinksMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-external-links-" + suffix), "checked", "webdeveloper-outline-external-links");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-links-with-ping-attributes-" + suffix), "checked", "webdeveloper-outline-links-with-ping-attributes");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-links-without-title-attributes-" + suffix), "checked", "webdeveloper-outline-links-without-title-attributes");
-}
-
-// Updates the outline positioned elements menu
-function webdeveloper_updateOutlinePositionedElementsMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-absolute-positioned-elements-" + suffix), "checked", "webdeveloper-outline-absolute-positioned-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-fixed-positioned-elements-" + suffix), "checked", "webdeveloper-outline-fixed-positioned-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-floated-elements-" + suffix), "checked", "webdeveloper-outline-floated-elements");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-relative-positioned-elements-" + suffix), "checked", "webdeveloper-outline-relative-positioned-elements");
-}
-
-// Updates the outline tables menu
-function webdeveloper_updateOutlineTablesMenu(suffix)
-{
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-table-captions-" + suffix), "checked", "webdeveloper-outline-table-captions");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-table-cells-" + suffix), "checked", "webdeveloper-outline-table-cells");
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-outline-all-tables-" + suffix), "checked", "webdeveloper-outline-all-tables");
-}
+++ /dev/null
-// Resizes the window to a custom size
-function webdeveloper_customResizeWindow()
-{
- var contentWindow = webdeveloper_getContentWindow();
-
- window.openDialog("chrome://webdeveloper/content/dialogs/resize.xul", "webdeveloper-resize-dialog", "centerscreen,chrome,modal", contentWindow.outerWidth, contentWindow.outerHeight, contentWindow.innerWidth, contentWindow.innerHeight);
-}
-
-// Displays the current window size
-function webdeveloper_displayWindowSize()
-{
- var contentWindow = webdeveloper_getContentWindow();
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- webdeveloper_message(stringBundle.getString("webdeveloper_windowSize"), stringBundle.getFormattedString("webdeveloper_displayWindowSizeResult", [contentWindow.outerWidth, contentWindow.outerHeight, contentWindow.innerWidth, contentWindow.innerHeight]));
-}
-
-// Displays the current window size in the title bar
-function webdeveloper_displayWindowSizeInTitle(element)
-{
- var contentDocument = webdeveloper_getContentDocument();
-
- // If the menu is checked
- if(element.getAttribute("checked"))
- {
- var contentWindow = webdeveloper_getContentWindow();
-
- contentDocument.title += " - " + contentWindow.outerWidth + "x" + contentWindow.outerHeight + " [" + contentWindow.innerWidth + "x" + contentWindow.innerHeight + "]";
-
- window.addEventListener("resize", webdeveloper_updateWindowSizeInTitle, false);
- }
- else
- {
- var title = contentDocument.title;
-
- contentDocument.title = title.substring(0, title.lastIndexOf(" - "));
-
- // Try to remove the event listener
- try
- {
- window.removeEventListener("resize", webdeveloper_updateWindowSizeInTitle, false);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-
- webdeveloper_toggleStyleSheet(element, "chrome://webdeveloper/content/stylesheets/empty.css", "webdeveloper-display-window-size-title");
-}
-
-// Resizes the window or viewport to the given width and height
-function webdeveloper_resizeWindow(width, height, viewport)
-{
- var windowX = window.screenX;
- var windowY = window.screenY;
-
- // If resizing the viewport
- if(viewport)
- {
- var contentWindow = webdeveloper_getContentWindow();
-
- contentWindow.innerHeight = height;
- contentWindow.innerWidth = width;
- }
- else
- {
- window.resizeTo(width, height);
- }
-
- window.screenX = windowX;
- window.screenY = windowY;
-}
-
-// Updates the resize menu
-function webdeveloper_updateResizeMenu(menu, suffix)
-{
- var contentWindow = webdeveloper_getContentWindow();
- var description = null;
- var descriptionPreference = null;
- var height = null;
- var heightPreference = null;
- var menuItem = document.createElement("menuitem");
- var resizeCount = webdeveloper_getIntegerPreference("webdeveloper.resize.count", true);
- var resizeSeparator = menu.getElementsByAttribute("id", "webdeveloper-resize-separator3-" + suffix)[0];
- var viewport = null;
- var viewportHeight = contentWindow.innerHeight;
- var viewportPreference = false;
- var viewportWidth = contentWindow.innerWidth;
- var width = null;
- var widthPreference = null;
- var windowHeight = contentWindow.outerHeight;
- var windowWidth = contentWindow.outerWidth;
-
- webdeveloper_configureElementByAppliedStyle(document.getElementById("webdeveloper-display-window-size-title-" + suffix), "checked", "webdeveloper-display-window-size-title");
- webdeveloper_removeGeneratedMenuItems(menu);
-
- // Loop through the possible resize options
- for(var i = 1; i <= resizeCount; i++)
- {
- description = "webdeveloper.resize." + i + ".description";
- height = "webdeveloper.resize." + i + ".height";
- viewport = "webdeveloper.resize." + i + ".viewport";
- width = "webdeveloper.resize." + i + ".width";
-
- // If the description, width and height are set
- if(webdeveloper_isPreferenceSet(description) && webdeveloper_isPreferenceSet(width) && webdeveloper_isPreferenceSet(height))
- {
- descriptionPreference = webdeveloper_getStringPreference(description, true);
-
- // If the description is not blank
- if(descriptionPreference != "")
- {
- heightPreference = webdeveloper_getIntegerPreference(height, true);
- menuItem = document.createElement("menuitem");
- viewportPreference = webdeveloper_getBooleanPreference(viewport, true);
- widthPreference = webdeveloper_getIntegerPreference(width, true);
-
- // If the resize attributes match the current size
- if((viewportPreference && viewportWidth == widthPreference && viewportHeight == heightPreference) || (!viewportPreference && windowWidth == widthPreference && windowHeight == heightPreference))
- {
- menuItem.setAttribute("checked", true);
- }
-
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", descriptionPreference);
- menuItem.setAttribute("oncommand", "webdeveloper_resizeWindow(" + widthPreference + ", " + heightPreference + ", " + viewportPreference + ")");
- menuItem.setAttribute("type", "radio");
-
- menu.insertBefore(menuItem, resizeSeparator);
- }
- }
- }
-}
-
-// Updates the window size in the title bar
-function webdeveloper_updateWindowSizeInTitle()
-{
- var contentDocument = webdeveloper_getContentDocument();
- var contentWindow = webdeveloper_getContentWindow();
- var title = contentDocument.title;
-
- contentDocument.title = title.substring(0, title.lastIndexOf(" - ")) + " - " + contentWindow.outerWidth + "x" + contentWindow.outerHeight + " [" + contentWindow.innerWidth + "x" + contentWindow.innerHeight + "]";
-}
-
-// Zooms the content
-function webdeveloper_zoom(zoomIn)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var factor = 1.5;
- var imageList = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- imageList = pageDocument.images;
-
- webdeveloper_zoomText(pageDocument.documentElement, zoomIn, factor);
- webdeveloper_zoomImages(imageList, zoomIn, factor);
- }
-}
-
-// Zooms the images
-function webdeveloper_zoomImages(imageList, zoomIn, factor)
-{
- var height = null;
- var image = null;
- var imageLength = imageList.length;
- var width = null;
-
- // Loop through the images
- for(var i = 0; i < imageLength; i++)
- {
- image = imageList[i];
- height = image.height;
- width = image.width;
-
- // If the width and height are set
- if(width && height)
- {
- // If zooming in
- if(zoomIn)
- {
- image.setAttribute("width", (width * factor));
- image.setAttribute("height", (height * factor));
- }
- else
- {
- image.setAttribute("width", (width / factor));
- image.setAttribute("height", (height / factor));
- }
- }
-
- height = null;
- width = null;
- }
-}
-
-// Zooms the text
-function webdeveloper_zoomText(node, zoomIn, factor)
-{
- var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node, null);
-
- // If the computed style is set
- if(computedStyle)
- {
- var childNode = null;
- var childNodeList = node.childNodes;
- var childNodeLength = childNodeList.length;
- var fontSize = computedStyle.getPropertyCSSValue("font-size");
- var lineHeight = computedStyle.getPropertyCSSValue("line-height");
-
- // Loop through the child nodes
- for(var i = 0; i < childNodeLength; i++)
- {
- childNode = childNodeList[i];
-
- // If this is an element
- if(childNode.nodeType == Node.ELEMENT_NODE)
- {
- webdeveloper_zoomText(childNode, zoomIn, factor);
- }
- }
-
- // If the font size is set and is in pixels
- if(fontSize && fontSize.primitiveType == CSSPrimitiveValue.CSS_PX)
- {
- // If zooming in
- if(zoomIn)
- {
- node.style.fontSize = (fontSize.getFloatValue(CSSPrimitiveValue.CSS_PX) * factor) + "px";
- }
- else
- {
- node.style.fontSize = (fontSize.getFloatValue(CSSPrimitiveValue.CSS_PX) / factor) + "px";
- }
- }
-
- // If the line height is set and is in pixels
- if(lineHeight && lineHeight.primitiveType == CSSPrimitiveValue.CSS_PX)
- {
- // If zooming in
- if(zoomIn)
- {
- node.style.lineHeight = (lineHeight.getFloatValue(CSSPrimitiveValue.CSS_PX) * factor) + "px";
- }
- else
- {
- node.style.lineHeight = (lineHeight.getFloatValue(CSSPrimitiveValue.CSS_PX) / factor) + "px";
- }
- }
- }
-}
+++ /dev/null
-blockquote, body, div, fieldset, form, h1, h2, h3, h4, h5, h6, html, input, li, ol, p, pre, table, td, th, ul
-{
- margin: 0;
- padding: 0;
-}
-
-body, h1, h2, h3, h4, h5, h6, li, ol, p, ul
-{
- font-size: 1em;
- line-height: 1.0;
-}
-
-em
-{
- font-style: normal;
-}
-
-ol, ul
-{
- list-style: none;
-}
-
-strong, th
-{
- font-weight: normal;
-}
\ No newline at end of file
+++ /dev/null
-@import url("imports/before.css");
-
-abbr:before
-{
- content: "Abbr=" attr(title) !important;
-}
-
-acronym:before
-{
- content: "Acronym=" attr(title) !important;
-}
+++ /dev/null
-@import url("imports/tooltips.css");
-
-span.webdeveloper-display-anchors a
-{
- -moz-opacity: 1.0 !important;
- border-style: none !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- font-weight: normal !important;
- letter-spacing: 0 !important;
- margin: 0 !important;
- opacity: 1.0 !important;
- padding: 0 !important;
- text-align: left !important;
- text-decoration: none !important;
- text-transform: none !important;
- z-index: 1 !important;
-}
\ No newline at end of file
+++ /dev/null
-@import url("imports/tooltips.css");
-
-div, form, table
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
+++ /dev/null
-@import url("imports/tooltips.css");
-
-div
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
+++ /dev/null
-*
-{
- cursor: crosshair !important;
-}
-
-#webdeveloper-element-information
-{
- -moz-opacity: 0.9 !important;
- background-color: #ffff99 !important;
- border: 1px solid #ffcc66 !important;
- left: 5px;
- max-width: 40em !important;
- min-width: 20em !important;
- opacity: 0.9 !important;
- position: absolute !important;
- top: 5px;
- z-index: 1000 !important;
-}
-
-#webdeveloper-element-information, #webdeveloper-element-information *
-{
- color: #000000 !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- font-weight: normal !important;
- height: auto !important;
- letter-spacing: 0 !important;
- text-align: left !important;
- text-decoration: none !important;
- text-transform: none !important;
- width: auto !important;
-}
-
-#webdeveloper-element-information, #webdeveloper-element-information dd, #webdeveloper-element-information dl, #webdeveloper-element-information dt, #webdeveloper-element-information h2, #webdeveloper-element-information p, #webdeveloper-element-information table, #webdeveloper-element-information td
-{
- margin: 0 !important;
-}
-
-#webdeveloper-element-information, #webdeveloper-element-information dl, #webdeveloper-element-information p, #webdeveloper-element-information table
-{
- padding: 0 !important;
-}
-
-#webdeveloper-element-information.force-width
-{
- width: 20em !important;
-}
-
-#webdeveloper-element-information dd, #webdeveloper-element-information dd *
-{
- cursor: text !important;
-}
-
-#webdeveloper-element-information dd, #webdeveloper-element-information dt
-{
- border-color: #ffcc66 !important;
- border-style: solid !important;
- border-width: 1px 0 0 0 !important;
-}
-
-#webdeveloper-element-information dd, #webdeveloper-element-information dt, #webdeveloper-element-information h2
-{
- padding: 0 5px !important;
-}
-
-#webdeveloper-element-information dt
-{
- background-color: #ffee88 !important;
- background-image: url(chrome://webdeveloper/content/images/arrow_down.png) !important;
- background-position: 95% 50% !important;
- background-repeat: no-repeat !important;
- cursor: pointer !important;
-}
-
-#webdeveloper-element-information dt, #webdeveloper-element-information h2
-{
- font-size: 12px !important;
- font-weight: bold !important;
-}
-
-#webdeveloper-element-information dt.collapsed
-{
- background-image: url(chrome://webdeveloper/content/images/arrow_left.png) !important;
-}
-
-#webdeveloper-element-information dt.collapsed + dd
-{
- display: none !important;
-}
-
-#webdeveloper-element-information h2
-{
- background-color: #ffcc66 !important;
- cursor: move !important;
-}
-
-#webdeveloper-element-information table
-{
- border-collapse: collapse !important;
-}
-
-#webdeveloper-element-information td
-{
- padding: 0 10px 0 0 !important;
- vertical-align: top !important;
-}
-
-#webdeveloper-element-information *
-{
- border-style: none !important;
-}
+++ /dev/null
-@import url("imports/before.css");
-@import url("imports/tooltips.css");
-
-form
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-form[action]:before
-{
- content: "<form action=\"" attr(action) "\">" !important;
-}
-
-form[action][autocomplete]:before
-{
- content: "<form action=\"" attr(action) "\" autocomplete=\"" attr(autocomplete) "\">" !important;
-}
-
-form[action][autocomplete][enctype]:before
-{
- content: "<form action=\"" attr(action) "\" autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\">" !important;
-}
-
-form[action][autocomplete][enctype][id]:before
-{
- content: "<form action=\"" attr(action) "\" autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[action][autocomplete][enctype][id][method]:before
-{
- content: "<form action=\"" attr(action) "\" autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[action][autocomplete][enctype][id][method][name]:before
-{
- content: "<form action=\"" attr(action) "\" autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[action][enctype]:before
-{
- content: "<form action=\"" attr(action) "\" enctype=\"" attr(enctype) "\">" !important;
-}
-
-form[action][enctype][id]:before
-{
- content: "<form action=\"" attr(action) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[action][enctype][id][method]:before
-{
- content: "<form action=\"" attr(action) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[action][enctype][id][method][name]:before
-{
- content: "<form action=\"" attr(action) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[action][id]:before
-{
- content: "<form action=\"" attr(action) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[action][id][method]:before
-{
- content: "<form action=\"" attr(action) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[action][id][method][name]:before
-{
- content: "<form action=\"" attr(action) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[action][method]:before
-{
- content: "<form action=\"" attr(action) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[action][method][name]:before
-{
- content: "<form action=\"" attr(action) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[action][name]:before
-{
- content: "<form action=\"" attr(action) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[autocomplete]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\">" !important;
-}
-
-form[autocomplete][enctype]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\">" !important;
-}
-
-form[autocomplete][enctype][id]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[autocomplete][enctype][id][method]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[autocomplete][enctype][id][method][name]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[autocomplete][id]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[autocomplete][id][method]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[autocomplete][id][method][name]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[autocomplete][method]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[autocomplete][method][name]:before
-{
- content: "<form autocomplete=\"" attr(autocomplete) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[enctype]:before
-{
- content: "<form enctype=\"" attr(enctype) "\">" !important;
-}
-
-form[enctype][id]:before
-{
- content: "<form enctype=\"" attr(enctype) "\" id=\"" attr(id) "\">" !important;
-}
-
-form[enctype][id][method]:before
-{
- content: "<form enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[enctype][id][method][name]:before
-{
- content: "<form enctype=\"" attr(enctype) "\" id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[enctype][method]:before
-{
- content: "<form enctype=\"" attr(enctype) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[enctype][method][name]:before
-{
- content: "<form enctype=\"" attr(enctype) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[id]:before
-{
- content: "<form id=\"" attr(id) "\">" !important;
-}
-
-form[id][method]:before
-{
- content: "<form id=\"" attr(id) "\" method=\"" attr(method) "\">" !important;
-}
-
-form[id][method][name]:before
-{
- content: "<form id=\"" attr(id) "\" method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[id][name]:before
-{
- content: "<form id=\"" attr(id) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[method]:before
-{
- content: "<form method=\"" attr(method) "\">" !important;
-}
-
-form[method][name]:before
-{
- content: "<form method=\"" attr(method) "\" name=\"" attr(name) "\">" !important;
-}
-
-form[name]:before
-{
- content: "<form name=\"" attr(name) "\">" !important;
-}
-
-input.webdeveloper-unhidden
-{
- -moz-outline: 1px solid #00ff00 !important;
- background-color: #c0c0c0 !important;
- color: #000000 !important;
- outline: 1px solid #00ff00 !important;
-}
+++ /dev/null
-#webdeveloper-line-guide-information
-{
- -moz-opacity: 0.9 !important;
- background-color: #ffff99 !important;
- border: 1px solid #ffcc66 !important;
- display: none;
- left: 5px;
- opacity: 0.9 !important;
- padding: 5px !important;
- position: absolute !important;
- top: 5px;
- z-index: 1000 !important;
-}
-
-#webdeveloper-line-guide-information, #webdeveloper-line-guide-information h1, #webdeveloper-line-guide-information p
-{
- color: #000000 !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- letter-spacing: 0 !important;
- margin: 0 !important;
- text-align: left !important;
- text-decoration: none !important;
- text-transform: none !important;
-}
-
-#webdeveloper-line-guide-information, #webdeveloper-line-guide-information p
-{
- font-weight: normal !important;
-}
-
-#webdeveloper-line-guide-information h1
-{
- font-weight: bold !important;
-}
-
-#webdeveloper-line-guide-information p
-{
- padding: 0 !important;
-}
-
-div.webdeveloper-horizontal-line-guide
-{
- height: 1px !important;
- left: 0 !important;
-}
-
-div.webdeveloper-line-guide
-{
- margin: 0 !important;
- padding: 0 !important;
- position: absolute !important;
- z-index: 999 !important;
-}
-div.webdeveloper-line-guide:hover
-{
- cursor: move !important;
-}
-
-div.webdeveloper-vertical-line-guide
-{
- top: 0 !important;
- width: 1px !important;
-}
\ No newline at end of file
+++ /dev/null
-@import url("imports/before.css");
-
-a[href]:before
-{
- content: "Href=" attr(href) !important;
-}
-
-a[href][ping]:before
-{
- content: "Href=" attr(href) " Ping=" attr(ping) !important;
-}
-
-a[href][ping][rel]:before
-{
- content: "Href=" attr(href) " Ping=" attr(ping) " Rel=" attr(rel) !important;
-}
-
-a[href][ping][target]:before
-{
- content: "Href=" attr(href) " Ping=" attr(ping) " Target=" attr(target) !important;
-}
-
-a[href][ping][rel][target]:before
-{
- content: "Href=" attr(href) " Ping=" attr(ping) " Rel=" attr(rel) " Target=" attr(target) !important;
-}
-
-a[href][rel]:before
-{
- content: "Href=" attr(href) " Rel=" attr(rel) !important;
-}
-
-a[href][rel][target]:before
-{
- content: "Href=" attr(href) " Rel=" attr(rel) " Target=" attr(target) !important;
-}
-
-a[href][target]:before
-{
- content: "Href=" attr(href) " Target=" attr(target) !important;
-}
-
-a[ping]:before
-{
- content: "Ping=" attr(ping) !important;
-}
-
-a[ping][rel]:before
-{
- content: "Ping=" attr(ping) " Rel=" attr(rel) !important;
-}
-
-a[ping][target]:before
-{
- content: "Ping=" attr(ping) " Target=" attr(target) !important;
-}
-
-a[rel]:before
-{
- content: "Rel=" attr(rel) !important;
-}
-
-a[rel][target]:before
-{
- content: "Rel=" attr(rel) " Target=" attr(target) !important;
-}
-
-a[target]:before
-{
- content: "Target=" attr(target) !important;
-}
+++ /dev/null
-@import url("imports/tooltips.css");
-
-div.webdeveloper-display-object-information
-{
- margin: 5px !important;
-}
-
-div.webdeveloper-display-object-information > p
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-div.webdeveloper-display-object-information > p.param
-{
- padding-left: 10px !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- cursor: crosshair !important;
-}
-
-#webdeveloper-ruler
-{
- -moz-opacity: 0.5 !important;
- -moz-outline: 1px solid #ff0000 !important;
- background-color: #cccccc !important;
- background-image: url(chrome://webdeveloper/content/images/features/ruler.png) !important;
- height: 0;
- left: 0;
- opacity: 0.5 !important;
- outline: 1px solid #ff0000 !important;
- position: absolute !important;
- top: 0;
- width: 0;
- z-index: 999 !important;
-}
-
-#webdeveloper-ruler > div > div
-{
- background-color: #666666 !important;
- border-color: #ff0000 !important;
- border-style: solid !important;
- height: 15px !important;
- position: absolute !important;
- width: 15px !important;
-}
-
-#webdeveloper-ruler-container
-{
- cursor: move !important;
- height: 100% !important;
- overflow: hidden !important;
- position: relative !important;
- width: 100% !important;
-}
-
-#webdeveloper-ruler-north-east
-{
- border-width: 0 0 1px 1px !important;
- cursor: ne-resize !important;
- right: 0 !important;
- top: 0 !important;
-}
-
-#webdeveloper-ruler-north-west
-{
- border-width: 0 1px 1px 0 !important;
- cursor: nw-resize !important;
- left: 0 !important;
- top: 0 !important;
-}
-
-#webdeveloper-ruler-south-east
-{
- border-width: 1px 0 0 1px !important;
- bottom: 0 !important;
- cursor: se-resize !important;
- right: 0 !important;
-}
-
-#webdeveloper-ruler-south-west
-{
- border-width: 1px 1px 0 0 !important;
- bottom: 0 !important;
- cursor: sw-resize !important;
- left: 0 !important;
-}
\ No newline at end of file
+++ /dev/null
-@import url("imports/tooltips.css");
-
-div.webdeveloper-display-table-information
-{
- margin: 5px !important;
-}
-
-div.webdeveloper-display-table-information, div.webdeveloper-display-table-information dd, div.webdeveloper-display-table-information dl, div.webdeveloper-display-table-information dt, div.webdeveloper-display-table-information p
-{
- padding: 0 !important;
-}
-
-div.webdeveloper-display-table-information dd, div.webdeveloper-display-table-information dl, div.webdeveloper-display-table-information p
-{
- margin: 0 !important;
-}
-
-div.webdeveloper-display-table-information dt
-{
- font-weight: bold !important;
- margin: 0 0 5px 0 !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- background-color: #000000 !important;
- background-image: none !important;
- border-color: #000000 !important;
- color: #ffffff !important;
-}
-
-* > *
-{
- background-color: #111111 !important;
- border-color: #111111 !important;
-}
-
-* > * > *
-{
- background-color: #222222 !important;
- border-color: #222222 !important;
-}
-
-* > * > * > *
-{
- background-color: #333333 !important;
- border-color: #333333 !important;
-}
-
-* > * > * > * > *
-{
- background-color: #444444 !important;
- border-color: #444444 !important;
-}
-
-* > * > * > * > * > *
-{
- background-color: #555555 !important;
- border-color: #555555 !important;
-}
-
-* > * > * > * > * > * > *
-{
- background-color: #666666 !important;
- border-color: #666666 !important;
-}
-
-* > * > * > * > * > * > * > *
-{
- background-color: #777777 !important;
- border-color: #777777 !important;
-}
-
-* > * > * > * > * > * > * > * > *
-{
- background-color: #888888 !important;
- border-color: #888888 !important;
-}
-
-* > * > * > * > * > * > * > * > * > *
-{
- background-color: #999999 !important;
- border-color: #999999 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #aaaaaa !important;
- border-color: #aaaaaa !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #bbbbbb !important;
- border-color: #bbbbbb !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #cccccc !important;
- border-color: #cccccc !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #dddddd !important;
- border-color: #dddddd !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #eeeeee !important;
- border-color: #eeeeee !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #ffffff !important;
- border-color: #ffffff !important;
- color: #000000 !important;
-}
-
-* > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
-{
- background-color: #ff00ff !important;
- border-color: #ff00ff !important;
- color: #000000 !important;
-}
\ No newline at end of file
+++ /dev/null
-a
-{
- border-color: #0000ff !important;
- border-style: dotted !important;
- border-width: 0 0 1px 0 !important;
- color: #0000ff !important;
- text-decoration: none !important;
-}
-a:visited
-{
- border-color: #660099 !important;
- color: #660099 !important;
-}
-a:focus, a:hover
-{
- border-color: #ff0000 !important;
- border-style: solid !important;
- color: #ff0000 !important;
-}
-
-a, table.sortable th, .pivot
-{
- cursor: pointer !important;
-}
-
-body
-{
- margin: 10px !important;
-}
-
-body, dl, h2, h3, html, ol, pre, table, td p, #tools li, ul.commands
-{
- padding: 0 !important;
-}
-
-body, html
-{
- background-color: #ffffff !important;
- color: #000000 !important;
-}
-
-body, p
-{
- line-height: 1.5 !important;
-}
-
-body, td, th
-{
- font-family: sans-serif !important;
-}
-
-h1
-{
- background-color: #000000 !important;
- background-image: url("chrome://webdeveloper/content/images/logo/large.png") !important;
- background-position: 10px 50% !important;
- background-repeat: no-repeat !important;
- color: #ffffff !important;
- font-size: 150% !important;
- letter-spacing: 1px !important;
- margin: -10px -10px 1em -10px !important;
- padding: 1em 1em 1em 50px !important;
- word-spacing: 1px !important;
-}
-
-h1, h2, th, tr.expanded
-{
- font-weight: bold !important;
-}
-
-h2
-{
- font-size: 150% !important;
-}
-
-h2, h2 a, h2 a:active, h2 a:focus, h2 a:visited, h3, h3 a, h3 a:active, h3 a:focus, h3 a:visited
-{
- border-color: #000000 !important;
- color: #000000 !important;
-}
-
-h2, hr, pre
-{
- margin: 1em 0 !important;
-}
-
-h3
-{
- font-size: 125% !important;
- margin: 0.5em 0 0 0 !important;
-}
-
-hr
-{
- background-color: #000000 !important;
- border-style: none !important;
- color: #000000 !important;
- height: 1px !important;
-}
-
-html, ul.commands li
-{
- margin: 0 !important;
-}
-
-ol
-{
- margin: 1em 1em 1em 2.5em !important;
-}
-
-p
-{
- margin: 0 0 0.5em 0 !important;
-}
-
-pre
-{
- font-family: monospace !important;
- line-height: 1 !important;
-}
-
-table
-{
- border-collapse: collapse !important;
- margin: 0 0 1em 0 !important;
- width: 100% !important;
-}
-
-td, th
-{
- border: 1px solid #000000 !important;
- text-align: left !important;
- vertical-align: top !important;
-}
-
-td, th, #tools, p.loading
-{
- padding: 0.5em !important;
-}
-
-th
-{
- background-color: #000000 !important;
- color: #ffffff !important;
- min-width: 10em !important;
- text-transform: uppercase !important;
- white-space: nowrap !important;
- width: 10em !important;
-}
-
-#tools
-{
- background-color: #eeeeee !important;
- border: 1px solid #cccccc !important;
- margin: 0.5em 0 !important;
-}
-
-#tools, ul.commands
-{
- list-style: none !important;
-}
-
-#tools li
-{
- display: inline !important;
- margin: 0 1em !important;
-}
-
-#tools a
-{
- padding-left: 15px !important;
-}
-
-#tools a, th.sort-ascending, th.sort-descending, ul.commands li, .pivot
-{
- background-repeat: no-repeat !important;
-}
-
-#tools a, ul.commands li
-{
- background-position: center left !important;
-}
-
-#webdeveloper-generated-tool-collapse-all, span.expanded, tr.expanded td.pivot
-{
- background-image: url(chrome://webdeveloper/content/images/content/expanded.png) !important;
-}
-
-#webdeveloper-generated-tool-expand-all, span.collapsed, tr.collapsed td.pivot
-{
- background-image: url(chrome://webdeveloper/content/images/content/collapsed.png) !important;
-}
-
-div.collapsed, tr.hidden
-{
- display: none !important;
-}
-
-p.loading
-{
- background-color: #ffff99 !important;
- border: 2px solid #ffcc66 !important;
- float: left !important;
- font-size: 150% !important;
- font-weight: bold !important;
-}
-
-p.loading img
-{
- margin-right: 0.5em !important;
-}
-
-span.pivot
-{
- margin-right: 10px !important;
- padding-left: 10px !important;
-}
-
-td.shaded, tr.shaded
-{
- background-color: #eeeeee !important;
-}
-
-th.sort-ascending
-{
- background-image: url(chrome://webdeveloper/content/images/content/arrow_down.png) !important;
-}
-
-th.sort-ascending, th.sort-descending
-{
- background-position: 95% 50% !important;
-}
-
-th.sort-descending
-{
- background-image: url(chrome://webdeveloper/content/images/content/arrow_up.png) !important;
-}
-
-ul.commands
-{
- margin: 0 0 1em 0 !important;
-}
-
-ul.commands li
-{
- padding: 0.25em 0 0.25em 20px !important;
-}
-
-ul.commands li.delete
-{
- background-image: url(chrome://webdeveloper/content/images/content/delete.png) !important;
-}
-
-ul.commands li.edit
-{
- background-image: url(chrome://webdeveloper/content/images/content/edit.png) !important;
-}
-
-.pivot
-{
- background-position: center center !important;
- width: 10px !important;
-}
-
-@media print
-{
- h1
- {
- background-image: none !important;
- padding: 1em !important;
- }
-
- h1, th
- {
- color: #000000 !important;
- }
-
- h1, th, td.shaded, tr.shaded
- {
- background-color: #ffffff !important;
- }
-
- #tools, span.pivot
- {
- display: none !important;
- }
-
- div.collapsed
- {
- display: block !important;
- }
-
- tr.hidden
- {
- display: table-row !important;
- }
-}
\ No newline at end of file
+++ /dev/null
-dd
-{
- border: 1px solid #000000 !important;
- height: 50px !important;
- width: 50px !important;
-}
-
-dd, dt
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-dl
-{
- float: left !important;
- margin: 1em !important;
- padding: 0 !important;
-}
-
-dt
-{
- font-family: monospace !important;
-}
-
-h2
-{
- clear: both !important;
-}
\ No newline at end of file
+++ /dev/null
-@import url("../imports/before.css");
-
-*:before
-{
- background-color: #ffff99 !important;
- border-color: #ffcc66 !important;
- color: #000000 !important;
- margin-right: 1em !important;
-}
-
-h1.webdeveloper-document-outline
-{
- font-size: 2.5em !important;
-}
-h1.webdeveloper-document-outline:before
-{
- content: "<h1>" !important;
-}
-
-h2.webdeveloper-document-outline
-{
- font-size: 2em !important;
- margin-left: 50px !important;
-}
-h2.webdeveloper-document-outline:before
-{
- content: "<h2>" !important;
-}
-
-h3.webdeveloper-document-outline
-{
- font-size: 1.5em !important;
- margin-left: 100px !important;
-}
-h3.webdeveloper-document-outline:before
-{
- content: "<h3>" !important;
-}
-
-h4.webdeveloper-document-outline
-{
- font-size: 1em !important;
- margin-left: 150px !important;
-}
-h4.webdeveloper-document-outline:before
-{
- content: "<h4>" !important;
-}
-
-h5.webdeveloper-document-outline
-{
- font-size: 0.9em !important;
- margin-left: 200px !important;
-}
-h5.webdeveloper-document-outline:before
-{
- content: "<h5>" !important;
-}
-
-h6.webdeveloper-document-outline
-{
- font-size: 0.8em !important;
- margin-left: 250px !important;
-}
-h6.webdeveloper-document-outline:before
-{
- content: "<h6>" !important;
-}
-
-.webdeveloper-document-outline
-{
- background-color: #ffffff !important;
- background-image: none !important;
- border-style: none !important;
- color: #000000 !important;
- margin: 0 !important;
- padding: 0 0 0.1em 0 !important;
-}
-.webdeveloper-document-outline:before
-{
- display: inline !important;
-}
-
-.webdeveloper-document-outline-missing
-{
- color: #cc0000 !important;
-}
-.webdeveloper-document-outline-missing:before
-{
- background-color: #ffcccc !important;
- border-color: #ff6666 !important;
-}
-
-@media print
-{
- *:before
- {
- background-color: #ffffff !important;
- border-color: #000000 !important;
- }
-
- .webdeveloper-document-outline-missing
- {
- color: #000000 !important;
- }
-}
\ No newline at end of file
+++ /dev/null
-table
-{
- width: auto !important;
-}
-
-td
-{
- border-style: none !important;
- padding: 0.25em !important;
-}
-
-td, tr.total > td.total-indent
-{
- border-style: none !important;
-}
-
-td.size
-{
- text-align: right !important;
-}
-
-tr.shaded > td.indent
-{
- background-color: #ffffff !important;
-}
-
-tr.total
-{
- font-weight: bold !important;
-}
-
-tr.total > td
-{
- border-color: #000000 !important;
- border-style: solid !important;
- border-width: 1px 0 0 0 !important;
-}
+++ /dev/null
-div.css
-{
- font-family: monospace !important;
-}
-
-div.css p
-{
- line-height: 1 !important;
- margin: 0 !important;
- padding: 0 !important;
-}
-
-div.css p.rule
-{
- margin-left: 3em !important;
-}
-
-div.css p.selector
-{
- color: #aa0000 !important;
- margin-top: 1.5em !important;
-}
-
-p.selector span
-{
- color: #666666 !important;
- font-style: italic !important;
- margin-left: 1em !important;
-}
-
-span.property
-{
- color: #0000aa !important;
-}
-
-span.value
-{
- color: #00aa00 !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- background-image: none !important;
-}
+++ /dev/null
-*
-{
- background-image: none !important;
-}
-
-img
-{
- display: none !important;
-}
-
-span.webdeveloper-alt-attribute
-{
- -moz-outline: 1px inset #000000 !important;
- outline: 1px inset #000000 !important;
- padding: 1px !important;
-}
\ No newline at end of file
+++ /dev/null
-*:before
-{
- border-style: solid !important;
- border-width: 1px !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- font-weight: normal !important;
- letter-spacing: 0 !important;
- margin: 0 1px 0 0 !important;
- padding: 1px !important;
- text-align: left !important;
- text-decoration: none !important;
- text-transform: none !important;
- z-index: 1 !important;
-}
-
-*[class^=webdeveloper-] *:before, *[class^=webdeveloper-]:before, *[id^=webdeveloper-] *:before, *[id^=webdeveloper-]:before
-{
- display: none !important;
-}
\ No newline at end of file
+++ /dev/null
-*[class^=webdeveloper-]
-{
- border-style: solid !important;
- border-width: 1px !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- font-weight: normal !important;
- letter-spacing: 0 !important;
- margin: 0 1px 0 0 !important;
- padding: 1px !important;
- text-align: left !important;
- text-decoration: none !important;
- text-transform: none !important;
- z-index: 1 !important;
-}
+++ /dev/null
-*
-{
- float: none !important;
- position: static !important;
-}
-
-table, tbody, td, tfoot, th, thead, tr
-{
- display: block !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- background-image: url("chrome://webdeveloper/content/images/spacer.gif") !important;
-}
+++ /dev/null
-img
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-input[type=image]
-{
- -moz-outline: 1px solid #00ff00 !important;
- outline: 1px solid #00ff00 !important;
-}
\ No newline at end of file
+++ /dev/null
-address, blockquote, h1, h2, h3, h4, h5, h6, p, pre
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-dd, dl, dt, ol, ul
-{
- -moz-outline: 1px solid #00ff00 !important;
- outline: 1px solid #00ff00 !important;
-}
-
-div, form, table
-{
- -moz-outline: 1px solid #0000ff !important;
- outline: 1px solid #0000ff !important;
-}
+++ /dev/null
-@import url("imports/before.css");
-
-address:before
-{
- content: "<address>" !important;
-}
-
-blockquote:before
-{
- content: "<blockquote>" !important;
-}
-
-div:before
-{
- content: "<div>" !important;
-}
-
-dl:before
-{
- content: "<dl>" !important;
-}
-
-form:before
-{
- content: "<form>" !important;
-}
-
-h1:before
-{
- content: "<h1>" !important;
-}
-
-h2:before
-{
- content: "<h2>" !important;
-}
-
-h3:before
-{
- content: "<h3>" !important;
-}
-
-h4:before
-{
- content: "<h4>" !important;
-}
-
-h5:before
-{
- content: "<h5>" !important;
-}
-
-h6:before
-{
- content: "<h6>" !important;
-}
-
-ol:before
-{
- content: "<ol>" !important;
-}
-
-p:before
-{
- content: "<p>" !important;
-}
-
-pre:before
-{
- content: "<pre>" !important;
-}
-
-table:before
-{
- content: "<table>" !important;
-}
-
-ul:before
-{
- content: "<ul>" !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- cursor: crosshair !important;
-}
+++ /dev/null
-applet, basefont, center, dir, font, isindex, menu, s, strike, u
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-@import url("imports/before.css");
-
-applet:before
-{
- content: "<applet>" !important;
-}
-
-basefont:before
-{
- content: "<basefont>" !important;
-}
-
-center:before
-{
- content: "<center>" !important;
-}
-
-dir:before
-{
- content: "<dir>" !important;
-}
-
-font:before
-{
- content: "<font>" !important;
-}
-
-isindex:before
-{
- content: "<isindex>" !important;
-}
-
-menu:before
-{
- content: "<menu>" !important;
-}
-
-s:before
-{
- content: "<s>" !important;
-}
-
-strike:before
-{
- content: "<strike>" !important;
-}
-
-u:before
-{
- content: "<u>" !important;
-}
\ No newline at end of file
+++ /dev/null
-.webdeveloper-floated-element
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
+++ /dev/null
-frame, frameset
-{
- border: 1px solid #ff0000 !important;
-}
-
-iframe
-{
- border: 1px solid #0000ff !important;
-}
\ No newline at end of file
+++ /dev/null
-h1
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-h2
-{
- -moz-outline: 1px solid #00ff00 !important;
- outline: 1px solid #00ff00 !important;
-}
-
-h3
-{
- -moz-outline: 1px solid #0000ff !important;
- outline: 1px solid #0000ff !important;
-}
-
-h4
-{
- -moz-outline: 1px solid #660099 !important;
- outline: 1px solid #660099 !important;
-}
-
-h5
-{
- -moz-outline: 1px solid #ff9900 !important;
- outline: 1px solid #ff9900 !important;
-}
-
-h6
-{
- -moz-outline: 1px solid #666666 !important;
- outline: 1px solid #666666 !important;
-}
+++ /dev/null
-@import url("imports/before.css");
-
-h1:before
-{
- content: "<h1>" !important;
-}
-
-h2:before
-{
- content: "<h2>" !important;
-}
-
-h3:before
-{
- content: "<h3>" !important;
-}
-
-h4:before
-{
- content: "<h4>" !important;
-}
-
-h5:before
-{
- content: "<h5>" !important;
-}
-
-h6:before
-{
- content: "<h6>" !important;
-}
+++ /dev/null
-img.webdeveloper-adjusted-image
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img[alt=""]
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img.webdeveloper-oversized-image
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img:not([alt])
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img:not([height]):not([width])
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img:not([title])
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-a[ping]
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-a:not([title])
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-img[src^=http\:], object[codebase^=http\:], object[src^=http\:]
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-iframe[src^=http\:]
-{
- border: 1px solid #ff0000 !important;
-}
\ No newline at end of file
+++ /dev/null
-.webdeveloper-absolute-positioned-element
-{
- -moz-outline: 1px solid #ff0000 !important;
- outline: 1px solid #ff0000 !important;
-}
-
-.webdeveloper-fixed-positioned-element
-{
- -moz-outline: 1px solid #00ff00 !important;
- outline: 1px solid #00ff00 !important;
-}
-
-.webdeveloper-relative-positioned-element
-{
- -moz-outline: 1px solid #0000ff !important;
- outline: 1px solid #0000ff !important;
-}
+++ /dev/null
-table
-{
- border-collapse: separate !important;
-}
-
-caption
-{
- border: 1px solid #ff0000 !important;
-}
+++ /dev/null
-table
-{
- border-collapse: separate !important;
-}
-
-td, th
-{
- border: 1px solid #ff0000 !important;
-}
-
-table table td, table table th
-{
- border-color: #00ff00 !important;
-}
-
-table table table td, table table table th
-{
- border-color: #0000ff !important;
-}
-
-table table table table td, table table table table th
-{
- border-color: #ff0000 !important;
-}
-
-table table table table table td, table table table table table th
-{
- border-color: #00ff00 !important;
-}
-
-table table table table table table td, table table table table table table th
-{
- border-color: #0000ff !important;
-}
+++ /dev/null
-@import url("imports/before.css");
-
-td:before
-{
- content: "<td>" !important;
-}
-
-th:before
-{
- content: "<th>" !important;
-}
+++ /dev/null
-table
-{
- border: 1px solid #ff0000 !important;
- border-collapse: separate !important;
-}
-
-table table
-{
- border-color: #00ff00 !important;
-}
-
-table table table
-{
- border-color: #0000ff !important;
-}
-
-table table table table
-{
- border-color: #ff0000 !important;
-}
-
-table table table table table
-{
- border-color: #00ff00 !important;
-}
-
-table table table table table table
-{
- border-color: #0000ff !important;
-}
+++ /dev/null
-div.webdeveloper-comment-icon
-{
- cursor: pointer !important;
- height: 14px !important;
- margin: 0 1px 0 0 !important;
- padding: 1px !important;
- text-align: center !important;
- width: 14px !important;
- z-index: 999 !important;
-}
-
-div.webdeveloper-comment-icon, div.webdeveloper-comment-text
-{
- background-color: #ffff99 !important;
- border: 1px solid #ffcc66 !important;
- position: absolute !important;
-}
-
-div.webdeveloper-comment-icon, div.webdeveloper-comment-text, div.webdeveloper-comment-text *
-{
- color: #000000 !important;
- font-family: sans-serif !important;
- font-size: 10px !important;
- font-style: normal !important;
- font-variant: normal !important;
- font-weight: normal !important;
- letter-spacing: 0 !important;
- line-height: 11px !important;
- text-decoration: none !important;
- text-transform: none !important;
-}
-
-div.webdeveloper-comment-text
-{
- padding: 5px !important;
- z-index: 1000 !important;
-}
-
-div.webdeveloper-comment-text, div.webdeveloper-comment-text *
-{
- text-align: left !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- background-image: none !important;
- float: none !important;
- font-size: 10px !important;
- font-variant: normal !important;
- height: auto !important;
- left: auto !important;
- letter-spacing: 0 !important;
- margin-bottom: auto !important;
- margin-left: 0 !important;
- margin-right: 0 !important;
- margin-top: auto !important;
- max-width: 250px !important;
- padding-left: 0 !important;
- padding-right: 0 !important;
- position: static !important;
- text-transform: none !important;
- top: auto !important;
- word-spacing: 0 !important;
-}
-
-*:not(body):not(html):not(li):not(ol):not(ul)
-{
- overflow: hidden !important;
-}
-
-*:not(img)
-{
- width: auto !important;
-}
-
-*:not(input):not(select):not(textarea)
-{
- border-style: none !important;
-}
-
-a
-{
- text-decoration: underline !important;
-}
-
-body
-{
- background-color: #ffffff !important;
- padding: 5px !important;
- width: 250px !important;
-}
-
-body, html
-{
- margin: 0 !important;
-}
-
-h1, h2
-{
- font-size: 12px !important;
-}
-
-html
-{
- background-color: #666666 !important;
- padding: 0 !important;
-}
-
-li
-{
- display: list-item !important;
-}
-
-ol, table, tbody, td, tfoot, th, thead, tr, ul
-{
- display: block !important;
-}
-
-ol, ul
-{
- padding-left: 15px !important;
-}
-
-ul
-{
- list-style-type: square !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- -moz-box-sizing: border-box !important;
-}
\ No newline at end of file
+++ /dev/null
-*
-{
- cursor: crosshair !important;
-}
\ No newline at end of file
+++ /dev/null
-// Loads the given application with the given URL
-function webdeveloper_loadApplicationWithURL(application, url)
-{
- // If the application and URL are set
- if(application && url)
- {
- application = new WebDeveloperApplication(application);
-
- application.launchWithURL(url);
- }
-}
-
-// Opens the DOM Inspector
-function webdeveloper_openDOMInspector()
-{
- // If the DOM Inspector is available
- if(webdeveloper_isDOMInspectorAvailable())
- {
- // If the open DOM Inspector in dashboard preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.dom.inspector.dashboard", true))
- {
- var domInspector = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_domInspector");
-
- // If the DOM inspector is already open in the dashboard
- if(webdeveloper_isOpenInDashboard(domInspector))
- {
- webdeveloper_closeInDashboard(domInspector);
- }
- else
- {
- webdeveloper_openInDashboard(domInspector, "chrome://inspector/content/sidebar.xul");
- window.setTimeout(BrowserReload, 1000);
- }
- }
- else
- {
- inspectDOMDocument(webdeveloper_getContentDocument());
- }
- }
- else
- {
- window.openDialog("chrome://webdeveloper/content/message/message.xul", "webdeveloper-message-dialog", "centerscreen,chrome,modal", document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_domInspectorRequired"), "http://chrispederick.com/work/web-developer/documentation/faq/#dom-inspector");
- }
-}
-
-// Opens the Java Console
-function webdeveloper_openJavaConsole()
-{
- Components.classes["@mozilla.org/oji/jvm-mgr;1"].getService(Components.interfaces.nsIJVMManager).showJavaConsole();
-}
-
-// Updates the tools menu
-function webdeveloper_updateToolsMenu(menu, suffix)
-{
- var bookmarklet = null;
- var bookmarkletPreference = null;
- var description = null;
- var descriptionPreference = null;
- var key = null;
- var menuItem = null;
- var path = null;
- var separator = null;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var toolPreference = null;
- var toolsCount = webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
- var toolsSeparator = menu.getElementsByAttribute("id", "webdeveloper-tools-separator1-" + suffix)[0];
- var url = null;
-
- webdeveloper_removeGeneratedMenuItems(menu);
-
- // Loop through the possible tools
- for(var i = 1; i <= toolsCount; i++)
- {
- bookmarklet = "webdeveloper.tool." + i + ".bookmarklet";
- description = "webdeveloper.tool." + i + ".description";
- key = "webdeveloper.tool." + i + ".key";
- path = "webdeveloper.tool." + i + ".path";
- separator = "webdeveloper.tool." + i + ".separator";
- url = "webdeveloper.tool." + i + ".url";
-
- // If the separator preference is set
- if(webdeveloper_getBooleanPreference(separator, true))
- {
- menuItem = document.createElement("menuseparator");
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menu.insertBefore(menuItem, toolsSeparator);
- }
- else if(webdeveloper_isPreferenceSet(description) && (webdeveloper_isPreferenceSet(bookmarklet) || webdeveloper_isPreferenceSet(path) || webdeveloper_isPreferenceSet(url)))
- {
- descriptionPreference = webdeveloper_getStringPreference(description, true);
-
- // If the description is not blank
- if(descriptionPreference != "")
- {
- menuItem = document.createElement("menuitem");
-
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", descriptionPreference);
-
- // If the bookmarklet preference is set
- if(webdeveloper_getStringPreference(bookmarklet, true))
- {
- menuItem.setAttribute("oncommand", "webdeveloper_runBookmarklet('" + encodeURIComponent(webdeveloper_getStringPreference(bookmarklet, true)).replace(new RegExp("'", "gi"), "\\'") + "')");
- }
- else if(webdeveloper_getStringPreference(path, true))
- {
- menuItem.setAttribute("oncommand", "webdeveloper_loadApplicationWithURL('" + webdeveloper_getStringPreference(path, true).replace(/\\/gi, "\\\\") + "', getBrowser().currentURI.spec)");
- }
- else
- {
- menuItem.setAttribute("oncommand", "webdeveloper_loadURL('" + webdeveloper_getStringPreference(url, true) + "' + encodeURIComponent(getBrowser().currentURI.spec))");
- }
-
- // If the key preference is set
- if(webdeveloper_isPreferenceSet(key))
- {
- menuItem.setAttribute("key", key);
- }
-
- menu.insertBefore(menuItem, toolsSeparator);
- }
- }
- }
-
- menuItem = document.getElementById("webdeveloper-dom-inspector-" + suffix);
-
- // If the menu exists
- if(menuItem)
- {
- // If the DOM Inspector is not available
- if(!webdeveloper_isDOMInspectorAvailable())
- {
- menuItem.setAttribute("class", "menuitem-iconic");
- }
- else if(menuItem.hasAttribute("class"))
- {
- menuItem.removeAttribute("class");
- }
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-dom-inspector-" + suffix), "checked", webdeveloper_isOpenInDashboard(stringBundle.getString("webdeveloper_domInspector")));
- webdeveloper_configureElement(document.getElementById("webdeveloper-display-page-validation-" + suffix), "checked", !document.getElementById("webdeveloper-page-validation-toolbar").hidden);
- webdeveloper_configureElement(document.getElementById("webdeveloper-error-console-" + suffix), "checked", webdeveloper_isOpenInDashboard(stringBundle.getString("webdeveloper_errorConsole")));
-}
-
-// Validates a local HTML file for accessibility
-function webdeveloper_validateLocalAccessibility()
-{
- new WebDeveloperValidateAccessibility().validateAccessibility(getBrowser().currentURI);
-}
-
-// Validates local CSS
-function webdeveloper_validateLocalCSS()
-{
- new WebDeveloperValidateCSS().validateCSS(getBrowser().currentURI, webdeveloper_getDocuments(webdeveloper_getContentWindow()));
-}
-
-// Validates a local HTML file
-function webdeveloper_validateLocalHTML()
-{
- new WebDeveloperValidateHTML().validateHTML(getBrowser().currentURI);
-}
\ No newline at end of file
+++ /dev/null
-// Migrate the extension to 1.0
-function webdeveloper_migrateTo1()
-{
- var toolbar = document.getElementById("webdeveloper-toolbar");
-
- webdeveloper_deletePreferenceBranch("webdeveloper.color");
- webdeveloper_deletePreferenceBranch("webdeveloper.edit.css");
- webdeveloper_deletePreferenceBranch("webdeveloper.tidied");
- webdeveloper_deletePreferenceBranch("webdeveloper.validator");
-
- // Remove the disabled preference
- if(webdeveloper_isPreferenceSet("webdeveloper.disabled"))
- {
- webdeveloper_deletePreference("webdeveloper.disabled");
- }
-
- // Migrate the populate form fields email
- if(webdeveloper_getStringPreference("webdeveloper.populate.form.fields.email", true) == "noemail@noemail.org")
- {
- webdeveloper_deletePreference("webdeveloper.populate.form.fields.email");
- }
-
- // Migrate the validate feed url
- if(webdeveloper_getStringPreference("webdeveloper.tool.2.url", true) == "http://feedvalidator.org/check.cgi?url=")
- {
- webdeveloper_deletePreference("webdeveloper.tool.2.url");
- }
-
- // Migrate the view speed report
- if(webdeveloper_getStringPreference("webdeveloper.tool.7.url", true) == "http://www.websiteoptimization.com/cgi-bin/wso/wso.pl?url=")
- {
- webdeveloper_deletePreference("webdeveloper.tool.7.description");
- webdeveloper_deletePreference("webdeveloper.tool.7.url");
- }
-
- // Migrate the tool count
- if(webdeveloper_getIntegerPreference("webdeveloper.tool.count", true) < 8)
- {
- webdeveloper_deletePreference("webdeveloper.tool.count");
- }
-
- toolbar.collapsed = false;
- toolbar.hidden = false;
-
- document.persist("webdeveloper-toolbar", "collapsed");
- document.persist("webdeveloper-toolbar", "hidden");
-}
-
-// Migrate the extension to 1.1
-function webdeveloper_migrateTo11()
-{
- // Migrate DOM Inspector sidebar
- if(webdeveloper_isPreferenceSet("webdeveloper.dom.inspector.sidebar"))
- {
- webdeveloper_setBooleanPreference("webdeveloper.dom.inspector.dashboard", webdeveloper_getBooleanPreference("webdeveloper.dom.inspector.sidebar", true));
- webdeveloper_deletePreference("webdeveloper.dom.inspector.sidebar");
- }
-
- // Migrate JavaScript console dashboard
- if(webdeveloper_isPreferenceSet("webdeveloper.javascript.console.dashboard"))
- {
- webdeveloper_setBooleanPreference("webdeveloper.error.console.dashboard", webdeveloper_getBooleanPreference("webdeveloper.javascript.console.dashboard", true));
- webdeveloper_deletePreference("webdeveloper.javascript.console.dashboard");
- }
-
- // Migrate JavaScript console key
- if(webdeveloper_isPreferenceSet("webdeveloper.javascript.console.key"))
- {
- webdeveloper_setStringPreference("webdeveloper.error.console.key", webdeveloper_getStringPreference("webdeveloper.javascript.console.key", true));
- webdeveloper_deletePreference("webdeveloper.javascript.console.key");
- }
-
- // Migrate JavaScript console sidebar
- if(webdeveloper_isPreferenceSet("webdeveloper.javascript.console.sidebar"))
- {
- webdeveloper_setBooleanPreference("webdeveloper.error.console.dashboard", webdeveloper_getBooleanPreference("webdeveloper.javascript.console.sidebar", true));
- webdeveloper_deletePreference("webdeveloper.javascript.console.sidebar");
- }
-
- // Migrate persist styles
- if(webdeveloper_isPreferenceSet("webdeveloper.styles.persist"))
- {
- webdeveloper_setBooleanPreference("webdeveloper.persist.features", webdeveloper_getBooleanPreference("webdeveloper.styles.persist", true));
- webdeveloper_deletePreference("webdeveloper.styles.persist");
- }
-
- // Migrate view style information dashboard
- if(webdeveloper_isPreferenceSet("webdeveloper.view.style.information.sidebar"))
- {
- webdeveloper_setBooleanPreference("webdeveloper.style.information.dashboard", webdeveloper_getBooleanPreference("webdeveloper.view.style.information.sidebar", true));
- webdeveloper_deletePreference("webdeveloper.view.style.information.sidebar");
- }
-}
-
-// Migrate the extension to 1.1.2
-function webdeveloper_migrateTo112()
-{
- // Migrate validate CSS
- if(webdeveloper_getStringPreference("webdeveloper.tool.1.url", true) == "http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=0&uri=")
- {
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.1.url", "http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=");
- }
-}
-
-// Parses the version number
-function webdeveloper_parseVersion(version)
-{
- // If the version is set
- if(version)
- {
- var splitVersion = version.split(".");
- var parsedVersion = splitVersion[0] + ".";
- var splitVersionLength = splitVersion.length;
-
- // Loop through the remaining parts of the version
- for(var i = 1; i < splitVersionLength; i++)
- {
- parsedVersion += splitVersion[i];
- }
-
- return parseFloat(parsedVersion);
- }
- else
- {
- return 0;
- }
-}
-
-// Check if the extension is being upgraded
-function webdeveloper_upgrade()
-{
- var previousVersion = webdeveloper_parseVersion(webdeveloper_getStringPreference("webdeveloper.version", true));
- var version = webdeveloper_parseVersion("1.1.4");
-
- // If the versions do not match
- if(previousVersion != version)
- {
- // If the previous version is less than 1.0.2
- if(previousVersion < webdeveloper_parseVersion("1.0.2"))
- {
- webdeveloper_migrateTo1();
- }
-
- // If the previous version is less than 1.1
- if(previousVersion < webdeveloper_parseVersion("1.1"))
- {
- webdeveloper_migrateTo11();
- }
-
- // If the previous version is less than 1.1.2
- if(previousVersion < webdeveloper_parseVersion("1.1.2"))
- {
- webdeveloper_migrateTo112();
- }
-
- webdeveloper_setStringPreference("webdeveloper.version", version);
- }
-}
\ No newline at end of file
+++ /dev/null
-// Clears the view generated source selection
-function webdeveloper_clearViewGeneratedSourceSelection(selection, generatedSourceWindow)
-{
- selection.removeAllRanges();
- generatedSourceWindow.document.getElementById("content").contentWindow.getSelection().removeAllRanges();
-}
-
-// Displays the view frame source menu
-function webdeveloper_displayViewFrameSourceMenu(menu)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var menuItem = null;
- var pageDocument = null;
-
- webdeveloper_removeGeneratedMenuItems(menu);
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- menuItem = document.createElement("menuitem");
- pageDocument = documentList[i];
- menuItem.pageDocument = pageDocument;
-
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", pageDocument.documentURI);
- menuItem.setAttribute("oncommand", "webdeveloper_viewSource(this.pageDocument)");
- menu.appendChild(menuItem);
- }
-}
-
-// Displays the view source with menu
-function webdeveloper_displayViewSourceWithMenu(menu, suffix)
-{
- var description = null;
- var descriptionPreference = null;
- var key = null;
- var menuItem = document.createElement("menuitem");
- var path = null;
- var viewSourceWithCount = webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
- var viewSourceWithSeparator = menu.getElementsByAttribute("id", "webdeveloper-view-source-separator3-" + suffix)[0];
-
- webdeveloper_removeGeneratedMenuItems(menu);
-
- // If there are no view source with applications
- if(viewSourceWithCount == 0)
- {
- viewSourceWithSeparator.setAttribute("hidden", true);
- }
- else
- {
- viewSourceWithSeparator.setAttribute("hidden", false);
-
- // Loop through the view source with options
- for(var i = 1; i <= viewSourceWithCount; i++)
- {
- description = "webdeveloper.view.source.with." + i + ".description";
- key = "webdeveloper.view.source.with." + i + ".key";
- path = "webdeveloper.view.source.with." + i + ".path";
-
- // If the description and path are set
- if(webdeveloper_isPreferenceSet(description) && webdeveloper_isPreferenceSet(path))
- {
- descriptionPreference = webdeveloper_getStringPreference(description, true);
-
- // If the description is not blank
- if(descriptionPreference != "")
- {
- menuItem = document.createElement("menuitem");
- menuItem.setAttribute("class", "webdeveloper-generated-menu");
- menuItem.setAttribute("label", descriptionPreference);
- menuItem.setAttribute("oncommand", "webdeveloper_loadApplicationWithSource('" + webdeveloper_getStringPreference(path, true).replace(/\\/gi, "\\\\") + "')");
-
- // If the key preference is set
- if(webdeveloper_isPreferenceSet(key))
- {
- menuItem.setAttribute("key", key);
- }
-
- menu.insertBefore(menuItem, viewSourceWithSeparator);
- }
- }
- }
- }
-}
-
-// Loads the given application with the source of the current page
-function webdeveloper_loadApplicationWithSource(application)
-{
- // If the application is set
- if(application)
- {
- application = new WebDeveloperApplication(application);
-
- application.launchWithSource(getBrowser().currentURI);
- }
-}
-
-// Toggles the view frame source menu
-function webdeveloper_toggleViewFrameSourceMenu(suffix)
-{
- var disabled = true;
- var frameCount = webdeveloper_getContentWindow().frames.length;
- var menu = document.getElementById("webdeveloper-view-frame-source-" + suffix);
-
- // If there are frames
- if(frameCount > 0)
- {
- disabled = false;
- }
-
- webdeveloper_configureElement(menu, "disabled", disabled);
-}
-
-// Adjusts the view source menu
-function webdeveloper_updateViewSourceMenu(menu, suffix)
-{
- webdeveloper_toggleViewFrameSourceMenu(suffix);
- webdeveloper_displayViewSourceWithMenu(menu, suffix);
-}
-
-// View the generated source
-function webdeveloper_viewGeneratedSource()
-{
- var currentDocument = webdeveloper_getContentDocument();
- var currentWindow = webdeveloper_getContentWindow();
- var generatedSourceWindow = null;
- var selection = currentWindow.getSelection();
-
- selection.selectAllChildren(currentDocument.documentElement);
-
- generatedSourceWindow = window.openDialog("chrome://global/content/viewPartialSource.xul", "_blank", "chrome,dialog=no,resizable,scrollbars", getBrowser().currentURI.spec, "charset=" + currentDocument.characterSet, currentWindow.getSelection(), "selection");
-
- window.setTimeout(webdeveloper_clearViewGeneratedSourceSelection, 1500, selection, generatedSourceWindow);
-}
-
-// View source
-function webdeveloper_viewSource(frameDocument)
-{
- // If the view source in tab preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.view.source.tab", true))
- {
- var newTab = getBrowser().addTab("view-source:" + frameDocument.documentURI);
-
- // If the open tabs in background preference is not set to true
- if(!webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = newTab;
- }
- }
- else
- {
- BrowserViewSourceOfDocument(frameDocument);
- }
-}
+++ /dev/null
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-/* Toolbar buttons */
-
-#webdeveloper-button
-{
- list-style-image: url("chrome://webdeveloper/content/images/logo/medium.png");
-}
-
-toolbar[iconsize="small"] #webdeveloper-button
-{
- list-style-image: url("chrome://webdeveloper/content/images/logo/small.png");
-}
-
-/* Toolbars */
-
-#webdeveloper-line-guides-toolbar description, #webdeveloper-page-magnifier-toolbar description, #webdeveloper-page-validation-toolbar description, #webdeveloper-ruler-toolbar description
-{
- margin-bottom: 0 !important;
- margin-top: 0 !important;
-}
-
-#webdeveloper-line-guides-toolbar spacer, #webdeveloper-page-magnifier-toolbar spacer, #webdeveloper-page-validation-toolbar spacer, #webdeveloper-ruler-toolbar spacer
-{
- width: 2em !important;
-}
-
-#webdeveloper-line-guides-toolbar spacer.small, #webdeveloper-page-magnifier-toolbar spacer.small, #webdeveloper-page-validation-toolbar spacer.small, #webdeveloper-ruler-toolbar spacer.small
-{
- width: 1em !important;
-}
-
-#webdeveloper-page-magnifier
-{
- display: block !important;
-}
-
-#webdeveloper-page-magnifier-container
-{
- border: 1px solid #ff0000 !important;
- cursor: crosshair !important;
- position: fixed !important;
-}
-
-/* Dashboard */
-
-#webdeveloper-dashboard
-{
- -moz-appearance: dialog !important;
-}
-
-#webdeveloper-dashboard-splitter
-{
- background-color: ThreeDFace !important;
- border: 1px solid ThreeDDarkShadow !important;
-}
-
-#webdeveloper-dashboard-tab-box, #webdeveloper-dashboard-tab-panels
-{
- margin: 0 !important;
- padding: 0 !important;
-}
-
-#webdeveloper-dashboard-tabs
-{
- display: block !important;
-}
-
-#webdeveloper-dashboard-tabs > tab
-{
- display: inline !important;
-}
+++ /dev/null
-var webdeveloper_appliedStyles = new Array();
-var webdeveloper_javaScriptCurrentTime = null;
-var webdeveloper_javaScriptPreviousTime = null;
-var webdeveloper_outlineElement = null;
-var webdeveloper_outlinedElements = new Array();
-var webdeveloper_selectedTab = -1;
-
-window.addEventListener("load", webdeveloper_initialize, false);
-window.addEventListener("unload", webdeveloper_uninitialize, false);
-
-// Displays the about dialog
-function webdeveloper_about()
-{
- window.openDialog("chrome://webdeveloper/content/about/about.xul", "webdeveloper-about-dialog", "centerscreen,chrome,modal");
-}
-
-// Add applied style
-function webdeveloper_addAppliedStyle(id)
-{
- // If the id is not in the applied styles
- if(!webdeveloper_contains(webdeveloper_appliedStyles, id))
- {
- webdeveloper_appliedStyles.push(id);
- webdeveloper_configureElement(document.getElementById("webdeveloper-statusbar-panel"), "hidden", false);
- }
-}
-
-// Add applied style if the element exists
-function webdeveloper_addAppliedStyleByElement(id)
-{
- var currentDocument = webdeveloper_getContentDocument();
-
- // If the element exists
- if(currentDocument.getElementById(id))
- {
- webdeveloper_addAppliedStyle(id);
- }
-}
-
-// Outlines the element in the event
-function webdeveloper_addElementOutline(event, currentElement)
-{
- var element = event.target;
-
- // If the element is set and is not the same as the current outline element
- if(element && element != currentElement)
- {
- webdeveloper_removeElementOutline(currentElement);
-
- element.style.MozOutline = "1px solid #ff0000";
-
- return element;
- }
-
- return null;
-}
-
-// Adds the generated styles to a page
-function webdeveloper_addGeneratedStyles(generatedDocument)
-{
- var headElement = webdeveloper_getDocumentHeadElement(generatedDocument);
- var linkElement = generatedDocument.createElement("link");
- var styleElement = generatedDocument.createElement("style");
-
- linkElement.setAttribute("href", "chrome://webdeveloper/content/stylesheets/generated/generated_content.css");
- linkElement.setAttribute("id", "webdeveloper-generated-content-stylesheet");
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
- headElement.appendChild(linkElement);
-
- styleElement.setAttribute("type", "text/css");
- styleElement.appendChild(generatedDocument.createTextNode("body, td, th { font-size: " + webdeveloper_getIntegerPreference("webdeveloper.generated.content.font.size", true) + "px !important; }"));
- headElement.appendChild(styleElement);
-}
-
-// Adds the generated tools to a page
-function webdeveloper_addGeneratedTools(generatedDocument)
-{
- var linkElement = generatedDocument.createElement("a");
- var listElement = generatedDocument.createElement("ul");
- var listItemElement = generatedDocument.createElement("li");
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- linkElement.setAttribute("href", "#");
- linkElement.setAttribute("id", "webdeveloper-generated-tool-collapse-all");
- linkElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_collapseAll")));
- listItemElement.appendChild(linkElement);
- listElement.appendChild(listItemElement);
-
- linkElement = generatedDocument.createElement("a");
- listItemElement = generatedDocument.createElement("li");
-
- linkElement.setAttribute("href", "#");
- linkElement.setAttribute("id", "webdeveloper-generated-tool-expand-all");
- linkElement.appendChild(generatedDocument.createTextNode(stringBundle.getString("webdeveloper_expandAll")));
- listItemElement.appendChild(linkElement);
- listElement.appendChild(listItemElement);
-
- listElement.setAttribute("id", "tools");
- webdeveloper_getDocumentBodyElement(generatedDocument).appendChild(listElement);
-}
-
-// Adds a status menu item
-function webdeveloper_addStatusMenuItem(statusMenu, menuId)
-{
- var originalMenuItem = document.getElementById(menuId + "-menu");
- var statusMenuItem = document.createElement("menuitem");
-
- statusMenuItem.setAttribute("checked", true);
- statusMenuItem.setAttribute("class", "webdeveloper-generated-menu");
- statusMenuItem.setAttribute("label", originalMenuItem.getAttribute("label"));
- statusMenuItem.setAttribute("oncommand", originalMenuItem.getAttribute("oncommand"));
- statusMenuItem.setAttribute("type", "checkbox");
-
- statusMenu.insertBefore(statusMenuItem, document.getElementById("webdeveloper-separator-statusbar"));
-}
-
-// Adds the style sheet at the given location with the given id
-function webdeveloper_addStyleSheet(location, id)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var linkElement = null;
- var pageDocument = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- linkElement = pageDocument.createElement("link");
-
- linkElement.setAttribute("href", location);
- linkElement.setAttribute("id", id);
- linkElement.setAttribute("rel", "stylesheet");
- linkElement.setAttribute("type", "text/css");
-
- webdeveloper_getDocumentHeadElement(pageDocument).appendChild(linkElement);
- }
-
- webdeveloper_addAppliedStyle(id);
-}
-
-// Adjusts the position of the given element
-function webdeveloper_adjustElementPosition(element, xPosition, yPosition, offset)
-{
- // If the element is set
- if(element)
- {
- var clientHeight = element.clientHeight;
- var clientWidth = element.clientWidth;
- var contentWindow = webdeveloper_getContentWindow();
- var innerHeight = contentWindow.innerHeight;
- var innerWidth = contentWindow.innerWidth;
- var offsetX = contentWindow.pageXOffset;
- var offsetY = contentWindow.pageYOffset;
-
- // If the x position is less than 0
- if(xPosition < 0)
- {
- xPosition = 0;
- }
-
- // If the y position is less than 0
- if(yPosition < 0)
- {
- yPosition = 0;
- }
-
- // If the element will fit at the x position
- if((xPosition + clientWidth + offset + 5) < (innerWidth + offsetX))
- {
- element.style.left = xPosition + offset + "px";
- }
- else
- {
- element.style.left = (innerWidth + offsetX - clientWidth - offset) + "px";
- }
-
- // If the element will fit at the y position
- if((yPosition + clientHeight + offset + 5) < (innerHeight + offsetY))
- {
- element.style.top = yPosition + offset + "px";
- }
- else
- {
- element.style.top = (innerHeight + offsetY - clientHeight - offset) + "px";
- }
- }
-}
-
-// Applies all selected style sheets
-function webdeveloper_applyStyleSheets(reset)
-{
- var appliedStyle = null;
- var appliedStyles = webdeveloper_appliedStyles.slice(0);
- var appliedStylesLength = appliedStyles.length;
- var element = null;
-
- // Loop through the duplicated applied styles
- for(var i = 0; i < appliedStylesLength; i++)
- {
- appliedStyle = appliedStyles[i];
-
- // Switch on the style
- switch(appliedStyle)
- {
- case "webdeveloper-add-user-style-sheet":
- element = document.getElementById("webdeveloper-add-user-style-sheet-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_addUserStyleSheet(element);
- break;
- case "webdeveloper-disable-all-styles":
- element = document.getElementById("webdeveloper-disable-all-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleStyles(element);
- break;
- case "webdeveloper-disable-browser-default-styles":
- element = document.getElementById("webdeveloper-disable-browser-default-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleBrowserDefaultStyles(element);
- break;
- case "webdeveloper-disable-embedded-styles":
- element = document.getElementById("webdeveloper-disable-embedded-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleEmbeddedStyles(element);
- break;
- case "webdeveloper-disable-inline-styles":
- element = document.getElementById("webdeveloper-disable-inline-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleInlineStyles(element);
- break;
- case "webdeveloper-disable-linked-styles":
- element = document.getElementById("webdeveloper-disable-linked-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleLinkedStyles(element);
- break;
- case "webdeveloper-disable-print-styles":
- element = document.getElementById("webdeveloper-disable-print-styles-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_togglePrintStyles(element);
- break;
- case "webdeveloper-display-abbreviations":
- element = document.getElementById("webdeveloper-display-abbreviations-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayAbbreviations(element);
- break;
- case "webdeveloper-display-access-keys":
- element = document.getElementById("webdeveloper-display-access-keys-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayAccessKeys(element);
- break;
- case "webdeveloper-display-alt-attributes":
- element = document.getElementById("webdeveloper-display-alt-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayAltAttributes(element);
- break;
- case "webdeveloper-display-anchors":
- element = document.getElementById("webdeveloper-display-anchors-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayAnchors(element);
- break;
- case "webdeveloper-display-block-size":
- element = document.getElementById("webdeveloper-display-block-size-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayBlockSize(element);
- break;
- case "webdeveloper-display-div-order":
- element = document.getElementById("webdeveloper-display-div-order-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayDivOrder(element);
- break;
- case "webdeveloper-display-element-information":
- element = document.getElementById("webdeveloper-display-element-information-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayElementInformation(element);
- break;
- case "webdeveloper-display-current-size-title":
- element = document.getElementById("webdeveloper-display-current-size-title-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayWindowSizeInTitle(element);
- break;
- case "webdeveloper-display-form-details":
- element = document.getElementById("webdeveloper-display-form-details-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayFormDetails(element);
- break;
- case "webdeveloper-display-handheld-css":
- element = document.getElementById("webdeveloper-display-handheld-css-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayHandheldCSS(element);
- break;
- case "webdeveloper-display-id-class-details":
- element = document.getElementById("webdeveloper-display-id-class-details-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayIdClassDetails(element);
- break;
- case "webdeveloper-display-image-dimensions":
- element = document.getElementById("webdeveloper-display-image-dimensions-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayImageDimensions(element);
- break;
- case "webdeveloper-display-image-file-sizes":
- element = document.getElementById("webdeveloper-display-image-file-sizes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayImageFileSizes(element);
- break;
- case "webdeveloper-display-image-paths":
- element = document.getElementById("webdeveloper-display-image-paths-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayImagePaths(element);
- break;
- case "webdeveloper-display-line-guides":
- element = document.getElementById("webdeveloper-display-line-guides-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayLineGuides(element);
- break;
- case "webdeveloper-display-link-details":
- element = document.getElementById("webdeveloper-display-link-details-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayLinkDetails(element);
- break;
- case "webdeveloper-display-object-information":
- element = document.getElementById("webdeveloper-display-object-information-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayObjectInformation(element);
- break;
- case "webdeveloper-display-print-css":
- element = document.getElementById("webdeveloper-display-print-css-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayPrintCSS(element);
- break;
- case "webdeveloper-display-ruler":
- element = document.getElementById("webdeveloper-display-ruler-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayRuler(element);
- break;
- case "webdeveloper-display-stack-levels":
- element = document.getElementById("webdeveloper-display-stack-levels-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayStackLevels(element);
- break;
- case "webdeveloper-display-tab-index":
- element = document.getElementById("webdeveloper-display-tab-index-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayTabIndex(element);
- break;
- case "webdeveloper-display-table-depth":
- element = document.getElementById("webdeveloper-display-table-depth-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayTableDepth(element);
- break;
- case "webdeveloper-display-table-information":
- element = document.getElementById("webdeveloper-display-table-information-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayTableInformation(element);
- break;
- case "webdeveloper-display-title-attributes":
- element = document.getElementById("webdeveloper-display-title-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayTitleAttributes(element);
- break;
- case "webdeveloper-display-topographic-information":
- element = document.getElementById("webdeveloper-display-topographic-information-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayTopographicInformation(element);
- break;
- case "webdeveloper-display-window-size-title":
- element = document.getElementById("webdeveloper-display-window-size-title-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_displayWindowSizeInTitle(element);
- break;
- case "webdeveloper-hide-background-images":
- element = document.getElementById("webdeveloper-hide-background-images-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_hideBackgroundImages(element);
- break;
- case "webdeveloper-hide-images":
- element = document.getElementById("webdeveloper-hide-images-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_hideImages(element, "webdeveloper-hide-images");
- break;
- case "webdeveloper-linearize-page":
- element = document.getElementById("webdeveloper-linearize-page-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_linearizePage(element);
- break;
- case "webdeveloper-make-images-invisible":
- element = document.getElementById("webdeveloper-make-images-invisible-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_makeImagesInvisible(element, "webdeveloper-make-images-invisible");
- break;
- case "webdeveloper-outline-absolute-positioned-elements":
- element = document.getElementById("webdeveloper-outline-absolute-positioned-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlinePositionedElements("absolute", element);
- break;
- case "webdeveloper-outline-all-images":
- element = document.getElementById("webdeveloper-outline-all-images-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineAllImages(element);
- break;
- case "webdeveloper-outline-all-tables":
- element = document.getElementById("webdeveloper-outline-all-tables-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineTables(element);
- break;
- case "webdeveloper-outline-background-images":
- element = document.getElementById("webdeveloper-outline-background-images-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineBackgroundImages(element, true);
- break;
- case "webdeveloper-outline-block-level-elements":
- element = document.getElementById("webdeveloper-outline-block-level-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineBlockLevelElements(element);
- break;
- case "webdeveloper-outline-current-element":
- element = document.getElementById("webdeveloper-outline-current-element-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineCurrentElement(element);
- break;
- case "webdeveloper-outline-custom-elements":
- element = document.getElementById("webdeveloper-outline-custom-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineElements(element);
- break;
- case "webdeveloper-outline-deprecated-elements":
- element = document.getElementById("webdeveloper-outline-deprecated-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineDeprecatedElements(element);
- break;
- case "webdeveloper-outline-external-links":
- element = document.getElementById("webdeveloper-outline-external-links-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineExternalLinks(element);
- break;
- case "webdeveloper-outline-fixed-positioned-elements":
- element = document.getElementById("webdeveloper-outline-fixed-positioned-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlinePositionedElements("fixed", element);
- break;
- case "webdeveloper-outline-floated-elements":
- element = document.getElementById("webdeveloper-outline-floated-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineFloatedElements(element);
- break;
- case "webdeveloper-outline-frames":
- element = document.getElementById("webdeveloper-outline-frames-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineFrames(element);
- break;
- case "webdeveloper-outline-headings":
- element = document.getElementById("webdeveloper-outline-headings-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineHeadings(element);
- break;
- case "webdeveloper-outline-images-with-adjusted-dimensions":
- element = document.getElementById("webdeveloper-outline-images-with-adjusted-dimensions-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithAdjustedDimensions(element);
- break;
- case "webdeveloper-outline-images-with-empty-alt-attributes":
- element = document.getElementById("webdeveloper-outline-images-with-empty-alt-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithEmptyAltAttributes(element);
- break;
- case "webdeveloper-outline-images-with-oversized-dimensions":
- element = document.getElementById("webdeveloper-outline-images-with-oversized-dimensions-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithOversizedDimensions(element);
- break;
- case "webdeveloper-outline-images-without-alt-attributes":
- element = document.getElementById("webdeveloper-outline-images-without-alt-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithoutAltAttributes(element);
- break;
- case "webdeveloper-outline-images-without-dimensions":
- element = document.getElementById("webdeveloper-outline-images-without-dimensions-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithoutDimensions(element);
- break;
- case "webdeveloper-outline-images-without-title-attributes":
- element = document.getElementById("webdeveloper-outline-images-without-title-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineImagesWithoutTitleAttributes(element);
- break;
- case "webdeveloper-outline-links-with-ping-attributes":
- element = document.getElementById("webdeveloper-outline-links-with-ping-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineLinksWithPingAttributes(element);
- break;
- case "webdeveloper-outline-links-without-title-attributes":
- element = document.getElementById("webdeveloper-outline-links-without-title-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineLinksWithoutTitleAttributes(element);
- break;
- case "webdeveloper-outline-relative-positioned-elements":
- element = document.getElementById("webdeveloper-outline-relative-positioned-elements-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlinePositionedElements("relative", element);
- break;
- case "webdeveloper-outline-table-cells":
- element = document.getElementById("webdeveloper-outline-table-cells-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_outlineTableCells(element);
- break;
- case "webdeveloper-replace-images-with-alt-attributes":
- element = document.getElementById("webdeveloper-replace-images-with-alt-attributes-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_replaceImagesWithAltAttributes(element);
- break;
- case "webdeveloper-show-comments":
- element = document.getElementById("webdeveloper-show-comments-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleComments(element);
- break;
- case "webdeveloper-small-screen-rendering":
- element = document.getElementById("webdeveloper-small-screen-rendering-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_smallScreenRendering(element);
- break;
- case "webdeveloper-use-border-box-model":
- element = document.getElementById("webdeveloper-use-border-box-model-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_toggleBorderBoxModel(element);
- break;
- case "webdeveloper-view-style-information":
- element = document.getElementById("webdeveloper-view-style-information-menu");
- webdeveloper_configureElement(element, "checked", !reset);
- webdeveloper_viewStyleInformation(element);
- break;
- }
- }
-}
-
-// Changes the options
-function webdeveloper_changeOptions()
-{
- var element = null;
- var hideContextMenuPreference = webdeveloper_getBooleanPreference("webdeveloper.context.hide", true);
- var hideMenuPreference = webdeveloper_getBooleanPreference("webdeveloper.menu.hide", true);
- var toolbar = document.getElementById("webdeveloper-toolbar");
-
- // If the toolbar exists
- if(toolbar)
- {
- var toolbarVisible = window.toolbar.visible;
-
- // If the toolbar is visible
- if(toolbarVisible)
- {
- var toolbarButtons = toolbar.getElementsByTagName("toolbarbutton");
- var toolbarButtonsLength = toolbarButtons.length;
- var toolbarPreference = webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true);
-
- toolbar.setAttribute("mode", toolbarPreference);
-
- // If the toolbar preference is set to icons
- if(toolbarPreference == "icons")
- {
- toolbarPreference = "pictures";
- }
-
- toolbar.setAttribute("buttonstyle", toolbarPreference);
-
- // Loop through the toolbar buttons
- for(var i = 0; i < toolbarButtonsLength; i++)
- {
- toolbarButtons[i].setAttribute("buttonstyle", toolbarPreference);
- }
-
- // If the toolbar preference is not set to text
- if(toolbarPreference != "text")
- {
- element = document.getElementById("webdeveloper-javascript-statusbar");
-
- // If the element exists
- if(element)
- {
- element.removeAttribute("label");
- }
-
- element = document.getElementById("webdeveloper-render-mode-statusbar");
-
- // If the element exists
- if(element)
- {
- element.removeAttribute("label");
- }
- }
- }
- }
-
- element = document.getElementById("webdeveloper-menu");
-
- // If the element exists
- if(element)
- {
- element.setAttribute("hidden", hideMenuPreference);
- }
-
- element = document.getElementById("webdeveloper-context");
-
- // If the element exists
- if(element)
- {
- element.setAttribute("hidden", hideContextMenuPreference);
- }
-
- element = document.getElementById("webdeveloper-context-separator1");
-
- // If the element exists
- if(element)
- {
- element.setAttribute("hidden", hideContextMenuPreference);
- }
-}
-
-// Clears the applied styles
-function webdeveloper_clearAppliedStyles()
-{
- webdeveloper_appliedStyles = new Array();
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-statusbar-panel"), "hidden", true);
-}
-
-// Configures the element with the given attribute and value
-function webdeveloper_configureElement(element, attribute, value)
-{
- // If the element exists
- if(element)
- {
- // If the value is set
- if(value)
- {
- element.setAttribute(attribute, value);
- }
- else
- {
- element.removeAttribute(attribute);
- }
- }
-}
-
-// Configures the element based on whether the applied style exists
-function webdeveloper_configureElementByAppliedStyle(element, attribute, id)
-{
- webdeveloper_configureElement(element, attribute, webdeveloper_contains(webdeveloper_appliedStyles, id));
-}
-
-// Configure the keyboard shortcuts
-function webdeveloper_configureKeyboardShortcuts(reset)
-{
- var bookmarklet = null;
- var id = null;
- var key = null;
- var keyElement = null;
- var keyPreference = null;
- var keyPreferenceValue = null;
- var keys = null;
- var keySet = null;
- var keysLength = null;
- var mainDocument = null;
- var path = null;
- var success = false;
- var toolCount = webdeveloper_getIntegerPreference("webdeveloper.tool.count", true);
- var url = null;
- var viewSourceWithCount = webdeveloper_getIntegerPreference("webdeveloper.view.source.with.count", true);
- var windowEnumeration = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getEnumerator("navigator:browser");
-
- // Loop through the open windows
- while(windowEnumeration.hasMoreElements())
- {
- mainDocument = windowEnumeration.getNext().document;
-
- // If a main document was found
- if(mainDocument)
- {
- keySet = mainDocument.getElementById("mainKeyset");
-
- // If the key set was not found
- if(!keySet)
- {
- keySet = mainDocument.getElementById("navKeys");
- }
-
- // If the key set was found
- if(keySet)
- {
- keys = keySet.childNodes;
- keysLength = keys.length;
-
- // Loop through the keys
- for(var i = 0; i < keysLength; i++)
- {
- key = keys.item(i);
-
- // If the key has an id starting with webdeveloper
- if(key.hasAttribute("id") && key.getAttribute("id").indexOf("webdeveloper-") == 0)
- {
- id = key.getAttribute("id").split("-").join(".");
-
- // If the key preference is set
- if(webdeveloper_isPreferenceSet(id))
- {
- keyPreferenceValue = webdeveloper_getStringPreference(id, true);
-
- key.setAttribute("key", keyPreferenceValue);
-
- // If the key preference value is set
- if(keyPreferenceValue)
- {
- key.setAttribute("disabled", false);
- }
- else
- {
- key.setAttribute("disabled", true);
- }
- }
- else if(!reset)
- {
- webdeveloper_setStringPreference(id, key.getAttribute("key"));
- }
-
- success = true;
- }
- }
-
- // Loop through the possible tools
- for(i = 1; i <= toolCount; i++)
- {
- bookmarklet = "webdeveloper.tool." + i + ".bookmarklet";
- keyPreference = "webdeveloper.tool." + i + ".key";
- keyElement = mainDocument.getElementById(keyPreference);
- path = "webdeveloper.tool." + i + ".path";
- url = "webdeveloper.tool." + i + ".url";
-
- // If the bookmarklet, path or URL preference and key preference is set
- if((webdeveloper_isPreferenceSet(bookmarklet) || webdeveloper_isPreferenceSet(path) || webdeveloper_isPreferenceSet(url)) && webdeveloper_isPreferenceSet(keyPreference))
- {
- keyPreferenceValue = webdeveloper_getStringPreference(keyPreference, true);
-
- // If the key preference value is set
- if(keyPreferenceValue)
- {
- key = mainDocument.createElement("key");
-
- key.setAttribute("id", keyPreference);
- key.setAttribute("key", keyPreferenceValue);
- key.setAttribute("modifiers", "accel,shift");
-
- // If the bookmarklet preference is set
- if(webdeveloper_getStringPreference(bookmarklet, true))
- {
- key.setAttribute("oncommand", "webdeveloper_runBookmarklet('" + encodeURIComponent(webdeveloper_getStringPreference(bookmarklet, true)).replace(new RegExp("'", "gi"), "\\'") + "')");
- }
- else if(webdeveloper_getStringPreference(path, true))
- {
- key.setAttribute("oncommand", "webdeveloper_loadApplicationWithURL('" + webdeveloper_getStringPreference(path, true).replace(/\\/gi, "\\\\") + "', getBrowser().currentURI.spec)");
- }
- else
- {
- key.setAttribute("oncommand", "webdeveloper_loadURL('" + webdeveloper_getStringPreference(url, true) + "' + encodeURIComponent(getBrowser().currentURI.spec))");
- }
-
- keySet.appendChild(key);
- }
- }
- else
- {
- webdeveloper_removeElement(keyElement);
- }
- }
-
- // Loop through the possible view source with options
- for(i = 1; i <= viewSourceWithCount; i++)
- {
- keyPreference = "webdeveloper.view.source.with." + i + ".key";
- keyElement = mainDocument.getElementById(keyPreference);
- path = "webdeveloper.view.source.with." + i + ".path";
-
- // If the path and key preferences are set
- if(webdeveloper_isPreferenceSet(path) && webdeveloper_isPreferenceSet(keyPreference))
- {
- keyPreferenceValue = webdeveloper_getStringPreference(keyPreference, true);
-
- // If the key preference value is set
- if(keyPreferenceValue)
- {
- key = mainDocument.createElement("key");
-
- key.setAttribute("id", keyPreference);
- key.setAttribute("key", keyPreferenceValue);
- key.setAttribute("modifiers", "accel,shift");
- key.setAttribute("oncommand", "webdeveloper_loadApplicationWithSource('" + webdeveloper_getStringPreference(path, true).replace(/\\/gi, "\\\\") + "')");
- keySet.appendChild(key);
- }
- }
- else
- {
- webdeveloper_removeElement(keyElement);
- }
- }
- }
- }
- }
-
- return success;
-}
-
-// Copies the elements ancestors to the clipboard
-function webdeveloper_copyElementAncestors(event)
-{
- var informationElement = document.getElementById("webdeveloper-information");
- var keyCode = event.charCode;
-
- // If the information element is set and the key code is set and is 99
- if(informationElement && keyCode && keyCode == 99)
- {
- Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper).copyString(informationElement.value);
-
- event.preventDefault();
- }
-}
-
-// Disables the given preference
-function webdeveloper_disablePreference(element, preference)
-{
- // If the element and preference are set
- if(element && preference)
- {
- webdeveloper_setBooleanPreference(preference, !element.getAttribute("checked"));
- }
-}
-
-// Displays the elements ancestors in the information bar
-function webdeveloper_displayElementAncestors(event)
-{
- var eventTarget = event.target;
- var informationElement = document.getElementById("webdeveloper-information");
-
- // If there is a target and the information element is set
- if(eventTarget && informationElement)
- {
- var tagName = eventTarget.tagName;
-
- // If the tag name is set and does not equal scrollbar
- if(tagName && tagName != "scrollbar")
- {
- var ancestorList = webdeveloper_getElementAncestors(eventTarget);
- var ancestorLength = ancestorList.length;
- var ancestorText = "";
-
- // Loop through the ancestors
- for(var i = 0; i < ancestorLength; i++)
- {
- ancestorText += webdeveloper_getElementDescription(ancestorList[i]) + " > ";
- }
-
- informationElement.value = ancestorText + webdeveloper_getElementDescription(eventTarget);
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", false);
-
- event.preventDefault();
- }
- }
-}
-
-// Enables the given preference
-function webdeveloper_enablePreference(element, preference)
-{
- // If the element and preference are set
- if(element && preference)
- {
- var checked = element.getAttribute("checked");
-
- // If the element is checked (explicit check required)
- if(checked)
- {
- webdeveloper_setBooleanPreference(preference, true);
- }
- else
- {
- webdeveloper_setBooleanPreference(preference, false);
- }
- }
-}
-
-// Formats a file size
-function webdeveloper_formatFileSize(fileSize)
-{
- // If the file size is set
- if(fileSize)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the file size is greater than a kilobyte
- if(fileSize > 1024)
- {
- return Math.round(fileSize / 1024) + " " + stringBundle.getString("webdeveloper_kilobytes");
- }
- else
- {
- return fileSize + " " + stringBundle.getString("webdeveloper_bytes");
- }
- }
- else
- {
- return "";
- }
-}
-
-// Generates a document in a new tab or window
-function webdeveloper_generateDocument(url)
-{
- var generatedPage = null;
- var request = new XMLHttpRequest();
-
- // If the open tabs preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true))
- {
- getBrowser().selectedTab = getBrowser().addTab(url);
-
- generatedPage = window;
- }
- else
- {
- generatedPage = window.open(url);
- }
-
- // This must be done to make generated content render
- request.open("get", "about:blank", false);
- request.send(null);
-
- return generatedPage.content.document;
-}
-
-// Returns a description for an element
-function webdeveloper_getElementDescription(element)
-{
- var description = null;
-
- // If the element and tag name are set
- if(element && element.tagName)
- {
- description = element.tagName.toLowerCase();
-
- // If the element has an id attribute
- if(element.hasAttribute("id"))
- {
- description += " #" + element.getAttribute("id");
- }
-
- // If the element has a class attribute
- if(element.hasAttribute("class"))
- {
- description += " ." + element.getAttribute("class");
- }
- }
-
- return description;
-}
-
-// Opens the help
-function webdeveloper_help()
-{
- webdeveloper_loadURL("http://chrispederick.com/work/web-developer/documentation/");
-}
-
-// Initializes the extension
-function webdeveloper_initialize(event)
-{
- var windowContent = window.document.getElementById("content");
-
- // If the window content is set
- if(windowContent)
- {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService().QueryInterface(Components.interfaces.nsIConsoleService);
- var dashboard = document.getElementById("webdeveloper-dashboard");
- var tabBox = windowContent.mTabBox;
-
- webdeveloper_upgrade();
- webdeveloper_setupDefaultOptions();
- webdeveloper_setupLocalizedOptions();
- webdeveloper_configureKeyboardShortcuts(false);
- webdeveloper_changeOptions();
-
- windowContent.addEventListener("load", webdeveloper_pageLoad, true);
- windowContent.addEventListener("unload", webdeveloper_pageUnload, true);
-
- // If the dashboard is set
- if(dashboard)
- {
- webdeveloper_setupDashboardPosition(webdeveloper_getStringPreference("webdeveloper.dashboard.position", true));
- }
-
- // If the console service is set
- if(consoleService)
- {
- consoleService.registerListener(WebDeveloperErrorConsoleListener);
- }
-
- // If the tab box is set
- if(tabBox)
- {
- tabBox.addEventListener("select", webdeveloper_tabSelect, false);
- }
-
- // Try to remove the event listener
- try
- {
- window.removeEventListener("load", webdeveloper_initialize, false);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-}
-
-// Returns true if the DOM Inspector is available
-function webdeveloper_isDOMInspectorAvailable()
-{
- try
- {
- Components.classes["@mozilla.org/inspector/dom-utils;1"].getService(Components.interfaces.inIDOMUtils);
-
- return true;
- }
- catch(exception)
- {
- return false;
- }
-}
-
-// Returns true if the information text toolbar is in use
-function webdeveloper_isInformationTextToolbarInUse()
-{
- // If one of the features that use the information text toolbar is enabled
- if(webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-display-element-information") || webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-outline-current-element") || webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-view-style-information"))
- {
- return true;
- }
-
- return false;
-}
-
-// Loads the given URL
-function webdeveloper_loadURL(url)
-{
- var oldTab = getBrowser().selectedTab;
-
- webdeveloper_generateDocument(url);
-
- // If the open tabs in background preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
- {
- getBrowser().selectedTab = oldTab;
- }
-}
-
-// Logs a debug message to the error console
-function webdeveloper_logDebug(message)
-{
- // If the debug preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.debug", true))
- {
- Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService).logStringMessage("Web Developer: " + message);
- webdeveloper_openErrorConsole(false);
- }
-}
-
-// Opens the error console
-function webdeveloper_openErrorConsole(toggle)
-{
- // If the open error console in dashboard preference is set to true
- if(webdeveloper_getBooleanPreference("webdeveloper.error.console.dashboard", true))
- {
- var errorConsole = document.getElementById("webdeveloper-string-bundle").getString("webdeveloper_errorConsole");
-
- // If the error console is already open in the dashboard
- if(webdeveloper_isOpenInDashboard(errorConsole))
- {
- // If toggling the console
- if(toggle)
- {
- webdeveloper_closeInDashboard(errorConsole);
- }
- else
- {
- webdeveloper_selectInDashboard(errorConsole);
- }
- }
- else
- {
- webdeveloper_openInDashboard(errorConsole, "chrome://global/content/console.xul");
- }
- }
- else
- {
- webdeveloper_javaScriptPreviousTime = webdeveloper_javaScriptCurrentTime;
- webdeveloper_javaScriptCurrentTime = new Date().getTime();
-
- // If the previous time is not set or the current time is greater than a second different from the previous time
- if(!webdeveloper_javaScriptPreviousTime || webdeveloper_javaScriptCurrentTime - webdeveloper_javaScriptPreviousTime > 1500)
- {
- toJavaScriptConsole();
- }
- }
-}
-
-// Opens a toolbar button automatically if another toolbar button is open on the toolbar
-function webdeveloper_openToolbarButton(currentToolbarButton)
-{
- // If the toolbar button is set and is not open
- if(currentToolbarButton && !currentToolbarButton.open)
- {
- var toolbarButton = null;
- var toolbarButtons = currentToolbarButton.parentNode.getElementsByTagName("toolbarbutton");
- var toolbarButtonsLength = toolbarButtons.length;
-
- // Loop through the toolbar buttons
- for(var i = 0; i < toolbarButtonsLength; i++)
- {
- toolbarButton = toolbarButtons.item(i);
-
- // If the toolbar button is set, is not the same toolbar button and is open
- if(toolbarButton && toolbarButton != currentToolbarButton && toolbarButton.open)
- {
- toolbarButton.open = false;
- currentToolbarButton.open = true;
-
- break;
- }
- }
- }
-}
-
-// Displays the options dialog
-function webdeveloper_options(openPage)
-{
- // If an open page is set
- if(openPage)
- {
- window.openDialog("chrome://webdeveloper/content/options/options.xul", "webdeveloper-options-dialog", "centerscreen,chrome,modal,resizable", openPage);
- }
- else
- {
- window.openDialog("chrome://webdeveloper/content/options/options.xul", "webdeveloper-options-dialog", "centerscreen,chrome,modal,resizable");
- }
-
- webdeveloper_changeOptions();
-}
-
-// Handles the page being loaded
-function webdeveloper_pageLoad(event)
-{
- var eventTarget = event.target;
-
- // If the browser is the target
- if(eventTarget && eventTarget == getBrowser())
- {
- var contentDocument = eventTarget.contentDocument;
-
- // If the content document is set
- if(contentDocument)
- {
- // Try to get the original target
- try
- {
- var loadedDocument = event.originalTarget;
-
- // If the loaded document is set and has the same URI as the content document
- if(loadedDocument && contentDocument.documentURI == loadedDocument.documentURI)
- {
- // Reset the display line guides and display ruler features
- webdeveloper_configureElement(document.getElementById("webdeveloper-line-guides-toolbar"), "hidden", true);
- webdeveloper_configureElement(document.getElementById("webdeveloper-ruler-toolbar"), "hidden", true);
- webdeveloper_removeAppliedStyle("webdeveloper-display-line-guides");
- webdeveloper_removeAppliedStyle("webdeveloper-display-ruler");
-
- webdeveloper_updateMetaRedirects(eventTarget.selectedBrowser);
- webdeveloper_updateRenderMode(contentDocument);
-
- // If the persist features preference is set and is true
- if(webdeveloper_getBooleanPreference("webdeveloper.persist.features", true))
- {
- webdeveloper_applyStyleSheets(false);
- }
- else
- {
- // Reset the information text toolbar
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", true);
-
- webdeveloper_clearAppliedStyles();
- }
- }
- }
- catch(exception)
- {
- // Do nothing
- }
- }
- }
-}
-
-// Handles the page being unloaded
-function webdeveloper_pageUnload(event)
-{
- var eventTarget = event.target;
-
- // Try to get the original target
- try
- {
- var originalTarget = event.originalTarget;
-
- // If the page is the target and the URI matches
- if(eventTarget && originalTarget && eventTarget.contentDocument && eventTarget == getBrowser() && eventTarget.contentDocument.documentURI == originalTarget.documentURI)
- {
- webdeveloper_updateCSSStatus();
- webdeveloper_updateJavaScriptStatus();
- }
- }
- catch(exception)
- {
- // Do nothing
- }
-}
-
-// Remove applied style
-function webdeveloper_removeAppliedStyle(id)
-{
- // If the id is in the applied styles
- if(webdeveloper_contains(webdeveloper_appliedStyles, id))
- {
- var appliedStylesLength = webdeveloper_appliedStyles.length;
-
- // Loop through the applied styles
- for(var i = 0; i < appliedStylesLength; i++)
- {
- // If this style sheet is in the applied styles
- if(webdeveloper_appliedStyles[i] == id)
- {
- webdeveloper_appliedStyles.splice(i, 1);
- break;
- }
- }
-
- // If the only applied style has been removed
- if(webdeveloper_appliedStyles.length == 0)
- {
- webdeveloper_configureElement(document.getElementById("webdeveloper-statusbar-panel"), "hidden", true);
- }
- }
-}
-
-// Removes the outline from an element
-function webdeveloper_removeElementOutline(element)
-{
- // If the element is set
- if(element)
- {
- element.style.MozOutline = "";
-
- // If the element has an empty style attribute
- if(element.hasAttribute("style") && element.getAttribute("style") == "")
- {
- element.removeAttribute("style");
- }
- }
-}
-
-// Removes all the generated menu items from the menu
-function webdeveloper_removeGeneratedMenuItems(menu)
-{
- var generatedMenuItems = new Array();
- var menuItem = null;
- var menuItems = menu.childNodes;
- var menuItemsLength = menuItems.length;
-
- // Loop through the menu items
- for(var i = 0; i < menuItemsLength; i++)
- {
- menuItem = menuItems.item(i);
-
- // If this is a generated menu item
- if(menuItem && menuItem.hasAttribute("class") && menuItem.getAttribute("class") == "webdeveloper-generated-menu")
- {
- generatedMenuItems.push(menuItem);
- }
- }
-
- menuItemsLength = generatedMenuItems.length;
-
- // Loop through the generated menu items
- for(i = 0; i < menuItemsLength; i++)
- {
- menu.removeChild(generatedMenuItems[i]);
- }
-}
-
-// Removes the style sheet with the given id
-function webdeveloper_removeStyleSheet(id)
-{
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- webdeveloper_removeElement(documentList[i].getElementById(id));
- }
-
- webdeveloper_removeAppliedStyle(id);
-}
-
-// Resets the CSS status button
-function webdeveloper_resetCSSStatus()
-{
- var cssButton = document.getElementById("webdeveloper-css-statusbar");
-
- webdeveloper_javaScriptCurrentTime = null;
- webdeveloper_javaScriptPreviousTime = null;
-
- // If the CSS button exists
- if(cssButton)
- {
- // If the CSS button has a class attribute
- if(cssButton.hasAttribute("class"))
- {
- cssButton.removeAttribute("class");
- }
-
- // If the CSS button has a tooltip text attribute
- if(cssButton.hasAttribute("tooltiptext"))
- {
- cssButton.removeAttribute("tooltiptext");
- }
-
- // If the toolbar preference is set to text and the CSS button has a label attribute
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text" && cssButton.hasAttribute("label"))
- {
- cssButton.removeAttribute("label");
- }
- }
-}
-
-// Resets the JavaScript status button
-function webdeveloper_resetJavaScriptStatus()
-{
- var javaScriptButton = document.getElementById("webdeveloper-javascript-statusbar");
-
- webdeveloper_javaScriptCurrentTime = null;
- webdeveloper_javaScriptPreviousTime = null;
-
- // If the JavaScript button exists
- if(javaScriptButton)
- {
- // If JavaScript is enabled
- if(webdeveloper_getBooleanPreference("javascript.enabled", false))
- {
- // If the JavaScript button has a class attribute
- if(javaScriptButton.hasAttribute("class"))
- {
- javaScriptButton.removeAttribute("class");
- }
-
- // If the JavaScript button has a tooltip text attribute
- if(javaScriptButton.hasAttribute("tooltiptext"))
- {
- javaScriptButton.removeAttribute("tooltiptext");
- }
-
- // If the toolbar preference is set to text and the JavaScript button has a label attribute
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text" && javaScriptButton.hasAttribute("label"))
- {
- javaScriptButton.removeAttribute("label");
- }
- }
- else
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the JavaScript button does not have a class attribute or it is not set to disabled
- if(!javaScriptButton.hasAttribute("class") || javaScriptButton.getAttribute("class") != "disabled")
- {
- javaScriptButton.setAttribute("class", "disabled");
- javaScriptButton.setAttribute("tooltiptext", stringBundle.getString("webdeveloper_javaScriptDisabledTooltip"));
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- javaScriptButton.setAttribute("label", stringBundle.getString("webdeveloper_javaScriptDisabledLabel"));
- }
- }
- }
- }
-}
-
-// Resets the page
-function webdeveloper_resetPage()
-{
- webdeveloper_applyStyleSheets(true);
- webdeveloper_clearAppliedStyles();
-
- webdeveloper_outlinedElements = new Array();
-}
-
-// Runs the given bookmarklet
-function webdeveloper_runBookmarklet(bookmarklet)
-{
- eval(decodeURIComponent(bookmarklet));
-}
-
-// Sets up the default options
-function webdeveloper_setupDefaultOptions()
-{
- // Set default custom colors
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.custom.1.color", "#ff0000");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.custom.2.color", "#33ff33");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.custom.3.color", "#3333ff");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.custom.4.color", "#ff0000");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.custom.5.color", "#33ff33");
-
- // Set default dashboard position
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.dashboard.position", "bottom");
-
- // Set default edit CSS preferences
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.edit.color.background", "#ffffff");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.edit.color.text", "#000000");
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.edit.font.size", 12);
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.edit.update.frequency", 2000);
-
- // Set default feature tooltip colors
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.feature.tooltip.color.background", "#ffff99");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.feature.tooltip.color.border", "#ffcc66");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.feature.tooltip.color.text", "#000000");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.feature.tooltip.opacity", "0.9");
-
- // Set default generated content font size
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.generated.content.font.size", 12);
-
- // Set default information preference
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.information.tidy", true);
-
- // Set default line guides preference
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.line.guides.color", "#000000");
-
- // Set default magnification preference
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.magnification.level", "2");
-
- // Set default open tabs preference
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.open.tabs", true);
-
- // Set default populate form fields email
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.populate.form.fields.email", "example@example.com");
-
- // Set default style information preference
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.style.information.dashboard", true);
-
- // Set default accessibility preferences
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.validate.local.accessibility.section508", true);
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.validate.local.accessibility.wai.priority1", true);
-
- // Set default CSS profile preference
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.validate.local.css.profile", "css21");
-}
-
-// Sets up the localized options
-function webdeveloper_setupLocalizedOptions()
-{
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the string bundle is set
- if(stringBundle)
- {
- // Set default resize count
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.resize.count", 1);
-
- // Set 800x600
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.resize.1.description", stringBundle.getString("webdeveloper_resize800x600"));
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.resize.1.width", 800);
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.resize.1.height", 600);
-
- // Set default tool count
- webdeveloper_setIntegerPreferenceIfNotSet("webdeveloper.tool.count", 8);
-
- // Set CSS validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.1.description", stringBundle.getString("webdeveloper_validateCSS"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.1.url", "http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=");
-
- // Set feed validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.2.description", stringBundle.getString("webdeveloper_validateFeed"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.2.url", "http://validator.w3.org/feed/check.cgi?url=");
-
- // Set HTML validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.3.description", stringBundle.getString("webdeveloper_validateHTML"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.3.key", "H");
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.3.url", "http://validator.w3.org/check?verbose=1&uri=");
-
- // Set links validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.4.description", stringBundle.getString("webdeveloper_validateLinks"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.4.url", "http://validator.w3.org/checklink?check=Check&hide_type=all&summary=on&uri=");
-
- // Set section 508 validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.5.description", stringBundle.getString("webdeveloper_validateSection508"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.5.url", "http://www.cynthiasays.com/mynewtester/cynthia.exe?rptmode=-1&url1=");
-
- // Set WAI validator
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.6.description", stringBundle.getString("webdeveloper_validateWAI"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.6.url", "http://www.cynthiasays.com/mynewtester/cynthia.exe?rptmode=2&url1=");
-
- // Set separator
- webdeveloper_setBooleanPreferenceIfNotSet("webdeveloper.tool.7.separator", true);
-
- // Set speed report
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.8.description", stringBundle.getString("webdeveloper_viewSpeedReport"));
- webdeveloper_setStringPreferenceIfNotSet("webdeveloper.tool.8.url", "http://www.websiteoptimization.com/cgi-bin/wso/wso.pl?url=");
- }
-}
-
-// Sorts two images
-function webdeveloper_sortImages(imageOne, imageTwo)
-{
- // If both images are set
- if(imageOne && imageTwo)
- {
- var imageOneSrc = imageOne.src;
- var imageTwoSrc = imageTwo.src;
-
- // If the images are equal
- if(imageOneSrc == imageTwoSrc)
- {
- return 0;
- }
- else if(imageOneSrc < imageTwoSrc)
- {
- return -1;
- }
- }
-
- return 1;
-}
-
-// Handles a tab being selected
-function webdeveloper_tabSelect(event)
-{
- var selectedTab = getBrowser().mTabBox.selectedIndex;
-
- // If the selected tab is different
- if(selectedTab != webdeveloper_selectedTab)
- {
- webdeveloper_selectedTab = selectedTab;
-
- webdeveloper_resetCSSStatus();
- webdeveloper_resetJavaScriptStatus();
- webdeveloper_updateAppliedStyles();
- webdeveloper_updateRenderMode(webdeveloper_getContentDocument());
-
- // Reset the display line guides and display ruler toolbars
- webdeveloper_configureElement(document.getElementById("webdeveloper-line-guides-toolbar"), "hidden", !webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-display-line-guides"));
- webdeveloper_configureElement(document.getElementById("webdeveloper-ruler-toolbar"), "hidden", !webdeveloper_contains(webdeveloper_appliedStyles, "webdeveloper-display-ruler"));
-
- // Reset the information text toolbar
- webdeveloper_configureElement(document.getElementById("webdeveloper-information-text-toolbar"), "hidden", !webdeveloper_isInformationTextToolbarInUse());
- }
-}
-
-// Tidies a list of images by removing duplicates and sorting
-function webdeveloper_tidyImages(imageList)
-{
- var image = null;
- var imageListLength = imageList.length;
- var imageSrc = null;
- var newImageList = new Array();
- var newImageListLength = null;
- var tidiedImageList = new Array();
-
- // Loop through the images
- for(var i = 0; i < imageListLength; i++)
- {
- image = imageList[i];
- imageSrc = image.src;
-
- // If the image src is set and does not end in '.xul'
- if(imageSrc && !imageSrc.endsWith(".xul"))
- {
- newImageList.push(image);
- }
- }
-
- newImageList.sort(webdeveloper_sortImages);
-
- newImageListLength = newImageList.length;
-
- // Loop through the images
- for(i = 0; i < newImageListLength; i++)
- {
- image = newImageList[i];
-
- // If this is not the last image and the image is the same as the next image
- if(i + 1 < newImageListLength && image.src == newImageList[i + 1].src)
- {
- continue;
- }
-
- tidiedImageList.push(image);
- }
-
- return tidiedImageList;
-}
-
-// Toggles the applied style with the given id
-function webdeveloper_toggleAppliedStyle(element, id)
-{
- webdeveloper_removeAppliedStyle(id);
-
- // If the menu is checked
- if(element && element.getAttribute("checked"))
- {
- webdeveloper_addAppliedStyle(id);
- }
-}
-
-// Toggles the feature tooltip styles
-function webdeveloper_toggleFeatureTooltipStyles(element, styleSheetId, selectors)
-{
- webdeveloper_removeStyleSheet(styleSheetId, false);
-
- // If the menu is checked
- if(element.getAttribute("checked"))
- {
- var colors = " background-color: " + webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.background", true) + " !important; border-color: " + webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.border", true) + " !important; color: " + webdeveloper_getStringPreference("webdeveloper.feature.tooltip.color.text", true) + " !important; ";
- var documentList = webdeveloper_getDocuments(webdeveloper_getContentWindow());
- var documentLength = documentList.length;
- var opacityValue = webdeveloper_getStringPreference("webdeveloper.feature.tooltip.opacity", true);
- var opacity = " -moz-opacity: " + opacityValue + " !important; opacity: " + opacityValue + " !important; ";
- var pageDocument = null;
- var styleElement = null;
-
- // Loop through the documents
- for(var i = 0; i < documentLength; i++)
- {
- pageDocument = documentList[i];
- styleElement = pageDocument.createElement("style");
-
- styleElement.appendChild(pageDocument.createTextNode(selectors + " {" + colors + opacity + "}"));
- styleElement.setAttribute("id", styleSheetId);
- styleElement.setAttribute("type", "text/css");
-
- webdeveloper_getDocumentHeadElement(pageDocument).appendChild(styleElement);
- }
- }
-}
-
-// Toggles an individual style sheet
-function webdeveloper_toggleIndividualStyleSheet(selectedStyleSheetHref)
-{
- var currentDocument = webdeveloper_getContentDocument();
- var styleSheet = null;
- var styleSheetHref = null;
- var styleSheetList = currentDocument.styleSheets;
- var styleSheetLength = styleSheetList.length;
-
- // Loop through the style sheets
- for(var i = 0; i < styleSheetLength; i++)
- {
- styleSheet = styleSheetList[i];
- styleSheetHref = styleSheet.href;
-
- // If this is the selected style sheet
- if(styleSheetHref == selectedStyleSheetHref)
- {
- styleSheet.disabled = !styleSheet.disabled;
- }
- }
-}
-
-// Toggles the style sheet with the given id
-function webdeveloper_toggleStyleSheet(element, location, id)
-{
- webdeveloper_removeStyleSheet(id);
-
- // If the menu is checked
- if(element && element.getAttribute("checked"))
- {
- webdeveloper_addStyleSheet(location, id);
- }
-}
-
-// Toggles the toolbar
-function webdeveloper_toggleToolbar()
-{
- var toolbar = document.getElementById("webdeveloper-toolbar");
-
- toolbar.collapsed = !toolbar.collapsed;
-
- document.persist("webdeveloper-toolbar", "collapsed");
-}
-
-// Uninitializes the extension
-function webdeveloper_uninitialize(event)
-{
- var windowContent = window.document.getElementById("content");
-
- // If the window content is set
- if(windowContent)
- {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService().QueryInterface(Components.interfaces.nsIConsoleService);
- var tabBox = windowContent.mTabBox;
-
- // Try to remove the event listener
- try
- {
- windowContent.removeEventListener("load", webdeveloper_pageLoad, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // Try to remove the event listener
- try
- {
- windowContent.removeEventListener("unload", webdeveloper_pageUnload, true);
- }
- catch(exception)
- {
- // Do nothing
- }
-
- // If the console service is set
- if(consoleService)
- {
- // Try to remove the console listener
- try
- {
- consoleService.unregisterListener(WebDeveloperErrorConsoleListener);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-
- // If the tab box is set
- if(tabBox)
- {
- // Try to remove the event listener
- try
- {
- tabBox.removeEventListener("select", webdeveloper_tabSelect, false);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-
- // Try to remove the event listener
- try
- {
- window.removeEventListener("close", webdeveloper_uninitialize, false);
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-}
-
-// Updates the applied styles
-function webdeveloper_updateAppliedStyles()
-{
- webdeveloper_clearAppliedStyles();
- webdeveloper_addAppliedStyleByElement("webdeveloper-add-user-style-sheet");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-all-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-browser-default-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-all-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-embedded-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-inline-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-linked-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-disable-print-styles");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-abbreviations");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-access-keys");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-alt-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-anchors");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-block-size");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-div-order");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-element-information");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-form-details");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-handheld-css");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-id-class-details");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-image-dimensions");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-image-file-sizes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-image-paths");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-line-guides");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-link-details");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-object-information");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-print-css");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-ruler");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-stack-levels");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-tab-index");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-table-depth");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-table-information");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-title-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-topographic-information");
- webdeveloper_addAppliedStyleByElement("webdeveloper-display-window-size-title");
- webdeveloper_addAppliedStyleByElement("webdeveloper-hide-background-images");
- webdeveloper_addAppliedStyleByElement("webdeveloper-hide-images");
- webdeveloper_addAppliedStyleByElement("webdeveloper-linearize-page");
- webdeveloper_addAppliedStyleByElement("webdeveloper-make-images-invisible");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-absolute-positioned-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-all-images");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-background-images");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-block-level-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-current-element");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-custom-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-deprecated-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-external-links");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-fixed-positioned-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-floated-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-frames");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-headings");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-images-with-adjusted-dimensions");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-images-with-empty-alt-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-images-without-alt-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-images-without-dimensions");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-images-without-title-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-links-with-ping-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-links-without-title-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-relative-positioned-elements");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-table-captions");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-table-cells");
- webdeveloper_addAppliedStyleByElement("webdeveloper-outline-all-tables");
- webdeveloper_addAppliedStyleByElement("webdeveloper-replace-images-with-alt-attributes");
- webdeveloper_addAppliedStyleByElement("webdeveloper-show-comments");
- webdeveloper_addAppliedStyleByElement("webdeveloper-small-screen-rendering");
- webdeveloper_addAppliedStyleByElement("webdeveloper-use-border-box-model");
- webdeveloper_addAppliedStyleByElement("webdeveloper-view-style-information");
-}
-
-// Updates the CSS status button
-function webdeveloper_updateCSSStatus(error)
-{
- var cssButton = document.getElementById("webdeveloper-css-statusbar");
-
- // If the CSS button is set
- if(cssButton)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the error is set
- if(error)
- {
- var errorMessage = error.errorMessage;
-
- cssButton.setAttribute("tooltiptext", stringBundle.getFormattedString("webdeveloper_cssErrorTooltip", [errorMessage]));
-
- // If the CSS button does not have a class attribute or it is not set to error
- if(!cssButton.hasAttribute("class") || cssButton.getAttribute("class") != "error")
- {
- cssButton.setAttribute("class", "error");
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- cssButton.setAttribute("label", stringBundle.getString("webdeveloper_cssErrorLabel"));
- }
- }
-
- // If the open CSS console error preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.open.css.console.error", true))
- {
- webdeveloper_openErrorConsole(false);
- }
- }
- else if(!cssButton.hasAttribute("class") || cssButton.getAttribute("class") != "valid")
- {
- cssButton.setAttribute("class", "valid");
- cssButton.setAttribute("tooltiptext", stringBundle.getString("webdeveloper_cssNoErrorsTooltip"));
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- cssButton.setAttribute("label", stringBundle.getString("webdeveloper_cssNoErrorsLabel"));
- }
- }
- }
-}
-
-// Updates the JavaScript status button
-function webdeveloper_updateJavaScriptStatus(error)
-{
- var javaScriptButton = document.getElementById("webdeveloper-javascript-statusbar");
-
- // If the JavaScript button is set
- if(javaScriptButton)
- {
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
-
- // If the error is set
- if(error)
- {
- var errorMessage = error.errorMessage;
- var warning = error.flags & error.warningFlag != 0;
-
- // If this is a warning
- if(warning)
- {
- javaScriptButton.setAttribute("tooltiptext", stringBundle.getFormattedString("webdeveloper_javaScriptWarningTooltip", [errorMessage]));
-
- // If the JavaScript button does not have a class attribute or it is not set to warning
- if(!javaScriptButton.hasAttribute("class") || javaScriptButton.getAttribute("class") != "warning")
- {
- javaScriptButton.setAttribute("class", "warning");
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- javaScriptButton.setAttribute("label", stringBundle.getString("webdeveloper_javaScriptWarningLabel"));
- }
- }
-
- // If the open JavaScript console warning preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.warning", true))
- {
- webdeveloper_openErrorConsole(false);
- }
- }
- else
- {
- javaScriptButton.setAttribute("tooltiptext", stringBundle.getFormattedString("webdeveloper_javaScriptErrorTooltip", [errorMessage]));
-
- // If the JavaScript button does not have a class attribute or it is not set to error
- if(!javaScriptButton.hasAttribute("class") || javaScriptButton.getAttribute("class") != "error")
- {
- javaScriptButton.setAttribute("class", "error");
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- javaScriptButton.setAttribute("label", stringBundle.getString("webdeveloper_javaScriptErrorLabel"));
- }
- }
-
- // If the open JavaScript console error preference is set
- if(webdeveloper_getBooleanPreference("webdeveloper.open.javascript.console.error", true))
- {
- webdeveloper_openErrorConsole(false);
- }
- }
- }
- else if(!javaScriptButton.hasAttribute("class") || javaScriptButton.getAttribute("class") != "valid")
- {
- javaScriptButton.setAttribute("class", "valid");
- javaScriptButton.setAttribute("tooltiptext", stringBundle.getString("webdeveloper_javaScriptNoErrorsTooltip"));
-
- // If the toolbar preference is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- javaScriptButton.setAttribute("label", stringBundle.getString("webdeveloper_javaScriptNoErrorsLabel"));
- }
- }
- }
-}
-
-// Updates the meta redirects status
-function webdeveloper_updateMetaRedirects(browser)
-{
- browser.docShell.allowMetaRedirects = !webdeveloper_getBooleanPreference("webdeveloper.meta.redirects.disable", true);
-}
-
-// Updates the options menu
-function webdeveloper_updateOptionsMenu(suffix)
-{
- var appliedStyles = true;
-
- // If there are no applied styles
- if(webdeveloper_appliedStyles.length == 0)
- {
- appliedStyles = false;
- }
-
- webdeveloper_configureElement(document.getElementById("webdeveloper-persist-features-" + suffix), "checked", webdeveloper_getBooleanPreference("webdeveloper.persist.features", true));
- webdeveloper_configureElement(document.getElementById("webdeveloper-reset-page-" + suffix), "disabled", !appliedStyles);
-}
-
-// Updates the render mode status button
-function webdeveloper_updateRenderMode(currentDocument)
-{
- var element = document.getElementById("webdeveloper-render-mode-statusbar");
-
- // If the render mode button exists
- if(element)
- {
- var renderMode = currentDocument.compatMode;
- var stringBundle = document.getElementById("webdeveloper-string-bundle");
- var textToolbar = false;
-
- // If the toolbar preference has a value and is set to text
- if(webdeveloper_getStringPreference("webdeveloper.toolbar.icons", true) == "text")
- {
- textToolbar = true;
- }
-
- // If the render mode is quirks mode
- if(renderMode == "BackCompat")
- {
- element.setAttribute("class", "quirks");
- element.setAttribute("tooltiptext", stringBundle.getString("webdeveloper_quirksModeTooltip"));
-
- // If the toolbar is in text mode
- if(textToolbar)
- {
- element.setAttribute("label", stringBundle.getString("webdeveloper_quirksModeLabel"));
- }
- }
- else
- {
- // If the render mode button has a class attribute
- if(element.hasAttribute("class"))
- {
- element.removeAttribute("class");
- }
-
- element.setAttribute("tooltiptext", stringBundle.getString("webdeveloper_standardsComplianceModeTooltip"));
-
- // If the toolbar is in text mode
- if(textToolbar)
- {
- element.setAttribute("label", stringBundle.getString("webdeveloper_standardsComplianceModeLabel"));
- }
- }
- }
-}
-
-// Updates the status menu
-function webdeveloper_updateStatusMenu(statusMenu)
-{
- var appliedStylesLength = webdeveloper_appliedStyles.length;
-
- webdeveloper_removeGeneratedMenuItems(statusMenu);
-
- // Loop through the applied styles
- for(var i = 0; i < appliedStylesLength; i++)
- {
- webdeveloper_addStatusMenuItem(statusMenu,webdeveloper_appliedStyles[i]);
- }
-
- // If the status menu has only two children
- if(statusMenu.childNodes.length == 2)
- {
- return false;
- }
-
- return true;
-}
-
-// Error console listener
-var WebDeveloperErrorConsoleListener =
-{
- // Observes changes in the console
- observe: function(error)
- {
- // If the document and error are set
- if(document && error)
- {
- // Try to convert the error to a script error
- try
- {
- error = error.QueryInterface(Components.interfaces.nsIScriptError);
-
- var errorCategory = error.category;
- var sourceName = error.sourceName;
-
- // If the error category is set and is content javascript
- if(errorCategory && errorCategory == "content javascript")
- {
- webdeveloper_updateJavaScriptStatus(error);
- }
- else if(errorCategory && errorCategory == "CSS Parser")
- {
- webdeveloper_updateCSSStatus(error);
- }
- else if(sourceName && sourceName.indexOf("chrome://webdeveloper/") != -1 && webdeveloper_getBooleanPreference("webdeveloper.debug", true))
- {
- webdeveloper_openErrorConsole(false);
- }
- }
- catch(exception)
- {
- // Do nothing
- }
- }
-
- return false;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://webdeveloper/content/webdeveloper.css" type="text/css"?>
-<?xml-stylesheet href="chrome://webdeveloper/skin/webdeveloper.css" type="text/css"?>
-
-<!DOCTYPE overlay SYSTEM "chrome://webdeveloper/locale/menu.dtd">
-
-<overlay id="webdeveloper"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml">
-
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/application.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/array.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/cookie.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/css.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/dom.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/file.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/history.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/preferences.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/prompt.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/string.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/xpath.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/validation/accessibility.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/validation/css.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/common/validation/html.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/dashboard/dashboard.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/display_element_information.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/display_line_guides.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/display_page_magnifier.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/display_page_validation.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/display_ruler.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/show_comments.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/view_document_size.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/features/view_style_information.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/cookies.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/css.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/disable.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/forms.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/images.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/information.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/miscellaneous.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/outline.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/resize.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/tools.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/upgrade.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/view_source.js"/>
- <script type="application/x-javascript" src="chrome://webdeveloper/content/webdeveloper.js"/>
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="webdeveloper-string-bundle" src="chrome://webdeveloper/locale/webdeveloper.properties"/>
- </stringbundleset>
-
- <broadcasterset id="navBroadcasters">
- <broadcaster id="webdeveloper-view-toolbar-command" checked="true" oncommand="webdeveloper_toggleToolbar()"/>
- </broadcasterset>
-
- <keyset id="mainKeyset">
- <key id="webdeveloper-disable-styles-key" key="&webdeveloper.disable.styles.shortcut;" label="&webdeveloper.disable.styles.label;" modifiers="accel,shift" oncommand="webdeveloper_toggleStyles(null)"/>
- <key id="webdeveloper-display-element-information-key" key="&webdeveloper.display.element.information.shortcut;" label="&webdeveloper.display.element.information.label;" modifiers="accel,shift" oncommand="webdeveloper_displayElementInformation(null)"/>
- <key id="webdeveloper-edit-css-key" key="&webdeveloper.edit.css.shortcut;" label="&webdeveloper.edit.css.label;" modifiers="accel,shift" oncommand="webdeveloper_editCSS()"/>
- <key id="webdeveloper-error-console-key" key="&webdeveloper.error.console.shortcut;" label="&webdeveloper.error.console.label;" modifiers="accel,shift" oncommand="webdeveloper_openErrorConsole(true)"/>
- <key id="webdeveloper-java-console-key" key="&webdeveloper.java.console.shortcut;" label="&webdeveloper.java.console.label;" modifiers="accel,shift" oncommand="webdeveloper_openJavaConsole()"/>
- <key id="webdeveloper-validate-local-html-key" key="&webdeveloper.validate.local.html.shortcut;" label="&webdeveloper.validate.local.html.label;" modifiers="accel,shift" oncommand="webdeveloper_validateLocalHTML()"/>
- <key id="webdeveloper-view-css-key" key="&webdeveloper.view.css.shortcut;" label="&webdeveloper.view.css.label;" modifiers="accel,shift" oncommand="webdeveloper_viewCSS()"/>
- <key id="webdeveloper-view-source-key" key="&webdeveloper.view.source.shortcut;" label="&webdeveloper.view.source.label;" modifiers="accel,shift" oncommand="webdeveloper_viewSource(webdeveloper_getContentDocument())"/>
- <key id="webdeveloper-view-style-information-key" key="&webdeveloper.view.style.information.shortcut;" label="&webdeveloper.view.style.information.label;" modifiers="accel,shift" oncommand="webdeveloper_viewStyleInformation(null)"/>
- <key id="webdeveloper-toolbar-key" key="&webdeveloper.toolbar.shortcut;" label="&webdeveloper.toolbar.name;" modifiers="accel,shift" oncommand="webdeveloper_toggleToolbar()"/>
- <key id="webdeveloper-zoom-in-key" key="&webdeveloper.zoom.in.shortcut;" label="&webdeveloper.zoom.in.label;" modifiers="accel,shift" oncommand="webdeveloper_zoom(true)"/>
- <key id="webdeveloper-zoom-out-key" key="&webdeveloper.zoom.out.shortcut;" label="&webdeveloper.zoom.out.label;" modifiers="accel,shift" oncommand="webdeveloper_zoom(false)"/>
- </keyset>
-
- <menupopup id="view_toolbars_popup">
- <menuitem id="webdeveloper-view-toolbar" accesskey="&webdeveloper.key;" class="menuitem-iconic" label="&webdeveloper.toolbar.name;" type="checkbox" observes="webdeveloper-view-toolbar-command"/>
- </menupopup>
-
- <menupopup id="menu_ToolsPopup">
- <menu id="webdeveloper-menu" accesskey="&webdeveloper.key;" class="menuitem-iconic" image="chrome://webdeveloper/content/images/logo/small.png" insertafter="devToolsSeparator" label="&webdeveloper.name;">
- <menupopup>
- <menu id="webdeveloper-disable-menu" accesskey="&webdeveloper.disable.key;" label="&webdeveloper.disable.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableMenu('menu')">
- <menuitem id="webdeveloper-disable-cache-menu" accesskey="&webdeveloper.disable.cache.key;" label="&webdeveloper.disable.cache.label;" type="checkbox" oncommand="webdeveloper_toggleCache(this)"/>
- <menuseparator id="webdeveloper-disable-separator1-menu"/>
- <menuitem id="webdeveloper-disable-java-menu" accesskey="&webdeveloper.disable.java.key;" label="&webdeveloper.disable.java.label;" type="checkbox" oncommand="webdeveloper_toggleJava(this)"/>
- <menu id="webdeveloper-disable-javascript-menu" accesskey="&webdeveloper.disable.javascript.key;" label="&webdeveloper.disable.javascript.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableJavaScriptMenu('menu')">
- <menuitem id="webdeveloper-disable-all-javascript-menu" accesskey="&webdeveloper.all.javascript.key;" label="&webdeveloper.all.javascript.label;" type="checkbox" oncommand="webdeveloper_toggleJavaScript(this)"/>
- <menuseparator id="webdeveloper-disable-javascript-separator1-menu"/>
- <menuitem id="webdeveloper-disable-strict-javascript-warnings-menu" accesskey="&webdeveloper.strict.warnings.key;" label="&webdeveloper.strict.warnings.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'javascript.options.strict')"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-disable-separator2-menu"/>
- <menuitem id="webdeveloper-disable-meta-redirects-menu" accesskey="&webdeveloper.disable.meta.redirects.key;" label="&webdeveloper.disable.meta.redirects.label;" type="checkbox" oncommand="webdeveloper_toggleMetaRedirects(this)"/>
- <menuitem id="webdeveloper-disable-minimum-font-size-menu" accesskey="&webdeveloper.disable.minimum.font.size.key;" label="&webdeveloper.disable.minimum.font.size.label;" type="checkbox" oncommand="webdeveloper_toggleMinimumFontSize(this)"/>
- <menuitem id="webdeveloper-disable-page-colors-menu" accesskey="&webdeveloper.disable.page.colors.key;" label="&webdeveloper.disable.page.colors.label;" type="checkbox" oncommand="webdeveloper_togglePageColors(this)"/>
- <menuitem id="webdeveloper-disable-popup-blocker-menu" accesskey="&webdeveloper.disable.popup.blocker.key;" label="&webdeveloper.disable.popup.blocker.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'dom.disable_open_during_load')"/>
- <menuitem id="webdeveloper-disable-proxy-menu" accesskey="&webdeveloper.disable.proxy.key;" label="&webdeveloper.disable.proxy.label;" type="checkbox" oncommand="webdeveloper_toggleProxy(this)"/>
- <menuitem id="webdeveloper-disable-referrers-menu" accesskey="&webdeveloper.disable.referrers.key;" label="&webdeveloper.disable.referrers.label;" type="checkbox" oncommand="webdeveloper_toggleReferrers(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-cookies-menu" accesskey="&webdeveloper.cookies.key;" label="&webdeveloper.cookies.label;">
- <menupopup>
- <menu id="webdeveloper-disable-cookies-menu" accesskey="&webdeveloper.disable.cookies.key;" label="&webdeveloper.disable.cookies.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableCookiesMenu('menu')">
- <menuitem id="webdeveloper-disable-all-cookies-menu" accesskey="&webdeveloper.all.cookies.key;" label="&webdeveloper.all.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleCookies(this)"/>
- <menuitem id="webdeveloper-disable-external-site-cookies-menu" accesskey="&webdeveloper.external.site.cookies.key;" label="&webdeveloper.external.site.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteCookies(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-cookies-separator1-menu"/>
- <menuitem id="webdeveloper-clear-session-cookies-menu" accesskey="&webdeveloper.clear.session.cookies.key;" label="&webdeveloper.clear.session.cookies.label;" oncommand="webdeveloper_clearSessionCookies()"/>
- <menuitem id="webdeveloper-delete-domain-cookies-menu" accesskey="&webdeveloper.delete.domain.cookies.key;" label="&webdeveloper.delete.domain.cookies.label;" oncommand="webdeveloper_deleteDomainCookies()"/>
- <menuitem id="webdeveloper-delete-path-cookies-menu" accesskey="&webdeveloper.delete.path.cookies.key;" label="&webdeveloper.delete.path.cookies.label;" oncommand="webdeveloper_deletePathCookies()"/>
- <menuseparator id="webdeveloper-cookies-separator2-menu"/>
- <menuitem id="webdeveloper-view-cookie-information-menu" accesskey="&webdeveloper.view.cookie.information.key;" label="&webdeveloper.view.cookie.information.label;" oncommand="webdeveloper_viewCookieInformation()"/>
- <menuseparator id="webdeveloper-cookies-separator3-menu"/>
- <menuitem id="webdeveloper-add-cookie-menu" accesskey="&webdeveloper.add.cookie.key;" label="&webdeveloper.add.cookie.label;" oncommand="webdeveloper_addCookie()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-css-menu" accesskey="&webdeveloper.css.key;" label="&webdeveloper.css.label;">
- <menupopup onpopupshowing="webdeveloper_updateCSSMenu('menu')">
- <menu id="webdeveloper-disable-styles-menu" accesskey="&webdeveloper.disable.styles.key;" label="&webdeveloper.disable.styles.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableStylesMenu('menu')">
- <menuitem id="webdeveloper-disable-all-styles-menu" accesskey="&webdeveloper.all.styles.key;" key="webdeveloper-disable-styles-key" label="&webdeveloper.all.styles.label;" type="checkbox" oncommand="webdeveloper_toggleStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator1-menu"/>
- <menuitem id="webdeveloper-disable-browser-default-styles-menu" accesskey="&webdeveloper.browser.default.styles.key;" label="&webdeveloper.browser.default.styles.label;" type="checkbox" oncommand="webdeveloper_toggleBrowserDefaultStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator2-menu"/>
- <menuitem id="webdeveloper-disable-embedded-styles-menu" accesskey="&webdeveloper.embedded.styles.key;" label="&webdeveloper.embedded.styles.label;" type="checkbox" oncommand="webdeveloper_toggleEmbeddedStyles(this)"/>
- <menuitem id="webdeveloper-disable-inline-styles-menu" accesskey="&webdeveloper.inline.styles.key;" label="&webdeveloper.inline.styles.label;" type="checkbox" oncommand="webdeveloper_toggleInlineStyles(this)"/>
- <menuitem id="webdeveloper-disable-linked-styles-menu" accesskey="&webdeveloper.linked.style.sheets.key;" label="&webdeveloper.linked.style.sheets.label;" type="checkbox" oncommand="webdeveloper_toggleLinkedStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator3-menu"/>
- <menuitem id="webdeveloper-disable-print-styles-menu" accesskey="&webdeveloper.print.styles.key;" label="&webdeveloper.print.styles.label;" type="checkbox" oncommand="webdeveloper_togglePrintStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator4-menu"/>
- <menu id="webdeveloper-disable-individual-style-sheet-menu" accesskey="&webdeveloper.individual.style.sheet.key;" label="&webdeveloper.individual.style.sheet.label;">
- <menupopup onpopupshowing="webdeveloper_displayDisableIndividualStyleSheetMenu(this)"/>
- </menu>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-css-separator1-menu"/>
- <menu id="webdeveloper-display-media-type-menu" accesskey="&webdeveloper.display.css.media.type.key;" label="&webdeveloper.display.css.media.type.label;">
- <menupopup onpopupshowing="webdeveloper_updateCSSMediaTypeMenu('menu')">
- <menuitem id="webdeveloper-display-handheld-css-menu" accesskey="&webdeveloper.handheld.key;" label="&webdeveloper.handheld.label;" type="checkbox" oncommand="webdeveloper_displayHandheldCSS(this)"/>
- <menuitem id="webdeveloper-display-print-css-menu" accesskey="&webdeveloper.print.key;" label="&webdeveloper.print.label;" type="checkbox" oncommand="webdeveloper_displayPrintCSS(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-css-menu" accesskey="&webdeveloper.view.css.key;" key="webdeveloper-view-css-key" label="&webdeveloper.view.css.label;" oncommand="webdeveloper_viewCSS()"/>
- <menuitem id="webdeveloper-view-style-information-menu" accesskey="&webdeveloper.view.style.information.key;" key="webdeveloper-view-style-information-key" label="&webdeveloper.view.style.information.label;" type="checkbox" oncommand="webdeveloper_viewStyleInformation(this)"/>
- <menuseparator id="webdeveloper-css-separator2-menu"/>
- <menuitem id="webdeveloper-add-user-style-sheet-menu" accesskey="&webdeveloper.add.user.style.sheet.key;" label="&webdeveloper.add.user.style.sheet.label;" type="checkbox" oncommand="webdeveloper_addUserStyleSheet(this)"/>
- <menuitem id="webdeveloper-edit-css-menu" accesskey="&webdeveloper.edit.css.key;" key="webdeveloper-edit-css-key" label="&webdeveloper.edit.css.label;" type="checkbox" oncommand="webdeveloper_editCSS()"/>
- <menuitem id="webdeveloper-use-border-box-model-menu" accesskey="&webdeveloper.use.border.box.model.key;" label="&webdeveloper.use.border.box.model.label;" type="checkbox" oncommand="webdeveloper_toggleBorderBoxModel(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-forms-menu" accesskey="&webdeveloper.forms.key;" label="&webdeveloper.forms.label;">
- <menupopup onpopupshowing="webdeveloper_updateFormsMenu('menu')">
- <menuitem id="webdeveloper-display-form-details-menu" accesskey="&webdeveloper.display.form.details.key;" label="&webdeveloper.display.form.details.label;" type="checkbox" oncommand="webdeveloper_displayFormDetails(this)"/>
- <menuitem id="webdeveloper-show-passwords-menu" accesskey="&webdeveloper.show.passwords.key;" label="&webdeveloper.show.passwords.label;" oncommand="webdeveloper_showPasswords()"/>
- <menuitem id="webdeveloper-view-form-information-menu" accesskey="&webdeveloper.view.form.information.key;" label="&webdeveloper.view.form.information.label;" oncommand="webdeveloper_viewFormInformation()"/>
- <menuseparator id="webdeveloper-forms-separator1-menu"/>
- <menu id="webdeveloper-convert-form-methods-menu" accesskey="&webdeveloper.convert.form.methods.key;" label="&webdeveloper.convert.form.methods.label;">
- <menupopup>
- <menuitem id="webdeveloper-convert-form-methods-gets-posts-menu" accesskey="&webdeveloper.gets.posts.key;" label="&webdeveloper.gets.posts.label;" oncommand="webdeveloper_convertFormMethods('post')"/>
- <menuitem id="webdeveloper-convert-form-methods-posts-gets-menu" accesskey="&webdeveloper.posts.gets.key;" label="&webdeveloper.posts.gets.label;" oncommand="webdeveloper_convertFormMethods('get')"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-convert-select-elements-text-inputs-menu" accesskey="&webdeveloper.convert.select.elements.text.inputs.key;" label="&webdeveloper.convert.select.elements.text.inputs.label;" oncommand="webdeveloper_convertSelectElementsToTextInputs()"/>
- <menuseparator id="webdeveloper-forms-separator2-menu"/>
- <menuitem id="webdeveloper-enable-auto-completion-menu" accesskey="&webdeveloper.enable.auto.completion.key;" label="&webdeveloper.enable.auto.completion.label;" oncommand="webdeveloper_enableFormAutoCompletion()"/>
- <menuitem id="webdeveloper-enable-form-fields-menu" accesskey="&webdeveloper.enable.form.fields.key;" label="&webdeveloper.enable.form.fields.label;" oncommand="webdeveloper_enableFormFields()"/>
- <menuseparator id="webdeveloper-forms-separator3-menu"/>
- <menuitem id="webdeveloper-clear-radio-buttons-menu" accesskey="&webdeveloper.clear.radio.buttons.key;" label="&webdeveloper.clear.radio.buttons.label;" oncommand="webdeveloper_clearRadioButtons()"/>
- <menuitem id="webdeveloper-make-form-fields-writable-menu" accesskey="&webdeveloper.make.form.fields.writable.key;" label="&webdeveloper.make.form.fields.writable.label;" oncommand="webdeveloper_makeFormFieldsWritable()"/>
- <menuitem id="webdeveloper-populate-form-fields-menu" accesskey="&webdeveloper.populate.form.fields.key;" label="&webdeveloper.populate.form.fields.label;" oncommand="webdeveloper_populateFormFields()"/>
- <menuitem id="webdeveloper-remove-maximum-lengths-menu" accesskey="&webdeveloper.remove.maximum.lengths.key;" label="&webdeveloper.remove.maximum.lengths.label;" oncommand="webdeveloper_removeMaximumLengths()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-images-menu" accesskey="&webdeveloper.images.key;" label="&webdeveloper.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateImagesMenu('menu')">
- <menu id="webdeveloper-disable-images-menu" accesskey="&webdeveloper.disable.images.key;" label="&webdeveloper.disable.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableImagesMenu('menu')">
- <menuitem id="webdeveloper-disable-all-images-menu" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_toggleImages(this)"/>
- <menuitem id="webdeveloper-disable-external-site-images-menu" accesskey="&webdeveloper.external.site.images.key;" label="&webdeveloper.external.site.images.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteImages(this)"/>
- <menuseparator id="webdeveloper-disable-images-separator1-menu"/>
- <menuitem id="webdeveloper-disable-image-animations-menu" accesskey="&webdeveloper.image.animations.key;" label="&webdeveloper.image.animations.label;" type="checkbox" oncommand="webdeveloper_toggleImageAnimations(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-images-separator1-menu"/>
- <menuitem id="webdeveloper-display-alt-attributes-menu" accesskey="&webdeveloper.display.alt.attributes.key;" label="&webdeveloper.display.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_displayAltAttributes(this)"/>
- <menuitem id="webdeveloper-display-image-dimensions-menu" accesskey="&webdeveloper.display.image.dimensions.key;" label="&webdeveloper.display.image.dimensions.label;" type="checkbox" oncommand="webdeveloper_displayImageDimensions(this)"/>
- <menuitem id="webdeveloper-display-image-file-sizes-menu" accesskey="&webdeveloper.display.image.file.sizes.key;" label="&webdeveloper.display.image.file.sizes.label;" type="checkbox" oncommand="webdeveloper_displayImageFileSizes(this)"/>
- <menuitem id="webdeveloper-display-image-paths-menu" accesskey="&webdeveloper.display.image.paths.key;" label="&webdeveloper.display.image.paths.label;" type="checkbox" oncommand="webdeveloper_displayImagePaths(this)"/>
- <menuseparator id="webdeveloper-images-separator2-menu"/>
- <menuitem id="webdeveloper-find-broken-images-menu" accesskey="&webdeveloper.find.broken.images.key;" label="&webdeveloper.find.broken.images.label;" oncommand="webdeveloper_findBrokenImages()"/>
- <menu id="webdeveloper-outline-images-menu" accesskey="&webdeveloper.outline.images.key;" label="&webdeveloper.outline.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineImagesMenu('menu')">
- <menuitem id="webdeveloper-outline-all-images-menu" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_outlineAllImages(this)"/>
- <menuitem id="webdeveloper-outline-background-images-menu" accesskey="&webdeveloper.background.images.key;" label="&webdeveloper.background.images.label;" type="checkbox" oncommand="webdeveloper_outlineBackgroundImages(this, true)"/>
- <menuseparator id="webdeveloper-outline-images-separator1-menu"/>
- <menuitem id="webdeveloper-outline-images-with-adjusted-dimensions-menu" accesskey="&webdeveloper.images.with.adjusted.dimensions.key;" label="&webdeveloper.images.with.adjusted.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithAdjustedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-with-empty-alt-attributes-menu" accesskey="&webdeveloper.images.with.empty.alt.key;" label="&webdeveloper.images.with.empty.alt.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithEmptyAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-with-oversized-dimensions-menu" accesskey="&webdeveloper.images.with.oversized.dimensions.key;" label="&webdeveloper.images.with.oversized.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithOversizedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-alt-attributes-menu" accesskey="&webdeveloper.images.without.alt.attributes.key;" label="&webdeveloper.images.without.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-without-dimensions-menu" accesskey="&webdeveloper.images.without.dimensions.key;" label="&webdeveloper.images.without.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-title-attributes-menu" accesskey="&webdeveloper.images.without.title.attributes.key;" label="&webdeveloper.images.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-image-information-menu" accesskey="&webdeveloper.view.image.information.key;" label="&webdeveloper.view.image.information.label;" oncommand="webdeveloper_viewImageInformation()"/>
- <menuseparator id="webdeveloper-images-separator3-menu"/>
- <menuitem id="webdeveloper-hide-background-images-menu" accesskey="&webdeveloper.hide.background.images.key;" label="&webdeveloper.hide.background.images.label;" type="checkbox" oncommand="webdeveloper_hideBackgroundImages(this)"/>
- <menuitem id="webdeveloper-hide-images-menu" accesskey="&webdeveloper.hide.images.key;" label="&webdeveloper.hide.images.label;" type="checkbox" oncommand="webdeveloper_hideImages(this, 'webdeveloper-hide-images')"/>
- <menuitem id="webdeveloper-make-images-full-size-menu" accesskey="&webdeveloper.make.images.full.size.key;" label="&webdeveloper.make.images.full.size.label;" oncommand="webdeveloper_makeImagesFullSize()"/>
- <menuitem id="webdeveloper-make-images-invisible-menu" accesskey="&webdeveloper.make.images.invisible.key;" label="&webdeveloper.make.images.invisible.label;" type="checkbox" oncommand="webdeveloper_makeImagesInvisible(this, 'webdeveloper-make-images-invisible')"/>
- <menuitem id="webdeveloper-replace-images-with-alt-attributes-menu" accesskey="&webdeveloper.replace.images.with.alt.attributes.key;" label="&webdeveloper.replace.images.with.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_replaceImagesWithAltAttributes(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-information-menu" accesskey="&webdeveloper.information.key;" label="&webdeveloper.information.label;">
- <menupopup onpopupshowing="webdeveloper_updateInformationMenu('menu')">
- <menuitem id="webdeveloper-display-abbreviations-menu" accesskey="&webdeveloper.display.abbreviations.key;" label="&webdeveloper.display.abbreviations.label;" type="checkbox" oncommand="webdeveloper_displayAbbreviations(this)"/>
- <menuitem id="webdeveloper-display-access-keys-menu" accesskey="&webdeveloper.display.access.keys.key;" label="&webdeveloper.display.access.keys.label;" type="checkbox" oncommand="webdeveloper_displayAccessKeys(this)"/>
- <menuitem id="webdeveloper-display-anchors-menu" accesskey="&webdeveloper.display.anchors.key;" label="&webdeveloper.display.anchors.label;" type="checkbox" oncommand="webdeveloper_displayAnchors(this)"/>
- <menuitem id="webdeveloper-display-block-size-menu" accesskey="&webdeveloper.display.block.size.key;" label="&webdeveloper.display.block.size.label;" type="checkbox" oncommand="webdeveloper_displayBlockSize(this)"/>
- <menuitem id="webdeveloper-display-div-order-menu" accesskey="&webdeveloper.display.div.order.key;" label="&webdeveloper.display.div.order.label;" type="checkbox" oncommand="webdeveloper_displayDivOrder(this)"/>
- <menuitem id="webdeveloper-display-element-information-menu" accesskey="&webdeveloper.display.element.information.key;" label="&webdeveloper.display.element.information.label;" key="webdeveloper-display-element-information-key" type="checkbox" oncommand="webdeveloper_displayElementInformation(this)"/>
- <menuitem id="webdeveloper-display-id-class-details-menu" accesskey="&webdeveloper.display.id.class.details.key;" label="&webdeveloper.display.id.class.details.label;" type="checkbox" oncommand="webdeveloper_displayIdClassDetails(this)"/>
- <menuitem id="webdeveloper-display-link-details-menu" accesskey="&webdeveloper.display.link.details.key;" label="&webdeveloper.display.link.details.label;" type="checkbox" oncommand="webdeveloper_displayLinkDetails(this)"/>
- <menuitem id="webdeveloper-display-object-information-menu" accesskey="&webdeveloper.display.object.information.key;" label="&webdeveloper.display.object.information.label;" type="checkbox" oncommand="webdeveloper_displayObjectInformation(this)"/>
- <menuitem id="webdeveloper-display-stack-levels-menu" accesskey="&webdeveloper.display.stack.levels.key;" label="&webdeveloper.display.stack.levels.label;" type="checkbox" oncommand="webdeveloper_displayStackLevels(this)"/>
- <menuitem id="webdeveloper-display-tab-index-menu" accesskey="&webdeveloper.display.tab.index.key;" label="&webdeveloper.display.tab.index.label;" type="checkbox" oncommand="webdeveloper_displayTabIndex(this)"/>
- <menuseparator id="webdeveloper-information-separator1-menu"/>
- <menuitem id="webdeveloper-display-table-depth-menu" accesskey="&webdeveloper.display.table.depth.key;" label="&webdeveloper.display.table.depth.label;" type="checkbox" oncommand="webdeveloper_displayTableDepth(this)"/>
- <menuitem id="webdeveloper-display-table-information-menu" accesskey="&webdeveloper.display.table.information.key;" label="&webdeveloper.display.table.information.label;" type="checkbox" oncommand="webdeveloper_displayTableInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator2-menu"/>
- <menuitem id="webdeveloper-display-title-attributes-menu" accesskey="&webdeveloper.display.title.attributes.key;" label="&webdeveloper.display.title.attributes.label;" type="checkbox" oncommand="webdeveloper_displayTitleAttributes(this)"/>
- <menuitem id="webdeveloper-display-topographic-information-menu" accesskey="&webdeveloper.display.topographic.information.key;" label="&webdeveloper.display.topographic.information.label;" type="checkbox" oncommand="webdeveloper_displayTopographicInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator3-menu"/>
- <menuitem id="webdeveloper-view-anchor-information-menu" accesskey="&webdeveloper.view.anchor.information.key;" label="&webdeveloper.view.anchor.information.label;" oncommand="webdeveloper_viewAnchorInformation()"/>
- <menuitem id="webdeveloper-view-color-information-menu" accesskey="&webdeveloper.view.color.information.key;" label="&webdeveloper.view.color.information.label;" oncommand="webdeveloper_viewColorInformation()"/>
- <menuseparator id="webdeveloper-information-separator4-menu"/>
- <menuitem id="webdeveloper-view-document-outline-menu" accesskey="&webdeveloper.view.document.outline.key;" label="&webdeveloper.view.document.outline.label;" oncommand="webdeveloper_viewDocumentOutline()"/>
- <menuitem id="webdeveloper-view-document-size-menu" accesskey="&webdeveloper.view.document.size.key;" label="&webdeveloper.view.document.size.label;" oncommand="webdeveloper_viewDocumentSize()"/>
- <menuseparator id="webdeveloper-information-separator5-menu"/>
- <menuitem id="webdeveloper-view-javascript-menu" accesskey="&webdeveloper.view.javascript.key;" label="&webdeveloper.view.javascript.label;" oncommand="webdeveloper_viewJavaScript()"/>
- <menuitem id="webdeveloper-view-link-information-menu" accesskey="&webdeveloper.view.link.information.key;" label="&webdeveloper.view.link.information.label;" oncommand="webdeveloper_viewLinkInformation()"/>
- <menuitem id="webdeveloper-view-meta-tag-information-menu" accesskey="&webdeveloper.view.meta.tag.information.key;" label="&webdeveloper.view.meta.tag.information.label;" oncommand="webdeveloper_viewMetaTagInformation()"/>
- <menuitem id="webdeveloper-view-page-information-menu" accesskey="&webdeveloper.view.page.information.key;" label="&webdeveloper.view.page.information.label;" oncommand="webdeveloper_viewPageInformation('chrome://browser/content/pageInfo.xul')"/>
- <menuitem id="webdeveloper-view-response-headers-menu" accesskey="&webdeveloper.view.response.headers.key;" label="&webdeveloper.view.response.headers.label;" oncommand="webdeveloper_viewResponseHeaders()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-miscellaneous-menu" accesskey="&webdeveloper.miscellaneous.key;" label="&webdeveloper.miscellaneous.label;">
- <menupopup onpopupshowing="webdeveloper_updateMiscellaneousMenu('menu')">
- <menu id="webdeveloper-clear-private-data-menu" accesskey="&webdeveloper.clear.private.data.key;" label="&webdeveloper.clear.private.data.label;">
- <menupopup onpopupshowing="webdeveloper_updateClearPrivateDataMenu('menu')">
- <menuitem id="webdeveloper-clear-cache-menu" accesskey="&webdeveloper.cache.key;" label="&webdeveloper.cache.label;" oncommand="webdeveloper_clearCache()"/>
- <menuitem id="webdeveloper-clear-history-menu" accesskey="&webdeveloper.history.key;" label="&webdeveloper.history.label;" oncommand="webdeveloper_clearHistory()"/>
- <menuitem id="webdeveloper-clear-http-authentication-menu" accesskey="&webdeveloper.http.authentication.key;" label="&webdeveloper.http.authentication.label;" oncommand="webdeveloper_clearHTTPAuthentication()"/>
- <menuseparator id="webdeveloper-clear-private-data-separator1-menu"/>
- <menuitem id="webdeveloper-clear-all-private-data-menu" accesskey="&webdeveloper.all.private.data.key;" label="&webdeveloper.all.private.data.label;" oncommand="webdeveloper_clearAllPrivateData()"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-miscellaneous-separator1-menu"/>
- <menuitem id="webdeveloper-display-line-guides-menu" accesskey="&webdeveloper.display.line.guides.key;" label="&webdeveloper.display.line.guides.label;" type="checkbox" oncommand="webdeveloper_displayLineGuides(this)"/>
- <menuitem id="webdeveloper-display-page-magnifier-menu" accesskey="&webdeveloper.display.page.magnifier.key;" label="&webdeveloper.display.page.magnifier.label;" type="checkbox" oncommand="webdeveloper_displayPageMagnifier(this)"/>
- <menuitem id="webdeveloper-display-ruler-menu" accesskey="&webdeveloper.display.ruler.key;" label="&webdeveloper.display.ruler.label;" type="checkbox" oncommand="webdeveloper_displayRuler(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator2-menu"/>
- <menuitem id="webdeveloper-show-comments-menu" accesskey="&webdeveloper.show.comments.key;" label="&webdeveloper.show.comments.label;" type="checkbox" oncommand="webdeveloper_toggleComments(this)"/>
- <menuitem id="webdeveloper-show-hidden-elements-menu" accesskey="&webdeveloper.show.hidden.elements.key;" label="&webdeveloper.show.hidden.elements.label;" oncommand="webdeveloper_showHiddenElements()"/>
- <menuitem id="webdeveloper-show-window-chrome-menu" accesskey="&webdeveloper.show.window.chrome.key;" label="&webdeveloper.show.window.chrome.label;" oncommand="webdeveloper_showWindowChrome()"/>
- <menuseparator id="webdeveloper-miscellaneous-separator3-menu"/>
- <menuitem id="webdeveloper-edit-html-menu" accesskey="&webdeveloper.edit.html.key;" label="&webdeveloper.edit.html.label;" type="checkbox" oncommand="webdeveloper_editHTML()"/>
- <menuitem id="webdeveloper-linearize-page-menu" accesskey="&webdeveloper.linearize.page.key;" label="&webdeveloper.linearize.page.label;" type="checkbox" oncommand="webdeveloper_linearizePage(this)"/>
- <menuitem id="webdeveloper-make-frames-resizable-menu" accesskey="&webdeveloper.make.frames.resizable.key;" label="&webdeveloper.make.frames.resizable.label;" oncommand="webdeveloper_makeFramesResizable()"/>
- <menuitem id="webdeveloper-small-screen-rendering-menu" accesskey="&webdeveloper.small.screen.rendering.key;" label="&webdeveloper.small.screen.rendering.label;" type="checkbox" oncommand="webdeveloper_smallScreenRendering(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator4-menu"/>
- <menu id="webdeveloper-visited-links-menu" accesskey="&webdeveloper.visited.links.key;" label="&webdeveloper.visited.links.label;">
- <menupopup>
- <menuitem id="webdeveloper-mark-all-links-unvisited-menu" accesskey="&webdeveloper.mark.all.links.unvisited.key;" label="&webdeveloper.mark.all.links.unvisited.label;" oncommand="webdeveloper_toggleVisitedLinks(false)"/>
- <menuitem id="webdeveloper-mark-all-links-visited-menu" accesskey="&webdeveloper.mark.all.links.visited.key;" label="&webdeveloper.mark.all.links.visited.label;" oncommand="webdeveloper_toggleVisitedLinks(true)"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <menu id="webdeveloper-outline-menu" accesskey="&webdeveloper.outline.key;" label="&webdeveloper.outline.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineMenu('menu')">
- <menuitem id="webdeveloper-outline-frames-menu" label="&webdeveloper.outline.frames.label;" accesskey="&webdeveloper.outline.frames.key;" type="checkbox" oncommand="webdeveloper_outlineFrames(this)"/>
- <menuitem id="webdeveloper-outline-headings-menu" label="&webdeveloper.outline.headings.label;" accesskey="&webdeveloper.outline.headings.key;" type="checkbox" oncommand="webdeveloper_outlineHeadings(this)"/>
- <menu id="webdeveloper-outline-links-menu" accesskey="&webdeveloper.outline.links.key;" label="&webdeveloper.outline.links.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineLinksMenu('menu')">
- <menuitem id="webdeveloper-outline-external-links-menu" accesskey="&webdeveloper.external.links.key;" label="&webdeveloper.external.links.label;" type="checkbox" oncommand="webdeveloper_outlineExternalLinks(this)"/>
- <menuseparator id="webdeveloper-outline-links-separator1-menu"/>
- <menuitem id="webdeveloper-outline-links-with-ping-attributes-menu" accesskey="&webdeveloper.links.with.ping.attributes.key;" label="&webdeveloper.links.with.ping.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithPingAttributes(this)"/>
- <menuitem id="webdeveloper-outline-links-without-title-attributes-menu" accesskey="&webdeveloper.links.without.title.attributes.key;" label="&webdeveloper.links.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-outline-tables-menu" accesskey="&webdeveloper.outline.tables.key;" label="&webdeveloper.outline.tables.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineTablesMenu('menu')">
- <menuitem id="webdeveloper-outline-table-captions-menu" accesskey="&webdeveloper.table.captions.key;" label="&webdeveloper.table.captions.label;" type="checkbox" oncommand="webdeveloper_outlineTableCaptions(this)"/>
- <menuitem id="webdeveloper-outline-table-cells-menu" accesskey="&webdeveloper.table.cells.key;" label="&webdeveloper.table.cells.label;" type="checkbox" oncommand="webdeveloper_outlineTableCells(this)"/>
- <menuitem id="webdeveloper-outline-all-tables-menu" accesskey="&webdeveloper.tables.key;" label="&webdeveloper.tables.label;" type="checkbox" oncommand="webdeveloper_outlineTables(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator1-menu"/>
- <menuitem id="webdeveloper-outline-block-level-elements-menu" accesskey="&webdeveloper.outline.block.level.elements.key;" label="&webdeveloper.outline.block.level.elements.label;" type="checkbox" oncommand="webdeveloper_outlineBlockLevelElements(this)"/>
- <menuitem id="webdeveloper-outline-deprecated-elements-menu" accesskey="&webdeveloper.outline.deprecated.elements.key;" label="&webdeveloper.outline.deprecated.elements.label;" type="checkbox" oncommand="webdeveloper_outlineDeprecatedElements(this)"/>
- <menu id="webdeveloper-outline-positioned-elements-menu" accesskey="&webdeveloper.outline.positioned.elements.key;" label="&webdeveloper.outline.positioned.elements.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlinePositionedElementsMenu('menu')">
- <menuitem id="webdeveloper-outline-absolute-positioned-elements-menu" accesskey="&webdeveloper.absolute.key;" label="&webdeveloper.absolute.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('absolute', this)"/>
- <menuitem id="webdeveloper-outline-fixed-positioned-elements-menu" accesskey="&webdeveloper.fixed.key;" label="&webdeveloper.fixed.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('fixed', this)"/>
- <menuitem id="webdeveloper-outline-floated-elements-menu" accesskey="&webdeveloper.float.key;" label="&webdeveloper.float.label;" type="checkbox" oncommand="webdeveloper_outlineFloatedElements(this)"/>
- <menuitem id="webdeveloper-outline-relative-positioned-elements-menu" accesskey="&webdeveloper.relative.key;" label="&webdeveloper.relative.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('relative', this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator2-menu"/>
- <menuitem id="webdeveloper-outline-current-element-menu" accesskey="&webdeveloper.outline.current.element.key;" label="&webdeveloper.outline.current.element.label;" type="checkbox" oncommand="webdeveloper_outlineCurrentElement(this)"/>
- <menuitem id="webdeveloper-outline-custom-elements-menu" accesskey="&webdeveloper.outline.custom.elements.key;" label="&webdeveloper.outline.custom.elements.label;" type="checkbox" oncommand="webdeveloper_outlineCustomElements(this)"/>
- <menuseparator id="webdeveloper-outline-separator3-menu"/>
- <menuitem id="webdeveloper-outline-show-element-names-menu" accesskey="&webdeveloper.show.element.names.when.outlining.key;" label="&webdeveloper.show.element.names.when.outlining.label;" type="checkbox" oncommand="webdeveloper_toggleShowElementNamesWhenOutlining(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-resize-menu" accesskey="&webdeveloper.resize.key;" label="&webdeveloper.resize.label;">
- <menupopup onpopupshowing="webdeveloper_updateResizeMenu(this, 'menu')">
- <menuitem id="webdeveloper-display-window-size-menu" accesskey="&webdeveloper.display.window.size.key;" label="&webdeveloper.display.window.size.label;" oncommand="webdeveloper_displayWindowSize()"/>
- <menuitem id="webdeveloper-display-window-size-title-menu" accesskey="&webdeveloper.display.window.size.title.key;" label="&webdeveloper.display.window.size.title.label;" type="checkbox" oncommand="webdeveloper_displayWindowSizeInTitle(this)"/>
- <menuseparator id="webdeveloper-resize-separator1-menu"/>
- <menuitem id="webdeveloper-resize-window-menu" accesskey="&webdeveloper.resize.window.key;" label="&webdeveloper.resize.window.label;" oncommand="webdeveloper_customResizeWindow()"/>
- <menuseparator id="webdeveloper-resize-separator2-menu"/>
- <menuseparator id="webdeveloper-resize-separator3-menu"/>
- <menuitem id="webdeveloper-edit-resize-dimensions-menu" accesskey="&webdeveloper.edit.resize.dimensions.key;" label="&webdeveloper.edit.resize.dimensions.label;" oncommand="webdeveloper_options('resize')"/>
- <menuseparator id="webdeveloper-resize-separator4-menu"/>
- <menu id="webdeveloper-zoom-menu" accesskey="&webdeveloper.zoom.key;" label="&webdeveloper.zoom.label;">
- <menupopup>
- <menuitem id="webdeveloper-zoom-in-menu" accesskey="&webdeveloper.zoom.in.key;" key="webdeveloper-zoom-in-key" label="&webdeveloper.zoom.in.label;" oncommand="webdeveloper_zoom(true)"/>
- <menuitem id="webdeveloper-zoom-out-menu" accesskey="&webdeveloper.zoom.out.key;" key="webdeveloper-zoom-out-key" label="&webdeveloper.zoom.out.label;" oncommand="webdeveloper_zoom(false)"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <menu id="webdeveloper-tools-menu" accesskey="&webdeveloper.tools.key;" label="&webdeveloper.tools.label;">
- <menupopup onpopupshowing="webdeveloper_updateToolsMenu(this, 'menu')">
- <menuseparator id="webdeveloper-tools-separator1-menu"/>
- <menuitem id="webdeveloper-edit-tools-menu" accesskey="&webdeveloper.edit.tools.key;" label="&webdeveloper.edit.tools.label;" oncommand="webdeveloper_options('tools')"/>
- <menuseparator id="webdeveloper-tools-separator2-menu"/>
- <menuitem id="webdeveloper-dom-inspector-menu" accesskey="&webdeveloper.dom.inspector.key;" label="&webdeveloper.dom.inspector.label;" type="checkbox" oncommand="webdeveloper_openDOMInspector()"/>
- <menuitem key="webdeveloper-error-console-key" accesskey="&webdeveloper.error.console.key;" label="&webdeveloper.error.console.label;" type="checkbox" oncommand="webdeveloper_openErrorConsole(true)"/>
- <menuitem id="webdeveloper-java-console-menu" accesskey="&webdeveloper.java.console.key;" key="webdeveloper-java-console-key" label="&webdeveloper.java.console.label;" oncommand="webdeveloper_openJavaConsole()"/>
- <menuseparator id="webdeveloper-tools-separator3-menu"/>
- <menuitem id="webdeveloper-display-page-validation-menu" accesskey="&webdeveloper.display.page.validation.key;" label="&webdeveloper.display.page.validation.label;" type="checkbox" oncommand="webdeveloper_displayPageValidation(this)"/>
- <menuitem id="webdeveloper-validate-local-accessibility-menu" accesskey="&webdeveloper.validate.local.accessibility.key;" label="&webdeveloper.validate.local.accessibility.label;" oncommand="webdeveloper_validateLocalAccessibility()"/>
- <menuitem id="webdeveloper-validate-local-css-menu" accesskey="&webdeveloper.validate.local.css.key;" label="&webdeveloper.validate.local.css.label;" oncommand="webdeveloper_validateLocalCSS()"/>
- <menuitem id="webdeveloper-validate-local-html-menu" accesskey="&webdeveloper.validate.local.html.key;" key="webdeveloper-validate-local-html-key" label="&webdeveloper.validate.local.html.label;" oncommand="webdeveloper_validateLocalHTML()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-view-source-menu" accesskey="&webdeveloper.view.source.key;" label="&webdeveloper.view.source.label;">
- <menupopup onpopupshowing="webdeveloper_updateViewSourceMenu(this, 'menu')">
- <menuitem id="webdeveloper-view-source-view-source-menu" accesskey="&webdeveloper.view.source.key;" key="webdeveloper-view-source-key" label="&webdeveloper.view.source.label;" oncommand="webdeveloper_viewSource(webdeveloper_getContentDocument())"/>
- <menuseparator id="webdeveloper-view-source-separator1-menu"/>
- <menu id="webdeveloper-view-frame-source-menu" accesskey="&webdeveloper.view.frame.source.key;" label="&webdeveloper.view.frame.source.label;">
- <menupopup onpopupshowing="webdeveloper_displayViewFrameSourceMenu(this)"/>
- </menu>
- <menuitem id="webdeveloper-view-generated-source-menu" accesskey="&webdeveloper.view.generated.source.key;" label="&webdeveloper.view.generated.source.label;" oncommand="webdeveloper_viewGeneratedSource()"/>
- <menuseparator id="webdeveloper-view-source-separator2-menu"/>
- <menuseparator id="webdeveloper-view-source-separator3-menu"/>
- <menuitem id="webdeveloper-edit-view-source-with-applications-menu" accesskey="&webdeveloper.edit.view.source.with.applications.key;" label="&webdeveloper.edit.view.source.with.applications.label;" oncommand="webdeveloper_options('view-source')"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-menu-separator1"/>
- <menu id="webdeveloper-options-menu" accesskey="&webdeveloper.options.key;" label="&webdeveloper.options.label;">
- <menupopup onpopupshowing="webdeveloper_updateOptionsMenu('menu')">
- <menuitem id="webdeveloper-persist-features-menu" accesskey="&webdeveloper.persist.features.key;" label="&webdeveloper.persist.features.label;" type="checkbox" oncommand="webdeveloper_enablePreference(this, 'webdeveloper.persist.features')"/>
- <menuitem id="webdeveloper-reset-page-menu" accesskey="&webdeveloper.reset.page.key;" label="&webdeveloper.reset.page.label;" oncommand="webdeveloper_resetPage()"/>
- <menuseparator id="webdeveloper-options-separator1-menu"/>
- <menuitem id="webdeveloper-options-options-menu" accesskey="&webdeveloper.options.menu.key;" label="&webdeveloper.options.menu.label;" oncommand="webdeveloper_options()"/>
- <menuseparator id="webdeveloper-options-separator2-menu"/>
- <menuitem id="webdeveloper-help-menu" accesskey="&webdeveloper.help.key;" label="&webdeveloper.help.label;" oncommand="webdeveloper_help()"/>
- <menuitem id="webdeveloper-about-menu" accesskey="&webdeveloper.about.key;" label="&webdeveloper.about.label;" oncommand="webdeveloper_about()"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
-
- <popup id="contentAreaContextMenu">
- <menuseparator id="webdeveloper-context-separator1"/>
- <menu id="webdeveloper-context" accesskey="&webdeveloper.context.key;" class="menuitem-iconic" image="chrome://webdeveloper/content/images/logo/small.png" label="&webdeveloper.name;">
- <menupopup>
- <menu id="webdeveloper-disable-context" accesskey="&webdeveloper.disable.key;" label="&webdeveloper.disable.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableMenu('context')">
- <menuitem id="webdeveloper-disable-cache-context" accesskey="&webdeveloper.disable.cache.key;" label="&webdeveloper.disable.cache.label;" type="checkbox" oncommand="webdeveloper_toggleCache(this)"/>
- <menuseparator id="webdeveloper-disable-separator1-context"/>
- <menuitem id="webdeveloper-disable-java-context" accesskey="&webdeveloper.disable.java.key;" label="&webdeveloper.disable.java.label;" type="checkbox" oncommand="webdeveloper_toggleJava(this)"/>
- <menu id="webdeveloper-disable-javascript-context" accesskey="&webdeveloper.disable.javascript.key;" label="&webdeveloper.disable.javascript.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableJavaScriptMenu('context')">
- <menuitem id="webdeveloper-disable-all-javascript-context" accesskey="&webdeveloper.all.javascript.key;" label="&webdeveloper.all.javascript.label;" type="checkbox" oncommand="webdeveloper_toggleJavaScript(this)"/>
- <menuseparator id="webdeveloper-disable-javascript-separator1-context"/>
- <menuitem id="webdeveloper-disable-strict-javascript-warnings-context" accesskey="&webdeveloper.strict.warnings.key;" label="&webdeveloper.strict.warnings.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'javascript.options.strict')"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-disable-separator2-context"/>
- <menuitem id="webdeveloper-disable-meta-redirects-context" accesskey="&webdeveloper.disable.meta.redirects.key;" label="&webdeveloper.disable.meta.redirects.label;" type="checkbox" oncommand="webdeveloper_toggleMetaRedirects(this)"/>
- <menuitem id="webdeveloper-disable-minimum-font-size-context" accesskey="&webdeveloper.disable.minimum.font.size.key;" label="&webdeveloper.disable.minimum.font.size.label;" type="checkbox" oncommand="webdeveloper_toggleMinimumFontSize(this)"/>
- <menuitem id="webdeveloper-disable-page-colors-context" accesskey="&webdeveloper.disable.page.colors.key;" label="&webdeveloper.disable.page.colors.label;" type="checkbox" oncommand="webdeveloper_togglePageColors(this)"/>
- <menuitem id="webdeveloper-disable-popup-blocker-context" accesskey="&webdeveloper.disable.popup.blocker.key;" label="&webdeveloper.disable.popup.blocker.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'dom.disable_open_during_load')"/>
- <menuitem id="webdeveloper-disable-proxy-context" accesskey="&webdeveloper.disable.proxy.key;" label="&webdeveloper.disable.proxy.label;" type="checkbox" oncommand="webdeveloper_toggleProxy(this)"/>
- <menuitem id="webdeveloper-disable-referrers-context" accesskey="&webdeveloper.disable.referrers.key;" label="&webdeveloper.disable.referrers.label;" type="checkbox" oncommand="webdeveloper_toggleReferrers(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-cookies-context" accesskey="&webdeveloper.cookies.key;" label="&webdeveloper.cookies.label;">
- <menupopup>
- <menu id="webdeveloper-disable-cookies-context" accesskey="&webdeveloper.disable.cookies.key;" label="&webdeveloper.disable.cookies.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableCookiesMenu('context')">
- <menuitem id="webdeveloper-disable-all-cookies-context" accesskey="&webdeveloper.all.cookies.key;" label="&webdeveloper.all.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleCookies(this)"/>
- <menuitem id="webdeveloper-disable-external-site-cookies-context" accesskey="&webdeveloper.external.site.cookies.key;" label="&webdeveloper.external.site.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteCookies(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-cookies-separator1-context"/>
- <menuitem id="webdeveloper-clear-session-cookies-context" accesskey="&webdeveloper.clear.session.cookies.key;" label="&webdeveloper.clear.session.cookies.label;" oncommand="webdeveloper_clearSessionCookies()"/>
- <menuitem id="webdeveloper-delete-domain-cookies-context" accesskey="&webdeveloper.delete.domain.cookies.key;" label="&webdeveloper.delete.domain.cookies.label;" oncommand="webdeveloper_deleteDomainCookies()"/>
- <menuitem id="webdeveloper-delete-path-cookies-context" accesskey="&webdeveloper.delete.path.cookies.key;" label="&webdeveloper.delete.path.cookies.label;" oncommand="webdeveloper_deletePathCookies()"/>
- <menuseparator id="webdeveloper-cookies-separator2-context"/>
- <menuitem id="webdeveloper-view-cookie-information-context" accesskey="&webdeveloper.view.cookie.information.key;" label="&webdeveloper.view.cookie.information.label;" oncommand="webdeveloper_viewCookieInformation()"/>
- <menuseparator id="webdeveloper-cookies-separator3-context"/>
- <menuitem id="webdeveloper-add-cookie-context" accesskey="&webdeveloper.add.cookie.key;" label="&webdeveloper.add.cookie.label;" oncommand="webdeveloper_addCookie()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-css-context" accesskey="&webdeveloper.css.key;" label="&webdeveloper.css.label;">
- <menupopup onpopupshowing="webdeveloper_updateCSSMenu('context')">
- <menu id="webdeveloper-disable-styles-context" accesskey="&webdeveloper.disable.styles.key;" label="&webdeveloper.disable.styles.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableStylesMenu('context')">
- <menuitem id="webdeveloper-disable-all-styles-context" accesskey="&webdeveloper.all.styles.key;" label="&webdeveloper.all.styles.label;" key="webdeveloper-disable-styles-key" type="checkbox" oncommand="webdeveloper_toggleStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator1-context"/>
- <menuitem id="webdeveloper-disable-browser-default-styles-context" accesskey="&webdeveloper.browser.default.styles.key;" label="&webdeveloper.browser.default.styles.label;" type="checkbox" oncommand="webdeveloper_toggleBrowserDefaultStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator2-context"/>
- <menuitem id="webdeveloper-disable-embedded-styles-context" accesskey="&webdeveloper.embedded.styles.key;" label="&webdeveloper.embedded.styles.label;" type="checkbox" oncommand="webdeveloper_toggleEmbeddedStyles(this)"/>
- <menuitem id="webdeveloper-disable-inline-styles-context" accesskey="&webdeveloper.inline.styles.key;" label="&webdeveloper.inline.styles.label;" type="checkbox" oncommand="webdeveloper_toggleInlineStyles(this)"/>
- <menuitem id="webdeveloper-disable-linked-styles-context" accesskey="&webdeveloper.linked.style.sheets.key;" label="&webdeveloper.linked.style.sheets.label;" type="checkbox" oncommand="webdeveloper_toggleLinkedStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator3-context"/>
- <menuitem id="webdeveloper-disable-print-styles-context" accesskey="&webdeveloper.print.styles.key;" label="&webdeveloper.print.styles.label;" type="checkbox" oncommand="webdeveloper_togglePrintStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator4-context"/>
- <menu id="webdeveloper-disable-individual-style-sheet-context" accesskey="&webdeveloper.individual.style.sheet.key;" label="&webdeveloper.individual.style.sheet.label;">
- <menupopup onpopupshowing="webdeveloper_displayDisableIndividualStyleSheetMenu(this)"/>
- </menu>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-css-separator1-context"/>
- <menu id="webdeveloper-display-media-type-context" accesskey="&webdeveloper.display.css.media.type.key;" label="&webdeveloper.display.css.media.type.label;">
- <menupopup onpopupshowing="webdeveloper_updateCSSMediaTypeMenu('context')">
- <menuitem id="webdeveloper-display-handheld-css-context" accesskey="&webdeveloper.handheld.key;" label="&webdeveloper.handheld.label;" type="checkbox" oncommand="webdeveloper_displayHandheldCSS(this)"/>
- <menuitem id="webdeveloper-display-print-css-context" accesskey="&webdeveloper.print.key;" label="&webdeveloper.print.label;" type="checkbox" oncommand="webdeveloper_displayPrintCSS(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-css-context" accesskey="&webdeveloper.view.css.key;" key="webdeveloper-view-css-key" label="&webdeveloper.view.css.label;" oncommand="webdeveloper_viewCSS()"/>
- <menuitem id="webdeveloper-view-style-information-context" accesskey="&webdeveloper.view.style.information.key;" key="webdeveloper-view-style-information-key" label="&webdeveloper.view.style.information.label;" type="checkbox" oncommand="webdeveloper_viewStyleInformation(this)"/>
- <menuseparator id="webdeveloper-css-separator2-context"/>
- <menuitem id="webdeveloper-add-user-style-sheet-context" accesskey="&webdeveloper.add.user.style.sheet.key;" label="&webdeveloper.add.user.style.sheet.label;" type="checkbox" oncommand="webdeveloper_addUserStyleSheet(this)"/>
- <menuitem id="webdeveloper-edit-css-context" accesskey="&webdeveloper.edit.css.key;" key="webdeveloper-edit-css-key" label="&webdeveloper.edit.css.label;" type="checkbox" oncommand="webdeveloper_editCSS()"/>
- <menuitem id="webdeveloper-use-border-box-model-context" accesskey="&webdeveloper.use.border.box.model.key;" label="&webdeveloper.use.border.box.model.label;" type="checkbox" oncommand="webdeveloper_toggleBorderBoxModel(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-forms-context" accesskey="&webdeveloper.forms.key;" label="&webdeveloper.forms.label;">
- <menupopup onpopupshowing="webdeveloper_updateFormsMenu('context')">
- <menuitem id="webdeveloper-display-form-details-context" accesskey="&webdeveloper.display.form.details.key;" label="&webdeveloper.display.form.details.label;" type="checkbox" oncommand="webdeveloper_displayFormDetails(this)"/>
- <menuitem id="webdeveloper-show-passwords-context" accesskey="&webdeveloper.show.passwords.key;" label="&webdeveloper.show.passwords.label;" oncommand="webdeveloper_showPasswords()"/>
- <menuitem id="webdeveloper-view-form-information-context" accesskey="&webdeveloper.view.form.information.key;" label="&webdeveloper.view.form.information.label;" oncommand="webdeveloper_viewFormInformation()"/>
- <menuseparator id="webdeveloper-forms-separator1-context"/>
- <menu id="webdeveloper-convert-form-methods-context" accesskey="&webdeveloper.convert.form.methods.key;" label="&webdeveloper.convert.form.methods.label;">
- <menupopup>
- <menuitem id="webdeveloper-convert-form-methods-gets-posts-context" accesskey="&webdeveloper.gets.posts.key;" label="&webdeveloper.gets.posts.label;" oncommand="webdeveloper_convertFormMethods('post')"/>
- <menuitem id="webdeveloper-convert-form-methods-posts-gets-context" accesskey="&webdeveloper.posts.gets.key;" label="&webdeveloper.posts.gets.label;" oncommand="webdeveloper_convertFormMethods('get')"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-convert-select-elements-text-inputs-context" accesskey="&webdeveloper.convert.select.elements.text.inputs.key;" label="&webdeveloper.convert.select.elements.text.inputs.label;" oncommand="webdeveloper_convertSelectElementsToTextInputs()"/>
- <menuseparator id="webdeveloper-forms-separator2-context"/>
- <menuitem id="webdeveloper-enable-auto-completion-context" accesskey="&webdeveloper.enable.auto.completion.key;" label="&webdeveloper.enable.auto.completion.label;" oncommand="webdeveloper_enableFormAutoCompletion()"/>
- <menuitem id="webdeveloper-enable-form-fields-context" accesskey="&webdeveloper.enable.form.fields.key;" label="&webdeveloper.enable.form.fields.label;" oncommand="webdeveloper_enableFormFields()"/>
- <menuseparator id="webdeveloper-forms-separator3-context"/>
- <menuitem id="webdeveloper-clear-radio-buttons-context" accesskey="&webdeveloper.clear.radio.buttons.key;" label="&webdeveloper.clear.radio.buttons.label;" oncommand="webdeveloper_clearRadioButtons()"/>
- <menuitem id="webdeveloper-make-form-fields-writable-context" accesskey="&webdeveloper.make.form.fields.writable.key;" label="&webdeveloper.make.form.fields.writable.label;" oncommand="webdeveloper_makeFormFieldsWritable()"/>
- <menuitem id="webdeveloper-populate-form-fields-context" accesskey="&webdeveloper.populate.form.fields.key;" label="&webdeveloper.populate.form.fields.label;" oncommand="webdeveloper_populateFormFields()"/>
- <menuitem id="webdeveloper-remove-maximum-lengths-context" accesskey="&webdeveloper.remove.maximum.lengths.key;" label="&webdeveloper.remove.maximum.lengths.label;" oncommand="webdeveloper_removeMaximumLengths()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-images-context" accesskey="&webdeveloper.images.key;" label="&webdeveloper.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateImagesMenu('context')">
- <menu id="webdeveloper-disable-images-context" accesskey="&webdeveloper.disable.images.key;" label="&webdeveloper.disable.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableImagesMenu('context')">
- <menuitem id="webdeveloper-disable-all-images-context" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_toggleImages(this)"/>
- <menuitem id="webdeveloper-disable-external-site-images-context" accesskey="&webdeveloper.external.site.images.key;" label="&webdeveloper.external.site.images.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteImages(this)"/>
- <menuseparator id="webdeveloper-disable-images-separator1-context"/>
- <menuitem id="webdeveloper-disable-image-animations-context" accesskey="&webdeveloper.image.animations.key;" label="&webdeveloper.image.animations.label;" type="checkbox" oncommand="webdeveloper_toggleImageAnimations(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-images-separator1-context"/>
- <menuitem id="webdeveloper-display-alt-attributes-context" accesskey="&webdeveloper.display.alt.attributes.key;" label="&webdeveloper.display.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_displayAltAttributes(this)"/>
- <menuitem id="webdeveloper-display-image-dimensions-context" accesskey="&webdeveloper.display.image.dimensions.key;" label="&webdeveloper.display.image.dimensions.label;" type="checkbox" oncommand="webdeveloper_displayImageDimensions(this)"/>
- <menuitem id="webdeveloper-display-image-file-sizes-context" accesskey="&webdeveloper.display.image.file.sizes.key;" label="&webdeveloper.display.image.file.sizes.label;" type="checkbox" oncommand="webdeveloper_displayImageFileSizes(this)"/>
- <menuitem id="webdeveloper-display-image-paths-context" accesskey="&webdeveloper.display.image.paths.key;" label="&webdeveloper.display.image.paths.label;" type="checkbox" oncommand="webdeveloper_displayImagePaths(this)"/>
- <menuseparator id="webdeveloper-images-separator2-context"/>
- <menuitem id="webdeveloper-find-broken-images-context" accesskey="&webdeveloper.find.broken.images.key;" label="&webdeveloper.find.broken.images.label;" oncommand="webdeveloper_findBrokenImages()"/>
- <menu id="webdeveloper-outline-images-context" accesskey="&webdeveloper.outline.images.key;" label="&webdeveloper.outline.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineImagesMenu('context')">
- <menuitem id="webdeveloper-outline-all-images-context" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_outlineAllImages(this)"/>
- <menuitem id="webdeveloper-outline-background-images-context" accesskey="&webdeveloper.background.images.key;" label="&webdeveloper.background.images.label;" type="checkbox" oncommand="webdeveloper_outlineBackgroundImages(this, true)"/>
- <menuseparator id="webdeveloper-outline-images-separator1-context"/>
- <menuitem id="webdeveloper-outline-images-with-adjusted-dimensions-context" accesskey="&webdeveloper.images.with.adjusted.dimensions.key;" label="&webdeveloper.images.with.adjusted.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithAdjustedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-with-empty-alt-attributes-context" accesskey="&webdeveloper.images.with.empty.alt.key;" label="&webdeveloper.images.with.empty.alt.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithEmptyAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-with-oversized-dimensions-context" accesskey="&webdeveloper.images.with.oversized.dimensions.key;" label="&webdeveloper.images.with.oversized.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithOversizedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-alt-attributes-context" accesskey="&webdeveloper.images.without.alt.attributes.key;" label="&webdeveloper.images.without.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-without-dimensions-context" accesskey="&webdeveloper.images.without.dimensions.key;" label="&webdeveloper.images.without.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-title-attributes-context" accesskey="&webdeveloper.images.without.title.attributes.key;" label="&webdeveloper.images.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-image-information-context" accesskey="&webdeveloper.view.image.information.key;" label="&webdeveloper.view.image.information.label;" oncommand="webdeveloper_viewImageInformation()"/>
- <menuseparator id="webdeveloper-images-separator3-context"/>
- <menuitem id="webdeveloper-hide-background-images-context" accesskey="&webdeveloper.hide.background.images.key;" label="&webdeveloper.hide.background.images.label;" type="checkbox" oncommand="webdeveloper_hideBackgroundImages(this)"/>
- <menuitem id="webdeveloper-hide-images-context" accesskey="&webdeveloper.hide.images.key;" label="&webdeveloper.hide.images.label;" type="checkbox" oncommand="webdeveloper_hideImages(this, 'webdeveloper-hide-images')"/>
- <menuitem id="webdeveloper-make-images-full-size-context" accesskey="&webdeveloper.make.images.full.size.key;" label="&webdeveloper.make.images.full.size.label;" oncommand="webdeveloper_makeImagesFullSize()"/>
- <menuitem id="webdeveloper-make-images-invisible-context" accesskey="&webdeveloper.make.images.invisible.key;" label="&webdeveloper.make.images.invisible.label;" type="checkbox" oncommand="webdeveloper_makeImagesInvisible(this, 'webdeveloper-make-images-invisible')"/>
- <menuitem id="webdeveloper-replace-images-with-alt-attributes-context" accesskey="&webdeveloper.replace.images.with.alt.attributes.key;" label="&webdeveloper.replace.images.with.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_replaceImagesWithAltAttributes(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-information-context" accesskey="&webdeveloper.information.key;" label="&webdeveloper.information.label;">
- <menupopup onpopupshowing="webdeveloper_updateInformationMenu('context')">
- <menuitem id="webdeveloper-display-abbreviations-context" accesskey="&webdeveloper.display.abbreviations.key;" label="&webdeveloper.display.abbreviations.label;" type="checkbox" oncommand="webdeveloper_displayAbbreviations(this)"/>
- <menuitem id="webdeveloper-display-access-keys-context" accesskey="&webdeveloper.display.access.keys.key;" label="&webdeveloper.display.access.keys.label;" type="checkbox" oncommand="webdeveloper_displayAccessKeys(this)"/>
- <menuitem id="webdeveloper-display-anchors-context" accesskey="&webdeveloper.display.anchors.key;" label="&webdeveloper.display.anchors.label;" type="checkbox" oncommand="webdeveloper_displayAnchors(this)"/>
- <menuitem id="webdeveloper-display-block-size-context" accesskey="&webdeveloper.display.block.size.key;" label="&webdeveloper.display.block.size.label;" type="checkbox" oncommand="webdeveloper_displayBlockSize(this)"/>
- <menuitem id="webdeveloper-display-div-order-context" accesskey="&webdeveloper.display.div.order.key;" label="&webdeveloper.display.div.order.label;" type="checkbox" oncommand="webdeveloper_displayDivOrder(this)"/>
- <menuitem id="webdeveloper-display-element-information-context" accesskey="&webdeveloper.display.element.information.key;" key="webdeveloper-display-element-information-key" label="&webdeveloper.display.element.information.label;" type="checkbox" oncommand="webdeveloper_displayElementInformation(this)"/>
- <menuitem id="webdeveloper-display-id-class-details-context" accesskey="&webdeveloper.display.id.class.details.key;" label="&webdeveloper.display.id.class.details.label;" type="checkbox" oncommand="webdeveloper_displayIdClassDetails(this)"/>
- <menuitem id="webdeveloper-display-link-details-context" accesskey="&webdeveloper.display.link.details.key;" label="&webdeveloper.display.link.details.label;" type="checkbox" oncommand="webdeveloper_displayLinkDetails(this)"/>
- <menuitem id="webdeveloper-display-object-information-context" accesskey="&webdeveloper.display.object.information.key;" label="&webdeveloper.display.object.information.label;" type="checkbox" oncommand="webdeveloper_displayObjectInformation(this)"/>
- <menuitem id="webdeveloper-display-stack-levels-context" accesskey="&webdeveloper.display.stack.levels.key;" label="&webdeveloper.display.stack.levels.label;" type="checkbox" oncommand="webdeveloper_displayStackLevels(this)"/>
- <menuitem id="webdeveloper-display-tab-index-context" accesskey="&webdeveloper.display.tab.index.key;" label="&webdeveloper.display.tab.index.label;" type="checkbox" oncommand="webdeveloper_displayTabIndex(this)"/>
- <menuseparator id="webdeveloper-information-separator1-context"/>
- <menuitem id="webdeveloper-display-table-depth-context" accesskey="&webdeveloper.display.table.depth.key;" label="&webdeveloper.display.table.depth.label;" type="checkbox" oncommand="webdeveloper_displayTableDepth(this)"/>
- <menuitem id="webdeveloper-display-table-information-context" accesskey="&webdeveloper.display.table.information.key;" label="&webdeveloper.display.table.information.label;" type="checkbox" oncommand="webdeveloper_displayTableInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator2-context"/>
- <menuitem id="webdeveloper-display-title-attributes-context" accesskey="&webdeveloper.display.title.attributes.key;" label="&webdeveloper.display.title.attributes.label;" type="checkbox" oncommand="webdeveloper_displayTitleAttributes(this)"/>
- <menuitem id="webdeveloper-display-topographic-information-context" accesskey="&webdeveloper.display.topographic.information.key;" label="&webdeveloper.display.topographic.information.label;" type="checkbox" oncommand="webdeveloper_displayTopographicInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator3-context"/>
- <menuitem id="webdeveloper-view-anchor-information-context" accesskey="&webdeveloper.view.anchor.information.key;" label="&webdeveloper.view.anchor.information.label;" oncommand="webdeveloper_viewAnchorInformation()"/>
- <menuitem id="webdeveloper-view-color-information-context" accesskey="&webdeveloper.view.color.information.key;" label="&webdeveloper.view.color.information.label;" oncommand="webdeveloper_viewColorInformation()"/>
- <menuseparator id="webdeveloper-information-separator4-context"/>
- <menuitem id="webdeveloper-view-document-outline-context" accesskey="&webdeveloper.view.document.outline.key;" label="&webdeveloper.view.document.outline.label;" oncommand="webdeveloper_viewDocumentOutline()"/>
- <menuitem id="webdeveloper-view-document-size-context" accesskey="&webdeveloper.view.document.size.key;" label="&webdeveloper.view.document.size.label;" oncommand="webdeveloper_viewDocumentSize()"/>
- <menuseparator id="webdeveloper-information-separator5-context"/>
- <menuitem id="webdeveloper-view-javascript-context" accesskey="&webdeveloper.view.javascript.key;" label="&webdeveloper.view.javascript.label;" oncommand="webdeveloper_viewJavaScript()"/>
- <menuitem id="webdeveloper-view-link-information-context" accesskey="&webdeveloper.view.link.information.key;" label="&webdeveloper.view.link.information.label;" oncommand="webdeveloper_viewLinkInformation()"/>
- <menuitem id="webdeveloper-view-meta-tag-information-context" accesskey="&webdeveloper.view.meta.tag.information.key;" label="&webdeveloper.view.meta.tag.information.label;" oncommand="webdeveloper_viewMetaTagInformation()"/>
- <menuitem id="webdeveloper-view-page-information-context" accesskey="&webdeveloper.view.page.information.key;" label="&webdeveloper.view.page.information.label;" oncommand="webdeveloper_viewPageInformation('chrome://browser/content/pageInfo.xul')"/>
- <menuitem id="webdeveloper-view-response-headers-context" accesskey="&webdeveloper.view.response.headers.key;" label="&webdeveloper.view.response.headers.label;" oncommand="webdeveloper_viewResponseHeaders()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-miscellaneous-context" accesskey="&webdeveloper.miscellaneous.key;" label="&webdeveloper.miscellaneous.label;">
- <menupopup onpopupshowing="webdeveloper_updateMiscellaneousMenu('context')">
- <menu id="webdeveloper-clear-private-data-context" accesskey="&webdeveloper.clear.private.data.key;" label="&webdeveloper.clear.private.data.label;">
- <menupopup onpopupshowing="webdeveloper_updateClearPrivateDataMenu('context')">
- <menuitem id="webdeveloper-clear-cache-context" accesskey="&webdeveloper.cache.key;" label="&webdeveloper.cache.label;" oncommand="webdeveloper_clearCache()"/>
- <menuitem id="webdeveloper-clear-history-context" accesskey="&webdeveloper.history.key;" label="&webdeveloper.history.label;" oncommand="webdeveloper_clearHistory()"/>
- <menuitem id="webdeveloper-clear-http-authentication-context" accesskey="&webdeveloper.http.authentication.key;" label="&webdeveloper.http.authentication.label;" oncommand="webdeveloper_clearHTTPAuthentication()"/>
- <menuseparator id="webdeveloper-clear-private-data-separator1-context"/>
- <menuitem id="webdeveloper-clear-all-private-data-context" accesskey="&webdeveloper.all.private.data.key;" label="&webdeveloper.all.private.data.label;" oncommand="webdeveloper_clearAllPrivateData()"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-miscellaneous-separator1-context"/>
- <menuitem id="webdeveloper-display-line-guides-context" accesskey="&webdeveloper.display.line.guides.key;" label="&webdeveloper.display.line.guides.label;" type="checkbox" oncommand="webdeveloper_displayLineGuides(this)"/>
- <menuitem id="webdeveloper-display-page-magnifier-context" accesskey="&webdeveloper.display.page.magnifier.key;" label="&webdeveloper.display.page.magnifier.label;" type="checkbox" oncommand="webdeveloper_displayPageMagnifier(this)"/>
- <menuitem id="webdeveloper-display-ruler-context" accesskey="&webdeveloper.display.ruler.key;" label="&webdeveloper.display.ruler.label;" type="checkbox" oncommand="webdeveloper_displayRuler(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator2-context"/>
- <menuitem id="webdeveloper-show-comments-context" accesskey="&webdeveloper.show.comments.key;" label="&webdeveloper.show.comments.label;" type="checkbox" oncommand="webdeveloper_toggleComments(this)"/>
- <menuitem id="webdeveloper-show-hidden-elements-context" accesskey="&webdeveloper.show.hidden.elements.key;" label="&webdeveloper.show.hidden.elements.label;" oncommand="webdeveloper_showHiddenElements()"/>
- <menuitem id="webdeveloper-show-window-chrome-context" accesskey="&webdeveloper.show.window.chrome.key;" label="&webdeveloper.show.window.chrome.label;" oncommand="webdeveloper_showWindowChrome()"/>
- <menuseparator id="webdeveloper-miscellaneous-separator3-context"/>
- <menuitem id="webdeveloper-edit-html-context" accesskey="&webdeveloper.edit.html.key;" label="&webdeveloper.edit.html.label;" type="checkbox" oncommand="webdeveloper_editHTML()"/>
- <menuitem id="webdeveloper-linearize-page-context" accesskey="&webdeveloper.linearize.page.key;" label="&webdeveloper.linearize.page.label;" type="checkbox" oncommand="webdeveloper_linearizePage(this)"/>
- <menuitem id="webdeveloper-make-frames-resizable-context" accesskey="&webdeveloper.make.frames.resizable.key;" label="&webdeveloper.make.frames.resizable.label;" oncommand="webdeveloper_makeFramesResizable()"/>
- <menuitem id="webdeveloper-small-screen-rendering-context" accesskey="&webdeveloper.small.screen.rendering.key;" label="&webdeveloper.small.screen.rendering.label;" type="checkbox" oncommand="webdeveloper_smallScreenRendering(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator4-context"/>
- <menu id="webdeveloper-visited-links-context" accesskey="&webdeveloper.visited.links.key;" label="&webdeveloper.visited.links.label;">
- <menupopup>
- <menuitem id="webdeveloper-mark-all-links-unvisited-context" accesskey="&webdeveloper.mark.all.links.unvisited.key;" label="&webdeveloper.mark.all.links.unvisited.label;" oncommand="webdeveloper_toggleVisitedLinks(false)"/>
- <menuitem id="webdeveloper-mark-all-links-visited-context" accesskey="&webdeveloper.mark.all.links.visited.key;" label="&webdeveloper.mark.all.links.visited.label;" oncommand="webdeveloper_toggleVisitedLinks(true)"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <menu id="webdeveloper-outline-context" accesskey="&webdeveloper.outline.key;" label="&webdeveloper.outline.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineMenu('context')">
- <menuitem id="webdeveloper-outline-frames-context" accesskey="&webdeveloper.outline.frames.key;" label="&webdeveloper.outline.frames.label;" type="checkbox" oncommand="webdeveloper_outlineFrames(this)"/>
- <menuitem id="webdeveloper-outline-headings-context" accesskey="&webdeveloper.outline.headings.key;" label="&webdeveloper.outline.headings.label;" type="checkbox" oncommand="webdeveloper_outlineHeadings(this)"/>
- <menu id="webdeveloper-outline-links-context" accesskey="&webdeveloper.outline.links.key;" label="&webdeveloper.outline.links.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineLinksMenu('context')">
- <menuitem id="webdeveloper-outline-external-links-context" accesskey="&webdeveloper.external.links.key;" label="&webdeveloper.external.links.label;" type="checkbox" oncommand="webdeveloper_outlineExternalLinks(this)"/>
- <menuseparator id="webdeveloper-outline-links-separator1-context"/>
- <menuitem id="webdeveloper-outline-links-with-ping-attributes-context" accesskey="&webdeveloper.links.with.ping.attributes.key;" label="&webdeveloper.links.with.ping.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithPingAttributes(this)"/>
- <menuitem id="webdeveloper-outline-links-without-title-attributes-context" accesskey="&webdeveloper.links.without.title.attributes.key;" label="&webdeveloper.links.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-outline-tables-context" accesskey="&webdeveloper.outline.tables.key;" label="&webdeveloper.outline.tables.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineTablesMenu('context')">
- <menuitem id="webdeveloper-outline-table-captions-context" accesskey="&webdeveloper.table.captions.key;" label="&webdeveloper.table.captions.label;" type="checkbox" oncommand="webdeveloper_outlineTableCaptions(this)"/>
- <menuitem id="webdeveloper-outline-table-cells-context" accesskey="&webdeveloper.table.cells.key;" label="&webdeveloper.table.cells.label;" type="checkbox" oncommand="webdeveloper_outlineTableCells(this)"/>
- <menuitem id="webdeveloper-outline-all-tables-context" accesskey="&webdeveloper.tables.key;" label="&webdeveloper.tables.label;" type="checkbox" oncommand="webdeveloper_outlineTables(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator1-context"/>
- <menuitem id="webdeveloper-outline-block-level-elements-context" accesskey="&webdeveloper.outline.block.level.elements.key;" label="&webdeveloper.outline.block.level.elements.label;" type="checkbox" oncommand="webdeveloper_outlineBlockLevelElements(this)"/>
- <menuitem id="webdeveloper-outline-deprecated-elements-context" accesskey="&webdeveloper.outline.deprecated.elements.key;" label="&webdeveloper.outline.deprecated.elements.label;" type="checkbox" oncommand="webdeveloper_outlineDeprecatedElements(this)"/>
- <menu id="webdeveloper-outline-positioned-elements-context" accesskey="&webdeveloper.outline.positioned.elements.key;" label="&webdeveloper.outline.positioned.elements.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlinePositionedElementsMenu('context')">
- <menuitem id="webdeveloper-outline-absolute-positioned-elements-context" accesskey="&webdeveloper.absolute.key;" label="&webdeveloper.absolute.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('absolute', this)"/>
- <menuitem id="webdeveloper-outline-fixed-positioned-elements-context" accesskey="&webdeveloper.fixed.key;" label="&webdeveloper.fixed.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('fixed', this)"/>
- <menuitem id="webdeveloper-outline-floated-elements-context" accesskey="&webdeveloper.float.key;" label="&webdeveloper.float.label;" type="checkbox" oncommand="webdeveloper_outlineFloatedElements(this)"/>
- <menuitem id="webdeveloper-outline-relative-positioned-elements-context" accesskey="&webdeveloper.relative.key;" label="&webdeveloper.relative.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('relative', this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator2-context"/>
- <menuitem id="webdeveloper-outline-current-element-context" accesskey="&webdeveloper.outline.current.element.key;" label="&webdeveloper.outline.current.element.label;" type="checkbox" oncommand="webdeveloper_outlineCurrentElement(this)"/>
- <menuitem id="webdeveloper-outline-custom-elements-context" accesskey="&webdeveloper.outline.custom.elements.key;" label="&webdeveloper.outline.custom.elements.label;" type="checkbox" oncommand="webdeveloper_outlineCustomElements(this)"/>
- <menuseparator id="webdeveloper-outline-separator3-context"/>
- <menuitem id="webdeveloper-outline-show-element-names-context" accesskey="&webdeveloper.show.element.names.when.outlining.key;" label="&webdeveloper.show.element.names.when.outlining.label;" type="checkbox" oncommand="webdeveloper_toggleShowElementNamesWhenOutlining(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-resize-context" accesskey="&webdeveloper.resize.key;" label="&webdeveloper.resize.label;">
- <menupopup onpopupshowing="webdeveloper_updateResizeMenu(this, 'context')">
- <menuitem id="webdeveloper-display-window-size-context" accesskey="&webdeveloper.display.window.size.key;" label="&webdeveloper.display.window.size.label;" oncommand="webdeveloper_displayWindowSize()"/>
- <menuitem id="webdeveloper-display-window-size-title-context" accesskey="&webdeveloper.display.window.size.title.key;" label="&webdeveloper.display.window.size.title.label;" type="checkbox" oncommand="webdeveloper_displayWindowSizeInTitle(this)"/>
- <menuseparator id="webdeveloper-resize-separator1-context"/>
- <menuitem id="webdeveloper-resize-window-context" accesskey="&webdeveloper.resize.window.key;" label="&webdeveloper.resize.window.label;" oncommand="webdeveloper_customResizeWindow()"/>
- <menuseparator id="webdeveloper-resize-separator2-context"/>
- <menuseparator id="webdeveloper-resize-separator3-context"/>
- <menuitem id="webdeveloper-edit-resize-dimensions-context" accesskey="&webdeveloper.edit.resize.dimensions.key;" label="&webdeveloper.edit.resize.dimensions.label;" oncommand="webdeveloper_options('resize')"/>
- <menuseparator id="webdeveloper-resize-separator4-context"/>
- <menu id="webdeveloper-zoom-context" accesskey="&webdeveloper.zoom.key;" label="&webdeveloper.zoom.label;">
- <menupopup>
- <menuitem id="webdeveloper-zoom-in-context" accesskey="&webdeveloper.zoom.in.key;" key="webdeveloper-zoom-in-key" label="&webdeveloper.zoom.in.label;" oncommand="webdeveloper_zoom(true)"/>
- <menuitem id="webdeveloper-zoom-out-context" accesskey="&webdeveloper.zoom.out.key;" key="webdeveloper-zoom-out-key" label="&webdeveloper.zoom.out.label;" oncommand="webdeveloper_zoom(false)"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <menu id="webdeveloper-tools-context" accesskey="&webdeveloper.tools.key;" label="&webdeveloper.tools.label;">
- <menupopup onpopupshowing="webdeveloper_updateToolsMenu(this, 'context')">
- <menuseparator id="webdeveloper-tools-separator1-context"/>
- <menuitem id="webdeveloper-edit-tools-context" accesskey="&webdeveloper.edit.tools.key;" label="&webdeveloper.edit.tools.label;" oncommand="webdeveloper_options('tools')"/>
- <menuseparator id="webdeveloper-tools-separator2-context"/>
- <menuitem id="webdeveloper-dom-inspector-context" accesskey="&webdeveloper.dom.inspector.key;" label="&webdeveloper.dom.inspector.label;" type="checkbox" oncommand="webdeveloper_openDOMInspector()"/>
- <menuitem id="webdeveloper-error-console-context" accesskey="&webdeveloper.error.console.key;" key="webdeveloper-error-console-key" label="&webdeveloper.error.console.label;" type="checkbox" oncommand="webdeveloper_openErrorConsole(true)"/>
- <menuitem id="webdeveloper-java-console-context" accesskey="&webdeveloper.java.console.key;" key="webdeveloper-java-console-key" label="&webdeveloper.java.console.label;" oncommand="webdeveloper_openJavaConsole()"/>
- <menuseparator id="webdeveloper-tools-separator3-context"/>
- <menuitem id="webdeveloper-display-page-validation-context" accesskey="&webdeveloper.display.page.validation.key;" label="&webdeveloper.display.page.validation.label;" type="checkbox" oncommand="webdeveloper_displayPageValidation(this)"/>
- <menuitem id="webdeveloper-validate-local-accessibility-context" accesskey="&webdeveloper.validate.local.accessibility.key;" label="&webdeveloper.validate.local.accessibility.label;" oncommand="webdeveloper_validateLocalAccessibility()"/>
- <menuitem id="webdeveloper-validate-local-css-context" accesskey="&webdeveloper.validate.local.css.key;" label="&webdeveloper.validate.local.css.label;" oncommand="webdeveloper_validateLocalCSS()"/>
- <menuitem id="webdeveloper-validate-local-html-context" accesskey="&webdeveloper.validate.local.html.key;" key="webdeveloper-validate-local-html-key" label="&webdeveloper.validate.local.html.label;" oncommand="webdeveloper_validateLocalHTML()"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-view-source-context" accesskey="&webdeveloper.view.source.key;" label="&webdeveloper.view.source.label;">
- <menupopup onpopupshowing="webdeveloper_updateViewSourceMenu(this, 'context')">
- <menuitem id="webdeveloper-view-source-view-source-context" accesskey="&webdeveloper.view.source.key;" key="webdeveloper-view-source-key" label="&webdeveloper.view.source.label;" oncommand="webdeveloper_viewSource(webdeveloper_getContentDocument())"/>
- <menuseparator id="webdeveloper-view-source-separator1-context"/>
- <menu id="webdeveloper-view-frame-source-context" accesskey="&webdeveloper.view.frame.source.key;" label="&webdeveloper.view.frame.source.label;">
- <menupopup onpopupshowing="webdeveloper_displayViewFrameSourceMenu(this)"/>
- </menu>
- <menuitem id="webdeveloper-view-generated-source-context" accesskey="&webdeveloper.view.generated.source.key;" label="&webdeveloper.view.generated.source.label;" oncommand="webdeveloper_viewGeneratedSource()"/>
- <menuseparator id="webdeveloper-view-source-separator2-context"/>
- <menuseparator id="webdeveloper-view-source-separator3-context"/>
- <menuitem id="webdeveloper-edit-view-source-with-applications-context" accesskey="&webdeveloper.edit.view.source.with.applications.key;" label="&webdeveloper.edit.view.source.with.applications.label;" oncommand="webdeveloper_options('view-source')"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-context-separator2"/>
- <menu id="webdeveloper-options-context" accesskey="&webdeveloper.options.key;" label="&webdeveloper.options.label;">
- <menupopup onpopupshowing="webdeveloper_updateOptionsMenu('context')">
- <menuitem id="webdeveloper-persist-features-context" accesskey="&webdeveloper.persist.features.key;" label="&webdeveloper.persist.features.label;" type="checkbox" oncommand="webdeveloper_enablePreference(this, 'webdeveloper.persist.features')"/>
- <menuitem id="webdeveloper-reset-page-context" accesskey="&webdeveloper.reset.page.key;" label="&webdeveloper.reset.page.label;" oncommand="webdeveloper_resetPage()"/>
- <menuseparator id="webdeveloper-options-separator1-context"/>
- <menuitem id="webdeveloper-options-options-context" accesskey="&webdeveloper.options.menu.key;" label="&webdeveloper.options.menu.label;" oncommand="webdeveloper_options()"/>
- <menuseparator id="webdeveloper-options-separator2-context"/>
- <menuitem id="webdeveloper-help-context" accesskey="&webdeveloper.help.key;" label="&webdeveloper.help.label;" oncommand="webdeveloper_help()"/>
- <menuitem id="webdeveloper-about-context" accesskey="&webdeveloper.about.key;" label="&webdeveloper.about.label;" oncommand="webdeveloper_about()"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </popup>
-
- <toolbarpalette id="BrowserToolbarPalette">
- <toolbarbutton id="webdeveloper-button" class="chromeclass-toolbar-additional toolbarbutton-1" label="&webdeveloper.name;" tooltiptext="&webdeveloper.name;" oncommand="webdeveloper_toggleToolbar()"/>
- <toolbarbutton id="webdeveloper-disable-toolbar" label="&webdeveloper.disable.label;" tooltiptext="&webdeveloper.disable.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateDisableMenu('toolbar')">
- <menuitem id="webdeveloper-disable-cache-toolbar" accesskey="&webdeveloper.disable.cache.key;" label="&webdeveloper.disable.cache.label;" type="checkbox" oncommand="webdeveloper_toggleCache(this)"/>
- <menuseparator id="webdeveloper-disable-separator1-toolbar"/>
- <menuitem id="webdeveloper-disable-java-toolbar" accesskey="&webdeveloper.disable.java.key;" label="&webdeveloper.disable.java.label;" type="checkbox" oncommand="webdeveloper_toggleJava(this)"/>
- <menu id="webdeveloper-disable-javascript-toolbar" accesskey="&webdeveloper.disable.javascript.key;" label="&webdeveloper.disable.javascript.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableJavaScriptMenu('toolbar')">
- <menuitem id="webdeveloper-disable-all-javascript-toolbar" accesskey="&webdeveloper.all.javascript.key;" label="&webdeveloper.all.javascript.label;" type="checkbox" oncommand="webdeveloper_toggleJavaScript(this)"/>
- <menuseparator id="webdeveloper-disable-javascript-separator1-toolbar"/>
- <menuitem id="webdeveloper-disable-strict-javascript-warnings-toolbar" accesskey="&webdeveloper.strict.warnings.key;" label="&webdeveloper.strict.warnings.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'javascript.options.strict')"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-disable-separator2-toolbar"/>
- <menuitem id="webdeveloper-disable-meta-redirects-toolbar" accesskey="&webdeveloper.disable.meta.redirects.key;" label="&webdeveloper.disable.meta.redirects.label;" type="checkbox" oncommand="webdeveloper_toggleMetaRedirects(this)"/>
- <menuitem id="webdeveloper-disable-minimum-font-size-toolbar" accesskey="&webdeveloper.disable.minimum.font.size.key;" label="&webdeveloper.disable.minimum.font.size.label;" type="checkbox" oncommand="webdeveloper_toggleMinimumFontSize(this)"/>
- <menuitem id="webdeveloper-disable-page-colors-toolbar" accesskey="&webdeveloper.disable.page.colors.key;" label="&webdeveloper.disable.page.colors.label;" type="checkbox" oncommand="webdeveloper_togglePageColors(this)"/>
- <menuitem id="webdeveloper-disable-popup-blocker-toolbar" accesskey="&webdeveloper.disable.popup.blocker.key;" label="&webdeveloper.disable.popup.blocker.label;" type="checkbox" oncommand="webdeveloper_disablePreference(this, 'dom.disable_open_during_load')"/>
- <menuitem id="webdeveloper-disable-proxy-toolbar" accesskey="&webdeveloper.disable.proxy.key;" label="&webdeveloper.disable.proxy.label;" type="checkbox" oncommand="webdeveloper_toggleProxy(this)"/>
- <menuitem id="webdeveloper-disable-referrers-toolbar" accesskey="&webdeveloper.disable.referrers.key;" label="&webdeveloper.disable.referrers.label;" type="checkbox" oncommand="webdeveloper_toggleReferrers(this)"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-cookies-toolbar" label="&webdeveloper.cookies.label;" tooltiptext="&webdeveloper.cookies.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup>
- <menu id="webdeveloper-disable-cookies-toolbar" accesskey="&webdeveloper.disable.cookies.key;" label="&webdeveloper.disable.cookies.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableCookiesMenu('toolbar')">
- <menuitem id="webdeveloper-disable-all-cookies-toolbar" accesskey="&webdeveloper.all.cookies.key;" label="&webdeveloper.all.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleCookies(this)"/>
- <menuitem id="webdeveloper-disable-external-site-cookies-toolbar" accesskey="&webdeveloper.external.site.cookies.key;" label="&webdeveloper.external.site.cookies.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteCookies(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-cookies-separator1-toolbar"/>
- <menuitem id="webdeveloper-clear-session-cookies-toolbar" accesskey="&webdeveloper.clear.session.cookies.key;" label="&webdeveloper.clear.session.cookies.label;" oncommand="webdeveloper_clearSessionCookies()"/>
- <menuitem id="webdeveloper-delete-domain-cookies-toolbar" accesskey="&webdeveloper.delete.domain.cookies.key;" label="&webdeveloper.delete.domain.cookies.label;" oncommand="webdeveloper_deleteDomainCookies()"/>
- <menuitem id="webdeveloper-delete-path-cookies-toolbar" accesskey="&webdeveloper.delete.path.cookies.key;" label="&webdeveloper.delete.path.cookies.label;" oncommand="webdeveloper_deletePathCookies()"/>
- <menuseparator id="webdeveloper-cookies-separator2-toolbar"/>
- <menuitem id="webdeveloper-view-cookie-information-toolbar" accesskey="&webdeveloper.view.cookie.information.key;" label="&webdeveloper.view.cookie.information.label;" oncommand="webdeveloper_viewCookieInformation()"/>
- <menuseparator id="webdeveloper-cookies-separator3-toolbar"/>
- <menuitem id="webdeveloper-add-cookie-toolbar" accesskey="&webdeveloper.add.cookie.key;" label="&webdeveloper.add.cookie.label;" oncommand="webdeveloper_addCookie()"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-css-toolbar" label="&webdeveloper.css.label;" tooltiptext="&webdeveloper.css.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateCSSMenu('toolbar')">
- <menu id="webdeveloper-disable-styles-toolbar" accesskey="&webdeveloper.disable.styles.key;" label="&webdeveloper.disable.styles.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableStylesMenu('toolbar')">
- <menuitem id="webdeveloper-disable-all-styles-toolbar" accesskey="&webdeveloper.all.styles.key;" key="webdeveloper-disable-styles-key" label="&webdeveloper.all.styles.label;" type="checkbox" oncommand="webdeveloper_toggleStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator1-toolbar"/>
- <menuitem id="webdeveloper-disable-browser-default-styles-toolbar" accesskey="&webdeveloper.browser.default.styles.key;" label="&webdeveloper.browser.default.styles.label;" type="checkbox" oncommand="webdeveloper_toggleBrowserDefaultStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator2-toolbar"/>
- <menuitem id="webdeveloper-disable-embedded-styles-toolbar" accesskey="&webdeveloper.embedded.styles.key;" label="&webdeveloper.embedded.styles.label;" type="checkbox" oncommand="webdeveloper_toggleEmbeddedStyles(this)"/>
- <menuitem id="webdeveloper-disable-inline-styles-toolbar" accesskey="&webdeveloper.inline.styles.key;" label="&webdeveloper.inline.styles.label;" type="checkbox" oncommand="webdeveloper_toggleInlineStyles(this)"/>
- <menuitem id="webdeveloper-disable-linked-styles-toolbar" accesskey="&webdeveloper.linked.style.sheets.key;" label="&webdeveloper.linked.style.sheets.label;" type="checkbox" oncommand="webdeveloper_toggleLinkedStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator3-toolbar"/>
- <menuitem id="webdeveloper-disable-print-styles-toolbar" accesskey="&webdeveloper.print.styles.key;" label="&webdeveloper.print.styles.label;" type="checkbox" oncommand="webdeveloper_togglePrintStyles(this)"/>
- <menuseparator id="webdeveloper-disable-styles-separator4-toolbar"/>
- <menu id="webdeveloper-disable-individual-style-sheet-toolbar" accesskey="&webdeveloper.individual.style.sheet.key;" label="&webdeveloper.individual.style.sheet.label;">
- <menupopup onpopupshowing="webdeveloper_displayDisableIndividualStyleSheetMenu(this)"/>
- </menu>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-css-separator1-toolbar"/>
- <menu id="webdeveloper-display-media-type-toolbar" accesskey="&webdeveloper.display.css.media.type.key;" label="&webdeveloper.display.css.media.type.label;">
- <menupopup onpopupshowing="webdeveloper_updateCSSMediaTypeMenu('toolbar')">
- <menuitem id="webdeveloper-display-handheld-css-toolbar" accesskey="&webdeveloper.handheld.key;" label="&webdeveloper.handheld.label;" type="checkbox" oncommand="webdeveloper_displayHandheldCSS(this)"/>
- <menuitem id="webdeveloper-display-print-css-toolbar" accesskey="&webdeveloper.print.key;" label="&webdeveloper.print.label;" type="checkbox" oncommand="webdeveloper_displayPrintCSS(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-css-toolbar" accesskey="&webdeveloper.view.css.key;" key="webdeveloper-view-css-key" label="&webdeveloper.view.css.label;" oncommand="webdeveloper_viewCSS()"/>
- <menuitem id="webdeveloper-view-style-information-toolbar" accesskey="&webdeveloper.view.style.information.key;" key="webdeveloper-view-style-information-key" label="&webdeveloper.view.style.information.label;" type="checkbox" oncommand="webdeveloper_viewStyleInformation(this)"/>
- <menuseparator id="webdeveloper-css-separator2-toolbar"/>
- <menuitem id="webdeveloper-add-user-style-sheet-toolbar" accesskey="&webdeveloper.add.user.style.sheet.key;" label="&webdeveloper.add.user.style.sheet.label;" type="checkbox" oncommand="webdeveloper_addUserStyleSheet(this)"/>
- <menuitem id="webdeveloper-edit-css-toolbar" accesskey="&webdeveloper.edit.css.key;" key="webdeveloper-edit-css-key" label="&webdeveloper.edit.css.label;" type="checkbox" oncommand="webdeveloper_editCSS()"/>
- <menuitem id="webdeveloper-use-border-box-model-toolbar" accesskey="&webdeveloper.use.border.box.model.key;" label="&webdeveloper.use.border.box.model.label;" type="checkbox" oncommand="webdeveloper_toggleBorderBoxModel(this)"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-forms-toolbar" label="&webdeveloper.forms.label;" tooltiptext="&webdeveloper.forms.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateFormsMenu('toolbar')">
- <menuitem id="webdeveloper-display-form-details-toolbar" accesskey="&webdeveloper.display.form.details.key;" label="&webdeveloper.display.form.details.label;" type="checkbox" oncommand="webdeveloper_displayFormDetails(this)"/>
- <menuitem id="webdeveloper-show-passwords-toolbar" accesskey="&webdeveloper.show.passwords.key;" label="&webdeveloper.show.passwords.label;" oncommand="webdeveloper_showPasswords()"/>
- <menuitem id="webdeveloper-view-form-information-toolbar" accesskey="&webdeveloper.view.form.information.key;" label="&webdeveloper.view.form.information.label;" oncommand="webdeveloper_viewFormInformation()"/>
- <menuseparator id="webdeveloper-forms-separator1-toolbar"/>
- <menu id="webdeveloper-convert-form-methods-toolbar" accesskey="&webdeveloper.convert.form.methods.key;" label="&webdeveloper.convert.form.methods.label;">
- <menupopup>
- <menuitem id="webdeveloper-convert-form-methods-gets-posts-toolbar" accesskey="&webdeveloper.gets.posts.key;" label="&webdeveloper.gets.posts.label;" oncommand="webdeveloper_convertFormMethods('post')"/>
- <menuitem id="webdeveloper-convert-form-methods-posts-gets-toolbar" accesskey="&webdeveloper.posts.gets.key;" label="&webdeveloper.posts.gets.label;" oncommand="webdeveloper_convertFormMethods('get')"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-convert-select-elements-text-inputs-toolbar" accesskey="&webdeveloper.convert.select.elements.text.inputs.key;" label="&webdeveloper.convert.select.elements.text.inputs.label;" oncommand="webdeveloper_convertSelectElementsToTextInputs()"/>
- <menuseparator id="webdeveloper-forms-separator2-toolbar"/>
- <menuitem id="webdeveloper-enable-auto-completion-toolbar" accesskey="&webdeveloper.enable.auto.completion.key;" label="&webdeveloper.enable.auto.completion.label;" oncommand="webdeveloper_enableFormAutoCompletion()"/>
- <menuitem id="webdeveloper-enable-form-fields-toolbar" accesskey="&webdeveloper.enable.form.fields.key;" label="&webdeveloper.enable.form.fields.label;" oncommand="webdeveloper_enableFormFields()"/>
- <menuseparator id="webdeveloper-forms-separator3-toolbar"/>
- <menuitem id="webdeveloper-clear-radio-buttons-toolbar" accesskey="&webdeveloper.clear.radio.buttons.key;" label="&webdeveloper.clear.radio.buttons.label;" oncommand="webdeveloper_clearRadioButtons()"/>
- <menuitem id="webdeveloper-make-form-fields-writable-toolbar" accesskey="&webdeveloper.make.form.fields.writable.key;" label="&webdeveloper.make.form.fields.writable.label;" oncommand="webdeveloper_makeFormFieldsWritable()"/>
- <menuitem id="webdeveloper-populate-form-fields-toolbar" accesskey="&webdeveloper.populate.form.fields.key;" label="&webdeveloper.populate.form.fields.label;" oncommand="webdeveloper_populateFormFields()"/>
- <menuitem id="webdeveloper-remove-maximum-lengths-toolbar" accesskey="&webdeveloper.remove.maximum.lengths.key;" label="&webdeveloper.remove.maximum.lengths.label;" oncommand="webdeveloper_removeMaximumLengths()"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-images-toolbar" label="&webdeveloper.images.label;" tooltiptext="&webdeveloper.images.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateImagesMenu('toolbar')">
- <menu id="webdeveloper-disable-images-toolbar" accesskey="&webdeveloper.disable.images.key;" label="&webdeveloper.disable.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateDisableImagesMenu('toolbar')">
- <menuitem id="webdeveloper-disable-all-images-toolbar" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_toggleImages(this)"/>
- <menuitem id="webdeveloper-disable-external-site-images-toolbar" accesskey="&webdeveloper.external.site.images.key;" label="&webdeveloper.external.site.images.label;" type="checkbox" oncommand="webdeveloper_toggleExternalSiteImages(this)"/>
- <menuseparator id="webdeveloper-disable-images-separator1-toolbar"/>
- <menuitem id="webdeveloper-disable-image-animations-toolbar" accesskey="&webdeveloper.image.animations.key;" label="&webdeveloper.image.animations.label;" type="checkbox" oncommand="webdeveloper_toggleImageAnimations(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-images-separator1-toolbar"/>
- <menuitem id="webdeveloper-display-alt-attributes-toolbar" accesskey="&webdeveloper.display.alt.attributes.key;" label="&webdeveloper.display.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_displayAltAttributes(this)"/>
- <menuitem id="webdeveloper-display-image-dimensions-toolbar" accesskey="&webdeveloper.display.image.dimensions.key;" label="&webdeveloper.display.image.dimensions.label;" type="checkbox" oncommand="webdeveloper_displayImageDimensions(this)"/>
- <menuitem id="webdeveloper-display-image-file-sizes-toolbar" accesskey="&webdeveloper.display.image.file.sizes.key;" label="&webdeveloper.display.image.file.sizes.label;" type="checkbox" oncommand="webdeveloper_displayImageFileSizes(this)"/>
- <menuitem id="webdeveloper-display-image-paths-toolbar" accesskey="&webdeveloper.display.image.paths.key;" label="&webdeveloper.display.image.paths.label;" type="checkbox" oncommand="webdeveloper_displayImagePaths(this)"/>
- <menuseparator id="webdeveloper-images-separator2-toolbar"/>
- <menuitem id="webdeveloper-find-broken-images-toolbar" accesskey="&webdeveloper.find.broken.images.key;" label="&webdeveloper.find.broken.images.label;" oncommand="webdeveloper_findBrokenImages()"/>
- <menu id="webdeveloper-outline-images-toolbar" accesskey="&webdeveloper.outline.images.key;" label="&webdeveloper.outline.images.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineImagesMenu('toolbar')">
- <menuitem id="webdeveloper-outline-all-images-toolbar" accesskey="&webdeveloper.all.images.key;" label="&webdeveloper.all.images.label;" type="checkbox" oncommand="webdeveloper_outlineAllImages(this)"/>
- <menuitem id="webdeveloper-outline-background-images-toolbar" accesskey="&webdeveloper.background.images.key;" label="&webdeveloper.background.images.label;" type="checkbox" oncommand="webdeveloper_outlineBackgroundImages(this, true)"/>
- <menuseparator id="webdeveloper-outline-images-separator1-toolbar"/>
- <menuitem id="webdeveloper-outline-images-with-adjusted-dimensions-toolbar" accesskey="&webdeveloper.images.with.adjusted.dimensions.key;" label="&webdeveloper.images.with.adjusted.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithAdjustedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-with-empty-alt-attributes-toolbar" accesskey="&webdeveloper.images.with.empty.alt.key;" label="&webdeveloper.images.with.empty.alt.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithEmptyAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-with-oversized-dimensions-toolbar" accesskey="&webdeveloper.images.with.oversized.dimensions.key;" label="&webdeveloper.images.with.oversized.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithOversizedDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-alt-attributes-toolbar" accesskey="&webdeveloper.images.without.alt.attributes.key;" label="&webdeveloper.images.without.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutAltAttributes(this)"/>
- <menuitem id="webdeveloper-outline-images-without-dimensions-toolbar" accesskey="&webdeveloper.images.without.dimensions.key;" label="&webdeveloper.images.without.dimensions.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutDimensions(this)"/>
- <menuitem id="webdeveloper-outline-images-without-title-attributes-toolbar" accesskey="&webdeveloper.images.without.title.attributes.key;" label="&webdeveloper.images.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineImagesWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menuitem id="webdeveloper-view-image-information-toolbar" accesskey="&webdeveloper.view.image.information.key;" label="&webdeveloper.view.image.information.label;" oncommand="webdeveloper_viewImageInformation()"/>
- <menuseparator id="webdeveloper-images-separator3-toolbar"/>
- <menuitem id="webdeveloper-hide-background-images-toolbar" accesskey="&webdeveloper.hide.background.images.key;" label="&webdeveloper.hide.background.images.label;" type="checkbox" oncommand="webdeveloper_hideBackgroundImages(this)"/>
- <menuitem id="webdeveloper-hide-images-toolbar" accesskey="&webdeveloper.hide.images.key;" label="&webdeveloper.hide.images.label;" type="checkbox" oncommand="webdeveloper_hideImages(this, 'webdeveloper-hide-images')"/>
- <menuitem id="webdeveloper-make-images-full-size-toolbar" accesskey="&webdeveloper.make.images.full.size.key;" label="&webdeveloper.make.images.full.size.label;" oncommand="webdeveloper_makeImagesFullSize()"/>
- <menuitem id="webdeveloper-make-images-invisible-toolbar" accesskey="&webdeveloper.make.images.invisible.key;" label="&webdeveloper.make.images.invisible.label;" type="checkbox" oncommand="webdeveloper_makeImagesInvisible(this, 'webdeveloper-make-images-invisible')"/>
- <menuitem id="webdeveloper-replace-images-with-alt-attributes-toolbar" accesskey="&webdeveloper.replace.images.with.alt.attributes.key;" label="&webdeveloper.replace.images.with.alt.attributes.label;" type="checkbox" oncommand="webdeveloper_replaceImagesWithAltAttributes(this)"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-information-toolbar" label="&webdeveloper.information.label;" tooltiptext="&webdeveloper.information.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateInformationMenu('toolbar')">
- <menuitem id="webdeveloper-display-abbreviations-toolbar" accesskey="&webdeveloper.display.abbreviations.key;" label="&webdeveloper.display.abbreviations.label;" type="checkbox" oncommand="webdeveloper_displayAbbreviations(this)"/>
- <menuitem id="webdeveloper-display-access-keys-toolbar" accesskey="&webdeveloper.display.access.keys.key;" label="&webdeveloper.display.access.keys.label;" type="checkbox" oncommand="webdeveloper_displayAccessKeys(this)"/>
- <menuitem id="webdeveloper-display-anchors-toolbar" accesskey="&webdeveloper.display.anchors.key;" label="&webdeveloper.display.anchors.label;" type="checkbox" oncommand="webdeveloper_displayAnchors(this)"/>
- <menuitem id="webdeveloper-display-block-size-toolbar" accesskey="&webdeveloper.display.block.size.key;" label="&webdeveloper.display.block.size.label;" type="checkbox" oncommand="webdeveloper_displayBlockSize(this)"/>
- <menuitem id="webdeveloper-display-div-order-toolbar" accesskey="&webdeveloper.display.div.order.key;" label="&webdeveloper.display.div.order.label;" type="checkbox" oncommand="webdeveloper_displayDivOrder(this)"/>
- <menuitem id="webdeveloper-display-element-information-toolbar" accesskey="&webdeveloper.display.element.information.key;" key="webdeveloper-display-element-information-key" label="&webdeveloper.display.element.information.label;" type="checkbox" oncommand="webdeveloper_displayElementInformation(this)"/>
- <menuitem id="webdeveloper-display-id-class-details-toolbar" accesskey="&webdeveloper.display.id.class.details.key;" label="&webdeveloper.display.id.class.details.label;" type="checkbox" oncommand="webdeveloper_displayIdClassDetails(this)"/>
- <menuitem id="webdeveloper-display-link-details-toolbar" accesskey="&webdeveloper.display.link.details.key;" label="&webdeveloper.display.link.details.label;" type="checkbox" oncommand="webdeveloper_displayLinkDetails(this)"/>
- <menuitem id="webdeveloper-display-object-information-toolbar" accesskey="&webdeveloper.display.object.information.key;" label="&webdeveloper.display.object.information.label;" type="checkbox" oncommand="webdeveloper_displayObjectInformation(this)"/>
- <menuitem id="webdeveloper-display-stack-levels-toolbar" accesskey="&webdeveloper.display.stack.levels.key;" label="&webdeveloper.display.stack.levels.label;" type="checkbox" oncommand="webdeveloper_displayStackLevels(this)"/>
- <menuitem id="webdeveloper-display-tab-index-toolbar" accesskey="&webdeveloper.display.tab.index.key;" label="&webdeveloper.display.tab.index.label;" type="checkbox" oncommand="webdeveloper_displayTabIndex(this)"/>
- <menuseparator id="webdeveloper-information-separator1-toolbar"/>
- <menuitem id="webdeveloper-display-table-depth-toolbar" accesskey="&webdeveloper.display.table.depth.key;" label="&webdeveloper.display.table.depth.label;" type="checkbox" oncommand="webdeveloper_displayTableDepth(this)"/>
- <menuitem id="webdeveloper-display-table-information-toolbar" accesskey="&webdeveloper.display.table.information.key;" label="&webdeveloper.display.table.information.label;" type="checkbox" oncommand="webdeveloper_displayTableInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator2-toolbar"/>
- <menuitem id="webdeveloper-display-title-attributes-toolbar" accesskey="&webdeveloper.display.title.attributes.key;" label="&webdeveloper.display.title.attributes.label;" type="checkbox" oncommand="webdeveloper_displayTitleAttributes(this)"/>
- <menuitem id="webdeveloper-display-topographic-information-toolbar" accesskey="&webdeveloper.display.topographic.information.key;" label="&webdeveloper.display.topographic.information.label;" type="checkbox" oncommand="webdeveloper_displayTopographicInformation(this)"/>
- <menuseparator id="webdeveloper-information-separator3-toolbar"/>
- <menuitem id="webdeveloper-view-anchor-information-toolbar" accesskey="&webdeveloper.view.anchor.information.key;" label="&webdeveloper.view.anchor.information.label;" oncommand="webdeveloper_viewAnchorInformation()"/>
- <menuitem id="webdeveloper-view-color-information-toolbar" accesskey="&webdeveloper.view.color.information.key;" label="&webdeveloper.view.color.information.label;" oncommand="webdeveloper_viewColorInformation()"/>
- <menuseparator id="webdeveloper-information-separator4-toolbar"/>
- <menuitem id="webdeveloper-view-document-outline-toolbar" accesskey="&webdeveloper.view.document.outline.key;" label="&webdeveloper.view.document.outline.label;" oncommand="webdeveloper_viewDocumentOutline()"/>
- <menuitem id="webdeveloper-view-document-size-toolbar" accesskey="&webdeveloper.view.document.size.key;" label="&webdeveloper.view.document.size.label;" oncommand="webdeveloper_viewDocumentSize()"/>
- <menuseparator id="webdeveloper-information-separator5-toolbar"/>
- <menuitem id="webdeveloper-view-javascript-toolbar" accesskey="&webdeveloper.view.javascript.key;" label="&webdeveloper.view.javascript.label;" oncommand="webdeveloper_viewJavaScript()"/>
- <menuitem id="webdeveloper-view-link-information-toolbar" accesskey="&webdeveloper.view.link.information.key;" label="&webdeveloper.view.link.information.label;" oncommand="webdeveloper_viewLinkInformation()"/>
- <menuitem id="webdeveloper-view-meta-tag-information-toolbar" accesskey="&webdeveloper.view.meta.tag.information.key;" label="&webdeveloper.view.meta.tag.information.label;" oncommand="webdeveloper_viewMetaTagInformation()"/>
- <menuitem id="webdeveloper-view-page-information-toolbar" accesskey="&webdeveloper.view.page.information.key;" label="&webdeveloper.view.page.information.label;" oncommand="webdeveloper_viewPageInformation('chrome://browser/content/pageInfo.xul')"/>
- <menuitem id="webdeveloper-view-response-headers-toolbar" accesskey="&webdeveloper.view.response.headers.key;" label="&webdeveloper.view.response.headers.label;" oncommand="webdeveloper_viewResponseHeaders()"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-miscellaneous-toolbar" label="&webdeveloper.miscellaneous.label;" tooltiptext="&webdeveloper.miscellaneous.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateMiscellaneousMenu('toolbar')">
- <menu id="webdeveloper-clear-private-data-toolbar" accesskey="&webdeveloper.clear.private.data.key;" label="&webdeveloper.clear.private.data.label;">
- <menupopup onpopupshowing="webdeveloper_updateClearPrivateDataMenu('toolbar')">
- <menuitem id="webdeveloper-clear-cache-toolbar" accesskey="&webdeveloper.cache.key;" label="&webdeveloper.cache.label;" oncommand="webdeveloper_clearCache()"/>
- <menuitem id="webdeveloper-clear-history-toolbar" accesskey="&webdeveloper.history.key;" label="&webdeveloper.history.label;" oncommand="webdeveloper_clearHistory()"/>
- <menuitem id="webdeveloper-clear-http-authentication-toolbar" accesskey="&webdeveloper.http.authentication.key;" label="&webdeveloper.http.authentication.label;" oncommand="webdeveloper_clearHTTPAuthentication()"/>
- <menuseparator id="webdeveloper-clear-private-data-separator1-toolbar"/>
- <menuitem id="webdeveloper-clear-all-private-data-toolbar" accesskey="&webdeveloper.all.private.data.key;" label="&webdeveloper.all.private.data.label;" oncommand="webdeveloper_clearAllPrivateData()"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-miscellaneous-separator1-toolbar"/>
- <menuitem id="webdeveloper-display-line-guides-toolbar" accesskey="&webdeveloper.display.line.guides.key;" label="&webdeveloper.display.line.guides.label;" type="checkbox" oncommand="webdeveloper_displayLineGuides(this)"/>
- <menuitem id="webdeveloper-display-page-magnifier-toolbar" accesskey="&webdeveloper.display.page.magnifier.key;" label="&webdeveloper.display.page.magnifier.label;" type="checkbox" oncommand="webdeveloper_displayPageMagnifier(this)"/>
- <menuitem id="webdeveloper-display-ruler-toolbar" accesskey="&webdeveloper.display.ruler.key;" label="&webdeveloper.display.ruler.label;" type="checkbox" oncommand="webdeveloper_displayRuler(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator2-toolbar"/>
- <menuitem id="webdeveloper-show-comments-toolbar" accesskey="&webdeveloper.show.comments.key;" label="&webdeveloper.show.comments.label;" type="checkbox" oncommand="webdeveloper_toggleComments(this)"/>
- <menuitem id="webdeveloper-show-hidden-elements-toolbar" accesskey="&webdeveloper.show.hidden.elements.key;" label="&webdeveloper.show.hidden.elements.label;" oncommand="webdeveloper_showHiddenElements()"/>
- <menuitem id="webdeveloper-show-window-chrome-toolbar" accesskey="&webdeveloper.show.window.chrome.key;" label="&webdeveloper.show.window.chrome.label;" oncommand="webdeveloper_showWindowChrome()"/>
- <menuseparator id="webdeveloper-miscellaneous-separator3-toolbar"/>
- <menuitem id="webdeveloper-edit-html-toolbar" accesskey="&webdeveloper.edit.html.key;" label="&webdeveloper.edit.html.label;" type="checkbox" oncommand="webdeveloper_editHTML()"/>
- <menuitem id="webdeveloper-linearize-page-toolbar" accesskey="&webdeveloper.linearize.page.key;" label="&webdeveloper.linearize.page.label;" type="checkbox" oncommand="webdeveloper_linearizePage(this)"/>
- <menuitem id="webdeveloper-make-frames-resizable-toolbar" accesskey="&webdeveloper.make.frames.resizable.key;" label="&webdeveloper.make.frames.resizable.label;" oncommand="webdeveloper_makeFramesResizable()"/>
- <menuitem id="webdeveloper-small-screen-rendering-toolbar" accesskey="&webdeveloper.small.screen.rendering.key;" label="&webdeveloper.small.screen.rendering.label;" type="checkbox" oncommand="webdeveloper_smallScreenRendering(this)"/>
- <menuseparator id="webdeveloper-miscellaneous-separator4-toolbar"/>
- <menu id="webdeveloper-visited-links-toolbar" accesskey="&webdeveloper.visited.links.key;" label="&webdeveloper.visited.links.label;">
- <menupopup>
- <menuitem id="webdeveloper-mark-all-links-unvisited-toolbar" accesskey="&webdeveloper.mark.all.links.unvisited.key;" label="&webdeveloper.mark.all.links.unvisited.label;" oncommand="webdeveloper_toggleVisitedLinks(false)"/>
- <menuitem id="webdeveloper-mark-all-links-visited-toolbar" accesskey="&webdeveloper.mark.all.links.visited.key;" label="&webdeveloper.mark.all.links.visited.label;" oncommand="webdeveloper_toggleVisitedLinks(true)"/>
- </menupopup>
- </menu>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-outline-toolbar" label="&webdeveloper.outline.label;" tooltiptext="&webdeveloper.outline.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateOutlineMenu('toolbar')">
- <menuitem id="webdeveloper-outline-frames-toolbar" accesskey="&webdeveloper.outline.frames.key;" label="&webdeveloper.outline.frames.label;" type="checkbox" oncommand="webdeveloper_outlineFrames(this)"/>
- <menuitem id="webdeveloper-outline-headings-toolbar" accesskey="&webdeveloper.outline.headings.key;" label="&webdeveloper.outline.headings.label;" type="checkbox" oncommand="webdeveloper_outlineHeadings(this)"/>
- <menu id="webdeveloper-outline-links-toolbar" accesskey="&webdeveloper.outline.links.key;" label="&webdeveloper.outline.links.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineLinksMenu('toolbar')">
- <menuitem id="webdeveloper-outline-external-links-toolbar" accesskey="&webdeveloper.external.links.key;" label="&webdeveloper.external.links.label;" type="checkbox" oncommand="webdeveloper_outlineExternalLinks(this)"/>
- <menuseparator id="webdeveloper-outline-links-separator1-toolbar"/>
- <menuitem id="webdeveloper-outline-links-with-ping-attributes-toolbar" accesskey="&webdeveloper.links.with.ping.attributes.key;" label="&webdeveloper.links.with.ping.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithPingAttributes(this)"/>
- <menuitem id="webdeveloper-outline-links-without-title-attributes-toolbar" accesskey="&webdeveloper.links.without.title.attributes.key;" label="&webdeveloper.links.without.title.attributes.label;" type="checkbox" oncommand="webdeveloper_outlineLinksWithoutTitleAttributes(this)"/>
- </menupopup>
- </menu>
- <menu id="webdeveloper-outline-tables-toolbar" accesskey="&webdeveloper.outline.tables.key;" label="&webdeveloper.outline.tables.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlineTablesMenu('toolbar')">
- <menuitem id="webdeveloper-outline-table-captions-toolbar" accesskey="&webdeveloper.table.captions.key;" label="&webdeveloper.table.captions.label;" type="checkbox" oncommand="webdeveloper_outlineTableCaptions(this)"/>
- <menuitem id="webdeveloper-outline-table-cells-toolbar" accesskey="&webdeveloper.table.cells.key;" label="&webdeveloper.table.cells.label;" type="checkbox" oncommand="webdeveloper_outlineTableCells(this)"/>
- <menuitem id="webdeveloper-outline-all-tables-toolbar" accesskey="&webdeveloper.tables.key;" label="&webdeveloper.tables.label;" type="checkbox" oncommand="webdeveloper_outlineTables(this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator1-toolbar"/>
- <menuitem id="webdeveloper-outline-block-level-elements-toolbar" accesskey="&webdeveloper.outline.block.level.elements.key;" label="&webdeveloper.outline.block.level.elements.label;" type="checkbox" oncommand="webdeveloper_outlineBlockLevelElements(this)"/>
- <menuitem id="webdeveloper-outline-deprecated-elements-toolbar" accesskey="&webdeveloper.outline.deprecated.elements.key;" label="&webdeveloper.outline.deprecated.elements.label;" type="checkbox" oncommand="webdeveloper_outlineDeprecatedElements(this)"/>
- <menu id="webdeveloper-outline-positioned-elements-toolbar" accesskey="&webdeveloper.outline.positioned.elements.key;" label="&webdeveloper.outline.positioned.elements.label;">
- <menupopup onpopupshowing="webdeveloper_updateOutlinePositionedElementsMenu('toolbar')">
- <menuitem id="webdeveloper-outline-absolute-positioned-elements-toolbar" accesskey="&webdeveloper.absolute.key;" label="&webdeveloper.absolute.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('absolute', this)"/>
- <menuitem id="webdeveloper-outline-fixed-positioned-elements-toolbar" accesskey="&webdeveloper.fixed.key;" label="&webdeveloper.fixed.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('fixed', this)"/>
- <menuitem id="webdeveloper-outline-floated-elements-toolbar" accesskey="&webdeveloper.float.key;" label="&webdeveloper.float.label;" type="checkbox" oncommand="webdeveloper_outlineFloatedElements(this)"/>
- <menuitem id="webdeveloper-outline-relative-positioned-elements-toolbar" accesskey="&webdeveloper.relative.key;" label="&webdeveloper.relative.label;" type="checkbox" oncommand="webdeveloper_outlinePositionedElements('relative', this)"/>
- </menupopup>
- </menu>
- <menuseparator id="webdeveloper-outline-separator2-toolbar"/>
- <menuitem id="webdeveloper-outline-current-element-toolbar" accesskey="&webdeveloper.outline.current.element.key;" label="&webdeveloper.outline.current.element.label;" type="checkbox" oncommand="webdeveloper_outlineCurrentElement(this)"/>
- <menuitem id="webdeveloper-outline-custom-elements-toolbar" accesskey="&webdeveloper.outline.custom.elements.key;" label="&webdeveloper.outline.custom.elements.label;" type="checkbox" oncommand="webdeveloper_outlineCustomElements(this)"/>
- <menuseparator id="webdeveloper-outline-separator3-toolbar"/>
- <menuitem id="webdeveloper-outline-show-element-names-toolbar" accesskey="&webdeveloper.show.element.names.when.outlining.key;" label="&webdeveloper.show.element.names.when.outlining.label;" type="checkbox" oncommand="webdeveloper_toggleShowElementNamesWhenOutlining(this)"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-resize-toolbar" label="&webdeveloper.resize.label;" tooltiptext="&webdeveloper.resize.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateResizeMenu(this, 'toolbar')">
- <menuitem id="webdeveloper-display-window-size-toolbar" accesskey="&webdeveloper.display.window.size.key;" label="&webdeveloper.display.window.size.label;" oncommand="webdeveloper_displayWindowSize()"/>
- <menuitem id="webdeveloper-display-window-size-title-toolbar" accesskey="&webdeveloper.display.window.size.title.key;" label="&webdeveloper.display.window.size.title.label;" type="checkbox" oncommand="webdeveloper_displayWindowSizeInTitle(this)"/>
- <menuseparator id="webdeveloper-resize-separator1-toolbar"/>
- <menuitem id="webdeveloper-resize-window-toolbar" accesskey="&webdeveloper.resize.window.key;" label="&webdeveloper.resize.window.label;" oncommand="webdeveloper_customResizeWindow()"/>
- <menuseparator id="webdeveloper-resize-separator2-toolbar"/>
- <menuseparator id="webdeveloper-resize-separator3-toolbar"/>
- <menuitem id="webdeveloper-edit-resize-dimensions-toolbar" accesskey="&webdeveloper.edit.resize.dimensions.key;" label="&webdeveloper.edit.resize.dimensions.label;" oncommand="webdeveloper_options('resize')"/>
- <menuseparator id="webdeveloper-resize-separator4-toolbar"/>
- <menu id="webdeveloper-zoom-toolbar" accesskey="&webdeveloper.zoom.key;" label="&webdeveloper.zoom.label;">
- <menupopup>
- <menuitem id="webdeveloper-zoom-in-toolbar" accesskey="&webdeveloper.zoom.in.key;" key="webdeveloper-zoom-in-key" label="&webdeveloper.zoom.in.label;" oncommand="webdeveloper_zoom(true)"/>
- <menuitem id="webdeveloper-zoom-out-toolbar" accesskey="&webdeveloper.zoom.out.key;" key="webdeveloper-zoom-out-key" label="&webdeveloper.zoom.out.label;" oncommand="webdeveloper_zoom(false)"/>
- </menupopup>
- </menu>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-tools-toolbar" label="&webdeveloper.tools.label;" tooltiptext="&webdeveloper.tools.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateToolsMenu(this, 'toolbar')">
- <menuseparator id="webdeveloper-tools-separator1-toolbar"/>
- <menuitem id="webdeveloper-edit-tools-toolbar" accesskey="&webdeveloper.edit.tools.key;" label="&webdeveloper.edit.tools.label;" oncommand="webdeveloper_options('tools')"/>
- <menuseparator id="webdeveloper-tools-separator2-toolbar"/>
- <menuitem id="webdeveloper-dom-inspector-toolbar" accesskey="&webdeveloper.dom.inspector.key;" label="&webdeveloper.dom.inspector.label;" type="checkbox" oncommand="webdeveloper_openDOMInspector()"/>
- <menuitem id="webdeveloper-error-console-toolbar" accesskey="&webdeveloper.error.console.key;" key="webdeveloper-error-console-key" label="&webdeveloper.error.console.label;" type="checkbox" oncommand="webdeveloper_openErrorConsole(true)"/>
- <menuitem id="webdeveloper-java-console-toolbar" accesskey="&webdeveloper.java.console.key;" key="webdeveloper-java-console-key" label="&webdeveloper.java.console.label;" oncommand="webdeveloper_openJavaConsole()"/>
- <menuseparator id="webdeveloper-tools-separator3-toolbar"/>
- <menuitem id="webdeveloper-display-page-validation-toolbar" accesskey="&webdeveloper.display.page.validation.key;" label="&webdeveloper.display.page.validation.label;" type="checkbox" oncommand="webdeveloper_displayPageValidation(this)"/>
- <menuitem id="webdeveloper-validate-local-accessibility-toolbar" accesskey="&webdeveloper.validate.local.accessibility.key;" label="&webdeveloper.validate.local.accessibility.label;" oncommand="webdeveloper_validateLocalAccessibility()"/>
- <menuitem id="webdeveloper-validate-local-css-toolbar" accesskey="&webdeveloper.validate.local.css.key;" label="&webdeveloper.validate.local.css.label;" oncommand="webdeveloper_validateLocalCSS()"/>
- <menuitem id="webdeveloper-validate-local-html-toolbar" accesskey="&webdeveloper.validate.local.html.key;" key="webdeveloper-validate-local-html-key" label="&webdeveloper.validate.local.html.label;" oncommand="webdeveloper_validateLocalHTML()"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-view-source-toolbar" label="&webdeveloper.view.source.label;" tooltiptext="&webdeveloper.view.source.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateViewSourceMenu(this, 'toolbar')">
- <menuitem id="webdeveloper-view-source-view-source-toolbar" accesskey="&webdeveloper.view.source.key;" key="webdeveloper-view-source-key" label="&webdeveloper.view.source.label;" oncommand="webdeveloper_viewSource(webdeveloper_getContentDocument())"/>
- <menuseparator id="webdeveloper-view-source-separator1-toolbar"/>
- <menu id="webdeveloper-view-frame-source-toolbar" accesskey="&webdeveloper.view.frame.source.key;" label="&webdeveloper.view.frame.source.label;">
- <menupopup onpopupshowing="webdeveloper_displayViewFrameSourceMenu(this)"/>
- </menu>
- <menuitem id="webdeveloper-view-generated-source-toolbar" accesskey="&webdeveloper.view.generated.source.key;" label="&webdeveloper.view.generated.source.label;" oncommand="webdeveloper_viewGeneratedSource()"/>
- <menuseparator id="webdeveloper-view-source-separator2-toolbar"/>
- <menuseparator id="webdeveloper-view-source-separator3-toolbar"/>
- <menuitem id="webdeveloper-edit-view-source-with-applications-toolbar" accesskey="&webdeveloper.edit.view.source.with.applications.key;" label="&webdeveloper.edit.view.source.with.applications.label;" oncommand="webdeveloper_options('view-source')"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-options-toolbar" label="&webdeveloper.options.label;" tooltiptext="&webdeveloper.options.label;" type="menu" onmouseover="webdeveloper_openToolbarButton(this)">
- <menupopup onpopupshowing="webdeveloper_updateOptionsMenu('toolbar')">
- <menuitem id="webdeveloper-persist-features-toolbar" accesskey="&webdeveloper.persist.features.key;" label="&webdeveloper.persist.features.label;" type="checkbox" oncommand="webdeveloper_enablePreference(this, 'webdeveloper.persist.features')"/>
- <menuitem id="webdeveloper-reset-page-toolbar" accesskey="&webdeveloper.reset.page.key;" label="&webdeveloper.reset.page.label;" oncommand="webdeveloper_resetPage()"/>
- <menuseparator id="webdeveloper-options-separator1-toolbar"/>
- <menuitem id="webdeveloper-options-options-toolbar" accesskey="&webdeveloper.options.menu.key;" label="&webdeveloper.options.menu.label;" oncommand="webdeveloper_options()"/>
- <menuseparator id="webdeveloper-options-separator2-toolbar"/>
- <menuitem id="webdeveloper-help-toolbar" accesskey="&webdeveloper.help.key;" label="&webdeveloper.help.label;" oncommand="webdeveloper_help()"/>
- <menuitem id="webdeveloper-about-toolbar" accesskey="&webdeveloper.about.key;" label="&webdeveloper.about.label;" oncommand="webdeveloper_about()"/>
- </menupopup>
- </toolbarbutton>
- <toolbarbutton id="webdeveloper-render-mode-statusbar" tooltiptext="&webdeveloper.render.mode.label;" oncommand="webdeveloper_viewPageInformation('chrome://browser/content/pageInfo.xul')"/>
- <toolbarbutton id="webdeveloper-css-statusbar" tooltiptext="&webdeveloper.css.label;" oncommand="webdeveloper_openErrorConsole(false)"/>
- <toolbarbutton id="webdeveloper-javascript-statusbar" tooltiptext="&webdeveloper.javascript.label;" oncommand="webdeveloper_openErrorConsole(false)"/>
- </toolbarpalette>
-
- <toolbox id="navigator-toolbox">
- <toolbar id="webdeveloper-toolbar" accesskey="&webdeveloper.key;" class="chromeclass-toolbar" collapsed="false" context="toolbar-context-menu" customizable="true" grippytooltiptext="&webdeveloper.toolbar.name;" hidden="false" iconsize="small" inherits="collapsed,hidden" mode="full" persist="collapsed,hidden" toolbarname="&webdeveloper.toolbar.name;"
- defaultset="webdeveloper-disable-toolbar,webdeveloper-cookies-toolbar,webdeveloper-css-toolbar,webdeveloper-forms-toolbar,webdeveloper-images-toolbar,webdeveloper-information-toolbar,webdeveloper-miscellaneous-toolbar,webdeveloper-outline-toolbar,webdeveloper-resize-toolbar,webdeveloper-tools-toolbar,webdeveloper-view-source-toolbar,webdeveloper-options-toolbar,spring,webdeveloper-render-mode-statusbar,webdeveloper-css-statusbar,webdeveloper-javascript-statusbar"/>
- <toolbar id="webdeveloper-line-guides-toolbar" class="chromeclass-toolbar" collapsed="false" grippytooltiptext="&webdeveloper.line.guides.toolbar.name;" hidden="true" inherits="collapsed,hidden" mode="full">
- <hbox align="center">
- <spacer class="small"/>
- <description value="&webdeveloper.line.guides.toolbar.name;"/>
- <spacer/>
- <label control="webdeveloper.line.guides.color" value="&webdeveloper.color.label;"/>
- <colorpicker id="webdeveloper.line.guides.color" palettename="standard" type="button" onchange="webdeveloper_updateLineGuideColor(this)"/>
- <spacer/>
- <button label="&webdeveloper.add.horizontal.line.guide.label;" oncommand="webdeveloper_addHorizontalLineGuide()"/>
- <button label="&webdeveloper.add.vertical.line.guide.label;" oncommand="webdeveloper_addVerticalLineGuide()"/>
- </hbox>
- <toolbarspring/>
- <toolbarbutton class="webdeveloper-close-toolbar" tooltiptext="&webdeveloper.close.label;" oncommand="webdeveloper_displayLineGuides(null)"/>
- </toolbar>
- <toolbar id="webdeveloper-page-magnifier-toolbar" class="chromeclass-toolbar" collapsed="false" grippytooltiptext="&webdeveloper.page.magnifier.toolbar.name;" hidden="true" inherits="collapsed,hidden" mode="full">
- <hbox align="center">
- <spacer class="small"/>
- <description value="&webdeveloper.page.magnifier.toolbar.name;"/>
- <spacer/>
- <label control="webdeveloper.magnification.level" value="&webdeveloper.magnification.level.label;"/>
- <textbox id="webdeveloper.magnification.level" size="5" onchange="webdeveloper_updateMagnificationLevel(this)"/>
- </hbox>
- <toolbarspring/>
- <toolbarbutton class="webdeveloper-close-toolbar" tooltiptext="&webdeveloper.close.label;" oncommand="webdeveloper_displayPageMagnifier(null)"/>
- </toolbar>
- <toolbar id="webdeveloper-page-validation-toolbar" class="chromeclass-toolbar" collapsed="false" grippytooltiptext="&webdeveloper.page.validation.toolbar.name;" hidden="true" inherits="collapsed,hidden" mode="full">
- <hbox align="center">
- <spacer class="small"/>
- <description value="&webdeveloper.page.validation.toolbar.name;"/>
- <spacer/>
- <description value="&webdeveloper.html.label;"/>
- <toolbarbutton id="webdeveloper-html-validation" tooltiptext="&webdeveloper.validate.html.label;" oncommand="webdeveloper_validateLocalHTML()"/>
- <spacer/>
- <description value="&webdeveloper.css.validation.label;"/>
- <toolbarbutton id="webdeveloper-css-validation" tooltiptext="&webdeveloper.validate.css.label;" oncommand="webdeveloper_validateLocalCSS()"/>
- <spacer/>
- <description value="&webdeveloper.accessibility.validation.label;"/>
- <toolbarbutton id="webdeveloper-accessibility-validation" tooltiptext="&webdeveloper.validate.accessibility.label;" oncommand="webdeveloper_validateLocalAccessibility()"/>
- </hbox>
- <toolbarspring/>
- <toolbarbutton class="webdeveloper-close-toolbar" tooltiptext="&webdeveloper.close.label;" oncommand="webdeveloper_displayPageValidation(null)"/>
- </toolbar>
- <toolbar id="webdeveloper-ruler-toolbar" class="chromeclass-toolbar" collapsed="false" grippytooltiptext="&webdeveloper.ruler.toolbar.name;" hidden="true" inherits="collapsed,hidden" mode="full">
- <hbox align="center">
- <spacer class="small"/>
- <description value="&webdeveloper.ruler.toolbar.name;"/>
- <spacer/>
- <label control="webdeveloper-ruler-width" value="&webdeveloper.width.label;"/>
- <textbox id="webdeveloper-ruler-width" size="5" onchange="webdeveloper_updateRulerWidth(this)"/>
- <label control="webdeveloper-ruler-height" value="&webdeveloper.height.label;"/>
- <textbox id="webdeveloper-ruler-height" size="5" onchange="webdeveloper_updateRulerHeight(this)"/>
- <spacer/>
- <description value="&webdeveloper.start.position.label;"/>
- <spacer class="small"/>
- <description value="X = "/>
- <description id="webdeveloper-ruler-start-x"/>
- <spacer class="small"/>
- <description value="Y = "/>
- <description id="webdeveloper-ruler-start-y"/>
- <spacer/>
- <description value="&webdeveloper.end.position.label;"/>
- <spacer class="small"/>
- <description value="X = "/>
- <description id="webdeveloper-ruler-end-x"/>
- <spacer class="small"/>
- <description value="Y = "/>
- <description id="webdeveloper-ruler-end-y"/>
- </hbox>
- <toolbarspring/>
- <toolbarbutton class="webdeveloper-close-toolbar" tooltiptext="&webdeveloper.close.label;" oncommand="webdeveloper_displayRuler(null)"/>
- </toolbar>
- <toolbar id="webdeveloper-information-text-toolbar" class="chromeclass-toolbar" collapsed="false" grippytooltiptext="&webdeveloper.name;" hidden="true" inherits="collapsed,hidden" mode="full">
- <hbox align="center" flex="1">
- <spacer class="small"/>
- <description value="&webdeveloper.name;"/>
- <spacer/>
- <textbox id="webdeveloper-information" flex="1" readonly="true"/>
- </hbox>
- </toolbar>
- </toolbox>
-
- <statusbar id="status-bar">
- <statusbarpanel id="webdeveloper-statusbar-panel" context="webdeveloper-statusbar-menu" hidden="true" insertafter="page-report-button">
- <image id="webdeveloper-statusbar" popup="webdeveloper-statusbar-menu" src="chrome://webdeveloper/content/images/logo/small.png" width="16" height="16" tooltiptext="&webdeveloper.name;"/>
- <menupopup id="webdeveloper-statusbar-menu" onpopupshowing="return webdeveloper_updateStatusMenu(this)">
- <menuseparator id="webdeveloper-separator-statusbar"/>
- <menuitem id="webdeveloper-reset-page-statusbar" accesskey="&webdeveloper.reset.page.key;" label="&webdeveloper.reset.page.label;" oncommand="webdeveloper_resetPage()"/>
- </menupopup>
- </statusbarpanel>
- </statusbar>
-
- <window id="main-window">
- <vbox id="webdeveloper-dashboard" class="chromeclass-extrachrome" hidden="true" persist="height,width">
- <tabbox id="webdeveloper-dashboard-tab-box" flex="1">
- <tabs id="webdeveloper-dashboard-tabs">
- <spacer id="webdeveloper-dashboard-spacer" flex="1"/>
- <toolbarbutton id="webdeveloper-position-dashboard" class="webdeveloper-dashboard-button" tooltiptext="&webdeveloper.position.label;" oncommand="webdeveloper_positionDashboard()"/>
- <toolbarbutton class="webdeveloper-close-toolbar" tooltiptext="&webdeveloper.close.label;" oncommand="webdeveloper_closeDashboardTab()"/>
- </tabs>
- <tabpanels id="webdeveloper-dashboard-tab-panels" flex="1"/>
- </tabbox>
- </vbox>
- <splitter id="webdeveloper-dashboard-splitter" class="chromeclass-extrachrome" hidden="true"/>
- <box id="webdeveloper-page-magnifier-container" hidden="true">
- <html:canvas id="webdeveloper-page-magnifier" width="200" height="200"/>
- </box>
- </window>
-</overlay>
\ No newline at end of file