Skip to content

Commit

Permalink
Merge m-c to inbound. a=merge
Browse files Browse the repository at this point in the history
CLOSED TREE
rvandermeulen committed Aug 6, 2014

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
2 parents 5b16c86 + e39aaf3 commit b59183f
Showing 193 changed files with 9,778 additions and 9,234 deletions.
15 changes: 14 additions & 1 deletion browser/components/loop/content/js/panel.js
Original file line number Diff line number Diff line change
@@ -203,6 +203,13 @@ loop.panel = (function(_, mozL10n) {
}
},

_generateMailto: function() {
return encodeURI([
"mailto:?subject=" + __("share_email_subject") + "&",
"body=" + __("share_email_body", {callUrl: this.state.callUrl})
].join(""));
},

render: function() {
// XXX setting elem value from a state (in the callUrl input)
// makes it immutable ie read only but that is fine in our case.
@@ -217,7 +224,13 @@ loop.panel = (function(_, mozL10n) {
PanelLayout({summary: __("share_link_header_text")},
React.DOM.div({className: "invite"},
React.DOM.input({type: "url", value: this.state.callUrl, readOnly: "true",
className: cx(inputCSSClass)})
className: cx(inputCSSClass)}),
React.DOM.a({className: cx({btn: true, hide: !this.state.callUrl}),
href: this._generateMailto()},
React.DOM.span(null,
__("share_button")
)
)
)
)
);
13 changes: 13 additions & 0 deletions browser/components/loop/content/js/panel.jsx
Original file line number Diff line number Diff line change
@@ -203,6 +203,13 @@ loop.panel = (function(_, mozL10n) {
}
},

_generateMailto: function() {
return encodeURI([
"mailto:?subject=" + __("share_email_subject") + "&",
"body=" + __("share_email_body", {callUrl: this.state.callUrl})
].join(""));
},

render: function() {
// XXX setting elem value from a state (in the callUrl input)
// makes it immutable ie read only but that is fine in our case.
@@ -218,6 +225,12 @@ loop.panel = (function(_, mozL10n) {
<div className="invite">
<input type="url" value={this.state.callUrl} readOnly="true"
className={cx(inputCSSClass)} />
<a className={cx({btn: true, hide: !this.state.callUrl})}
href={this._generateMailto()}>
<span>
{__("share_button")}
</span>
</a>
</div>
</PanelLayout>
);
8 changes: 7 additions & 1 deletion browser/components/loop/content/shared/css/common.css
Original file line number Diff line number Diff line change
@@ -58,7 +58,13 @@ h1, h2, h3 {
}

.hide {
display: none;
/**
* Force the display: none as it can conflict with other display.
* You usually want to avoid !important statements as much as
* possible. In this case, it makes sense as it's unlikely we want a
* class to undo the hide feature.
*/
display: none !important;
}

.visually-hidden {
24 changes: 23 additions & 1 deletion browser/components/loop/content/shared/css/panel.css
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
}

.component-spacer {
padding: 5px 10px;
padding: 5px 10px 10px 10px;
}

.spacer {
@@ -75,6 +75,28 @@
padding-top: 6px;
}

.share .action .btn {
background-color: #0096DD;
border: 1px solid #0095DD;
color: #fff;
width: 50%;
height: 26px;
text-align: center;
font-family: 'Lucida Grande', sans-serif;
margin-top: 10px;
}

.share .action .btn:hover {
background-color: #008ACB;
border: 1px solid #008ACB;
}

.share .action .btn span {
margin-top: 2px;
font-size: 12px;
display: inline-block;
}

/* Specific cases */

.panel #messages .alert {
29 changes: 29 additions & 0 deletions browser/components/loop/test/desktop-local/panel_test.js
Original file line number Diff line number Diff line change
@@ -247,6 +247,21 @@ describe("loop.panel", function() {

describe("Rendering the component should generate a call URL", function() {

beforeEach(function() {
document.mozL10n.initialize({
getStrings: function(key) {
var text;

if (key === "share_email_subject")
text = "email-subject";
else if (key === "share_email_body")
text = "{{callUrl}}";

return JSON.stringify({textContent: text});
}
});
});

it("should make a request to requestCallUrl", function() {
sandbox.stub(fakeClient, "requestCallUrl");
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
@@ -290,6 +305,20 @@ describe("loop.panel", function() {
sinon.assert.calledOnce(view.props.notifier.clear);
});

it("should display a share button for email", function() {
fakeClient.requestCallUrl = sandbox.stub();
var mailto = 'mailto:?subject=email-subject&body=http://example.com';
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
notifier: notifier,
client: fakeClient
}));
view.setState({pending: false, callUrl: "http://example.com"});

TestUtils.findRenderedDOMComponentWithTag(view, "a");
var shareButton = view.getDOMNode().querySelector("a.btn");
expect(shareButton.href).to.equal(encodeURI(mailto));
});

it("should notify the user when the operation failed", function() {
fakeClient.requestCallUrl = function(_, cb) {
cb("fake error");
23 changes: 6 additions & 17 deletions browser/devtools/framework/gDevTools.jsm
Original file line number Diff line number Diff line change
@@ -894,24 +894,13 @@ let gDevToolsBrowser = {
},

/**
* Connects to the SPS profiler when the developer tools are open.
* Connects to the SPS profiler when the developer tools are open. This is
* necessary because of the WebConsole's `profile` and `profileEnd` methods.
*/
_connectToProfiler: function DT_connectToProfiler() {
let ProfilerController = devtools.require("devtools/profiler/controller");

for (let win of gDevToolsBrowser._trackedBrowserWindows) {
if (devtools.TargetFactory.isKnownTab(win.gBrowser.selectedTab)) {
let target = devtools.TargetFactory.forTab(win.gBrowser.selectedTab);
if (gDevTools._toolboxes.has(target)) {
target.makeRemote().then(() => {
let profiler = new ProfilerController(target);
profiler.connect();
}).then(null, Cu.reportError);

return;
}
}
}
_connectToProfiler: function DT_connectToProfiler(event, toolbox) {
let SharedProfilerUtils = devtools.require("devtools/profiler/shared");
let connection = SharedProfilerUtils.getProfilerConnection(toolbox);
connection.open();
},

/**
18 changes: 3 additions & 15 deletions browser/devtools/jar.mn
Original file line number Diff line number Diff line change
@@ -78,21 +78,9 @@ browser.jar:
content/browser/devtools/webaudioeditor-controller.js (webaudioeditor/webaudioeditor-controller.js)
content/browser/devtools/webaudioeditor-view.js (webaudioeditor/webaudioeditor-view.js)
content/browser/devtools/profiler.xul (profiler/profiler.xul)
content/browser/devtools/cleopatra.html (profiler/cleopatra/cleopatra.html)
content/browser/devtools/profiler/cleopatra/css/ui.css (profiler/cleopatra/css/ui.css)
content/browser/devtools/profiler/cleopatra/css/tree.css (profiler/cleopatra/css/tree.css)
content/browser/devtools/profiler/cleopatra/css/devtools.css (profiler/cleopatra/css/devtools.css)
content/browser/devtools/profiler/cleopatra/js/strings.js (profiler/cleopatra/js/strings.js)
content/browser/devtools/profiler/cleopatra/js/parser.js (profiler/cleopatra/js/parser.js)
content/browser/devtools/profiler/cleopatra/js/parserWorker.js (profiler/cleopatra/js/parserWorker.js)
content/browser/devtools/profiler/cleopatra/js/tree.js (profiler/cleopatra/js/tree.js)
content/browser/devtools/profiler/cleopatra/js/ui.js (profiler/cleopatra/js/ui.js)
content/browser/devtools/profiler/cleopatra/js/ProgressReporter.js (profiler/cleopatra/js/ProgressReporter.js)
content/browser/devtools/profiler/cleopatra/js/devtools.js (profiler/cleopatra/js/devtools.js)
content/browser/devtools/profiler/cleopatra/images/circlearrow.svg (profiler/cleopatra/images/circlearrow.svg)
content/browser/devtools/profiler/cleopatra/images/noise.png (profiler/cleopatra/images/noise.png)
content/browser/devtools/profiler/cleopatra/images/throbber.svg (profiler/cleopatra/images/throbber.svg)
content/browser/devtools/profiler/cleopatra/images/treetwisty.svg (profiler/cleopatra/images/treetwisty.svg)
content/browser/devtools/profiler.js (profiler/profiler.js)
content/browser/devtools/ui-recordings.js (profiler/ui-recordings.js)
content/browser/devtools/ui-profile.js (profiler/ui-profile.js)
content/browser/devtools/responsivedesign/resize-commands.js (responsivedesign/resize-commands.js)
content/browser/devtools/commandline.css (commandline/commandline.css)
content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
9 changes: 4 additions & 5 deletions browser/devtools/main.js
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/styleeditor/
loader.lazyGetter(this, "ShaderEditorPanel", () => require("devtools/shadereditor/panel").ShaderEditorPanel);
loader.lazyGetter(this, "CanvasDebuggerPanel", () => require("devtools/canvasdebugger/panel").CanvasDebuggerPanel);
loader.lazyGetter(this, "WebAudioEditorPanel", () => require("devtools/webaudioeditor/panel").WebAudioEditorPanel);
loader.lazyGetter(this, "ProfilerPanel", () => require("devtools/profiler/panel"));
loader.lazyGetter(this, "ProfilerPanel", () => require("devtools/profiler/panel").ProfilerPanel);
loader.lazyGetter(this, "NetMonitorPanel", () => require("devtools/netmonitor/panel").NetMonitorPanel);
loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/scratchpad/scratchpad-panel").ScratchpadPanel);

@@ -264,18 +264,17 @@ Tools.webAudioEditor = {
Tools.jsprofiler = {
id: "jsprofiler",
accesskey: l10n("profiler.accesskey", profilerStrings),
key: l10n("profiler2.commandkey", profilerStrings),
key: l10n("profiler.commandkey2", profilerStrings),
ordinal: 7,
modifiers: "shift",
visibilityswitch: "devtools.profiler.enabled",
icon: "chrome://browser/skin/devtools/tool-profiler.svg",
invertIconForLightTheme: true,
url: "chrome://browser/content/devtools/profiler.xul",
label: l10n("profiler.label", profilerStrings),
panelLabel: l10n("profiler.panelLabel", profilerStrings),
label: l10n("profiler.label2", profilerStrings),
panelLabel: l10n("profiler.panelLabel2", profilerStrings),
tooltip: l10n("profiler.tooltip2", profilerStrings),
inMenu: true,
commands: "devtools/profiler/commands",

isTargetSupported: function (target) {
return !target.isAddon;
Loading

0 comments on commit b59183f

Please sign in to comment.