Skip to content

Commit 280299b

Browse files
committed
Merge branch 'rpl-refactoring/select-connections'
2 parents f5d497b + 24d0852 commit 280299b

37 files changed

+727
-113
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0"?>
2+
3+
<?xml-stylesheet href="chrome://global/skin/global.css"?>
4+
<?xml-stylesheet href="chrome://global/skin/findBar.css" type="text/css"?>
5+
<?xml-stylesheet href="chrome://browser/skin/devtools/widgets.css" type="text/css"?>
6+
7+
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
8+
xmlns:html="http://www.w3.org/1999/xhtml"
9+
id="rdpinspectorconnections"
10+
windowtype="RDPInspectorConnectionList"
11+
title="RDP Inspector - Connections"
12+
width="300" height="480"
13+
screenX="10" screenY="10"
14+
persist="screenX screenY width height sizemode">
15+
16+
<!-- Firefox Files -->
17+
<script xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" type="application/javascript;version=1.8"
18+
src="chrome://browser/content/devtools/theme-switching.js"/>
19+
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
20+
<script type="application/x-javascript" src="chrome://global/content/findBar.js"/>
21+
22+
<!-- String Bundles -->
23+
<stringbundle id="bundle_findBar" src="chrome://global/locale/findbar.properties"/>
24+
25+
<!-- Commands -->
26+
<commandset id="mainCommandSet">
27+
<command id="cmd_find" oncommand="gFindBar.onFindCommand();"/>
28+
<command id="cmd_findAgain" oncommand="gFindBar.onFindAgainCmd();"/>
29+
<command id="cmd_findPrevious" oncommand="gFindBar.onFindPreviousCmd();"/>
30+
</commandset>
31+
32+
<keyset id="mainKeyset">
33+
<key id="key_find" key="f" command="cmd_find" modifiers="accel"/>
34+
</keyset>
35+
36+
<!-- Application Content -->
37+
<vbox flex="1">
38+
39+
<!-- React UI Container -->
40+
<browser id="contentFrame" type="content-primary" flex="1"
41+
disablehistory="true" />
42+
43+
<!-- Search bar -->
44+
<findbar id="FindToolbar" browserid="contentFrame"/>
45+
46+
<script type="application/x-javascript">
47+
window.gFindBar = document.getElementById("FindToolbar");
48+
</script>
49+
</vbox>
50+
</window>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# LOCALIZATION NOTE (rdpConnections.tab.LocalTabs, rdpConnections.tab.WebIDE)
2+
# A label for "Connect To..." window tabs.
3+
rdpConnections.tab.LocalTabs=Local Tabs
4+
rdpConnections.tab.WebIDE=WebIDE

chrome/locale/en-US/toolbox.properties

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ rdpInspector.menu.packetCache.tip=Store packets in a cache before the console is
4848
rdpInspector.menu.showInlineDetails.label=Show Packet Details Inline
4949
rdpInspector.menu.showInlineDetails.tip=Show a detailed tree view of the Packet content.
5050

51-
# LOCALIZATION NOTE (rdpInspector.menu.webideConnectionsMonitor.label,rdpInspector.menu.webideConnectionsMonitor.tip):
51+
# LOCALIZATION NOTE (rdpInspector.menu.autoOpenOnWebIDEConnection.label,rdpInspector.menu.autoOpenOnWebIDEConnection.tip):
5252
# RDP Inspector menu label. The menu is available in RDP Inspector start
5353
# button located in Firefox toolbar, inside the Options sub-menu.
54-
rdpInspector.menu.webideConnectionsMonitor.label=Monitor WebIDE connections
55-
rdpInspector.menu.webideConnectionsMonitor.tip=Monitor WebIDE connections and auto-open an RDP inspector window.
54+
rdpInspector.menu.autoOpenOnWebIDEConnection.label=Open automatically on new WebIDE connections
55+
rdpInspector.menu.autoOpenOnWebIDEConnection.tip=Open an RDP inspector window automatically on every new WebIDE connections.
56+
57+
# LOCALIZATION NOTE (rdpInspector.menu.connectionList.label, rdpInspector.menu.connectionList.tip):
58+
# RDP Inspector menu label. The menu is available in RDP Inspector start
59+
# button located in Firefox toolbar.
60+
rdpInspector.menu.connectionList.label=Connect to...
61+
rdpInspector.menu.connectionList.tip=Open a dialog which lists all the RDP Connections available to the RDPInspector
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* See license.txt for terms of usage */
2+
3+
define(function(require, exports/*, module*/) {
4+
5+
"use strict";
6+
7+
// ReactJS
8+
const React = require("react");
9+
10+
// React Bootstrap factories
11+
const {
12+
ListGroup, ListGroupItem,
13+
TabbedArea, TabPane
14+
} = require("shared/react-bootstrap-factories");
15+
16+
const ConnectionsGroup = React.createClass({
17+
displayName: "ConnectionsGroup",
18+
19+
render() {
20+
let connections = this.props.connections.map((conn) => {
21+
return ListGroupItem({
22+
onClick: (evt) => {
23+
this.props.onConnectionClick(conn, evt);
24+
}
25+
}, conn.name);
26+
});
27+
28+
return ListGroup({ fill: true }, connections);
29+
}
30+
});
31+
32+
exports.ConnectionList = React.createClass({
33+
displayName: "ConnectionList",
34+
35+
render() {
36+
const connections = this.props.connections || {};
37+
38+
// turn the first level (connections group) into a ConnectionsGroups components
39+
const connectionsGroups = Object.keys(connections).map((groupName, i) => {
40+
return TabPane({
41+
key: groupName,
42+
tab: connections[groupName].label,
43+
eventKey: i + 1,
44+
style: { overflow: "auto"}
45+
}, React.createElement(ConnectionsGroup, {
46+
onConnectionClick: this.props.onConnectionClick,
47+
connections: connections[groupName].connections
48+
}));
49+
});
50+
51+
return TabbedArea({
52+
className: "mainTabbedArea",
53+
defaultActiveKey: 1, animation: false
54+
}, connectionsGroups);
55+
}
56+
});
57+
58+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* See license.txt for terms of usage */
2+
3+
define(function(require, exports/*, module*/) {
4+
5+
"use strict";
6+
7+
// ReactJS
8+
const React = require("react");
9+
10+
// Connections List components
11+
const { ConnectionList } = require("./connection-list");
12+
13+
exports.MainPanel = React.createClass({
14+
displayName: "MainPanel",
15+
16+
render() {
17+
return React.createElement(ConnectionList, {
18+
connections: this.props.connections,
19+
onConnectionClick: this.props.onConnectionClick
20+
});
21+
}
22+
});
23+
24+
});

data/connection-list/config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* See license.txt for terms of usage */
2+
3+
/* globals requirejs */
4+
5+
// RequireJS configuration
6+
require.config({
7+
baseUrl: ".",
8+
scriptType: "application/javascript;version=1.8",
9+
paths: {
10+
"shared": "../shared",
11+
"jquery": "../lib/jquery/jquery",
12+
"react": "../lib/react/react",
13+
"bootstrap": "../lib/bootstrap/js/bootstrap",
14+
"immutable": "../lib/immutable/immutable",
15+
"react-bootstrap": "../lib/react-bootstrap/react-bootstrap",
16+
"reps": "../../node_modules/firebug.sdk/lib/reps"
17+
}
18+
});
19+
20+
// Load the main panel module
21+
requirejs(["index"]);

data/connection-list/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<!-- Bootstrap default CSS -->
9+
<link href="../lib/bootstrap/css/bootstrap.css" rel="stylesheet">
10+
11+
<!-- Custom styles -->
12+
13+
<link href="../inspector/css/base.css" rel="stylesheet">
14+
<link href="../inspector/css/toolbox.css" rel="stylesheet">
15+
<link href="../inspector/css/toolbar.css" rel="stylesheet">
16+
<link href="../inspector/css/search-box.css" rel="stylesheet">
17+
18+
<link href="chrome://rdpinspector-firebug.sdk/skin/domTree.css" rel="stylesheet">
19+
20+
<!-- Load RequireJS config file as the entry point module -->
21+
<script data-main="config" src="../lib/requirejs/require.js"></script>
22+
</head>
23+
<body class="theme-firebug">
24+
<div id="content"></div>
25+
</body>
26+
</html>

data/connection-list/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* See license.txt for terms of usage */
2+
3+
define(function(require/*, exports, module*/) {
4+
5+
"use strict";
6+
7+
const { RDPConnectionList } = require("shared/rdp-inspector-window");
8+
var { Resizer } = require("shared/resizer");
9+
10+
const { MainPanel } = require("./components/main-panel");
11+
12+
// ReactJS
13+
var React = require("react");
14+
15+
function render() {
16+
let connections = RDPConnectionList.getConnectionsInfo();
17+
18+
return React.render(
19+
React.createElement(MainPanel, {
20+
connections,
21+
onConnectionClick: (conn) => {
22+
RDPConnectionList.openRDPInspectorWindow(conn);
23+
}
24+
}),
25+
document.querySelector("#content")
26+
);
27+
}
28+
29+
let theApp = render();
30+
RDPConnectionList.onConnectionsUpdated.addListener(render);
31+
32+
/* eslint-disable no-new */
33+
new Resizer(window, theApp);
34+
/* eslint-enable */
35+
36+
});

data/inspector/components/actors-panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { Reps } = require("reps/repository");
1414
// RDP Inspector
1515
const { ActorsToolbar } = require("./actors-toolbar");
1616

17-
const { Locale } = require("../rdp-inspector-window");
17+
const { Locale } = require("shared/rdp-inspector-window");
1818

1919
// Shortcuts
2020
const { TR, TD, TABLE, TBODY, THEAD, TH, DIV, H4 } = Reps.DOM;

data/inspector/components/actors-toolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { Reps } = require("reps/reps");
1616
const { SELECT, OPTION } = Reps.DOM;
1717

1818
// RDP Window injected APIs
19-
const { Locale } = require("../rdp-inspector-window");
19+
const { Locale } = require("shared/rdp-inspector-window");
2020

2121
/**
2222
* @template This object is responsible for rendering the toolbar

0 commit comments

Comments
 (0)