[gnome-shell-extensions/wip/fmuellner/js-cleanup: 14/20] cleanup: Fix some coding style issues



commit d3bbeb1b0c8467be8722110f31aecdfe7df4119c
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 27 17:37:31 2017 +0200

    cleanup: Fix some coding style issues
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30

 extensions/alternate-tab/prefs.js           |  2 +-
 extensions/example/extension.js             |  2 +-
 extensions/places-menu/placeDisplay.js      | 12 ++++++------
 extensions/window-list/extension.js         |  3 +--
 extensions/workspace-indicator/extension.js | 10 +++++-----
 5 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js
index 864ea36..2828c4f 100644
--- a/extensions/alternate-tab/prefs.js
+++ b/extensions/alternate-tab/prefs.js
@@ -27,7 +27,7 @@ const AltTabSettingsWidget = new GObject.Class({
     GTypeName: 'AltTabSettingsWidget',
     Extends: Gtk.Grid,
 
-    _init : function(params) {
+    _init: function(params) {
         this.parent(params);
         this.margin = 24;
         this.row_spacing = 6;
diff --git a/extensions/example/extension.js b/extensions/example/extension.js
index d2de6f4..752b373 100644
--- a/extensions/example/extension.js
+++ b/extensions/example/extension.js
@@ -20,7 +20,7 @@ function _showHello() {
     let monitor = Main.layoutManager.primaryMonitor;
     global.stage.add_actor(label);
     label.set_position(Math.floor (monitor.width / 2 - label.width / 2), Math.floor(monitor.height / 2 - 
label.height / 2));
-    Mainloop.timeout_add(3000, function () { label.destroy(); });
+    Mainloop.timeout_add(3000, function() { label.destroy(); });
 }
 
 // Put your extension initialization code here
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
index 34c594e..bf7372a 100644
--- a/extensions/places-menu/placeDisplay.js
+++ b/extensions/places-menu/placeDisplay.js
@@ -290,11 +290,11 @@ var PlacesManager = new Lang.Class({
 
         if (this._bookmarksFile) {
             this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
-            this._monitor.connect('changed', Lang.bind(this, function () {
+            this._monitor.connect('changed', Lang.bind(this, function() {
                 if (this._bookmarkTimeoutId > 0)
                     return;
                 /* Defensive event compression */
-                this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function () {
+                this._bookmarkTimeoutId = Mainloop.timeout_add(100, Lang.bind(this, function() {
                     this._bookmarkTimeoutId = 0;
                     this._reloadBookmarks();
                     return false;
@@ -333,7 +333,7 @@ var PlacesManager = new Lang.Class({
     },
 
     _updateSpecials: function() {
-        this._places.special.forEach(function (p) { p.destroy(); });
+        this._places.special.forEach(function(p) { p.destroy(); });
         this._places.special = [];
 
         let homePath = GLib.get_home_dir();
@@ -375,9 +375,9 @@ var PlacesManager = new Lang.Class({
         let networkMounts = [];
         let networkVolumes = [];
 
-        this._places.devices.forEach(function (p) { p.destroy(); });
+        this._places.devices.forEach(function(p) { p.destroy(); });
         this._places.devices = [];
-        this._places.network.forEach(function (p) { p.destroy(); });
+        this._places.network.forEach(function(p) { p.destroy(); });
         this._places.network = [];
 
         /* Add standard places */
@@ -542,7 +542,7 @@ var PlacesManager = new Lang.Class({
         this._places[kind].push(volItem);
     },
 
-    get: function (kind) {
+    get: function(kind) {
         return this._places[kind];
     }
 });
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index f01b872..b005155 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -573,7 +573,6 @@ const AppButton = new Lang.Class({
         });
     },
 
-
     getWindowList: function() {
         return this.app.get_windows().filter(Lang.bind(this, function(win) {
             return this._isWindowVisible(win);
@@ -674,7 +673,7 @@ const WorkspaceIndicator = new Lang.Class({
     Name: 'WindowList.WorkspaceIndicator',
     Extends: PanelMenu.Button,
 
-    _init: function(){
+    _init: function() {
         this.parent(0.0, _("Workspace Indicator"), true);
         this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM));
         this.actor.add_style_class_name('window-list-workspace-indicator');
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index af0b7ca..37a3a08 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -26,7 +26,7 @@ const WorkspaceIndicator = new Lang.Class({
     Name: 'WorkspaceIndicator.WorkspaceIndicator',
     Extends: PanelMenu.Button,
 
-    _init: function(){
+    _init: function() {
        this.parent(0.0, _("Workspace Indicator"));
 
        this._currentWorkspace = global.screen.get_active_workspace().index();
@@ -74,7 +74,7 @@ const WorkspaceIndicator = new Lang.Class({
        this.statusLabel.set_text(this._labelText());
     },
 
-    _labelText : function(workspaceIndex) {
+    _labelText: function(workspaceIndex) {
        if(workspaceIndex == undefined) {
            workspaceIndex = this._currentWorkspace;
            return (workspaceIndex + 1).toString();
@@ -82,7 +82,7 @@ const WorkspaceIndicator = new Lang.Class({
        return Meta.prefs_get_workspace_name(workspaceIndex);
     },
 
-    _createWorkspacesSection : function() {
+    _createWorkspacesSection: function() {
        this._workspaceSection.removeAll();
        this.workspacesItems = [];
        this._currentWorkspace = global.screen.get_active_workspace().index();
@@ -105,14 +105,14 @@ const WorkspaceIndicator = new Lang.Class({
        this.statusLabel.set_text(this._labelText());
     },
 
-    _activate : function (index) {
+    _activate: function(index) {
        if(index >= 0 && index <  global.screen.n_workspaces) {
            let metaWorkspace = global.screen.get_workspace_by_index(index);
            metaWorkspace.activate(global.get_current_time());
        }
     },
 
-    _onScrollEvent : function(actor, event) {
+    _onScrollEvent: function(actor, event) {
        let direction = event.get_scroll_direction();
        let diff = 0;
        if (direction == Clutter.ScrollDirection.DOWN) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]