forked from mirrors/gecko-dev
		
	 ddd187450f
			
		
	
	
		ddd187450f
		
	
	
	
	
		
			
			MozReview-Commit-ID: GtAe9ggiCeA --HG-- rename : devtools/client/netmonitor/filter-predicates.js => devtools/client/netmonitor/utils/filter-predicates.js rename : devtools/client/netmonitor/l10n.js => devtools/client/netmonitor/utils/l10n.js rename : devtools/client/netmonitor/prefs.js => devtools/client/netmonitor/utils/prefs.js rename : devtools/client/netmonitor/request-utils.js => devtools/client/netmonitor/utils/request-utils.js rename : devtools/client/netmonitor/sort-predicates.js => devtools/client/netmonitor/utils/sort-predicates.js extra : rebase_source : a543be5c81e3552f831c1c26107d5109fc90fc96
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* 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 Services = require("Services");
 | |
| const {
 | |
|   DOM,
 | |
|   PropTypes,
 | |
| } = require("devtools/client/shared/vendor/react");
 | |
| const { gDevTools } = require("devtools/client/framework/devtools");
 | |
| const { L10N } = require("../../utils/l10n");
 | |
| 
 | |
| const { a } = DOM;
 | |
| 
 | |
| const LEARN_MORE = L10N.getStr("netmonitor.headers.learnMore");
 | |
| 
 | |
| function MDNLink({ url }) {
 | |
|   return (
 | |
|     a({
 | |
|       className: "learn-more-link",
 | |
|       title: url,
 | |
|       onClick: (e) => onLearnMoreClick(e, url),
 | |
|     }, `[${LEARN_MORE}]`)
 | |
|   );
 | |
| }
 | |
| 
 | |
| MDNLink.displayName = "MDNLink";
 | |
| 
 | |
| MDNLink.propTypes = {
 | |
|   url: PropTypes.string.isRequired,
 | |
| };
 | |
| 
 | |
| function onLearnMoreClick(e, url) {
 | |
|   e.stopPropagation();
 | |
|   e.preventDefault();
 | |
| 
 | |
|   let win = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
 | |
|   win.openUILinkIn(url, "tab");
 | |
| }
 | |
| 
 | |
| module.exports = MDNLink;
 |