mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
ae1f9364cd
38 changed files with 85 additions and 1993 deletions
|
|
@ -65,7 +65,6 @@ exports.devtoolsModules = [
|
|||
"devtools/shared/gcli/commands/inject",
|
||||
"devtools/shared/gcli/commands/jsb",
|
||||
"devtools/shared/gcli/commands/listen",
|
||||
"devtools/shared/gcli/commands/mdn",
|
||||
"devtools/shared/gcli/commands/measure",
|
||||
"devtools/shared/gcli/commands/media",
|
||||
"devtools/shared/gcli/commands/pagemod",
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
/* 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 l10n = require("gcli/l10n");
|
||||
|
||||
var MdnDocsWidget;
|
||||
try {
|
||||
MdnDocsWidget = require("devtools/client/shared/widgets/MdnDocsWidget");
|
||||
} catch (e) {
|
||||
// DevTools MdnDocsWidget only available in Firefox Desktop
|
||||
}
|
||||
|
||||
exports.items = [{
|
||||
name: "mdn",
|
||||
description: l10n.lookup("mdnDesc")
|
||||
}, {
|
||||
item: "command",
|
||||
runAt: "client",
|
||||
name: "mdn css",
|
||||
description: l10n.lookup("mdnCssDesc"),
|
||||
returnType: "cssPropertyOutput",
|
||||
params: [{
|
||||
name: "property",
|
||||
type: { name: "string" },
|
||||
defaultValue: null,
|
||||
description: l10n.lookup("mdnCssProp")
|
||||
}],
|
||||
exec: function(args) {
|
||||
if (!MdnDocsWidget) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return MdnDocsWidget.getCssDocs(args.property).then(result => {
|
||||
return {
|
||||
data: result,
|
||||
url: MdnDocsWidget.PAGE_LINK_URL + args.property,
|
||||
property: args.property
|
||||
};
|
||||
}, error => {
|
||||
return { error, property: args.property };
|
||||
});
|
||||
}
|
||||
}, {
|
||||
item: "converter",
|
||||
from: "cssPropertyOutput",
|
||||
to: "dom",
|
||||
exec: function(result, context) {
|
||||
let propertyName = result.property;
|
||||
|
||||
let document = context.document;
|
||||
let root = document.createElement("div");
|
||||
|
||||
if (result.error) {
|
||||
// The css property specified doesn't exist.
|
||||
root.appendChild(document.createTextNode(
|
||||
l10n.lookupFormat("mdnCssPropertyNotFound", [ propertyName ]) +
|
||||
" (" + result.error + ")"));
|
||||
} else {
|
||||
let title = document.createElement("h2");
|
||||
title.textContent = propertyName;
|
||||
root.appendChild(title);
|
||||
|
||||
let link = document.createElement("p");
|
||||
link.classList.add("gcli-mdn-url");
|
||||
link.textContent = l10n.lookup("mdnCssVisitPage");
|
||||
root.appendChild(link);
|
||||
|
||||
link.addEventListener("click", () => {
|
||||
let mainWindow = context.environment.chromeWindow;
|
||||
mainWindow.openUILinkIn(result.url, "tab");
|
||||
});
|
||||
|
||||
let summary = document.createElement("p");
|
||||
summary.textContent = result.data.summary;
|
||||
root.appendChild(summary);
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
}];
|
||||
|
|
@ -16,7 +16,6 @@ DevToolsModules(
|
|||
'inject.js',
|
||||
'jsb.js',
|
||||
'listen.js',
|
||||
'mdn.js',
|
||||
'measure.js',
|
||||
'media.js',
|
||||
'pagemod.js',
|
||||
|
|
|
|||
|
|
@ -1457,24 +1457,6 @@ folderInvalidPath=Please enter a valid path
|
|||
# The argument (%1$S) is the folder path.
|
||||
folderOpenDirResult=Opened %1$S
|
||||
|
||||
# LOCALIZATION NOTE (mdnDesc) A very short string used to describe the
|
||||
# use of 'mdn' command.
|
||||
mdnDesc=Retrieve documentation from MDN
|
||||
# LOCALIZATION NOTE (mdnCssDesc) A very short string used to describe the
|
||||
# result of the 'mdn css' command.
|
||||
mdnCssDesc=Retrieve documentation about a given CSS property name from MDN
|
||||
# LOCALIZATION NOTE (mdnCssProp) String used to describe the 'property name'
|
||||
# parameter used in the 'mdn css' command.
|
||||
mdnCssProp=Property name
|
||||
# LOCALIZATION NOTE (mdnCssPropertyNotFound) String used to display an error in
|
||||
# the result of the 'mdn css' command. Errors occur when a given CSS property
|
||||
# wasn't found on MDN. The %1$S parameter will be replaced with the name of the
|
||||
# CSS property.
|
||||
mdnCssPropertyNotFound=MDN documentation for the CSS property ‘%1$S’ was not found.
|
||||
# LOCALIZATION NOTE (mdnCssVisitPage) String used as the label of a link to the
|
||||
# MDN page for a given CSS property.
|
||||
mdnCssVisitPage=Visit MDN page
|
||||
|
||||
# LOCALIZATION NOTE (security)
|
||||
securityPrivacyDesc=Display supported security and privacy features
|
||||
securityManual=Commands to list and get suggestions about security features for the current domain.
|
||||
|
|
|
|||
|
|
@ -130,14 +130,6 @@ styleinspector.contextmenu.toggleOrigSources=Show Original Sources
|
|||
# the rule view context menu "Show original sources" entry.
|
||||
styleinspector.contextmenu.toggleOrigSources.accessKey=O
|
||||
|
||||
# LOCALIZATION NOTE (styleinspector.contextmenu.showMdnDocs): Text displayed in the rule view
|
||||
# context menu to display docs from MDN for an item.
|
||||
styleinspector.contextmenu.showMdnDocs=Show MDN Docs
|
||||
|
||||
# LOCALIZATION NOTE (styleinspector.contextmenu.showMdnDocs.accessKey): Access key for
|
||||
# the rule view context menu "Show MDN docs" entry.
|
||||
styleinspector.contextmenu.showMdnDocs.accessKey=D
|
||||
|
||||
# LOCALIZATION NOTE (styleinspector.contextmenu.addNewRule): Text displayed in the
|
||||
# rule view context menu for adding a new rule to the element.
|
||||
# This should match inspector.addRule.tooltip in inspector.properties
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue