mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-13 10:47:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
42
devtools/client/inspector/layout/components/Accordion.css
Normal file
42
devtools/client/inspector/layout/components/Accordion.css
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* This file should not be modified and is a duplicate from the debugger.html project.
|
||||
* Any changes to this file should be imported from the upstream debugger.html project.
|
||||
*/
|
||||
|
||||
.accordion {
|
||||
background-color: var(--theme-body-background);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.accordion ._header {
|
||||
background-color: var(--theme-toolbar-background);
|
||||
border-bottom: 1px solid var(--theme-splitter-color);
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
padding: 5px;
|
||||
transition: all 0.25s ease;
|
||||
width: 100%;
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
.accordion ._header:hover {
|
||||
background-color: var(--theme-selection-color);
|
||||
}
|
||||
|
||||
.accordion ._header:hover svg {
|
||||
fill: var(--theme-comment-alt);
|
||||
}
|
||||
|
||||
.accordion ._content {
|
||||
border-bottom: 1px solid var(--theme-splitter-color);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
82
devtools/client/inspector/layout/components/Accordion.js
Normal file
82
devtools/client/inspector/layout/components/Accordion.js
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* This file should not be modified and is a duplicate from the debugger.html project.
|
||||
* Any changes to this file should be imported from the upstream debugger.html project.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const React = require("devtools/client/shared/vendor/react");
|
||||
const { DOM: dom, PropTypes } = React;
|
||||
|
||||
const { div, span } = dom;
|
||||
|
||||
const Accordion = React.createClass({
|
||||
displayName: "Accordion",
|
||||
|
||||
propTypes: {
|
||||
items: PropTypes.array
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
return { opened: this.props.items.map(item => item.opened),
|
||||
created: [] };
|
||||
},
|
||||
|
||||
handleHeaderClick: function (i) {
|
||||
const opened = [...this.state.opened];
|
||||
const created = [...this.state.created];
|
||||
const item = this.props.items[i];
|
||||
|
||||
opened[i] = !opened[i];
|
||||
created[i] = true;
|
||||
|
||||
if (opened[i] && item.onOpened) {
|
||||
item.onOpened();
|
||||
}
|
||||
|
||||
this.setState({ opened, created });
|
||||
},
|
||||
|
||||
renderContainer: function (item, i) {
|
||||
const { opened, created } = this.state;
|
||||
const containerClassName =
|
||||
item.header.toLowerCase().replace(/\s/g, "-") + "-pane";
|
||||
let arrowClassName = "arrow theme-twisty";
|
||||
if (opened[i]) {
|
||||
arrowClassName += " open";
|
||||
}
|
||||
|
||||
return div(
|
||||
{ className: containerClassName, key: i },
|
||||
|
||||
div(
|
||||
{ className: "_header",
|
||||
onClick: () => this.handleHeaderClick(i) },
|
||||
span({ className: arrowClassName }),
|
||||
item.header
|
||||
),
|
||||
|
||||
(created[i] || opened[i]) ?
|
||||
div(
|
||||
{ className: "_content",
|
||||
style: { display: opened[i] ? "block" : "none" }
|
||||
},
|
||||
React.createElement(item.component, item.componentProps || {})
|
||||
) :
|
||||
null
|
||||
);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
return div(
|
||||
{ className: "accordion" },
|
||||
this.props.items.map(this.renderContainer)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = Accordion;
|
||||
35
devtools/client/inspector/layout/components/App.js
Normal file
35
devtools/client/inspector/layout/components/App.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { getStr } = require("../utils/l10n");
|
||||
const { DOM: dom, createClass, createFactory } = require("devtools/client/shared/vendor/react");
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
|
||||
const Accordion = createFactory(require("./Accordion"));
|
||||
const Grid = createFactory(require("./Grid"));
|
||||
|
||||
const App = createClass({
|
||||
|
||||
displayName: "App",
|
||||
|
||||
render() {
|
||||
return dom.div(
|
||||
{
|
||||
id: "layoutview-container",
|
||||
},
|
||||
Accordion({
|
||||
items: [
|
||||
{ header: getStr("layout.header"),
|
||||
component: Grid,
|
||||
opened: true }
|
||||
]
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
module.exports = connect(state => state)(App);
|
||||
30
devtools/client/inspector/layout/components/Grid.js
Normal file
30
devtools/client/inspector/layout/components/Grid.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { getStr } = require("../utils/l10n");
|
||||
const { DOM: dom, createClass } = require("devtools/client/shared/vendor/react");
|
||||
|
||||
const Grid = createClass({
|
||||
|
||||
displayName: "Grid",
|
||||
|
||||
render() {
|
||||
return dom.div(
|
||||
{
|
||||
id: "layoutview-grid-container",
|
||||
},
|
||||
dom.div(
|
||||
{
|
||||
className: "layoutview-no-grids"
|
||||
},
|
||||
getStr("layout.noGrids")
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
module.exports = Grid;
|
||||
12
devtools/client/inspector/layout/components/moz.build
Normal file
12
devtools/client/inspector/layout/components/moz.build
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DevToolsModules(
|
||||
'Accordion.css',
|
||||
'Accordion.js',
|
||||
'App.js',
|
||||
'Grid.js',
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue