index.js (3176B)
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 "use strict"; 6 7 // This file lists all of the actions available in responsive design. This 8 // central list of constants makes it easy to see all possible action names at 9 // a glance. Please add a comment with each new action type. 10 11 const { createEnum } = require("resource://devtools/client/shared/enum.js"); 12 13 const { 14 CHANGE_NETWORK_THROTTLING, 15 } = require("resource://devtools/client/shared/components/throttling/actions.js"); 16 17 createEnum( 18 [ 19 // Add a new device. 20 "ADD_DEVICE", 21 22 // Add a new device type. 23 "ADD_DEVICE_TYPE", 24 25 // Add an additional viewport to display the document. 26 "ADD_VIEWPORT", 27 28 // Change the device displayed in the viewport. 29 "CHANGE_DEVICE", 30 31 // Change the location of the page. This may be triggered by the user 32 // directly entering a new URL, navigating with links, etc. 33 "CHANGE_LOCATION", 34 35 // The pixel ratio of the display has changed. This may be triggered by the user 36 // when changing the monitor resolution, or when the window is dragged to a different 37 // display with a different pixel ratio. 38 "CHANGE_DISPLAY_PIXEL_RATIO", 39 40 // Change the network throttling profile. 41 CHANGE_NETWORK_THROTTLING, 42 43 // Change the user agent of the viewport. 44 "CHANGE_USER_AGENT", 45 46 // The pixel ratio of the viewport has changed. This may be triggered by the user 47 // when changing the device displayed in the viewport, or when a pixel ratio is 48 // selected from the device pixel ratio dropdown. 49 "CHANGE_PIXEL_RATIO", 50 51 // Change the viewport angle. 52 "CHANGE_VIEWPORT_ANGLE", 53 54 // Edit a device. 55 "EDIT_DEVICE", 56 57 // Indicates that the device list is being loaded. 58 "LOAD_DEVICE_LIST_START", 59 60 // Indicates that the device list loading action threw an error. 61 "LOAD_DEVICE_LIST_ERROR", 62 63 // Indicates that the device list has been loaded successfully. 64 "LOAD_DEVICE_LIST_END", 65 66 // Remove a device. 67 "REMOVE_DEVICE", 68 69 // Remove the viewport's device assocation. 70 "REMOVE_DEVICE_ASSOCIATION", 71 72 // Resize the viewport. 73 "RESIZE_VIEWPORT", 74 75 // Rotate the viewport. 76 "ROTATE_VIEWPORT", 77 78 // Take a screenshot of the viewport. 79 "TAKE_SCREENSHOT_START", 80 81 // Indicates when the screenshot action ends. 82 "TAKE_SCREENSHOT_END", 83 84 // Toggles the left alignment of the viewports. 85 "TOGGLE_LEFT_ALIGNMENT", 86 87 // Toggles the reload on touch simulation changes. 88 "TOGGLE_RELOAD_ON_TOUCH_SIMULATION", 89 90 // Toggles the reload on user agent changes. 91 "TOGGLE_RELOAD_ON_USER_AGENT", 92 93 // Toggles the touch simulation state of the viewports. 94 "TOGGLE_TOUCH_SIMULATION", 95 96 // Toggles the user agent input displayed in the toolbar. 97 "TOGGLE_USER_AGENT_INPUT", 98 99 // Update the device display state in the device selector. 100 "UPDATE_DEVICE_DISPLAYED", 101 102 // Update the device modal state. 103 "UPDATE_DEVICE_MODAL", 104 105 // Zoom the viewport. 106 "ZOOM_VIEWPORT", 107 ], 108 module.exports 109 );