From 703b21cef098d2a6fd60a4c3c88412db1132c675 Mon Sep 17 00:00:00 2001 From: Marina Zhurakhinskaya Date: Thu, 13 May 2010 15:46:04 -0400 Subject: [PATCH] Don't use double quotes for things that don't need to be translated This is our convention. The only exceptions are double quotes for words in comments that give them a special meaning (though beware that these quotes are not truly necessary most of the time) and double quotes that need to be a part of the output string. --- js/ui/altTab.js | 14 +++--- js/ui/appDisplay.js | 8 ++-- js/ui/boxpointer.js | 2 +- js/ui/calendar.js | 36 +++++++-------- js/ui/chrome.js | 2 +- js/ui/dash.js | 44 +++++++++--------- js/ui/dnd.js | 4 +- js/ui/docDisplay.js | 6 +-- js/ui/environment.js | 2 +- js/ui/extensionSystem.js | 2 +- js/ui/genericDisplay.js | 30 ++++++------ js/ui/lookingGlass.js | 82 ++++++++++++++++----------------- js/ui/magnifier.js | 34 +++++++------- js/ui/magnifierDBus.js | 8 ++-- js/ui/main.js | 34 +++++++------- js/ui/messageTray.js | 50 ++++++++++---------- js/ui/notificationDaemon.js | 6 +-- js/ui/panel.js | 10 ++-- js/ui/placeDisplay.js | 10 ++-- js/ui/runDialog.js | 8 ++-- js/ui/search.js | 20 ++++---- js/ui/shellDBus.js | 16 +++---- js/ui/telepathyClient.js | 4 +- js/ui/tweener.js | 4 +- js/ui/windowManager.js | 14 +++--- js/ui/workspace.js | 24 +++++----- js/ui/workspaceSwitcherPopup.js | 8 ++-- js/ui/workspacesView.js | 14 +++--- 28 files changed, 248 insertions(+), 248 deletions(-) diff --git a/js/ui/altTab.js b/js/ui/altTab.js index dd5e75a79..5146f50f1 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -120,7 +120,7 @@ AltTabPopup.prototype = { show : function(backward) { let tracker = Shell.WindowTracker.get_default(); - let apps = tracker.get_running_apps (""); + let apps = tracker.get_running_apps (''); if (!apps.length) return false; @@ -420,7 +420,7 @@ AltTabPopup.prototype = { Tweener.addTween(this._thumbnails.actor, { opacity: 0, time: THUMBNAIL_FADE_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: function() { this.destroy(); } }); this._thumbnails = null; @@ -437,7 +437,7 @@ AltTabPopup.prototype = { Tweener.addTween(this._thumbnails.actor, { opacity: 255, time: THUMBNAIL_FADE_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); } }; @@ -761,7 +761,7 @@ function AppIcon(app) { AppIcon.prototype = { _init: function(app) { this.app = app; - this.actor = new St.BoxLayout({ style_class: "alt-tab-app", + this.actor = new St.BoxLayout({ style_class: 'alt-tab-app', vertical: true }); this.icon = null; this._iconBin = new St.Bin(); @@ -948,7 +948,7 @@ ThumbnailList.prototype = { let activeWorkspace = global.screen.get_active_workspace(); - // We fake the value of "separatorAdded" when the app has no window + // We fake the value of 'separatorAdded' when the app has no window // on the current workspace, to avoid displaying a useless separator in // that case. let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace; @@ -964,10 +964,10 @@ ThumbnailList.prototype = { separatorAdded = true; } - let box = new St.BoxLayout({ style_class: "thumbnail-box", + let box = new St.BoxLayout({ style_class: 'thumbnail-box', vertical: true }); - let bin = new St.Bin({ style_class: "thumbnail" }); + let bin = new St.Bin({ style_class: 'thumbnail' }); box.add_actor(bin); this._thumbnailBins.push(bin); diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index acc12fcd8..3cd2eb3d5 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -323,7 +323,7 @@ AppSearchProvider.prototype = { }, expandSearch: function(terms) { - log("TODO expand search"); + log('TODO expand search'); } }; @@ -713,7 +713,7 @@ AppIconMenu.prototype = { }, _appendSeparator: function () { - let bin = new St.Bin({ style_class: "app-well-menu-separator" }); + let bin = new St.Bin({ style_class: 'app-well-menu-separator' }); this._windowContainer.add_actor(bin); }, @@ -850,7 +850,7 @@ function WellGrid() { WellGrid.prototype = { _init: function() { - this.actor = new St.BoxLayout({ name: "dashAppWell", vertical: true }); + this.actor = new St.BoxLayout({ name: 'dashAppWell', vertical: true }); // Pulled from CSS, but hardcode some defaults here this._spacing = 0; this._item_size = 48; @@ -1012,7 +1012,7 @@ AppWell.prototype = { let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); /* hardcode here pending some design about how exactly desktop contexts behave */ - let contextId = ""; + let contextId = ''; let running = this._tracker.get_running_apps(contextId); let runningIds = this._appIdListToHash(running); diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 11e31f2cd..bd58828af 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -26,7 +26,7 @@ function BoxPointer(side, sourceActor, binProperties) { BoxPointer.prototype = { _init: function(arrowSide, sourceActor, binProperties) { if (arrowSide != St.Side.TOP) - throw new Error("not implemented"); + throw new Error('Not implemented'); this._arrowSide = arrowSide; this._sourceActor = sourceActor; this._arrowOrigin = 0; diff --git a/js/ui/calendar.js b/js/ui/calendar.js index ec4689c2f..8122e506f 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -24,27 +24,27 @@ Calendar.prototype = { // GTK+ by preference uses nl_langinfo (NL_TIME_FIRST_WEEKDAY). We probably // should add a C function so we can do the full handling. this._weekStart = NaN; - let weekStartString = Gettext_gtk20.gettext("calendar:week_start:0"); - if (weekStartString.indexOf("calendar:week_start:") == 0) { + let weekStartString = Gettext_gtk20.gettext('calendar:week_start:0'); + if (weekStartString.indexOf('calendar:week_start:') == 0) { this._weekStart = parseInt(weekStartString.substring(20)); } if (isNaN(this._weekStart) || this._weekStart < 0 || this._weekStart > 6) { - log("Translation of 'calendar:week_start:0' in GTK+ is not correct"); + log('Translation of "calendar:week_start:0" in GTK+ is not correct'); this._weekStart = 0; } // Find the ordering for month/year in the calendar heading - switch (Gettext_gtk20.gettext("calendar:MY")) { - case "calendar:MY": - this._headerFormat = "%B %Y"; + switch (Gettext_gtk20.gettext('calendar:MY')) { + case 'calendar:MY': + this._headerFormat = '%B %Y'; break; - case "calendar:YM": - this._headerFormat = "%Y %B"; + case 'calendar:YM': + this._headerFormat = '%Y %B'; break; default: - log("Translation of 'calendar:MY' in GTK+ is not correct"); - this._headerFormat = "%B %Y"; + log('Translation of "calendar:MY" in GTK+ is not correct'); + this._headerFormat = '%B %Y'; break; } @@ -52,7 +52,7 @@ Calendar.prototype = { this.date = new Date(); this.actor = new St.Table({ homogeneous: false, - style_class: "calendar", + style_class: 'calendar', reactive: true }); this.actor.connect('scroll-event', @@ -63,21 +63,21 @@ Calendar.prototype = { this.actor.add(this._topBox, { row: 0, col: 0, col_span: 7 }); - let [backlabel, forwardlabel] = ["<", ">"]; + let [backlabel, forwardlabel] = ['<', '>']; if (St.Widget.get_default_direction () == St.TextDirection.RTL) { [backlabel, forwardlabel] = [forwardlabel, backlabel]; } let back = new St.Button({ label: backlabel, style_class: 'calendar-change-month' }); this._topBox.add(back); - back.connect("clicked", Lang.bind(this, this._prevMonth)); + back.connect('clicked', Lang.bind(this, this._prevMonth)); this._dateLabel = new St.Label(); this._topBox.add(this._dateLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE }); let forward = new St.Button({ label: forwardlabel, style_class: 'calendar-change-month' }); this._topBox.add(forward); - forward.connect("clicked", Lang.bind(this, this._nextMonth)); + forward.connect('clicked', Lang.bind(this, this._nextMonth)); // We need to figure out the abbreviated localized names for the days of the week; // we do this by just getting the next 7 days starting from right now and then putting @@ -86,7 +86,7 @@ Calendar.prototype = { iter.setSeconds(0); // Leap second protection. Hah! iter.setHours(12); for (let i = 0; i < 7; i++) { - this.actor.add(new St.Label({ text: iter.toLocaleFormat("%a") }), + this.actor.add(new St.Label({ text: iter.toLocaleFormat('%a') }), { row: 1, col: (7 + iter.getDay() - this._weekStart) % 7, x_fill: false, x_align: St.Align.END }); @@ -161,11 +161,11 @@ Calendar.prototype = { while (true) { let label = new St.Label({ text: iter.getDate().toString() }); if (_sameDay(now, iter)) - label.style_class = "calendar-day calendar-today"; + label.style_class = 'calendar-day calendar-today'; else if (iter.getMonth() != this.date.getMonth()) - label.style_class = "calendar-day calendar-other-month-day"; + label.style_class = 'calendar-day calendar-other-month-day'; else - label.style_class = "calendar-day"; + label.style_class = 'calendar-day'; this.actor.add(label, { row: row, col: (7 + iter.getDay() - this._weekStart) % 7, x_fill: false, x_align: St.Align.END }); diff --git a/js/ui/chrome.js b/js/ui/chrome.js index e386a4e06..b42989b9d 100644 --- a/js/ui/chrome.js +++ b/js/ui/chrome.js @@ -249,7 +249,7 @@ Chrome.prototype = { // The chrome layer should be visible unless there is a window // with layer FULLSCREEN, or a window with layer // OVERRIDE_REDIRECT that covers the whole screen. - // ("override_redirect" is not actually a layer above all + // ('override_redirect' is not actually a layer above all // other windows, but this seems to be how mutter treats it // currently...) If we wanted to be extra clever, we could // figure out when an OVERRIDE_REDIRECT window was trying to diff --git a/js/ui/dash.js b/js/ui/dash.js index a14d288ba..9d9cddf15 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -22,8 +22,8 @@ const Search = imports.ui.search; // 25 search results (per result type) should be enough for everyone const MAX_RENDERED_SEARCH_RESULTS = 25; -const DOCS = "docs"; -const PLACES = "places"; +const DOCS = 'docs'; +const PLACES = 'places'; /* * Returns the index in an array of a given length that is obtained @@ -54,7 +54,7 @@ Pane.prototype = { _init: function () { this._open = false; - this.actor = new St.BoxLayout({ style_class: "dash-pane", + this.actor = new St.BoxLayout({ style_class: 'dash-pane', vertical: true, reactive: true }); this.actor.connect('button-press-event', Lang.bind(this, function (a, e) { @@ -185,7 +185,7 @@ function SearchEntry() { SearchEntry.prototype = { _init : function() { - this.actor = new St.Entry({ name: "searchEntry", + this.actor = new St.Entry({ name: 'searchEntry', hint_text: _("Find") }); this.entry = this.actor.clutter_text; @@ -193,7 +193,7 @@ SearchEntry.prototype = { function() { if (this.isActive()) this.actor.set_secondary_icon_from_file(global.imagedir + - "close-black.svg"); + 'close-black.svg'); else this.actor.set_secondary_icon_from_file(null); })); @@ -530,7 +530,7 @@ SearchResults.prototype = { let meta = this._metaForProvider(provider); meta.actor.show(); meta.resultDisplay.renderResults(providerResults, terms); - meta.count.set_text(""+providerResults.length); + meta.count.set_text('' + providerResults.length); } this.selectDown(false); @@ -608,11 +608,11 @@ function MoreLink() { MoreLink.prototype = { _init : function () { - this.actor = new St.BoxLayout({ style_class: "more-link", + this.actor = new St.BoxLayout({ style_class: 'more-link', reactive: true }); this.pane = null; - this._expander = new St.Bin({ style_class: "more-link-expander" }); + this._expander = new St.Bin({ style_class: 'more-link-expander' }); this.actor.add(this._expander, { expand: true, y_fill: false }); }, @@ -644,9 +644,9 @@ function BackLink() { BackLink.prototype = { _init : function () { - this.actor = new St.Button({ style_class: "section-header-back", + this.actor = new St.Button({ style_class: 'section-header-back', reactive: true }); - this.actor.set_child(new St.Bin({ style_class: "section-header-back-image" })); + this.actor.set_child(new St.Bin({ style_class: 'section-header-back-image' })); } }; @@ -656,12 +656,12 @@ function SectionHeader(title, suppressBrowse) { SectionHeader.prototype = { _init : function (title, suppressBrowse) { - this.actor = new St.Bin({ style_class: "section-header", + this.actor = new St.Bin({ style_class: 'section-header', x_align: St.Align.START, x_fill: true, y_fill: true, reactive: !suppressBrowse }); - this._innerBox = new St.BoxLayout({ style_class: "section-header-inner" }); + this._innerBox = new St.BoxLayout({ style_class: 'section-header-inner' }); this.actor.set_child(this._innerBox); this.backLink = new BackLink(); @@ -671,12 +671,12 @@ SectionHeader.prototype = { this.emit('back-link-activated'); })); - let textBox = new St.BoxLayout({ style_class: "section-text-content" }); - this.text = new St.Label({ style_class: "section-title", + let textBox = new St.BoxLayout({ style_class: 'section-text-content' }); + this.text = new St.Label({ style_class: 'section-title', text: title }); textBox.add(this.text, { x_align: St.Align.START }); - this.countText = new St.Label({ style_class: "section-count" }); + this.countText = new St.Label({ style_class: 'section-count' }); textBox.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END }); this.countText.hide(); @@ -712,7 +712,7 @@ SectionHeader.prototype = { }, setCountText : function(countText) { - if (countText == "") { + if (countText == '') { this.countText.hide(); } else { this.countText.show(); @@ -729,14 +729,14 @@ function SearchSectionHeader(title, onClick) { SearchSectionHeader.prototype = { _init : function(title, onClick) { - this.actor = new St.Button({ style_class: "dash-search-section-header", + this.actor = new St.Button({ style_class: 'dash-search-section-header', x_fill: true, y_fill: true }); let box = new St.BoxLayout(); this.actor.set_child(box); - let titleText = new St.Label({ style_class: "dash-search-section-title", + let titleText = new St.Label({ style_class: 'dash-search-section-title', text: title }); - this.countText = new St.Label({ style_class: "dash-search-section-count" }); + this.countText = new St.Label({ style_class: 'dash-search-section-count' }); box.add(titleText); box.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END }); @@ -776,14 +776,14 @@ Dash.prototype = { // of the Group actor ends up including the width of its hidden children, so we were getting a reactive object as // wide as the details pane that was blocking the clicks to the workspaces underneath it even when the details pane // was actually hidden. - this.actor = new St.BoxLayout({ name: "dash", + this.actor = new St.BoxLayout({ name: 'dash', vertical: true, reactive: true }); // The searchArea just holds the entry - this.searchArea = new St.BoxLayout({ name: "dashSearchArea", + this.searchArea = new St.BoxLayout({ name: 'dashSearchArea', vertical: true }); - this.sectionArea = new St.BoxLayout({ name: "dashSections", + this.sectionArea = new St.BoxLayout({ name: 'dashSections', vertical: true }); this.actor.add(this.searchArea); diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 4a7c3ebef..aa0d19e1b 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -254,7 +254,7 @@ _Draggable.prototype = { { scale_x: scale * origScale, scale_y: scale * origScale, time: SCALE_ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onUpdate: function() { let currentScale = this._dragActor.scale_x / origScale; this._dragOffsetX = currentScale * origDragOffsetX; @@ -368,7 +368,7 @@ _Draggable.prototype = { scale_y: this._snapBackScale, opacity: this._dragOrigOpacity, time: SNAP_BACK_ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._onSnapBackComplete, onCompleteScope: this, onCompleteParams: [this._dragActor, eventTime] diff --git a/js/ui/docDisplay.js b/js/ui/docDisplay.js index c5460b5c7..7e9de073f 100644 --- a/js/ui/docDisplay.js +++ b/js/ui/docDisplay.js @@ -41,7 +41,7 @@ DocDisplayItem.prototype = { GenericDisplay.GenericDisplayItem.prototype._init.call(this); this._docInfo = docInfo; - this._setItemInfo(docInfo.name, ""); + this._setItemInfo(docInfo.name, ''); this._timeoutTime = -1; this._resetTimeDisplay(currentSecs); @@ -80,7 +80,7 @@ DocDisplayItem.prototype = { // Creates and returns a large preview icon, but only if this._docInfo is an image file // and we were able to generate a pixbuf from it successfully. _createLargePreviewIcon : function() { - if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf("image/") != 0) + if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf('image/') != 0) return null; try { @@ -513,6 +513,6 @@ DocSearchProvider.prototype = { }, expandSearch: function(terms) { - log("TODO expand docs search"); + log('TODO expand docs search'); } }; diff --git a/js/ui/environment.js b/js/ui/environment.js index dbf816413..209cdc822 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -36,7 +36,7 @@ function init() { String.prototype.format = Format.format; // Set the default direction for St widgets (this needs to be done before any use of St) - if (Gettext_gtk20.gettext("default:LTR") == "default:RTL") { + if (Gettext_gtk20.gettext('default:LTR') == 'default:RTL') { St.Widget.set_default_direction(St.TextDirection.RTL); } } diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 8c0ab4c20..8031bfeb8 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -124,7 +124,7 @@ function init() { try { userExtensionsDir.make_directory_with_parents(null); } catch (e) { - global.logError(""+e); + global.logError('' + e); } disabledExtensions = Shell.GConf.get_default().get_string_list('disabled_extensions'); diff --git a/js/ui/genericDisplay.js b/js/ui/genericDisplay.js index e264d00ff..3ab8d0d78 100644 --- a/js/ui/genericDisplay.js +++ b/js/ui/genericDisplay.js @@ -34,7 +34,7 @@ function GenericDisplayItem() { GenericDisplayItem.prototype = { _init: function() { - this.actor = new St.BoxLayout({ style_class: "generic-display-item", + this.actor = new St.BoxLayout({ style_class: 'generic-display-item', reactive: true }); this.actor._delegate = this; @@ -144,7 +144,7 @@ GenericDisplayItem.prototype = { // Performes an action associated with launching this item, such as opening a file or an application. launch: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, //// Protected methods //// @@ -176,12 +176,12 @@ GenericDisplayItem.prototype = { this._icon = this._createIcon(); this._iconBin.set_child(this._icon); - this._name = new St.Label({ style_class: "generic-display-item-name", + this._name = new St.Label({ style_class: 'generic-display-item-name', text: nameText }); this._infoText.add(this._name); - this._description = new St.Label({ style_class: "generic-display-item-description", - text: descriptionText ? descriptionText : "" }); + this._description = new St.Label({ style_class: 'generic-display-item-description', + text: descriptionText ? descriptionText : '' }); this._infoText.add(this._description); }, @@ -208,12 +208,12 @@ GenericDisplayItem.prototype = { // Returns an icon for the item. _createIcon: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, // Returns a preview icon for the item. _createPreviewIcon: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); } //// Private methods //// @@ -356,7 +356,7 @@ GenericDisplay.prototype = { // TODO: figure out why this._list.displayedCount is returning a // positive number when this._mathedItems.length is 0 // This can be triggered if a search string is entered for which there are no matches. - // log("this._mathedItems.length: " + this._matchedItems.length + " this._list.displayedCount " + this._list.displayedCount); + // log('this._mathedItems.length: ' + this._matchedItems.length + ' this._list.displayedCount ' + this._list.displayedCount); return this._matchedItemKeys.length > 0; }, @@ -402,7 +402,7 @@ GenericDisplay.prototype = { // and adds it to the list of displayed items, but does not yet display it. _addDisplayItem : function(itemId) { if (this._displayedItems.hasOwnProperty(itemId)) { - log("Tried adding a display item for " + itemId + ", but an item with this item id is already among displayed items."); + log('Tried adding a display item for ' + itemId + ', but an item with this item id is already among displayed items.'); return; } @@ -461,7 +461,7 @@ GenericDisplay.prototype = { // Return true if there's an active search or other constraint // on the list _filterActive: function() { - return this._search != ""; + return this._search != ''; }, // Called when we are resetting state @@ -584,13 +584,13 @@ GenericDisplay.prototype = { // Implementation should return %true if we are up to date, and %false // if a full reload occurred. _refreshCache: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, // Sets the list of the displayed items based on the default sorting order. // The default sorting order is specific to each implementing class. _setDefaultList: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, // Compares items associated with the item ids based on the order in which the @@ -598,18 +598,18 @@ GenericDisplay.prototype = { // Intended to be used as a compareFunction for array.sort(). // Returns an integer value indicating the result of the comparison. _compareItems: function(itemIdA, itemIdB) { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, // Checks if the item info can be a match for the search string. // Returns a boolean flag indicating if that's the case. _isInfoMatching: function(itemInfo, search) { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, // Creates a display item based on itemInfo. _createDisplayItem: function(itemInfo) { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, //// Private methods //// diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index aed40850f..62b743732 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -17,22 +17,22 @@ const Tweener = imports.ui.tweener; const Main = imports.ui.main; /* Imports...feel free to add here as needed */ -var commandHeader = "const Clutter = imports.gi.Clutter; " + - "const GLib = imports.gi.GLib; " + - "const Gtk = imports.gi.Gtk; " + - "const Mainloop = imports.mainloop; " + - "const Meta = imports.gi.Meta; " + - "const Shell = imports.gi.Shell; " + - "const Main = imports.ui.main; " + - "const Lang = imports.lang; " + - "const Tweener = imports.ui.tweener; " + +var commandHeader = 'const Clutter = imports.gi.Clutter; ' + + 'const GLib = imports.gi.GLib; ' + + 'const Gtk = imports.gi.Gtk; ' + + 'const Mainloop = imports.mainloop; ' + + 'const Meta = imports.gi.Meta; ' + + 'const Shell = imports.gi.Shell; ' + + 'const Main = imports.ui.main; ' + + 'const Lang = imports.lang; ' + + 'const Tweener = imports.ui.tweener; ' + /* Utility functions...we should probably be able to use these * in the shell core code too. */ - "const stage = global.stage; " + - "const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; " + + 'const stage = global.stage; ' + + 'const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; ' + /* Special lookingGlass functions */ - "const it = Main.lookingGlass.getIt(); " + - "const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); "; + 'const it = Main.lookingGlass.getIt(); ' + + 'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); '; function Notebook() { this._init(); @@ -42,14 +42,14 @@ Notebook.prototype = { _init: function() { this.actor = new St.BoxLayout({ vertical: true }); - this.tabControls = new St.BoxLayout({ style_class: "labels" }); + this.tabControls = new St.BoxLayout({ style_class: 'labels' }); this._selectedIndex = -1; this._tabs = []; }, appendPage: function(name, child) { - let labelBox = new St.BoxLayout({ style_class: "notebook-tab" }); + let labelBox = new St.BoxLayout({ style_class: 'notebook-tab' }); let label = new St.Button({ label: name }); label.connect('clicked', Lang.bind(this, function () { this.selectChild(child); @@ -153,13 +153,13 @@ Result.prototype = { cmdTxt.ellipsize = Pango.EllipsizeMode.END; this.actor.add(cmdTxt); - let resultTxt = new St.Label({ text: "r(" + index + ") = " + o }); + let resultTxt = new St.Label({ text: 'r(' + index + ') = ' + o }); resultTxt.ellipsize = Pango.EllipsizeMode.END; this.actor.add(resultTxt); - let line = new Clutter.Rectangle({ name: "Separator", + let line = new Clutter.Rectangle({ name: 'Separator', height: 1 }); - let padBin = new St.Bin({ name: "Separator", x_fill: true, y_fill: true }); + let padBin = new St.Bin({ name: 'Separator', x_fill: true, y_fill: true }); padBin.add_actor(line); this.actor.add(padBin); } @@ -171,7 +171,7 @@ function WindowList() { WindowList.prototype = { _init : function () { - this.actor = new St.BoxLayout({ name: "Windows", vertical: true, style: "spacing: 8px" }); + this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' }); let display = global.screen.get_display(); let tracker = Shell.WindowTracker.get_default(); this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList)); @@ -193,16 +193,16 @@ WindowList.prototype = { box.add(label.actor); let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' }); box.add(propsBox); - propsBox.add(new St.Label({ text: "wmclass: " + metaWindow.get_wm_class() })); + propsBox.add(new St.Label({ text: 'wmclass: ' + metaWindow.get_wm_class() })); let app = tracker.get_window_app(metaWindow); if (app != null && !app.is_transient()) { let icon = app.create_icon_texture(22); let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' }); propsBox.add(propBox); - propBox.add(new St.Label({ text: "app: " + app.get_id() }), { y_align: St.Align.MIDDLE }); + propBox.add(new St.Label({ text: 'app: ' + app.get_id() }), { y_align: St.Align.MIDDLE }); propBox.add(icon, { y_align: St.Align.MIDDLE }); } else { - propsBox.add(new St.Label({ text: "" })); + propsBox.add(new St.Label({ text: '' })); } } } @@ -219,7 +219,7 @@ PropertyInspector.prototype = { this._parentList = []; - this.actor = new St.BoxLayout({ name: "PropertyInspector", vertical: true }); + this.actor = new St.BoxLayout({ name: 'PropertyInspector', vertical: true }); }, setTarget: function(actor) { @@ -230,11 +230,11 @@ PropertyInspector.prototype = { for (let propName in actor) { let valueStr; try { - valueStr = "" + actor[propName]; + valueStr = '' + actor[propName]; } catch (e) { valueStr = ''; } - let propText = propName + ": " + valueStr; + let propText = propName + ': ' + valueStr; let propDisplay = new St.Label({ reactive: true, text: propText }); this.actor.add_actor(propDisplay); @@ -250,7 +250,7 @@ Inspector.prototype = { _init: function() { let width = 150; let primary = global.get_primary_monitor(); - let eventHandler = new St.BoxLayout({ name: "LookingGlassDialog", + let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog', vertical: false, y: primary.y + Math.floor(primary.height / 2), reactive: true }); @@ -336,7 +336,7 @@ ErrorLog.prototype = { let stack = Main._getAndClearErrorStack(); for (let i = 0; i < stack.length; i++) { let logItem = stack[i]; - text += logItem.category + " t=" + this._formatTime(new Date(logItem.timestamp)) + " " + logItem.message + "\n"; + text += logItem.category + ' t=' + this._formatTime(new Date(logItem.timestamp)) + ' ' + logItem.message + '\n'; } this.text.text = text; } @@ -396,7 +396,7 @@ Extensions.prototype = { case ExtensionSystem.ExtensionState.OUT_OF_DATE: return _("Out of date"); } - return "Unknown"; // Not translated, shouldn't appear + return 'Unknown'; // Not translated, shouldn't appear }, _createExtensionDisplay: function(meta) { @@ -442,7 +442,7 @@ function LookingGlass() { LookingGlass.prototype = { _init : function() { this._idleHistorySaveId = 0; - let historyPath = global.userdatadir + "/lookingglass-history.txt"; + let historyPath = global.userdatadir + '/lookingglass-history.txt'; this._historyFile = Gio.file_new_for_path(historyPath); this._savedText = null; this._historyNavIndex = -1; @@ -461,19 +461,19 @@ LookingGlass.prototype = { // Sort of magic, but...eh. this._maxItems = 150; - this.actor = new St.BoxLayout({ name: "LookingGlassDialog", + this.actor = new St.BoxLayout({ name: 'LookingGlassDialog', vertical: true, visible: false }); let gconf = Shell.GConf.get_default(); - gconf.watch_directory("/desktop/gnome/interface"); - gconf.connect("changed::/desktop/gnome/interface/monospace_font_name", + gconf.watch_directory('/desktop/gnome/interface'); + gconf.connect('changed::/desktop/gnome/interface/monospace_font_name', Lang.bind(this, this._updateFont)); this._updateFont(); Main.uiGroup.add_actor(this.actor); - let toolbar = new St.BoxLayout({ name: "Toolbar" }); + let toolbar = new St.BoxLayout({ name: 'Toolbar' }); this.actor.add_actor(toolbar); let inspectIcon = St.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }), 24); @@ -501,13 +501,13 @@ LookingGlass.prototype = { toolbar.add(emptyBox, { expand: true }); toolbar.add_actor(notebook.tabControls); - this._evalBox = new St.BoxLayout({ name: "EvalBox", vertical: true }); + this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true }); notebook.appendPage('Evaluator', this._evalBox); - this._resultsArea = new St.BoxLayout({ name: "ResultsArea", vertical: true }); + this._resultsArea = new St.BoxLayout({ name: 'ResultsArea', vertical: true }); this._evalBox.add(this._resultsArea, { expand: true }); - let entryArea = new St.BoxLayout({ name: "EntryArea" }); + let entryArea = new St.BoxLayout({ name: 'EntryArea' }); this._evalBox.add_actor(entryArea); let label = new St.Label({ text: 'js>>> ' }); @@ -543,7 +543,7 @@ LookingGlass.prototype = { // newline-separated. text.replace('\n', ' '); // Strip leading and trailing whitespace - text = text.replace(/^\s+/g, "").replace(/\s+$/g, ""); + text = text.replace(/^\s+/g, '').replace(/\s+$/g, ''); if (text == '') return true; this._evaluate(text); @@ -579,7 +579,7 @@ LookingGlass.prototype = { _updateFont: function() { let gconf = Shell.GConf.get_default(); - let fontName = gconf.get_string("/desktop/gnome/interface/monospace_font_name"); + let fontName = gconf.get_string('/desktop/gnome/interface/monospace_font_name'); // This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName); // https://bugzilla.gnome.org/show_bug.cgi?id=595889 let fontDesc = Pango.Font.description_from_string(fontName); @@ -653,7 +653,7 @@ LookingGlass.prototype = { try { resultObj = eval(fullCmd); } catch (e) { - resultObj = ""; + resultObj = ''; } this._pushResult(command, resultObj); @@ -725,7 +725,7 @@ LookingGlass.prototype = { global.stage.set_key_focus(this._entry); Tweener.addTween(this.actor, { time: 0.5, - transition: "easeOutQuad", + transition: 'easeOutQuad', y: this._targetY }); }, @@ -750,7 +750,7 @@ LookingGlass.prototype = { Main.popModal(this.actor); Tweener.addTween(this.actor, { time: 0.5, - transition: "easeOutQuad", + transition: 'easeOutQuad', y: this._hiddenY, onComplete: Lang.bind(this, function () { this.actor.hide(); diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 75e2f5ab5..a67e5393b 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -43,22 +43,22 @@ const DEFAULT_CROSSHAIRS_LENGTH = 4096; const DEFAULT_CROSSHAIRS_CLIP = false; const DEFAULT_CROSSHAIRS_CLIP_SIZE = [100, 100]; const DEFAULT_CROSSHAIRS_COLOR = new Clutter.Color(); -DEFAULT_CROSSHAIRS_COLOR.from_string("Red"); +DEFAULT_CROSSHAIRS_COLOR.from_string('Red'); // GConf settings -const A11Y_MAG_PREFS_DIR = "/desktop/gnome/accessibility/magnifier"; -const SHOW_KEY = A11Y_MAG_PREFS_DIR + "/show_magnifier"; -const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + "/screen_position"; -const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + "/mag_factor"; -const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + "/lens_mode"; -const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + "/scroll_at_edges"; -const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + "/mouse_tracking"; -const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + "/show_cross_hairs"; -const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_thickness"; -const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_color"; -const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_opacity"; -const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_length"; -const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_clip"; +const A11Y_MAG_PREFS_DIR = '/desktop/gnome/accessibility/magnifier'; +const SHOW_KEY = A11Y_MAG_PREFS_DIR + '/show_magnifier'; +const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + '/screen_position'; +const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + '/mag_factor'; +const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + '/lens_mode'; +const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + '/scroll_at_edges'; +const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + '/mouse_tracking'; +const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + '/show_cross_hairs'; +const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_thickness'; +const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_color'; +const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_opacity'; +const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_length'; +const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_clip'; let magDBusService = null; @@ -329,7 +329,7 @@ Magnifier.prototype = { /** * setCrosshairsColor: * Set the color of the crosshairs for all ZoomRegions. - * @color: The color as a string, e.g. "#ff0000ff" or "red". + * @color: The color as a string, e.g. '#ff0000ff' or 'red'. */ setCrosshairsColor: function(color) { if (this._crossHairs) { @@ -342,7 +342,7 @@ Magnifier.prototype = { /** * getCrosshairsColor: * Get the color of the crosshairs. - * @return: The color as a string, e.g. "#0000ffff" for blue. + * @return: The color as a string, e.g. '#0000ffff' or 'blue'. */ getCrosshairsColor: function() { if (this._crossHairs) { @@ -350,7 +350,7 @@ Magnifier.prototype = { return clutterColor.to_string(); } else - return "#00000000"; + return '#00000000'; }, /** diff --git a/js/ui/magnifierDBus.js b/js/ui/magnifierDBus.js index 08a3cee0b..b4b59151c 100644 --- a/js/ui/magnifierDBus.js +++ b/js/ui/magnifierDBus.js @@ -53,8 +53,8 @@ const ZoomRegionIface = { }; // For making unique ZoomRegion DBus proxy object paths of the form: -// "/org/gnome/Magnifier/ZoomRegion/zoomer0", -// "/org/gnome/Magnifier/ZoomRegion/zoomer1", etc. +// '/org/gnome/Magnifier/ZoomRegion/zoomer0', +// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc. let _zoomRegionInstanceCount = 0; function ShellMagnifier() { @@ -118,7 +118,7 @@ ShellMagnifier.prototype = { let ROI = { x: roi[0], y: roi[1], width: roi[2], height: roi[3] }; let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2], height: viewPort[3] }; let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox); - let objectPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount; + let objectPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount; _zoomRegionInstanceCount++; let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion); @@ -169,7 +169,7 @@ ShellMagnifier.prototype = { } if (!found) { // Got a ZoomRegion with no DBus proxy, make one. - let newPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount; + let newPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount; _zoomRegionInstanceCount++; let zoomRegionProxy = new ShellMagnifierZoomRegion(newPath, aZoomRegion); let proxyAndZoomer = {}; diff --git a/js/ui/main.js b/js/ui/main.js index af51612d1..879020e50 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -54,9 +54,9 @@ let _startDate; let background = null; function start() { - // Add a binding for "global" in the global JS namespace; (gjs + // Add a binding for 'global' in the global JS namespace; (gjs // keeps the web browser convention of having that namespace be - // called "window".) + // called 'window'.) window.global = Shell.Global.get(); // Now monkey patch utility functions into the global proxy; @@ -65,7 +65,7 @@ function start() { global.logError = _logError; global.log = _logDebug; - Gio.DesktopAppInfo.set_desktop_env("GNOME"); + Gio.DesktopAppInfo.set_desktop_env('GNOME'); global.grab_dbus_service(); shellDBusService = new ShellDBus.GnomeShell(); @@ -94,17 +94,17 @@ function start() { global.stage.color = DEFAULT_BACKGROUND_COLOR; let themeContext = St.ThemeContext.get_for_stage (global.stage); - let stylesheetPath = global.datadir + "/theme/gnome-shell.css"; + let stylesheetPath = global.datadir + '/theme/gnome-shell.css'; let theme = new St.Theme ({ application_stylesheet: stylesheetPath }); themeContext.set_theme (theme); let shellwm = global.window_manager; - shellwm.takeover_keybinding("panel_main_menu"); - shellwm.connect("keybinding::panel_main_menu", function () { + shellwm.takeover_keybinding('panel_main_menu'); + shellwm.connect('keybinding::panel_main_menu', function () { overview.toggle(); }); - shellwm.takeover_keybinding("panel_run_dialog"); - shellwm.connect("keybinding::panel_run_dialog", function () { + shellwm.takeover_keybinding('panel_run_dialog'); + shellwm.connect('keybinding::panel_run_dialog', function () { getRunDialog().open(); }); @@ -136,9 +136,9 @@ function start() { } else { //read the parameters from GConf always in case they have changed let gconf = Shell.GConf.get_default(); - recorder.set_framerate(gconf.get_int("recorder/framerate")); - recorder.set_filename("shell-%d%u-%c." + gconf.get_string("recorder/file_extension")); - let pipeline = gconf.get_string("recorder/pipeline"); + recorder.set_framerate(gconf.get_int('recorder/framerate')); + recorder.set_filename('shell-%d%u-%c.' + gconf.get_string('recorder/file_extension')); + let pipeline = gconf.get_string('recorder/pipeline'); if (!pipeline.match(/^\s*$/)) recorder.set_pipeline(pipeline); else @@ -191,7 +191,7 @@ function _log(category, msg) { for (let i = 2; i < arguments.length; i++) { text += JSON.stringify(arguments[i]); if (i < arguments.length - 1) - text += " "; + text += ' '; } } _errorLogStack.push({timestamp: new Date().getTime(), @@ -280,8 +280,8 @@ function _globalKeyPressHandler(actor, event) { if (symbol == Clutter.Print) { // We want to be able to take screenshots of the shell at all times let gconf = Shell.GConf.get_default(); - let command = gconf.get_string("/apps/metacity/keybinding_commands/command_screenshot"); - if (command != null && command != "") { + let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot'); + if (command != null && command != '') { let [ok, len, args] = GLib.shell_parse_argv(command); let p = new Shell.Process({'args' : args}); p.run(); @@ -354,7 +354,7 @@ function _findModal(actor) { function pushModal(actor) { if (modalCount == 0) { if (!global.begin_modal(global.get_current_time())) { - log("pushModal: invocation of begin_modal failed"); + log('pushModal: invocation of begin_modal failed'); return false; } } @@ -521,7 +521,7 @@ function _queueBeforeRedraw(workId) { */ function initializeDeferredWork(actor, callback, props) { // Turn into a string so we can use as an object property - let workId = "" + (++_deferredWorkSequence); + let workId = '' + (++_deferredWorkSequence); _deferredWorkData[workId] = { 'actor': actor, 'callback': callback }; actor.connect('notify::mapped', function () { @@ -551,7 +551,7 @@ function initializeDeferredWork(actor, callback, props) { function queueDeferredWork(workId) { let data = _deferredWorkData[workId]; if (!data) { - global.logError("invalid work id ", workId); + global.logError('invalid work id ', workId); return; } if (_deferredWorkQueue.indexOf(workId) < 0) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index e690d44e3..e96add140 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -30,10 +30,10 @@ const State = { function _cleanMarkup(text) { // Support &, ", ', < and >, escape all other // occurrences of '&'. - let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, "&"); + let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, '&'); // Support , , and , escape anything else // so it displays as raw markup. - return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, "<$1"); + return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, '<$1'); } // Notification: @@ -332,7 +332,7 @@ Notification.prototype = { Tweener.addTween(this._bannerLabel, { opacity: 0, time: ANIMATION_TIME, - transition: "easeOutQuad" }); + transition: 'easeOutQuad' }); return true; }, @@ -342,7 +342,7 @@ Notification.prototype = { Tweener.addTween(this._bannerLabel, { opacity: 255, time: ANIMATION_TIME, - transition: "easeOutQuad" }); + transition: 'easeOutQuad' }); return true; }, @@ -692,7 +692,7 @@ MessageTray.prototype = { // All of the logic for what happens when occurs here; the various // event handlers merely update variables such as - // "this._pointerInTray", "this._summaryState", etc, and + // 'this._pointerInTray', 'this._summaryState', etc, and // _updateState() figures out what (if anything) needs to be done // at the present time. _updateState: function() { @@ -782,19 +782,19 @@ MessageTray.prototype = { _showTray: function() { let primary = global.get_primary_monitor(); - this._tween(this.actor, "_trayState", State.SHOWN, + this._tween(this.actor, '_trayState', State.SHOWN, { y: primary.y + primary.height - this.actor.height, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, _hideTray: function() { let primary = global.get_primary_monitor(); - this._tween(this.actor, "_trayState", State.HIDDEN, + this._tween(this.actor, '_trayState', State.HIDDEN, { y: primary.y + primary.height - 1, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, @@ -806,11 +806,11 @@ MessageTray.prototype = { this._notificationBin.y = this.actor.height; this._notificationBin.show(); - this._tween(this._notificationBin, "_notificationState", State.SHOWN, + this._tween(this._notificationBin, '_notificationState', State.SHOWN, { y: 0, opacity: 255, time: ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._showNotificationCompleted, onCompleteScope: this }); @@ -858,11 +858,11 @@ MessageTray.prototype = { this._reExpandNotificationId = 0; } - this._tween(this._notificationBin, "_notificationState", State.HIDDEN, + this._tween(this._notificationBin, '_notificationState', State.HIDDEN, { y: this.actor.height, opacity: 0, time: ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._hideNotificationCompleted, onCompleteScope: this }); @@ -877,10 +877,10 @@ MessageTray.prototype = { _expandNotification: function() { if (this._notification && this._notification.popOut()) { - this._tween(this._notificationBin, "_notificationState", State.SHOWN, + this._tween(this._notificationBin, '_notificationState', State.SHOWN, { y: this.actor.height - this._notificationBin.height, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); if (!this._reExpandNotificationId) @@ -892,11 +892,11 @@ MessageTray.prototype = { let primary = global.get_primary_monitor(); this._summaryBin.opacity = 0; this._summaryBin.y = this.actor.height; - this._tween(this._summaryBin, "_summaryState", State.SHOWN, + this._tween(this._summaryBin, '_summaryState', State.SHOWN, { y: 0, opacity: 255, time: ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._showSummaryCompleted, onCompleteScope: this, onCompleteParams: [withTimeout] @@ -920,10 +920,10 @@ MessageTray.prototype = { }, _hideSummary: function() { - this._tween(this._summaryBin, "_summaryState", State.HIDDEN, + this._tween(this._summaryBin, '_summaryState', State.HIDDEN, { opacity: 0, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); this._summaryNeedsToBeShown = false; }, @@ -942,11 +942,11 @@ MessageTray.prototype = { this._summaryNotificationBin.y = this.actor.height; this._summaryNotificationBin.show(); - this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN, + this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN, { y: this.actor.height - this._summaryNotificationBin.height, opacity: 255, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); if (!this._reExpandSummaryNotificationId) @@ -954,21 +954,21 @@ MessageTray.prototype = { }, _reExpandSummaryNotification: function() { - this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN, + this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN, { y: this.actor.height - this._summaryNotificationBin.height, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, _hideSummaryNotification: function() { this._summaryNotification.popIn(); - this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.HIDDEN, + this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.HIDDEN, { y: this.actor.height, opacity: 0, time: ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._hideSummaryNotificationCompleted, onCompleteScope: this }); diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 7054bdce4..300cdcc13 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -121,10 +121,10 @@ NotificationDaemon.prototype = { // kill the notification-daemon. pkill is more portable // than killall, but on Linux at least it won't match if // you pass more than 15 characters of the process name... - // However, if you use the "-f" flag to match the entire + // However, if you use the '-f' flag to match the entire // command line, it will work, but we have to be careful - // in that case that we don't match "gedit - // notification-daemon.c" or whatever... + // in that case that we don't match 'gedit + // notification-daemon.c' or whatever... let p = new Shell.Process({ args: ['pkill', '-f', '^([^ ]*/)?(notification-daemon|notify-osd)$']}); p.run(); diff --git a/js/ui/panel.js b/js/ui/panel.js index 8a28641d0..f39395a67 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -794,7 +794,7 @@ Panel.prototype = { /* center */ - let clockButton = new St.Button({ style_class: "panel-button", + let clockButton = new St.Button({ style_class: 'panel-button', toggle_mode: true, x_fill: true, y_fill: true }); @@ -881,7 +881,7 @@ Panel.prototype = { Tweener.addTween(this.actor, { y: 0, time: 0.2, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, @@ -941,7 +941,7 @@ Panel.prototype = { case 'unix': // force updates every second showSeconds = true; - clockFormat = "%s"; + clockFormat = '%s'; break; case 'custom': // force updates every second @@ -1119,7 +1119,7 @@ CalendarPopup.prototype = { Tweener.addTween(this.actor, { y: panelActor.y + panelActor.height, time: 0.2, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, @@ -1129,7 +1129,7 @@ CalendarPopup.prototype = { Tweener.addTween(this.actor, { y: panelActor.y + panelActor.height - this.actor.height, time: 0.2, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: function() { this.actor.hide(); }, onCompleteScope: this }); diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index d9cca2b27..6c54a3cc6 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -71,7 +71,7 @@ PlaceDeviceInfo.prototype = { this._mount = mount; this.name = mount.get_name(); this._lowerName = this.name.toLowerCase(); - this.id = "mount:" + mount.get_root().get_uri(); + this.id = 'mount:' + mount.get_root().get_uri(); }, iconFactory: function(size) { @@ -155,7 +155,7 @@ PlacesManager.prototype = { this._connect = new PlaceInfo('special:connect', _("Connect to..."), function (size) { - return St.TextureCache.get_default().load_icon_name("applications-internet", size); + return St.TextureCache.get_default().load_icon_name('applications-internet', size); }, function () { new Shell.Process({ args: ['nautilus-connect-server'] }).run(); @@ -168,7 +168,7 @@ PlacesManager.prototype = { try { networkApp = Shell.AppSystem.get_default().load_from_desktop_file('network-scheme.desktop'); } catch(e) { - log("Cannot create \"Network\" item, .desktop file not found or corrupt."); + log('Cannot create "Network" item, .desktop file not found or corrupt.'); } } @@ -208,7 +208,7 @@ PlacesManager.prototype = { this._volumeMonitor.connect('drive-changed', Lang.bind(this, this._updateDevices)); this._updateDevices(); - this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), ".gtk-bookmarks"]); + this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']); this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath); let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); this._bookmarkTimeoutId = 0; @@ -340,7 +340,7 @@ PlacesManager.prototype = { this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY); if (this._isDesktopHome) - this._removeById(this._defaultPlaces, "special:desktop"); + this._removeById(this._defaultPlaces, 'special:desktop'); else this._defaultPlaces.splice(this._desktopMenuIndex, 0, this._desktopMenu); diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index a0a319cf2..f2cab461c 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -51,7 +51,7 @@ CommandCompleter.prototype = { this._paths[i] = file.get_path(); this._monitors[i] = file.monitor_directory(Gio.FileMonitorFlags.NONE, null); if (this._monitors[i] != null) { - this._monitors[i].connect("changed", Lang.bind(this, this._onChanged)); + this._monitors[i].connect('changed', Lang.bind(this, this._onChanged)); } } this._paths = this._paths.filter(function(a) { @@ -132,7 +132,7 @@ CommandCompleter.prototype = { }, getCompletion: function(text) { - let common = ""; + let common = ''; let notInit = true; if (!this._valid) { this._update(0); @@ -145,7 +145,7 @@ CommandCompleter.prototype = { break; } if (k == 0) - return ""; + return ''; return s1.substr(0, k); } function _hasPrefix(s1, prefix) { @@ -372,7 +372,7 @@ RunDialog.prototype = { // We are only interested in the actual error, so parse //that out. let m = /.+\((.+)\)/.exec(e); - let errorStr = _("Execution of '%s' failed:").format(command) + "\n" + m[1]; + let errorStr = _("Execution of '%s' failed:").format(command) + '\n' + m[1]; this._errorMessage.set_text(errorStr); this._errorBox.show(); diff --git a/js/ui/search.js b/js/ui/search.js index bacf33612..cebe23273 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -40,7 +40,7 @@ SearchResultDisplay.prototype = { * The terms are useful for search match highlighting. */ renderResults: function(results, terms) { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -67,7 +67,7 @@ SearchResultDisplay.prototype = { * Returns: The number of actors visible. */ getVisibleResultCount: function() { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -79,14 +79,14 @@ SearchResultDisplay.prototype = { * available. */ selectIndex: function() { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** * Activate the currently selected search result. */ activateSelected: function() { - throw new Error("not implemented"); + throw new Error('Not implemented'); } }; @@ -127,7 +127,7 @@ SearchProvider.prototype = { * or network queries. */ getInitialResultSet: function(terms) { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -144,7 +144,7 @@ SearchProvider.prototype = { * result set, rather than possibly performing a full re-query. */ getSubsearchResultSet: function(previousResults, newTerms) { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -155,7 +155,7 @@ SearchProvider.prototype = { * properties which describe the given search result. */ getResultMeta: function(id) { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -194,7 +194,7 @@ SearchProvider.prototype = { * Called when the user chooses a given result. */ activateResult: function(id) { - throw new Error("not implemented"); + throw new Error('Not implemented'); }, /** @@ -205,7 +205,7 @@ SearchProvider.prototype = { * displaying search results for that item type. */ expandSearch: function(terms) { - throw new Error("not implemented"); + throw new Error('Not implemented'); } }; Signals.addSignalMethods(SearchProvider.prototype); @@ -238,7 +238,7 @@ SearchSystem.prototype = { }, updateSearch: function(searchString) { - searchString = searchString.replace(/^\s+/g, "").replace(/\s+$/g, ""); + searchString = searchString.replace(/^\s+/g, '').replace(/\s+$/g, ''); if (searchString == '') return null; diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 8ff743ecc..4eebb5a20 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -8,16 +8,16 @@ const Mainloop = imports.mainloop; const Main = imports.ui.main; const GnomeShellIface = { - name: "org.gnome.Shell", - methods: [{ name: "Eval", - inSignature: "s", - outSignature: "bs" + name: 'org.gnome.Shell', + methods: [{ name: 'Eval', + inSignature: 's', + outSignature: 'bs' } ], signals: [], - properties: [{ name: "OverviewActive", - signature: "b", - access: "readwrite" }] + properties: [{ name: 'OverviewActive', + signature: 'b', + access: 'readwrite' }] }; function GnomeShell() { @@ -50,7 +50,7 @@ GnomeShell.prototype = { returnValue = JSON.stringify(eval(code)); // A hack; DBus doesn't have null/undefined if (returnValue == undefined) - returnValue = ""; + returnValue = ''; success = true; } catch (e) { returnValue = JSON.stringify(e); diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index e717f70c8..ea330532e 100644 --- a/js/ui/telepathyClient.js +++ b/js/ui/telepathyClient.js @@ -19,8 +19,8 @@ const SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes const SCROLLBACK_RECENT_LENGTH = 20; const SCROLLBACK_IDLE_LENGTH = 5; -// This is GNOME Shell's implementation of the Telepathy "Client" -// interface. Specifically, the shell is a Telepathy "Observer", which +// This is GNOME Shell's implementation of the Telepathy 'Client' +// interface. Specifically, the shell is a Telepathy 'Observer', which // lets us see messages even if they belong to another app (eg, // Empathy). diff --git a/js/ui/tweener.js b/js/ui/tweener.js index 8eb358a00..f686375df 100644 --- a/js/ui/tweener.js +++ b/js/ui/tweener.js @@ -46,7 +46,7 @@ let slowDownFactor = 1.0; // Called from Main.start function init() { - let slowdownEnv = GLib.getenv("GNOME_SHELL_SLOWDOWN_FACTOR"); + let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR'); if (slowdownEnv) { let factor = parseFloat(slowdownEnv); if (!isNaN(factor) && factor > 0.0) @@ -190,7 +190,7 @@ function registerSpecialPropertySplitter(name, splitFunction, parameters) { } -// The "FrameTicker" object is an object used to feed new frames to +// The 'FrameTicker' object is an object used to feed new frames to // Tweener so it can update values and redraw. The default frame // ticker for Tweener just uses a simple timeout at a fixed frame rate // and has no idea of "catching up" by dropping frames. diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 2e497de0b..7232fc9e8 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -103,7 +103,7 @@ WindowManager.prototype = { x: xDest, y: 0, time: WINDOW_ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._minimizeWindowDone, onCompleteScope: this, onCompleteParams: [shellwm, actor], @@ -160,7 +160,7 @@ WindowManager.prototype = { Tweener.addTween(actor, { opacity: 255, time: WINDOW_ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._mapWindowDone, onCompleteScope: this, onCompleteParams: [shellwm, actor], @@ -258,7 +258,7 @@ WindowManager.prototype = { { x: xDest, y: yDest, time: WINDOW_ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: this._switchWorkspaceDone, onCompleteScope: this, onCompleteParams: [shellwm] @@ -267,7 +267,7 @@ WindowManager.prototype = { { x: 0, y: 0, time: WINDOW_ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); }, @@ -306,7 +306,7 @@ WindowManager.prototype = { _showWorkspaceSwitcher : function(shellwm, binding, window, backwards) { /* We don't support this kind of layout */ - if (binding == "switch_to_workspace_up" || binding == "switch_to_workspace_down") + if (binding == 'switch_to_workspace_up' || binding == 'switch_to_workspace_down') return; if (global.screen.n_workspaces == 1) @@ -315,11 +315,11 @@ WindowManager.prototype = { if (this._workspaceSwitcherPopup == null) this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); - if (binding == "switch_to_workspace_left") { + if (binding == 'switch_to_workspace_left') { this.actionMoveWorkspaceLeft(); } - if (binding == "switch_to_workspace_right") { + if (binding == 'switch_to_workspace_right') { this.actionMoveWorkspaceRight(); } }, diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 014df8c6f..21bd5b637 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -325,7 +325,7 @@ DesktopClone.prototype = { Tweener.addTween(this._desktop, { opacity: 255, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad" }); + transition: 'easeOutQuad' }); } }, @@ -339,7 +339,7 @@ DesktopClone.prototype = { Tweener.addTween(this._desktop, { opacity: 0, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: Lang.bind(this, function() { this._desktop.hide(); @@ -374,7 +374,7 @@ WindowOverlay.prototype = { this._windowClone = windowClone; this._parentActor = parentActor; - let title = new St.Label({ style_class: "window-caption", + let title = new St.Label({ style_class: 'window-caption', text: metaWindow.title }); title.clutter_text.ellipsize = Pango.EllipsizeMode.END; title._spacing = 0; @@ -384,7 +384,7 @@ WindowOverlay.prototype = { this.title.text = w.title; })); - let button = new St.Button({ style_class: "window-close" }); + let button = new St.Button({ style_class: 'window-close' }); button._overlap = 0; this._idleToggleCloseId = 0; @@ -439,7 +439,7 @@ WindowOverlay.prototype = { Tweener.addTween(this.title, { opacity: 255, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad" }); + transition: 'easeOutQuad' }); }, chromeWidth: function () { @@ -1105,7 +1105,7 @@ Workspace.prototype = { Tweener.addTween(clone.actor, { opacity: 255, time: Overview.ANIMATION_TIME, - transition: "easeInQuad" + transition: 'easeInQuad' }); } @@ -1116,7 +1116,7 @@ Workspace.prototype = { scale_y: scale, workspace_relative: workspaceZooming ? this : null, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: Lang.bind(this, function() { this._fadeInWindowOverlay(clone, overlay); }) @@ -1370,7 +1370,7 @@ Workspace.prototype = { workspace_relative: this, time: Overview.ANIMATION_TIME, opacity: 255, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); } else { // The window is hidden, make it shrink and fade it out @@ -1380,7 +1380,7 @@ Workspace.prototype = { opacity: 0, workspace_relative: this, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); } } @@ -1403,7 +1403,7 @@ Workspace.prototype = { scale_x: this.scale, scale_y: this.scale, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: Lang.bind(this, this._fadeInAllOverlays) }); }, @@ -1423,7 +1423,7 @@ Workspace.prototype = { scale_x: this.scale, scale_y: this.scale, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); this._visible = true; @@ -1445,7 +1445,7 @@ Workspace.prototype = { scale_x: this.scale, scale_y: this.scale, time: Overview.ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: onComplete }); diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js index cd41d8379..20db9ef6e 100644 --- a/js/ui/workspaceSwitcherPopup.js +++ b/js/ui/workspaceSwitcherPopup.js @@ -30,8 +30,8 @@ WorkspaceSwitcherPopup.prototype = { this._scaleWidth = global.screen_width / global.screen_height; - this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" }); - this._list = new St.BoxLayout({ style_class: "workspace-switcher" }); + this._container = new St.BoxLayout({ style_class: 'workspace-switcher-container' }); + this._list = new St.BoxLayout({ style_class: 'workspace-switcher' }); this._container.add(this._list); @@ -73,7 +73,7 @@ WorkspaceSwitcherPopup.prototype = { _show : function() { Tweener.addTween(this._container, { opacity: 255, time: ANIMATION_TIME, - transition: "easeOutQuad" + transition: 'easeOutQuad' }); this._position(); this.actor.show(); @@ -92,7 +92,7 @@ WorkspaceSwitcherPopup.prototype = { this._timeoutId = 0; Tweener.addTween(this._container, { opacity: 0.0, time: ANIMATION_TIME, - transition: "easeOutQuad", + transition: 'easeOutQuad', onComplete: function() { this.actor.hide(); }, onCompleteScope: this }); diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 7ba13b9fd..c849c5f52 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -43,7 +43,7 @@ function GenericWorkspacesView(width, height, x, y, workspaces) { GenericWorkspacesView.prototype = { _init: function(width, height, x, y, workspaces) { - this.actor = new St.Bin({ style_class: "workspaces" }); + this.actor = new St.Bin({ style_class: 'workspaces' }); this._actor = new Clutter.Group(); this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); @@ -227,7 +227,7 @@ GenericWorkspacesView.prototype = { }, createControllerBar: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, canAddWorkspace: function() { @@ -244,7 +244,7 @@ GenericWorkspacesView.prototype = { }, _getWorkspaceIndexToRemove: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, canRemoveWorkspace: function() { @@ -263,19 +263,19 @@ GenericWorkspacesView.prototype = { }, updateWorkspaces: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, _transitionWorkspaces: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, _computeWorkspacePositions: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, _activeWorkspaceChanged: function() { - throw new Error("Not implemented"); + throw new Error('Not implemented'); }, _acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) {