From 033277b68f2910e54ce62f45fa92af2f5092a7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 18 Jul 2017 19:47:27 +0200 Subject: [PATCH] Define externally accessible contants with 'var' instead of 'const' Just as we did with classes, define other constants that are (or may be) used from other modules with 'var' to cut down on warnings. https://bugzilla.gnome.org/show_bug.cgi?id=785084 --- HACKING | 2 +- js/gdm/authPrompt.js | 14 +++++----- js/gdm/util.js | 8 +++--- js/misc/config.js.in | 18 ++++++------- js/misc/extensionUtils.js | 4 +-- js/misc/gnomeSession.js | 2 +- js/misc/history.js | 2 +- js/misc/keyboardManager.js | 6 ++--- js/misc/util.js | 2 +- js/misc/weather.js | 2 +- js/ui/accessDialog.js | 2 +- js/ui/altTab.js | 16 ++++++------ js/ui/animation.js | 2 +- js/ui/appDisplay.js | 38 ++++++++++++++-------------- js/ui/audioDeviceSelection.js | 2 +- js/ui/background.js | 8 +++--- js/ui/boxpointer.js | 4 +-- js/ui/calendar.js | 10 ++++---- js/ui/closeDialog.js | 4 +-- js/ui/components/automountManager.js | 6 ++--- js/ui/components/autorunManager.js | 4 +-- js/ui/components/keyring.js | 8 +++--- js/ui/components/networkAgent.js | 2 +- js/ui/components/polkitAgent.js | 10 ++++---- js/ui/components/telepathyClient.js | 20 +++++++-------- js/ui/ctrlAltTab.js | 6 ++--- js/ui/dash.js | 8 +++--- js/ui/dnd.js | 12 ++++----- js/ui/edgeDragAction.js | 4 +-- js/ui/endSessionDialog.js | 4 +-- js/ui/extensionDownloader.js | 8 +++--- js/ui/extensionSystem.js | 8 +++--- js/ui/ibusCandidatePopup.js | 6 ++--- js/ui/iconGrid.js | 26 +++++++++---------- js/ui/keyboard.js | 2 +- js/ui/layout.js | 10 ++++---- js/ui/legacyTray.js | 12 ++++----- js/ui/lightbox.js | 6 ++--- js/ui/lookingGlass.js | 6 ++--- js/ui/magnifier.js | 8 +++--- js/ui/main.js | 2 +- js/ui/messageList.js | 4 +-- js/ui/messageTray.js | 24 +++++++++--------- js/ui/modalDialog.js | 6 ++--- js/ui/notificationDaemon.js | 4 +-- js/ui/osdMonitorLabeler.js | 2 +- js/ui/osdWindow.js | 6 ++--- js/ui/overview.js | 8 +++--- js/ui/overviewControls.js | 4 +-- js/ui/panel.js | 8 +++--- js/ui/pointerWatcher.js | 2 +- js/ui/popupMenu.js | 2 +- js/ui/runDialog.js | 4 +-- js/ui/screenShield.js | 20 +++++++-------- js/ui/screenshot.js | 2 +- js/ui/search.js | 4 +-- js/ui/shellMountOperation.js | 4 +-- js/ui/slider.js | 2 +- js/ui/status/accessibility.js | 2 +- js/ui/status/location.js | 2 +- js/ui/status/network.js | 4 +-- js/ui/status/volume.js | 2 +- js/ui/switcherPopup.js | 8 +++--- js/ui/userWidget.js | 2 +- js/ui/viewSelector.js | 4 +-- js/ui/windowManager.js | 24 +++++++++--------- js/ui/workspace.js | 16 ++++++------ js/ui/workspaceSwitcherPopup.js | 4 +-- js/ui/workspaceThumbnail.js | 8 +++--- js/ui/workspacesView.js | 4 +-- 70 files changed, 255 insertions(+), 255 deletions(-) diff --git a/HACKING b/HACKING index 5165cfdc0..eb25f7e9e 100644 --- a/HACKING +++ b/HACKING @@ -304,7 +304,7 @@ designed around setting properties, like Tweener. If you want to animate an arbitrary property, create a getter and setter, and use Tweener to animate the property. - const ANIMATION_TIME = 2000; + var ANIMATION_TIME = 2000; var MyClass = new Lang.Class({ Name: 'MyClass', diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index e22db49c3..a436431be 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -15,25 +15,25 @@ const ShellEntry = imports.ui.shellEntry; const Tweener = imports.ui.tweener; const UserWidget = imports.ui.userWidget; -const DEFAULT_BUTTON_WELL_ICON_SIZE = 16; -const DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1.0; -const DEFAULT_BUTTON_WELL_ANIMATION_TIME = 0.3; +var DEFAULT_BUTTON_WELL_ICON_SIZE = 16; +var DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1.0; +var DEFAULT_BUTTON_WELL_ANIMATION_TIME = 0.3; -const MESSAGE_FADE_OUT_ANIMATION_TIME = 0.5; +var MESSAGE_FADE_OUT_ANIMATION_TIME = 0.5; -const AuthPromptMode = { +var AuthPromptMode = { UNLOCK_ONLY: 0, UNLOCK_OR_LOG_IN: 1 }; -const AuthPromptStatus = { +var AuthPromptStatus = { NOT_VERIFYING: 0, VERIFYING: 1, VERIFICATION_FAILED: 2, VERIFICATION_SUCCEEDED: 3 }; -const BeginRequestType = { +var BeginRequestType = { PROVIDE_USERNAME: 0, DONT_PROVIDE_USERNAME: 1 }; diff --git a/js/gdm/util.js b/js/gdm/util.js index 5b1b4f3aa..b65a7b0f0 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -21,8 +21,8 @@ const PASSWORD_SERVICE_NAME = 'gdm-password'; const FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint'; const SMARTCARD_SERVICE_NAME = 'gdm-smartcard'; const OVIRT_SERVICE_NAME = 'gdm-ovirtcred'; -const FADE_ANIMATION_TIME = 0.16; -const CLONE_FADE_ANIMATION_TIME = 0.25; +var FADE_ANIMATION_TIME = 0.16; +var CLONE_FADE_ANIMATION_TIME = 0.25; const LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen'; const PASSWORD_AUTHENTICATION_KEY = 'enable-password-authentication'; @@ -36,9 +36,9 @@ const LOGO_KEY = 'logo'; const DISABLE_USER_LIST_KEY = 'disable-user-list'; // Give user 48ms to read each character of a PAM message -const USER_READ_TIME = 48 +var USER_READ_TIME = 48 -const MessageType = { +var MessageType = { NONE: 0, ERROR: 1, INFO: 2, diff --git a/js/misc/config.js.in b/js/misc/config.js.in index 82f20c6b4..e8ad9d9e4 100644 --- a/js/misc/config.js.in +++ b/js/misc/config.js.in @@ -1,19 +1,19 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* The name of this package (not localized) */ -const PACKAGE_NAME = '@PACKAGE_NAME@'; +var PACKAGE_NAME = '@PACKAGE_NAME@'; /* The version of this package */ -const PACKAGE_VERSION = '@PACKAGE_VERSION@'; +var PACKAGE_VERSION = '@PACKAGE_VERSION@'; /* 1 if gnome-bluetooth is available, 0 otherwise */ -const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@; +var HAVE_BLUETOOTH = @HAVE_BLUETOOTH@; /* 1 if networkmanager is available, 0 otherwise */ -const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@; +var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@; /* gettext package */ -const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@'; +var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@'; /* locale dir */ -const LOCALEDIR = '@datadir@/locale'; +var LOCALEDIR = '@datadir@/locale'; /* other standard directories */ -const LIBEXECDIR = '@libexecdir@'; -const SYSCONFDIR = '@sysconfdir@'; +var LIBEXECDIR = '@libexecdir@'; +var SYSCONFDIR = '@sysconfdir@'; /* g-i package versions */ -const LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@' +var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@' diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index b8c94150a..ca02582c9 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -11,13 +11,13 @@ const Gio = imports.gi.Gio; const Config = imports.misc.config; const FileUtils = imports.misc.fileUtils; -const ExtensionType = { +var ExtensionType = { SYSTEM: 1, PER_USER: 2 }; // Maps uuid -> metadata object -const extensions = {}; +var extensions = {}; /** * getCurrentExtension: diff --git a/js/misc/gnomeSession.js b/js/misc/gnomeSession.js index 6cf986c90..4c5d7f2a9 100644 --- a/js/misc/gnomeSession.js +++ b/js/misc/gnomeSession.js @@ -16,7 +16,7 @@ const PresenceIface = ' \ \ '; -const PresenceStatus = { +var PresenceStatus = { AVAILABLE: 0, INVISIBLE: 1, BUSY: 2, diff --git a/js/misc/history.js b/js/misc/history.js index 6668bd03c..a8c8024cd 100644 --- a/js/misc/history.js +++ b/js/misc/history.js @@ -5,7 +5,7 @@ const Signals = imports.signals; const Clutter = imports.gi.Clutter; const Params = imports.misc.params; -const DEFAULT_LIMIT = 512; +var DEFAULT_LIMIT = 512; var HistoryManager = new Lang.Class({ Name: 'HistoryManager', diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js index 108986bc2..e55fa0ea5 100644 --- a/js/misc/keyboardManager.js +++ b/js/misc/keyboardManager.js @@ -7,9 +7,9 @@ const Meta = imports.gi.Meta; const Main = imports.ui.main; -const DEFAULT_LOCALE = 'en_US'; -const DEFAULT_LAYOUT = 'us'; -const DEFAULT_VARIANT = ''; +var DEFAULT_LOCALE = 'en_US'; +var DEFAULT_LAYOUT = 'us'; +var DEFAULT_VARIANT = ''; let _xkbInfo = null; diff --git a/js/misc/util.js b/js/misc/util.js index 525491949..010dec229 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -14,7 +14,7 @@ const Main = imports.ui.main; const Tweener = imports.ui.tweener; const Params = imports.misc.params; -const SCROLL_TIME = 0.1; +var SCROLL_TIME = 0.1; // http://daringfireball.net/2010/07/improved_regex_for_matching_urls const _balancedParens = '\\((?:[^\\s()<>]+|(?:\\(?:[^\\s()<>]+\\)))*\\)'; diff --git a/js/misc/weather.js b/js/misc/weather.js index 38fb56657..6b6255a56 100644 --- a/js/misc/weather.js +++ b/js/misc/weather.js @@ -11,7 +11,7 @@ const PermissionStore = imports.misc.permissionStore; const Util = imports.misc.util; // Minimum time between updates to show loading indication -const UPDATE_THRESHOLD = 10 * GLib.TIME_SPAN_MINUTE; +var UPDATE_THRESHOLD = 10 * GLib.TIME_SPAN_MINUTE; var WeatherClient = new Lang.Class({ Name: 'WeatherClient', diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js index dc7eb8285..257757f5d 100644 --- a/js/ui/accessDialog.js +++ b/js/ui/accessDialog.js @@ -32,7 +32,7 @@ const AccessIface = ' \ \ '; -const DialogResponse = { +var DialogResponse = { OK: 0, CANCEL: 1, CLOSED: 2 diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 2a4d827bb..265d81a1f 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -14,19 +14,19 @@ const Main = imports.ui.main; const SwitcherPopup = imports.ui.switcherPopup; const Tweener = imports.ui.tweener; -const APP_ICON_HOVER_TIMEOUT = 200; // milliseconds +var APP_ICON_HOVER_TIMEOUT = 200; // milliseconds -const THUMBNAIL_DEFAULT_SIZE = 256; -const THUMBNAIL_POPUP_TIME = 500; // milliseconds -const THUMBNAIL_FADE_TIME = 0.1; // seconds +var THUMBNAIL_DEFAULT_SIZE = 256; +var THUMBNAIL_POPUP_TIME = 500; // milliseconds +var THUMBNAIL_FADE_TIME = 0.1; // seconds -const WINDOW_PREVIEW_SIZE = 128; -const APP_ICON_SIZE = 96; -const APP_ICON_SIZE_SMALL = 48; +var WINDOW_PREVIEW_SIZE = 128; +var APP_ICON_SIZE = 96; +var APP_ICON_SIZE_SMALL = 48; const baseIconSizes = [96, 64, 48, 32, 22]; -const AppIconMode = { +var AppIconMode = { THUMBNAIL_ONLY: 1, APP_ICON_ONLY: 2, BOTH: 3, diff --git a/js/ui/animation.js b/js/ui/animation.js index 4ea8727cd..00e297763 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -7,7 +7,7 @@ const St = imports.gi.St; const Signals = imports.signals; const Atk = imports.gi.Atk; -const ANIMATED_ICON_UPDATE_TIMEOUT = 16; +var ANIMATED_ICON_UPDATE_TIMEOUT = 16; var Animation = new Lang.Class({ Name: 'Animation', diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 611f7ea3c..fe36deded 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -27,38 +27,38 @@ const Workspace = imports.ui.workspace; const Params = imports.misc.params; const Util = imports.misc.util; -const MAX_APPLICATION_WORK_MILLIS = 75; -const MENU_POPUP_TIMEOUT = 600; -const MAX_COLUMNS = 6; -const MIN_COLUMNS = 4; -const MIN_ROWS = 4; +var MAX_APPLICATION_WORK_MILLIS = 75; +var MENU_POPUP_TIMEOUT = 600; +var MAX_COLUMNS = 6; +var MIN_COLUMNS = 4; +var MIN_ROWS = 4; -const INACTIVE_GRID_OPACITY = 77; +var INACTIVE_GRID_OPACITY = 77; // This time needs to be less than IconGrid.EXTRA_SPACE_ANIMATION_TIME // to not clash with other animations -const INACTIVE_GRID_OPACITY_ANIMATION_TIME = 0.24; -const FOLDER_SUBICON_FRACTION = .4; +var INACTIVE_GRID_OPACITY_ANIMATION_TIME = 0.24; +var FOLDER_SUBICON_FRACTION = .4; -const MIN_FREQUENT_APPS_COUNT = 3; +var MIN_FREQUENT_APPS_COUNT = 3; -const INDICATORS_BASE_TIME = 0.25; -const INDICATORS_ANIMATION_DELAY = 0.125; -const INDICATORS_ANIMATION_MAX_TIME = 0.75; +var INDICATORS_BASE_TIME = 0.25; +var INDICATORS_ANIMATION_DELAY = 0.125; +var INDICATORS_ANIMATION_MAX_TIME = 0.75; -const VIEWS_SWITCH_TIME = 0.4; -const VIEWS_SWITCH_ANIMATION_DELAY = 0.1; +var VIEWS_SWITCH_TIME = 0.4; +var VIEWS_SWITCH_ANIMATION_DELAY = 0.1; // Follow iconGrid animations approach and divide by 2 to animate out to // not annoy the user when the user wants to quit appDisplay. // Also, make sure we don't exceed iconGrid animation total time or // views switch time. -const INDICATORS_BASE_TIME_OUT = 0.125; -const INDICATORS_ANIMATION_DELAY_OUT = 0.0625; -const INDICATORS_ANIMATION_MAX_TIME_OUT = +var INDICATORS_BASE_TIME_OUT = 0.125; +var INDICATORS_ANIMATION_DELAY_OUT = 0.0625; +var INDICATORS_ANIMATION_MAX_TIME_OUT = Math.min (VIEWS_SWITCH_TIME, IconGrid.ANIMATION_TIME_OUT + IconGrid.ANIMATION_MAX_DELAY_OUT_FOR_ITEM); -const PAGE_SWITCH_TIME = 0.3; +var PAGE_SWITCH_TIME = 0.3; const SWITCHEROO_BUS_NAME = 'net.hadess.SwitcherooControl'; const SWITCHEROO_OBJECT_PATH = '/net/hadess/SwitcherooControl'; @@ -873,7 +873,7 @@ var FrequentView = new Lang.Class({ } }); -const Views = { +var Views = { FREQUENT: 0, ALL: 1 }; diff --git a/js/ui/audioDeviceSelection.js b/js/ui/audioDeviceSelection.js index 8bfb3c315..b0e5db8bd 100644 --- a/js/ui/audioDeviceSelection.js +++ b/js/ui/audioDeviceSelection.js @@ -9,7 +9,7 @@ const St = imports.gi.St; const Main = imports.ui.main; const ModalDialog = imports.ui.modalDialog; -const AudioDevice = { +var AudioDevice = { HEADPHONES: 1 << 0, HEADSET: 1 << 1, MICROPHONE: 1 << 2 diff --git a/js/ui/background.js b/js/ui/background.js index ec058a7f8..681a5feaa 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -107,7 +107,7 @@ const Main = imports.ui.main; const Params = imports.misc.params; const Tweener = imports.ui.tweener; -const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff); +var DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff); const BACKGROUND_SCHEMA = 'org.gnome.desktop.background'; const PRIMARY_COLOR_KEY = 'primary-color'; @@ -117,14 +117,14 @@ const BACKGROUND_STYLE_KEY = 'picture-options'; const PICTURE_OPACITY_KEY = 'picture-opacity'; const PICTURE_URI_KEY = 'picture-uri'; -const FADE_ANIMATION_TIME = 1.0; +var FADE_ANIMATION_TIME = 1.0; // These parameters affect how often we redraw. // The first is how different (percent crossfaded) the slide show // has to look before redrawing and the second is the minimum // frequency (in seconds) we're willing to wake up -const ANIMATION_OPACITY_STEP_INCREMENT = 4.0; -const ANIMATION_MIN_WAKEUP_INTERVAL = 1.0; +var ANIMATION_OPACITY_STEP_INCREMENT = 4.0; +var ANIMATION_MIN_WAKEUP_INTERVAL = 1.0; let _backgroundCache = null; diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 7a77d914d..091ae157f 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -10,14 +10,14 @@ const St = imports.gi.St; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const PopupAnimation = { +var PopupAnimation = { NONE: 0, SLIDE: 1 << 0, FADE: 1 << 1, FULL: ~0, }; -const POPUP_ANIMATION_TIME = 0.15; +var POPUP_ANIMATION_TIME = 0.15; /** * BoxPointer: diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 2c4c1f9be..bb42d72f3 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -16,15 +16,15 @@ const MessageTray = imports.ui.messageTray; const Mpris = imports.ui.mpris; const Util = imports.misc.util; -const MSECS_IN_DAY = 24 * 60 * 60 * 1000; -const SHOW_WEEKDATE_KEY = 'show-weekdate'; -const ELLIPSIS_CHAR = '\u2026'; +var MSECS_IN_DAY = 24 * 60 * 60 * 1000; +var SHOW_WEEKDATE_KEY = 'show-weekdate'; +var ELLIPSIS_CHAR = '\u2026'; -const MESSAGE_ICON_SIZE = 16; +var MESSAGE_ICON_SIZE = 16; // alias to prevent xgettext from picking up strings translated in GTK+ const gtk30_ = Gettext_gtk30.gettext; -const NC_ = function(context, str) { return context + '\u0004' + str; }; +var NC_ = function(context, str) { return context + '\u0004' + str; }; function sameYear(dateA, dateB) { return (dateA.getYear() == dateB.getYear()); diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js index b3a570dea..6570bedfd 100644 --- a/js/ui/closeDialog.js +++ b/js/ui/closeDialog.js @@ -11,8 +11,8 @@ const Dialog = imports.ui.dialog; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const FROZEN_WINDOW_BRIGHTNESS = -0.3 -const DIALOG_TRANSITION_TIME = 0.15 +var FROZEN_WINDOW_BRIGHTNESS = -0.3 +var DIALOG_TRANSITION_TIME = 0.15 var CloseDialog = new Lang.Class({ Name: 'CloseDialog', diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js index 051d260b5..247eee3f0 100644 --- a/js/ui/components/automountManager.js +++ b/js/ui/components/automountManager.js @@ -11,13 +11,13 @@ const GnomeSession = imports.misc.gnomeSession; const Main = imports.ui.main; const ShellMountOperation = imports.ui.shellMountOperation; -const GNOME_SESSION_AUTOMOUNT_INHIBIT = 16; +var GNOME_SESSION_AUTOMOUNT_INHIBIT = 16; // GSettings keys const SETTINGS_SCHEMA = 'org.gnome.desktop.media-handling'; const SETTING_ENABLE_AUTOMOUNT = 'automount'; -const AUTORUN_EXPIRE_TIMEOUT_SECS = 10; +var AUTORUN_EXPIRE_TIMEOUT_SECS = 10; var AutomountManager = new Lang.Class({ Name: 'AutomountManager', @@ -242,4 +242,4 @@ var AutomountManager = new Lang.Class({ GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun'); } }); -const Component = AutomountManager; +var Component = AutomountManager; diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js index 38935bfa9..de0fda7a0 100644 --- a/js/ui/components/autorunManager.js +++ b/js/ui/components/autorunManager.js @@ -15,7 +15,7 @@ const SETTING_START_APP = 'autorun-x-content-start-app'; const SETTING_IGNORE = 'autorun-x-content-ignore'; const SETTING_OPEN_FOLDER = 'autorun-x-content-open-folder'; -const AutorunSetting = { +var AutorunSetting = { RUN: 0, IGNORE: 1, FILES: 2, @@ -378,4 +378,4 @@ var AutorunNotification = new Lang.Class({ } }); -const Component = AutorunManager; +var Component = AutorunManager; diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js index 6abd003f3..21c3ddd4b 100644 --- a/js/ui/components/keyring.js +++ b/js/ui/components/keyring.js @@ -16,9 +16,9 @@ const ShellEntry = imports.ui.shellEntry; const CheckBox = imports.ui.checkBox; const Tweener = imports.ui.tweener; -const WORK_SPINNER_ICON_SIZE = 16; -const WORK_SPINNER_ANIMATION_DELAY = 1.0; -const WORK_SPINNER_ANIMATION_TIME = 0.3; +var WORK_SPINNER_ICON_SIZE = 16; +var WORK_SPINNER_ANIMATION_DELAY = 1.0; +var WORK_SPINNER_ANIMATION_TIME = 0.3; var KeyringDialog = new Lang.Class({ Name: 'KeyringDialog', @@ -311,4 +311,4 @@ var KeyringPrompter = new Lang.Class({ } }); -const Component = KeyringPrompter; +var Component = KeyringPrompter; diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index 02c8363c2..fd59c11ca 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -798,4 +798,4 @@ var NetworkAgent = new Lang.Class({ } } }); -const Component = NetworkAgent; +var Component = NetworkAgent; diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index c7345d138..37afa8f64 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -21,11 +21,11 @@ const ShellEntry = imports.ui.shellEntry; const UserWidget = imports.ui.userWidget; const Tweener = imports.ui.tweener; -const DIALOG_ICON_SIZE = 48; +var DIALOG_ICON_SIZE = 48; -const WORK_SPINNER_ICON_SIZE = 16; -const WORK_SPINNER_ANIMATION_DELAY = 1.0; -const WORK_SPINNER_ANIMATION_TIME = 0.3; +var WORK_SPINNER_ICON_SIZE = 16; +var WORK_SPINNER_ANIMATION_DELAY = 1.0; +var WORK_SPINNER_ANIMATION_TIME = 0.3; var AuthenticationDialog = new Lang.Class({ Name: 'AuthenticationDialog', @@ -400,4 +400,4 @@ var AuthenticationAgent = new Lang.Class({ }, }); -const Component = AuthenticationAgent; +var Component = AuthenticationAgent; diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index 516b10f78..d81c3bcc0 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -29,25 +29,25 @@ const Util = imports.misc.util; const HAVE_TP = (Tp != null && Tpl != null); // See Notification.appendMessage -const SCROLLBACK_IMMEDIATE_TIME = 3 * 60; // 3 minutes -const SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes -const SCROLLBACK_RECENT_LENGTH = 20; -const SCROLLBACK_IDLE_LENGTH = 5; +var SCROLLBACK_IMMEDIATE_TIME = 3 * 60; // 3 minutes +var SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes +var SCROLLBACK_RECENT_LENGTH = 20; +var SCROLLBACK_IDLE_LENGTH = 5; // See Source._displayPendingMessages -const SCROLLBACK_HISTORY_LINES = 10; +var SCROLLBACK_HISTORY_LINES = 10; // See Notification._onEntryChanged -const COMPOSING_STOP_TIMEOUT = 5; +var COMPOSING_STOP_TIMEOUT = 5; -const CHAT_EXPAND_LINES = 12; +var CHAT_EXPAND_LINES = 12; -const NotificationDirection = { +var NotificationDirection = { SENT: 'chat-sent', RECEIVED: 'chat-received' }; -const N_ = function(s) { return s; }; +var N_ = function(s) { return s; }; function makeMessageFromTpMessage(tpMessage, direction) { let [text, flags] = tpMessage.to_text(); @@ -996,4 +996,4 @@ var ChatNotificationBanner = new Lang.Class({ } }); -const Component = TelepathyComponent; +var Component = TelepathyComponent; diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js index d6de9de71..91a6be9db 100644 --- a/js/ui/ctrlAltTab.js +++ b/js/ui/ctrlAltTab.js @@ -12,10 +12,10 @@ const SwitcherPopup = imports.ui.switcherPopup; const Params = imports.misc.params; const Tweener = imports.ui.tweener; -const POPUP_APPICON_SIZE = 96; -const POPUP_FADE_TIME = 0.1; // seconds +var POPUP_APPICON_SIZE = 96; +var POPUP_FADE_TIME = 0.1; // seconds -const SortGroup = { +var SortGroup = { TOP: 0, MIDDLE: 1, BOTTOM: 2 diff --git a/js/ui/dash.js b/js/ui/dash.js index 8f728c167..0c89545a2 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -18,10 +18,10 @@ const Main = imports.ui.main; const Tweener = imports.ui.tweener; const Workspace = imports.ui.workspace; -const DASH_ANIMATION_TIME = 0.2; -const DASH_ITEM_LABEL_SHOW_TIME = 0.15; -const DASH_ITEM_LABEL_HIDE_TIME = 0.1; -const DASH_ITEM_HOVER_TIMEOUT = 300; +var DASH_ANIMATION_TIME = 0.2; +var DASH_ITEM_LABEL_SHOW_TIME = 0.15; +var DASH_ITEM_LABEL_HIDE_TIME = 0.1; +var DASH_ITEM_HOVER_TIMEOUT = 300; function getAppFromSource(source) { if (source instanceof AppDisplay.AppIcon) { diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 95e9f7e4d..da227e9e7 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -14,26 +14,26 @@ const Main = imports.ui.main; const Params = imports.misc.params; // Time to scale down to maxDragActorSize -const SCALE_ANIMATION_TIME = 0.25; +var SCALE_ANIMATION_TIME = 0.25; // Time to animate to original position on cancel -const SNAP_BACK_ANIMATION_TIME = 0.25; +var SNAP_BACK_ANIMATION_TIME = 0.25; // Time to animate to original position on success -const REVERT_ANIMATION_TIME = 0.75; +var REVERT_ANIMATION_TIME = 0.75; -const DragMotionResult = { +var DragMotionResult = { NO_DROP: 0, COPY_DROP: 1, MOVE_DROP: 2, CONTINUE: 3 }; -const DRAG_CURSOR_MAP = { +var DRAG_CURSOR_MAP = { 0: Meta.Cursor.DND_UNSUPPORTED_TARGET, 1: Meta.Cursor.DND_COPY, 2: Meta.Cursor.DND_MOVE }; -const DragDropResult = { +var DragDropResult = { FAILURE: 0, SUCCESS: 1, CONTINUE: 2 diff --git a/js/ui/edgeDragAction.js b/js/ui/edgeDragAction.js index 085266084..f0bea6ec1 100644 --- a/js/ui/edgeDragAction.js +++ b/js/ui/edgeDragAction.js @@ -8,8 +8,8 @@ const St = imports.gi.St; const Main = imports.ui.main; -const EDGE_THRESHOLD = 20; -const DRAG_DISTANCE = 80; +var EDGE_THRESHOLD = 20; +var DRAG_DISTANCE = 80; var EdgeDragAction = new Lang.Class({ Name: 'EdgeDragAction', diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index e65ede322..25e59dc9b 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -41,7 +41,7 @@ let _endSessionDialog = null; const _ITEM_ICON_SIZE = 48; const _DIALOG_ICON_SIZE = 48; -const GSM_SESSION_MANAGER_LOGOUT_FORCE = 2; +var GSM_SESSION_MANAGER_LOGOUT_FORCE = 2; const EndSessionDialogIface = ' \ \ @@ -166,7 +166,7 @@ const DialogContent = { 4 /* DialogType.UPGRADE_RESTART */: restartUpgradeDialogContent }; -const MAX_USERS_IN_SESSION_DIALOG = 5; +var MAX_USERS_IN_SESSION_DIALOG = 5; const LogindSessionIface = ' \ \ diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js index 926114107..03441e6b0 100644 --- a/js/ui/extensionDownloader.js +++ b/js/ui/extensionDownloader.js @@ -17,10 +17,10 @@ const ModalDialog = imports.ui.modalDialog; const _signals = ExtensionSystem._signals; -const REPOSITORY_URL_BASE = 'https://extensions.gnome.org'; -const REPOSITORY_URL_DOWNLOAD = REPOSITORY_URL_BASE + '/download-extension/%s.shell-extension.zip'; -const REPOSITORY_URL_INFO = REPOSITORY_URL_BASE + '/extension-info/'; -const REPOSITORY_URL_UPDATE = REPOSITORY_URL_BASE + '/update-info/'; +var REPOSITORY_URL_BASE = 'https://extensions.gnome.org'; +var REPOSITORY_URL_DOWNLOAD = REPOSITORY_URL_BASE + '/download-extension/%s.shell-extension.zip'; +var REPOSITORY_URL_INFO = REPOSITORY_URL_BASE + '/extension-info/'; +var REPOSITORY_URL_UPDATE = REPOSITORY_URL_BASE + '/update-info/'; let _httpSession; diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index cf501da82..51ce234c2 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -10,7 +10,7 @@ const St = imports.gi.St; const ExtensionUtils = imports.misc.extensionUtils; const Main = imports.ui.main; -const ExtensionState = { +var ExtensionState = { ENABLED: 1, DISABLED: 2, ERROR: 3, @@ -26,7 +26,7 @@ const ExtensionState = { // Arrays of uuids var enabledExtensions; // Contains the order that extensions were enabled in. -const extensionOrder = []; +var extensionOrder = []; // We don't really have a class to add signals on. So, create // a simple dummy object, add the signal methods, and export those @@ -34,8 +34,8 @@ const extensionOrder = []; var _signals = {}; Signals.addSignalMethods(_signals); -const connect = Lang.bind(_signals, _signals.connect); -const disconnect = Lang.bind(_signals, _signals.disconnect); +var connect = Lang.bind(_signals, _signals.connect); +var disconnect = Lang.bind(_signals, _signals.disconnect); const ENABLED_EXTENSIONS_KEY = 'enabled-extensions'; const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions'; diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js index 1b5c56084..1571224e6 100644 --- a/js/ui/ibusCandidatePopup.js +++ b/js/ui/ibusCandidatePopup.js @@ -9,10 +9,10 @@ const St = imports.gi.St; const BoxPointer = imports.ui.boxpointer; const Main = imports.ui.main; -const MAX_CANDIDATES_PER_PAGE = 16; +var MAX_CANDIDATES_PER_PAGE = 16; -const DEFAULT_INDEX_LABELS = [ '1', '2', '3', '4', '5', '6', '7', '8', - '9', '0', 'a', 'b', 'c', 'd', 'e', 'f' ]; +var DEFAULT_INDEX_LABELS = [ '1', '2', '3', '4', '5', '6', '7', '8', + '9', '0', 'a', 'b', 'c', 'd', 'e', 'f' ]; var CandidateArea = new Lang.Class({ Name: 'CandidateArea', diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index b72c6e209..b7af36512 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -12,27 +12,27 @@ const Params = imports.misc.params; const Tweener = imports.ui.tweener; const Main = imports.ui.main; -const ICON_SIZE = 96; -const MIN_ICON_SIZE = 16; +var ICON_SIZE = 96; +var MIN_ICON_SIZE = 16; -const EXTRA_SPACE_ANIMATION_TIME = 0.25; +var EXTRA_SPACE_ANIMATION_TIME = 0.25; -const ANIMATION_TIME_IN = 0.350; -const ANIMATION_TIME_OUT = 1/2 * ANIMATION_TIME_IN; -const ANIMATION_MAX_DELAY_FOR_ITEM = 2/3 * ANIMATION_TIME_IN; -const ANIMATION_BASE_DELAY_FOR_ITEM = 1/4 * ANIMATION_MAX_DELAY_FOR_ITEM; -const ANIMATION_MAX_DELAY_OUT_FOR_ITEM = 2/3 * ANIMATION_TIME_OUT; -const ANIMATION_FADE_IN_TIME_FOR_ITEM = 1/4 * ANIMATION_TIME_IN; +var ANIMATION_TIME_IN = 0.350; +var ANIMATION_TIME_OUT = 1/2 * ANIMATION_TIME_IN; +var ANIMATION_MAX_DELAY_FOR_ITEM = 2/3 * ANIMATION_TIME_IN; +var ANIMATION_BASE_DELAY_FOR_ITEM = 1/4 * ANIMATION_MAX_DELAY_FOR_ITEM; +var ANIMATION_MAX_DELAY_OUT_FOR_ITEM = 2/3 * ANIMATION_TIME_OUT; +var ANIMATION_FADE_IN_TIME_FOR_ITEM = 1/4 * ANIMATION_TIME_IN; -const ANIMATION_BOUNCE_ICON_SCALE = 1.1; +var ANIMATION_BOUNCE_ICON_SCALE = 1.1; -const AnimationDirection = { +var AnimationDirection = { IN: 0, OUT: 1 }; -const APPICON_ANIMATION_OUT_SCALE = 3; -const APPICON_ANIMATION_OUT_TIME = 0.25; +var APPICON_ANIMATION_OUT_SCALE = 3; +var APPICON_ANIMATION_OUT_TIME = 0.25; var BaseIcon = new Lang.Class({ Name: 'BaseIcon', diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e00d44d37..1a0472425 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -19,7 +19,7 @@ const Layout = imports.ui.layout; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; -const KEYBOARD_REST_TIME = Layout.KEYBOARD_ANIMATION_TIME * 2 * 1000; +var KEYBOARD_REST_TIME = Layout.KEYBOARD_ANIMATION_TIME * 2 * 1000; const KEYBOARD_SCHEMA = 'org.gnome.shell.keyboard'; const KEYBOARD_TYPE = 'keyboard-type'; diff --git a/js/ui/layout.js b/js/ui/layout.js index b44c5ea5d..fd3b3f523 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -18,12 +18,12 @@ const Main = imports.ui.main; const Params = imports.misc.params; const Tweener = imports.ui.tweener; -const STARTUP_ANIMATION_TIME = 0.5; -const KEYBOARD_ANIMATION_TIME = 0.15; -const BACKGROUND_FADE_ANIMATION_TIME = 1.0; +var STARTUP_ANIMATION_TIME = 0.5; +var KEYBOARD_ANIMATION_TIME = 0.15; +var BACKGROUND_FADE_ANIMATION_TIME = 1.0; -const HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels -const HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms +var HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels +var HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms function isPopupMetaWindow(actor) { switch(actor.meta_window.get_window_type()) { diff --git a/js/ui/legacyTray.js b/js/ui/legacyTray.js index f76615ef8..fc4996dc6 100644 --- a/js/ui/legacyTray.js +++ b/js/ui/legacyTray.js @@ -13,7 +13,7 @@ const Overview = imports.ui.overview; const OverviewControls = imports.ui.overviewControls; const Tweener = imports.ui.tweener; -const STANDARD_TRAY_ICON_IMPLEMENTATIONS = { +var STANDARD_TRAY_ICON_IMPLEMENTATIONS = { 'bluetooth-applet': 'bluetooth', 'gnome-volume-control-applet': 'volume', // renamed to gnome-sound-applet // when moved to control center @@ -29,12 +29,12 @@ const STANDARD_TRAY_ICON_IMPLEMENTATIONS = { }; // Offset of the original position from the bottom-right corner -const CONCEALED_WIDTH = 3; -const REVEAL_ANIMATION_TIME = 0.2; -const TEMP_REVEAL_TIME = 2; +var CONCEALED_WIDTH = 3; +var REVEAL_ANIMATION_TIME = 0.2; +var TEMP_REVEAL_TIME = 2; -const BARRIER_THRESHOLD = 70; -const BARRIER_TIMEOUT = 1000; +var BARRIER_THRESHOLD = 70; +var BARRIER_TIMEOUT = 1000; var LegacyTray = new Lang.Class({ Name: 'LegacyTray', diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js index 41956b77b..d6eec7fae 100644 --- a/js/ui/lightbox.js +++ b/js/ui/lightbox.js @@ -10,9 +10,9 @@ const Shell = imports.gi.Shell; const Params = imports.misc.params; const Tweener = imports.ui.tweener; -const DEFAULT_FADE_FACTOR = 0.4; -const VIGNETTE_BRIGHTNESS = 0.8; -const VIGNETTE_SHARPNESS = 0.7; +var DEFAULT_FADE_FACTOR = 0.4; +var VIGNETTE_BRIGHTNESS = 0.8; +var VIGNETTE_SHARPNESS = 0.7; const VIGNETTE_DECLARATIONS = '\ uniform float brightness;\n\ diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 292dc9619..278391b1a 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -46,9 +46,9 @@ var commandHeader = 'const Clutter = imports.gi.Clutter; ' + const HISTORY_KEY = 'looking-glass-history'; // Time between tabs for them to count as a double-tab event -const AUTO_COMPLETE_DOUBLE_TAB_DELAY = 500; -const AUTO_COMPLETE_SHOW_COMPLETION_ANIMATION_DURATION = 0.2; -const AUTO_COMPLETE_GLOBAL_KEYWORDS = _getAutoCompleteGlobalKeywords(); +var AUTO_COMPLETE_DOUBLE_TAB_DELAY = 500; +var AUTO_COMPLETE_SHOW_COMPLETION_ANIMATION_DURATION = 0.2; +var AUTO_COMPLETE_GLOBAL_KEYWORDS = _getAutoCompleteGlobalKeywords(); function _getAutoCompleteGlobalKeywords() { const keywords = ['true', 'false', 'null', 'new']; diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 39a082246..4e91155a5 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -19,11 +19,11 @@ const MagnifierDBus = imports.ui.magnifierDBus; const Params = imports.misc.params; const PointerWatcher = imports.ui.pointerWatcher; -const MOUSE_POLL_FREQUENCY = 50; -const CROSSHAIRS_CLIP_SIZE = [100, 100]; -const NO_CHANGE = 0.0; +var MOUSE_POLL_FREQUENCY = 50; +var CROSSHAIRS_CLIP_SIZE = [100, 100]; +var NO_CHANGE = 0.0; -const POINTER_REST_TIME = 1000; // milliseconds +var POINTER_REST_TIME = 1000; // milliseconds // Settings const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications'; diff --git a/js/ui/main.js b/js/ui/main.js index 9f71b30ec..31f1b82ed 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -552,7 +552,7 @@ function activateWindow(window, time, workspaceNum) { // TODO - replace this timeout with some system to guess when the user might // be e.g. just reading the screen and not likely to interact. -const DEFERRED_TIMEOUT_SECONDS = 20; +var DEFERRED_TIMEOUT_SECONDS = 20; var _deferredWorkData = {}; // Work scheduled for some point in the future var _deferredWorkQueue = []; diff --git a/js/ui/messageList.js b/js/ui/messageList.js index 1c783aeba..9dbd13131 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -15,9 +15,9 @@ const Calendar = imports.ui.calendar; const Tweener = imports.ui.tweener; const Util = imports.misc.util; -const MESSAGE_ANIMATION_TIME = 0.1; +var MESSAGE_ANIMATION_TIME = 0.1; -const DEFAULT_EXPAND_LINES = 6; +var DEFAULT_EXPAND_LINES = 6; function _fixMarkup(text, allowMarkup) { if (allowMarkup) { diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index cadd1c425..4704073eb 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -24,23 +24,23 @@ const Util = imports.misc.util; const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings'; -const ANIMATION_TIME = 0.2; -const NOTIFICATION_TIMEOUT = 4; +var ANIMATION_TIME = 0.2; +var NOTIFICATION_TIMEOUT = 4; -const HIDE_TIMEOUT = 0.2; -const LONGER_HIDE_TIMEOUT = 0.6; +var HIDE_TIMEOUT = 0.2; +var LONGER_HIDE_TIMEOUT = 0.6; -const MAX_NOTIFICATIONS_IN_QUEUE = 3; -const MAX_NOTIFICATIONS_PER_SOURCE = 3; -const MAX_NOTIFICATION_BUTTONS = 3; +var MAX_NOTIFICATIONS_IN_QUEUE = 3; +var MAX_NOTIFICATIONS_PER_SOURCE = 3; +var MAX_NOTIFICATION_BUTTONS = 3; // We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD // range from the point where it left the tray. -const MOUSE_LEFT_ACTOR_THRESHOLD = 20; +var MOUSE_LEFT_ACTOR_THRESHOLD = 20; -const IDLE_TIME = 1000; +var IDLE_TIME = 1000; -const State = { +var State = { HIDDEN: 0, SHOWING: 1, SHOWN: 2, @@ -52,7 +52,7 @@ const State = { // and the user did not interact with, DISMISSED for all other notifications // that were destroyed as a result of a user action, and SOURCE_CLOSED for the // notifications that were requested to be destroyed by the associated source. -const NotificationDestroyedReason = { +var NotificationDestroyedReason = { EXPIRED: 1, DISMISSED: 2, SOURCE_CLOSED: 3 @@ -62,7 +62,7 @@ const NotificationDestroyedReason = { // urgency values map to the corresponding values for the notifications received // through the notification daemon. HIGH urgency value is used for chats received // through the Telepathy client. -const Urgency = { +var Urgency = { LOW: 0, NORMAL: 1, HIGH: 2, diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index acb200c5a..1547b89d3 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -20,10 +20,10 @@ const Lightbox = imports.ui.lightbox; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const OPEN_AND_CLOSE_TIME = 0.1; -const FADE_OUT_DIALOG_TIME = 1.0; +var OPEN_AND_CLOSE_TIME = 0.1; +var FADE_OUT_DIALOG_TIME = 1.0; -const State = { +var State = { OPENED: 0, CLOSED: 1, OPENING: 2, diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 31f64b22b..27ed28149 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -67,14 +67,14 @@ const FdoNotificationsIface = ' \ \ '; -const NotificationClosedReason = { +var NotificationClosedReason = { EXPIRED: 1, DISMISSED: 2, APP_CLOSED: 3, UNDEFINED: 4 }; -const Urgency = { +var Urgency = { LOW: 0, NORMAL: 1, CRITICAL: 2 diff --git a/js/ui/osdMonitorLabeler.js b/js/ui/osdMonitorLabeler.js index 92e076abb..dfc4ea123 100644 --- a/js/ui/osdMonitorLabeler.js +++ b/js/ui/osdMonitorLabeler.js @@ -9,7 +9,7 @@ const Main = imports.ui.main; const Tweener = imports.ui.tweener; const Meta = imports.gi.Meta; -const FADE_TIME = 0.1; +var FADE_TIME = 0.1; var OsdMonitorLabel = new Lang.Class({ Name: 'OsdMonitorLabel', diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js index 29afad44f..2fbc111c4 100644 --- a/js/ui/osdWindow.js +++ b/js/ui/osdWindow.js @@ -11,9 +11,9 @@ const Mainloop = imports.mainloop; const Tweener = imports.ui.tweener; const Meta = imports.gi.Meta; -const HIDE_TIMEOUT = 1500; -const FADE_TIME = 0.1; -const LEVEL_ANIMATION_TIME = 0.1; +var HIDE_TIMEOUT = 1500; +var FADE_TIME = 0.1; +var LEVEL_ANIMATION_TIME = 0.1; var LevelBar = new Lang.Class({ Name: 'LevelBar', diff --git a/js/ui/overview.js b/js/ui/overview.js index f763bef4c..1ac62a4f2 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -24,16 +24,16 @@ const Tweener = imports.ui.tweener; const WorkspaceThumbnail = imports.ui.workspaceThumbnail; // Time for initial animation going into Overview mode -const ANIMATION_TIME = 0.25; +var ANIMATION_TIME = 0.25; // Must be less than ANIMATION_TIME, since we switch to // or from the overview completely after ANIMATION_TIME, // and don't want the shading animation to get cut off -const SHADE_ANIMATION_TIME = .20; +var SHADE_ANIMATION_TIME = .20; -const DND_WINDOW_SWITCH_TIMEOUT = 750; +var DND_WINDOW_SWITCH_TIMEOUT = 750; -const OVERVIEW_ACTIVATION_TIMEOUT = 0.5; +var OVERVIEW_ACTIVATION_TIMEOUT = 0.5; var ShellInfo = new Lang.Class({ Name: 'ShellInfo', diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index c243e4261..1f6c63bb0 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -14,7 +14,7 @@ const Tweener = imports.ui.tweener; const ViewSelector = imports.ui.viewSelector; const WorkspaceThumbnail = imports.ui.workspaceThumbnail; -const SIDE_CONTROLS_ANIMATION_TIME = 0.16; +var SIDE_CONTROLS_ANIMATION_TIME = 0.16; function getRtlSlideDirection(direction, actor) { let rtl = (actor.text_direction == Clutter.TextDirection.RTL); @@ -25,7 +25,7 @@ function getRtlSlideDirection(direction, actor) { return direction; }; -const SlideDirection = { +var SlideDirection = { LEFT: 0, RIGHT: 1 }; diff --git a/js/ui/panel.js b/js/ui/panel.js index 4220ff9c0..3056ac792 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -25,12 +25,12 @@ const RemoteMenu = imports.ui.remoteMenu; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const PANEL_ICON_SIZE = 16; -const APP_MENU_ICON_MARGIN = 0; +var PANEL_ICON_SIZE = 16; +var APP_MENU_ICON_MARGIN = 0; -const BUTTON_DND_ACTIVATION_TIMEOUT = 250; +var BUTTON_DND_ACTIVATION_TIMEOUT = 250; -const SPINNER_ANIMATION_TIME = 1.0; +var SPINNER_ANIMATION_TIME = 1.0; // To make sure the panel corners blend nicely with the panel, // we draw background and borders the same way, e.g. drawing diff --git a/js/ui/pointerWatcher.js b/js/ui/pointerWatcher.js index fb2dac638..5a1db8032 100644 --- a/js/ui/pointerWatcher.js +++ b/js/ui/pointerWatcher.js @@ -8,7 +8,7 @@ const GnomeDesktop = imports.gi.GnomeDesktop; const Shell = imports.gi.Shell; // We stop polling if the user is idle for more than this amount of time -const IDLE_TIME = 1000; +var IDLE_TIME = 1000; // This file implements a reasonably efficient system for tracking the position // of the mouse pointer. We simply query the pointer from the X server in a loop, diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index ffc4a54b1..a2a4df340 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -16,7 +16,7 @@ const Main = imports.ui.main; const Params = imports.misc.params; const Tweener = imports.ui.tweener; -const Ornament = { +var Ornament = { NONE: 0, DOT: 1, CHECK: 2, diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 6591cf579..90f4c9856 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -17,7 +17,7 @@ const Tweener = imports.ui.tweener; const Util = imports.misc.util; const History = imports.misc.history; -const MAX_FILE_DELETED_BEFORE_INVALID = 10; +var MAX_FILE_DELETED_BEFORE_INVALID = 10; const HISTORY_KEY = 'command-history'; @@ -28,7 +28,7 @@ const TERMINAL_SCHEMA = 'org.gnome.desktop.default-applications.terminal'; const EXEC_KEY = 'exec'; const EXEC_ARG_KEY = 'exec-arg'; -const DIALOG_GROW_TIME = 0.1; +var DIALOG_GROW_TIME = 0.1; var RunDialog = new Lang.Class({ Name: 'RunDialog', diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index af6b7df85..9f3ff84ad 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -39,15 +39,15 @@ const DISABLE_LOCK_KEY = 'disable-lock-screen'; const LOCKED_STATE_STR = 'screenShield.locked'; // fraction of screen height the arrow must reach before completing // the slide up automatically -const ARROW_DRAG_THRESHOLD = 0.1; +var ARROW_DRAG_THRESHOLD = 0.1; // Parameters for the arrow animation -const N_ARROWS = 3; -const ARROW_ANIMATION_TIME = 0.6; -const ARROW_ANIMATION_PEAK_OPACITY = 0.4; -const ARROW_IDLE_TIME = 30000; // ms +var N_ARROWS = 3; +var ARROW_ANIMATION_TIME = 0.6; +var ARROW_ANIMATION_PEAK_OPACITY = 0.4; +var ARROW_IDLE_TIME = 30000; // ms -const SUMMARY_ICON_SIZE = 48; +var SUMMARY_ICON_SIZE = 48; // ScreenShield animation time // - STANDARD_FADE_TIME is used when the session goes idle @@ -55,10 +55,10 @@ const SUMMARY_ICON_SIZE = 48; // or when cancelling the dialog // - BACKGROUND_FADE_TIME is used when the background changes to crossfade to new background // - CURTAIN_SLIDE_TIME is used when raising the shield before unlocking -const STANDARD_FADE_TIME = 10; -const MANUAL_FADE_TIME = 0.3; -const BACKGROUND_FADE_TIME = 1.0; -const CURTAIN_SLIDE_TIME = 0.3; +var STANDARD_FADE_TIME = 10; +var MANUAL_FADE_TIME = 0.3; +var BACKGROUND_FADE_TIME = 1.0; +var CURTAIN_SLIDE_TIME = 0.3; var Clock = new Lang.Class({ Name: 'ScreenShieldClock', diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index b8dfc1618..2e0e35d58 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -338,7 +338,7 @@ var SelectArea = new Lang.Class({ }); Signals.addSignalMethods(SelectArea.prototype); -const FLASHSPOT_ANIMATION_OUT_TIME = 0.5; // seconds +var FLASHSPOT_ANIMATION_OUT_TIME = 0.5; // seconds var Flashspot = new Lang.Class({ Name: 'Flashspot', diff --git a/js/ui/search.js b/js/ui/search.js index 8e705356f..84369c577 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -21,8 +21,8 @@ const Util = imports.misc.util; const SEARCH_PROVIDERS_SCHEMA = 'org.gnome.desktop.search-providers'; -const MAX_LIST_SEARCH_RESULTS_ROWS = 5; -const MAX_GRID_SEARCH_RESULTS_ROWS = 1; +var MAX_LIST_SEARCH_RESULTS_ROWS = 5; +var MAX_GRID_SEARCH_RESULTS_ROWS = 1; var MaxWidthBin = new Lang.Class({ Name: 'MaxWidthBin', diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index 6832abea7..d13580aba 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -18,7 +18,7 @@ const ModalDialog = imports.ui.modalDialog; const Params = imports.misc.params; const ShellEntry = imports.ui.shellEntry; -const LIST_ITEM_ICON_SIZE = 48; +var LIST_ITEM_ICON_SIZE = 48; const REMEMBER_MOUNT_PASSWORD_KEY = 'remember-mount-password'; @@ -473,7 +473,7 @@ const GnomeShellMountOpIface = ' \ \ '; -const ShellMountOperationType = { +var ShellMountOperationType = { NONE: 0, ASK_PASSWORD: 1, ASK_QUESTION: 2, diff --git a/js/ui/slider.js b/js/ui/slider.js index 72ef23bb4..eb8b5aa04 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -7,7 +7,7 @@ const Lang = imports.lang; const St = imports.gi.St; const Signals = imports.signals; -const SLIDER_SCROLL_STEP = 0.02; /* Slider scrolling step in % */ +var SLIDER_SCROLL_STEP = 0.02; /* Slider scrolling step in % */ var Slider = new Lang.Class({ Name: "Slider", diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index 79737e918..de76731a1 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -21,7 +21,7 @@ const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable'; const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications'; -const DPI_FACTOR_LARGE = 1.25; +var DPI_FACTOR_LARGE = 1.25; const WM_SCHEMA = 'org.gnome.desktop.wm.preferences'; const KEY_VISUAL_BELL = 'visual-bell'; diff --git a/js/ui/status/location.js b/js/ui/status/location.js index ef62685a1..13aa8a94e 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -22,7 +22,7 @@ const ENABLED = 'enabled'; const APP_PERMISSIONS_TABLE = 'gnome'; const APP_PERMISSIONS_ID = 'geolocation'; -const GeoclueAccuracyLevel = { +var GeoclueAccuracyLevel = { NONE: 0, COUNTRY: 1, CITY: 4, diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 69b6c0012..1237230cf 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -40,14 +40,14 @@ const NMAccessPointSecurity = { WPA2_ENT: 6 }; -const MAX_DEVICE_ITEMS = 4; +var MAX_DEVICE_ITEMS = 4; // small optimization, to avoid using [] all the time const NM80211Mode = NetworkManager['80211Mode']; const NM80211ApFlags = NetworkManager['80211ApFlags']; const NM80211ApSecurityFlags = NetworkManager['80211ApSecurityFlags']; -const PortalHelperResult = { +var PortalHelperResult = { CANCELLED: 0, COMPLETED: 1, RECHECK: 2 diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 98a77254f..ddda8f36d 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -12,7 +12,7 @@ const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const Slider = imports.ui.slider; -const VOLUME_NOTIFY_ID = 1; +var VOLUME_NOTIFY_ID = 1; // Each Gvc.MixerControl is a connection to PulseAudio, // so it's better to make it a singleton diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 6f7c472ab..d4da7b6b1 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -13,12 +13,12 @@ const St = imports.gi.St; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const POPUP_DELAY_TIMEOUT = 150; // milliseconds +var POPUP_DELAY_TIMEOUT = 150; // milliseconds -const POPUP_SCROLL_TIME = 0.10; // seconds -const POPUP_FADE_OUT_TIME = 0.1; // seconds +var POPUP_SCROLL_TIME = 0.10; // seconds +var POPUP_FADE_OUT_TIME = 0.1; // seconds -const DISABLE_HOVER_TIMEOUT = 500; // milliseconds +var DISABLE_HOVER_TIMEOUT = 500; // milliseconds function mod(a, b) { return (a + b) % b; diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js index 68c1d844c..966439f2c 100644 --- a/js/ui/userWidget.js +++ b/js/ui/userWidget.js @@ -12,7 +12,7 @@ const St = imports.gi.St; const Params = imports.misc.params; -const AVATAR_ICON_SIZE = 64; +var AVATAR_ICON_SIZE = 64; // Adapted from gdm/gui/user-switch-applet/applet.c // diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 942086a5f..ba7f46c71 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -24,9 +24,9 @@ const EdgeDragAction = imports.ui.edgeDragAction; const IconGrid = imports.ui.iconGrid; const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings'; -const PINCH_GESTURE_THRESHOLD = 0.7; +var PINCH_GESTURE_THRESHOLD = 0.7; -const ViewPage = { +var ViewPage = { WINDOWS: 1, APPS: 2, SEARCH: 3 diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 73eae5d81..272dbec89 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -23,18 +23,18 @@ const EdgeDragAction = imports.ui.edgeDragAction; const CloseDialog = imports.ui.closeDialog; const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings'; -const MINIMIZE_WINDOW_ANIMATION_TIME = 0.2; -const SHOW_WINDOW_ANIMATION_TIME = 0.15; -const DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1; -const DESTROY_WINDOW_ANIMATION_TIME = 0.15; -const DIALOG_DESTROY_WINDOW_ANIMATION_TIME = 0.1; -const WINDOW_ANIMATION_TIME = 0.25; -const DIM_BRIGHTNESS = -0.3; -const DIM_TIME = 0.500; -const UNDIM_TIME = 0.250; +var MINIMIZE_WINDOW_ANIMATION_TIME = 0.2; +var SHOW_WINDOW_ANIMATION_TIME = 0.15; +var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1; +var DESTROY_WINDOW_ANIMATION_TIME = 0.15; +var DIALOG_DESTROY_WINDOW_ANIMATION_TIME = 0.1; +var WINDOW_ANIMATION_TIME = 0.25; +var DIM_BRIGHTNESS = -0.3; +var DIM_TIME = 0.500; +var UNDIM_TIME = 0.250; -const DISPLAY_REVERT_TIMEOUT = 20; // in seconds - keep in sync with mutter -const ONE_SECOND = 1000; // in ms +var DISPLAY_REVERT_TIMEOUT = 20; // in seconds - keep in sync with mutter +var ONE_SECOND = 1000; // in ms const GSD_WACOM_BUS_NAME = 'org.gnome.SettingsDaemon.Wacom'; const GSD_WACOM_OBJECT_PATH = '/org/gnome/SettingsDaemon/Wacom'; @@ -183,7 +183,7 @@ function getWindowDimmer(actor) { * the main window of an application, and give the app a grace period * where it can map another window before we remove the workspace. */ -const LAST_WINDOW_GRACE_TIME = 1000; +var LAST_WINDOW_GRACE_TIME = 1000; var WorkspaceTracker = new Lang.Class({ Name: 'WorkspaceTracker', diff --git a/js/ui/workspace.js b/js/ui/workspace.js index a7c229f9b..035a6b572 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -18,23 +18,23 @@ const Overview = imports.ui.overview; const Tweener = imports.ui.tweener; const WindowManager = imports.ui.windowManager; -const WINDOW_DND_SIZE = 256; +var WINDOW_DND_SIZE = 256; -const WINDOW_CLONE_MAXIMUM_SCALE = 0.7; +var WINDOW_CLONE_MAXIMUM_SCALE = 0.7; -const CLOSE_BUTTON_FADE_TIME = 0.1; +var CLOSE_BUTTON_FADE_TIME = 0.1; -const DRAGGING_WINDOW_OPACITY = 100; +var DRAGGING_WINDOW_OPACITY = 100; // When calculating a layout, we calculate the scale of windows and the percent // of the available area the new layout uses. If the values for the new layout, // when weighted with the values as below, are worse than the previous layout's, // we stop looking for a new layout and use the previous layout. // Otherwise, we keep looking for a new layout. -const LAYOUT_SCALE_WEIGHT = 1; -const LAYOUT_SPACE_WEIGHT = 0.1; +var LAYOUT_SCALE_WEIGHT = 1; +var LAYOUT_SPACE_WEIGHT = 0.1; -const WINDOW_ANIMATION_MAX_NUMBER_BLENDING = 3; +var WINDOW_ANIMATION_MAX_NUMBER_BLENDING = 3; function _interpolate(start, end, step) { return start + (end - start) * step; @@ -731,7 +731,7 @@ var WindowOverlay = new Lang.Class({ }); Signals.addSignalMethods(WindowOverlay.prototype); -const WindowPositionFlags = { +var WindowPositionFlags = { NONE: 0, INITIAL: 1 << 0, ANIMATE: 1 << 1 diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js index b4ed716a3..b67e5beb8 100644 --- a/js/ui/workspaceSwitcherPopup.js +++ b/js/ui/workspaceSwitcherPopup.js @@ -12,8 +12,8 @@ const St = imports.gi.St; const Main = imports.ui.main; const Tweener = imports.ui.tweener; -const ANIMATION_TIME = 0.1; -const DISPLAY_TIMEOUT = 600; +var ANIMATION_TIME = 0.1; +var DISPLAY_TIMEOUT = 600; var WorkspaceSwitcherPopup = new Lang.Class({ Name: 'WorkspaceSwitcherPopup', diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 645af5c90..814885a47 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -21,15 +21,15 @@ const WorkspacesView = imports.ui.workspacesView; // The maximum size of a thumbnail is 1/8 the width and height of the screen let MAX_THUMBNAIL_SCALE = 1/8.; -const RESCALE_ANIMATION_TIME = 0.2; -const SLIDE_ANIMATION_TIME = 0.2; +var RESCALE_ANIMATION_TIME = 0.2; +var SLIDE_ANIMATION_TIME = 0.2; // When we create workspaces by dragging, we add a "cut" into the top and // bottom of each workspace so that the user doesn't have to hit the // placeholder exactly. -const WORKSPACE_CUT_SIZE = 10; +var WORKSPACE_CUT_SIZE = 10; -const WORKSPACE_KEEP_ALIVE_TIME = 100; +var WORKSPACE_KEEP_ALIVE_TIME = 100; const OVERRIDE_SCHEMA = 'org.gnome.shell.overrides'; diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index d4b265c4e..8e08cb126 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -17,9 +17,9 @@ const Tweener = imports.ui.tweener; const Workspace = imports.ui.workspace; const WorkspaceThumbnail = imports.ui.workspaceThumbnail; -const WORKSPACE_SWITCH_TIME = 0.25; +var WORKSPACE_SWITCH_TIME = 0.25; -const AnimationType = { +var AnimationType = { ZOOM: 0, FADE: 1 };