Bug 1946184 - Fix computing the CSD margin right after calling HideWindowChrome(...
[gecko.git] / devtools / client / webconsole / actions / history.js
blob3c553890204f52b2abf4e69c58dce576592f8e3a
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/. */
5 "use strict";
7 const {
8 APPEND_TO_HISTORY,
9 CLEAR_HISTORY,
10 HISTORY_LOADED,
11 UPDATE_HISTORY_POSITION,
12 REVERSE_SEARCH_INPUT_CHANGE,
13 REVERSE_SEARCH_BACK,
14 REVERSE_SEARCH_NEXT,
15 } = require("resource://devtools/client/webconsole/constants.js");
17 /**
18 * Append a new value in the history of executed expressions,
19 * or overwrite the most recent entry. The most recent entry may
20 * contain the last edited input value that was not evaluated yet.
22 function appendToHistory(expression) {
23 return {
24 type: APPEND_TO_HISTORY,
25 expression,
29 /**
30 * Clear the console history altogether. Note that this will not affect
31 * other consoles that are already opened (since they have their own copy),
32 * but it will reset the array for all newly-opened consoles.
34 function clearHistory() {
35 return {
36 type: CLEAR_HISTORY,
40 /**
41 * Fired when the console history from previous Firefox sessions is loaded.
43 function historyLoaded(entries) {
44 return {
45 type: HISTORY_LOADED,
46 entries,
50 /**
51 * Update place-holder position in the history list.
53 function updateHistoryPosition(direction, expression) {
54 return {
55 type: UPDATE_HISTORY_POSITION,
56 direction,
57 expression,
61 function reverseSearchInputChange(value) {
62 return {
63 type: REVERSE_SEARCH_INPUT_CHANGE,
64 value,
68 function showReverseSearchNext({ access } = {}) {
69 return {
70 type: REVERSE_SEARCH_NEXT,
71 access,
75 function showReverseSearchBack({ access } = {}) {
76 return {
77 type: REVERSE_SEARCH_BACK,
78 access,
82 module.exports = {
83 appendToHistory,
84 clearHistory,
85 historyLoaded,
86 updateHistoryPosition,
87 reverseSearchInputChange,
88 showReverseSearchNext,
89 showReverseSearchBack,