Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'prepare-release-1.1.1'

  • Loading branch information...
commit 2eadb03e79e86f11a18df1240eaa882bfbe93ee6 2 parents 86bf1fa + eb2505a
@rpl authored
View
127 chrome/content/repl.js
@@ -719,7 +719,7 @@ var httpInspectInteractor = {
var target = resolveObjectPath(repl._hostContext, path);
- var content = <tbody/>;
+ var content = document.createElement("tbody");
for(var propName in target) {
var propType;
try {
@@ -728,23 +728,31 @@ var httpInspectInteractor = {
propType = '[exception]';
}
- content.appendChild(
- <tr>
- <td><a href={path + (path.slice(-1) == '/' ? '' : '/') + propName}>{propName}</a></td>
- <td>{propType}</td>
- </tr>
- );
+ var tr = document.createElement("tr");
+ tr.innerHTML = "<td><a href=" + path
+ + (path.slice(-1) == '/' ? '' : '/') + propName
+ + ">" + propName + "</a></td><td>" + propType + "</td>";
+ content.appendChild(tr);
}
var targetType = typeof(target);
var targetRepresentation = target.toString();
- var breadcrumbs = <div id="breadcrumb"><a href="/">[root]</a></div>;
+ var breadcrumbs = document.createElement("div");
+ breadcrumb.id = "breadcrumb";
+ breadcrumb.innerHTML = '<a href="/">[root]</a>';
var pathSteps = path.split('/');
for(let i=1; i<pathSteps.length; i++) {
- breadcrumbs.appendChild('/')
- breadcrumbs.appendChild(<a href={pathSteps.slice(0,i+1).join('/')}>{pathSteps[i]}</a>);
+ breadcrumbs.appendChild('/');
+
+ var aLink = document.createElement("a");
+ aLink.setAttribute(
+ "href",
+ pathSteps.slice(0,i+1).join('/')
+ );
+ aLink.textContent = pathSteps[i];
+ breadcrumbs.appendChild(aLink);
}
breadcrumbs.appendChild('(' + targetType + ')');
@@ -752,56 +760,53 @@ var httpInspectInteractor = {
repl.print("Server: you wouldn't believe. :D");
repl.print('Content-Type: application/xhtml+xml');
repl.print();
- repl.print(
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Meta-Browser</title>
- <style type="text/css">
- <![CDATA[
- html {
- font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif;
- background: lightblue;
- }
- body { margin: 1em; }
- td { padding: 0.1em 0.5em; }
- h2 { text-align: center; }
- #content {
- -moz-border-radius: 1em;
- width: 40em; margin: auto;
- background: white;
- padding: 0.5em 1.5em 2em 1.5em;
- min-height: 30em;
- }
- #representation {
- white-space: -moz-pre-wrap;
- overflow: auto;
- background: #f2f2f2;
- padding: 1em;
- }
- #properties { width: 100%; }
- td { background: #f2f2f2; }
- ]]>
- </style>
- </head>
- <body>
- <div id="content">
- <h2>Context</h2>
- {breadcrumbs}
-
- <h2>Representation</h2>
- <pre id="representation">{targetRepresentation}</pre>
-
- <h2>Properties</h2>
- <table id="properties">
- <thead>
- <tr><th>Name</th><th>Type</th></tr>
- </thead>
- {content}
- </table>
- </div>
- </body>
- </html>
- );
+ repl.print('\
+ <html xmlns="http://www.w3.org/1999/xhtml">\
+ <head>\
+ <title>Meta-Browser</title>\
+ <style type="text/css">\
+ <![CDATA[\
+ html {\
+ font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif;\
+ background: lightblue;\
+ }\
+ body { margin: 1em; }\
+ td { padding: 0.1em 0.5em; }\
+ h2 { text-align: center; }\
+ #content {\
+ -moz-border-radius: 1em;\
+ width: 40em; margin: auto;\
+ background: white;\
+ padding: 0.5em 1.5em 2em 1.5em;\
+ min-height: 30em;\
+ }\
+ #representation {\
+ white-space: -moz-pre-wrap;\
+ overflow: auto;\
+ background: #f2f2f2;\
+ padding: 1em;\
+ }\
+ #properties { width: 100%; }\
+ td { background: #f2f2f2; }\
+ ]]>\
+ </style>\
+ </head>\
+ <body>\
+ <div id="content">\
+ <h2>Context</h2>'
+ + breadcrumbs
+ + '<h2>Representation</h2>\
+ <pre id="representation">' + targetRepresentation
+ + '</pre>\
+ <h2>Properties</h2>\
+ <table id="properties">\
+ <thead>\
+ <tr><th>Name</th><th>Type</th></tr>\
+ </thead>' + content
+ + '</table>\
+ </div>\
+ </body>\
+ </html>');
// Don't keep connection open
repl.quit();
@@ -936,7 +941,7 @@ function evaluate(code) {
_.cacheKiller++;
var scriptUrl = _.TMP_FILE_URL + '?' + _.cacheKiller;
debug('evaluate', scriptUrl);
- var result = loader.loadSubScript(scriptUrl, this._workContext);
+ var result = loader.loadSubScript(scriptUrl, this._workContext, 'UTF-8');
this.$$ = result;
return result;
View
16 chrome/content/server.js
@@ -96,12 +96,14 @@ function start(port, loopbackOnly) {
function onSocketAccepted(serv, transport) {
try {
var outstream = transport.openOutputStream(Ci.nsITransport.OPEN_BLOCKING , 0, 0);
+ var outstreamutf8 = Cc['@mozilla.org/intl/converter-output-stream;1']
+ .createInstance(Ci.nsIConverterOutputStream);
+ outstreamutf8.init(outstream, 'UTF-8', 0, 0);
- var stream = transport.openInputStream(0, 0, 0);
- var instream = Cc['@mozilla.org/intl/converter-input-stream;1']
+ var instream = transport.openInputStream(0, 0, 0);
+ var instreamutf8 = Cc['@mozilla.org/intl/converter-input-stream;1']
.createInstance(Ci.nsIConverterInputStream);
- instream.init(stream, 'UTF-8', 1024,
- Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+ instreamutf8.init(instream, 'UTF-8', 1024, 0);
} catch(e) {
log('E, MOZREPL : Error : ' + e);
}
@@ -119,7 +121,7 @@ function onSocketAccepted(serv, transport) {
var session = new REPL();
session.onOutput = function(string) {
- outstream.write(string, string.length);
+ outstreamutf8.writeString(string);
};
session.onQuit = function() {
log('I, MOZREPL : Client closed connection : ' + transport.host + ':' + transport.port);
@@ -135,7 +137,7 @@ function onSocketAccepted(serv, transport) {
var pump = Cc['@mozilla.org/network/input-stream-pump;1']
.createInstance(Ci.nsIInputStreamPump);
- pump.init(stream, -1, -1, 0, 0, false);
+ pump.init(instream, -1, -1, 0, 0, false);
pump.asyncRead({
onStartRequest: function(request, context) {},
onStopRequest: function(request, context, status) {
@@ -143,7 +145,7 @@ function onSocketAccepted(serv, transport) {
},
onDataAvailable: function(request, context, inputStream, offset, count) {
var str = {}
- instream.readString(count, str)
+ instreamutf8.readString(count, str)
session.receive(str.value);
}
}, null);
View
2  components/MozRepl.idl
@@ -6,7 +6,7 @@ interface nsIObserver;
[scriptable, uuid(57f4284b-1f9b-4990-8525-9ed5cbb23e01)]
interface nsIMozRepl: nsISupports
{
- void start(in short port);
+ void start(in short port, in boolean loopbackOnly);
void stop();
View
BIN  components/MozRepl.xpt
Binary file not shown
View
6 install.rdf
@@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>mozrepl@hyperstruct.net</em:id>
- <em:version>1.1.0</em:version>
+ <em:version>1.1.1</em:version>
<em:type>2</em:type>
<!-- firefox -->
@@ -13,7 +13,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
- <em:maxVersion>10.*</em:maxVersion>
+ <em:maxVersion>20.*</em:maxVersion>
</Description>
</em:targetApplication>
@@ -22,7 +22,7 @@
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>1.9</em:minVersion>
- <em:maxVersion>10.*</em:maxVersion>
+ <em:maxVersion>20.*</em:maxVersion>
</Description>
</em:targetApplication>
Please sign in to comment.
Something went wrong with that request. Please try again.