tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ui.js (2644B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 
      5 import { getSelectedSource } from "./sources";
      6 
      7 export function getSelectedPrimaryPaneTab(state) {
      8  return state.ui.selectedPrimaryPaneTab;
      9 }
     10 
     11 export function getActiveSearch(state) {
     12  return state.ui.activeSearch;
     13 }
     14 
     15 export function getFrameworkGroupingState(state) {
     16  return state.ui.frameworkGroupingOn;
     17 }
     18 
     19 export function getPaneCollapse(state, position) {
     20  if (position == "start") {
     21    return state.ui.startPanelCollapsed;
     22  }
     23 
     24  return state.ui.endPanelCollapsed;
     25 }
     26 
     27 export function getHighlightedLineRangeForSelectedSource(state) {
     28  const selectedSource = getSelectedSource(state);
     29  if (!selectedSource) {
     30    return null;
     31  }
     32  // Only return the highlighted line range if it matches the selected source
     33  const highlightedLineRange = state.ui.highlightedLineRange;
     34  if (
     35    highlightedLineRange &&
     36    selectedSource.id == highlightedLineRange.sourceId
     37  ) {
     38    return highlightedLineRange;
     39  }
     40  return null;
     41 }
     42 
     43 export function getConditionalPanelLocation(state) {
     44  return state.ui.conditionalPanelLocation;
     45 }
     46 
     47 export function getLogPointStatus(state) {
     48  return state.ui.isLogPoint;
     49 }
     50 
     51 export function getOrientation(state) {
     52  return state.ui.orientation;
     53 }
     54 
     55 export function getViewport(state) {
     56  return state.ui.viewport;
     57 }
     58 
     59 export function getInlinePreview(state) {
     60  return state.ui.inlinePreviewEnabled;
     61 }
     62 
     63 export function getEditorWrapping(state) {
     64  return state.ui.editorWrappingEnabled;
     65 }
     66 
     67 export function getJavascriptTracingLogMethod(state) {
     68  return state.ui.javascriptTracingLogMethod;
     69 }
     70 
     71 export function getJavascriptTracingValues(state) {
     72  return state.ui.javascriptTracingValues;
     73 }
     74 
     75 export function getJavascriptTracingOnNextInteraction(state) {
     76  return state.ui.javascriptTracingOnNextInteraction;
     77 }
     78 
     79 export function getJavascriptTracingOnNextLoad(state) {
     80  return state.ui.javascriptTracingOnNextLoad;
     81 }
     82 
     83 export function getJavascriptTracingFunctionReturn(state) {
     84  return state.ui.javascriptTracingFunctionReturn;
     85 }
     86 
     87 export function getSearchOptions(state, searchKey) {
     88  return state.ui.mutableSearchOptions[searchKey];
     89 }
     90 
     91 export function getProjectSearchQuery(state) {
     92  return state.ui.projectSearchQuery;
     93 }
     94 
     95 export function getHideIgnoredSources(state) {
     96  return state.ui.hideIgnoredSources;
     97 }
     98 
     99 export function isSourceMapIgnoreListEnabled(state) {
    100  return state.ui.sourceMapIgnoreListEnabled;
    101 }
    102 
    103 export function areSourceMapsEnabled(state) {
    104  return state.ui.sourceMapsEnabled;
    105 }