Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/stiak/restclient-fx-patched
Browse files Browse the repository at this point in the history
Conflicts:
	chrome.manifest
	install.rdf
  • Loading branch information
chao committed Jan 15, 2011
2 parents a9f16d5 + d8e0f25 commit acc322c
Show file tree
Hide file tree
Showing 58 changed files with 3,381 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
= restclient-fx-patched

Patched version of Firefox addon called RESTClient (https://addons.mozilla.org/en-US/firefox/addon/9780/)

== changes
- field values recovering when Firefox crashes
- fixed header deleting (now you can use delete key when editing header name or value)
- fixed display of json data (I've just moved css file to right place)
- added ability to select and copy text from response (by adding right css style, that doesn't work always properly)
- field values storing when Firefox is shutting down by user

== todo
- switch from TabRestored to TabRestoring for tab recovering
- bind refresh key to send request action
8 changes: 8 additions & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<<<<<<< HEAD
content restclient jar:chrome/restclient.jar!/content/

locale restclient en-US jar:chrome/restclient.jar!/locale/en-US/
locale restclient zh-CN jar:chrome/restclient.jar!/locale/zh-CN/
locale restclient fr-FR jar:chrome/restclient.jar!/locale/fr-FR/

skin restclient classic/1.0 jar:chrome/restclient.jar!/skin/
=======
content restclient content/
skin restclient classic/1.0 skin/
locale restclient en-US locale/en-US/
locale restclient fr-FR locale/fr-FR/
locale restclient zh-CN locale/zh-CN/
>>>>>>> d8e0f25c9b460181c151a203e810df78219c8574

overlay chrome://browser/content/browser.xul chrome://restclient/content/restclientOverlay.xul
style chrome://global/content/customizeToolbar.xul chrome://restclient/skin/overlay.css
69 changes: 69 additions & 0 deletions content/JSONPrettyPrint.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* The top-level container for all the formatted json or the error message if there is one */
.json-content {
background-color: white;
border: 1px solid #999999;
margin-right: 10px;
padding: 10px 10px 10px 0;
}

.json-string {
color: green;
white-space: pre;
}

.json-null {
color: red;
}

.json-numeric {
color: red;
}

.json-bool {
color: blue;
}

/*
An object or an array
*/
.json-object {
padding-left: 10px;
}

/*
A member of an array or object.
- a member of an array is just a value
- a member of an object is a name/value pair
*/
.json-member {
padding-left: 10px;
}

/*
The label, for example:
{
validated: true
^^^^^^^^^
}
*/
.json-label {
font-weight: bold;
}

/*
The braces for objects and arrays, ie {} or []
*/
.json-brace {
font-weight: bold;
}

/* The part that says there was an error, eg "There was an error" */
.json-error-title {
font-weight: bold;
}

/* The actual error message, eg "Missing left bracket on line 6" */
.json-error-message {

}

132 changes: 132 additions & 0 deletions content/XMLPrettyPrint.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
version="1.0">

<xsl:output method="xml"/>

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="*">
<html:div class="indent">
<html:span class="markup">&lt;</html:span>
<html:span class="start-tag"><xsl:value-of select="name(.)"/></html:span>
<xsl:apply-templates select="@*"/>
<html:span class="markup">/&gt;</html:span>
</html:div>
</xsl:template>

<xsl:template match="*[node()]">
<html:div class="indent">
<html:span class="markup">&lt;</html:span>
<html:span class="start-tag"><xsl:value-of select="name(.)"/></html:span>
<xsl:apply-templates select="@*"/>
<html:span class="markup">&gt;</html:span>

<html:span class="text"><xsl:value-of select="."/></html:span>

<html:span class="markup">&lt;/</html:span>
<html:span class="end-tag"><xsl:value-of select="name(.)"/></html:span>
<html:span class="markup">&gt;</html:span>
</html:div>
</xsl:template>

<xsl:template match="*[* or processing-instruction() or comment() or string-length(.) &gt; 50]">
<html:table>
<html:tr>
<xsl:call-template name="expander"/>
<html:td>
<html:span class="markup">&lt;</html:span>
<html:span class="start-tag"><xsl:value-of select="name(.)"/></html:span>
<xsl:apply-templates select="@*"/>
<html:span class="markup">&gt;</html:span>

<html:div class="expander-content"><xsl:apply-templates/></html:div>

<html:span class="markup">&lt;/</html:span>
<html:span class="end-tag"><xsl:value-of select="name(.)"/></html:span>
<html:span class="markup">&gt;</html:span>
</html:td>
</html:tr>
</html:table>
</xsl:template>


<xsl:template match="@*">
<xsl:text> </xsl:text>
<html:span class="attribute-name"><xsl:value-of select="name(.)"/></html:span>
<html:span class="markup">=</html:span>
<xsl:choose>
<xsl:when test="name(.) = 'href'">
"<xsl:element name="html:a">
<xsl:attribute name="href">#</xsl:attribute>
<xsl:attribute name="class">attribute-href</xsl:attribute>
<xsl:attribute name="onclick">setRequestUrl('<xsl:value-of select="."/>');</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>"
</xsl:when>
<xsl:otherwise>
<html:span class="attribute-value">"<xsl:value-of select="."/>"</html:span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="text()">
<xsl:if test="normalize-space(.)">
<html:div class="indent text"><xsl:value-of select="."/></html:div>
</xsl:if>
</xsl:template>

<xsl:template match="processing-instruction()">
<html:div class="indent pi">
<xsl:text>&lt;?</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
<xsl:text>?&gt;</xsl:text>
</html:div>
</xsl:template>

<xsl:template match="processing-instruction()[string-length(.) &gt; 50]">
<html:table>
<html:tr>
<xsl:call-template name="expander"/>
<html:td class="pi">
&lt;?<xsl:value-of select="name(.)"/>
<html:div class="indent expander-content"><xsl:value-of select="."/></html:div>
<xsl:text>?&gt;</xsl:text>
</html:td>
</html:tr>
</html:table>
</xsl:template>

<xsl:template match="comment()">
<html:div class="comment indent">
<xsl:text>&lt;!--</xsl:text>
<xsl:value-of select="."/>
<xsl:text>--&gt;</xsl:text>
</html:div>
</xsl:template>

<xsl:template match="comment()[string-length(.) &gt; 50]">
<html:table>
<html:tr>
<xsl:call-template name="expander"/>
<html:td class="comment">
<xsl:text>&lt;!--</xsl:text>
<html:div class="indent expander-content"><xsl:value-of select="."/></html:div>
<xsl:text>--&gt;</xsl:text>
</html:td>
</html:tr>
</html:table>
</xsl:template>

<xsl:template name="expander">
<html:td class="expander">&#x2212;<html:div class="spacer"/></html:td>
</xsl:template>

</xsl:stylesheet>
42 changes: 42 additions & 0 deletions content/about.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<!DOCTYPE window SYSTEM "chrome://restclient/locale/restclient.dtd">

<window class="dialog"
title="&restclient.about.title;"
orient="vertical"
autostretch="always"
onload="sizeToContent()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<!-- Original template by Jed Brown -->

<groupbox align="center" orient="horizontal">
<vbox>
<text value="&restclient.about.title;" style="font-weight: bold; font-size: x-large;"/>
<text value="ver. 1.3.2"/>
<separator class="thin"/>
<text value="&restclient.about.createby;" style="font-weight: bold;"/>
<text value="Chao ZHOU" class="url"
onclick="window.open('mailto:[email protected]'); window.close();"/>
<separator class="thin"/>
<text value="&restclient.about.contributor;" style="font-weight: bold;"/>
<text value="Aurelien Benel" class="url" onclick="window.open('http://www.porphyry.org/Members/abenel/');window.close();"/>
<text value="Christophe Lejeune"/>
<separator class="thin"/>
<text value="&restclient.about.feedback;" style="font-weight: bold;"/>
<text value="[email protected]"
class="url"
onclick="window.open('mailto:[email protected]'); window.close();"/>
</vbox>
<spring flex="1"/>
<image src="chrome://restclient/skin/logo48.png"/>
</groupbox>

<hbox>
<spacer flex="1"/>
<button label="Close" oncommand="window.close();"/>
</hbox>

</window>
Loading

0 comments on commit acc322c

Please sign in to comment.