diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/netmonitor/actions | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/netmonitor/actions')
-rw-r--r-- | devtools/client/netmonitor/actions/filters.js | 57 | ||||
-rw-r--r-- | devtools/client/netmonitor/actions/index.js | 9 | ||||
-rw-r--r-- | devtools/client/netmonitor/actions/moz.build | 10 | ||||
-rw-r--r-- | devtools/client/netmonitor/actions/sidebar.js | 49 |
4 files changed, 125 insertions, 0 deletions
diff --git a/devtools/client/netmonitor/actions/filters.js b/devtools/client/netmonitor/actions/filters.js new file mode 100644 index 000000000..71582546a --- /dev/null +++ b/devtools/client/netmonitor/actions/filters.js @@ -0,0 +1,57 @@ +/* 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 { + TOGGLE_FILTER_TYPE, + ENABLE_FILTER_TYPE_ONLY, + SET_FILTER_TEXT, +} = require("../constants"); + +/** + * Toggle an existing filter type state. + * If type 'all' is specified, all the other filter types are set to false. + * Available filter types are defined in filters reducer. + * + * @param {string} filter - A filter type is going to be updated + */ +function toggleFilterType(filter) { + return { + type: TOGGLE_FILTER_TYPE, + filter, + }; +} + +/** + * Enable filter type exclusively. + * Except filter type is set to true, all the other filter types are set + * to false. + * Available filter types are defined in filters reducer. + * + * @param {string} filter - A filter type is going to be updated + */ +function enableFilterTypeOnly(filter) { + return { + type: ENABLE_FILTER_TYPE_ONLY, + filter, + }; +} + +/** + * Set filter text. + * + * @param {string} url - A filter text is going to be set + */ +function setFilterText(url) { + return { + type: SET_FILTER_TEXT, + url, + }; +} + +module.exports = { + toggleFilterType, + enableFilterTypeOnly, + setFilterText, +}; diff --git a/devtools/client/netmonitor/actions/index.js b/devtools/client/netmonitor/actions/index.js new file mode 100644 index 000000000..3f7b0bd2f --- /dev/null +++ b/devtools/client/netmonitor/actions/index.js @@ -0,0 +1,9 @@ +/* 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 filters = require("./filters"); +const sidebar = require("./sidebar"); + +module.exports = Object.assign({}, filters, sidebar); diff --git a/devtools/client/netmonitor/actions/moz.build b/devtools/client/netmonitor/actions/moz.build new file mode 100644 index 000000000..477cafb41 --- /dev/null +++ b/devtools/client/netmonitor/actions/moz.build @@ -0,0 +1,10 @@ +# 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( + 'filters.js', + 'index.js', + 'sidebar.js', +) diff --git a/devtools/client/netmonitor/actions/sidebar.js b/devtools/client/netmonitor/actions/sidebar.js new file mode 100644 index 000000000..7e8dca5c1 --- /dev/null +++ b/devtools/client/netmonitor/actions/sidebar.js @@ -0,0 +1,49 @@ +/* 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 { + DISABLE_TOGGLE_BUTTON, + SHOW_SIDEBAR, + TOGGLE_SIDEBAR, +} = require("../constants"); + +/** + * Change ToggleButton disabled state. + * + * @param {boolean} disabled - expected button disabled state + */ +function disableToggleButton(disabled) { + return { + type: DISABLE_TOGGLE_BUTTON, + disabled: disabled, + }; +} + +/** + * Change sidebar visible state. + * + * @param {boolean} visible - expected sidebar visible state + */ +function showSidebar(visible) { + return { + type: SHOW_SIDEBAR, + visible: visible, + }; +} + +/** + * Toggle to show/hide sidebar. + */ +function toggleSidebar() { + return { + type: TOGGLE_SIDEBAR, + }; +} + +module.exports = { + disableToggleButton, + showSidebar, + toggleSidebar, +}; |