change exported objects to var instead of const or let to be ES6 compliant (gnome shell warning)

This commit is contained in:
Wolfgang Rumpler 2018-01-16 19:14:18 +01:00
parent d03caa0246
commit 39f681bd87
10 changed files with 33 additions and 38 deletions

View file

@ -14,7 +14,7 @@ const Self = imports.misc.extensionUtils.getCurrentExtension();
const LoggerModule = Self.imports.logger;
const Timer = Self.imports.timer;
const HistoryElement = new Lang.Class({
var HistoryElement = new Lang.Class({
Name: 'HistoryElement',
Extends: PopupMenu.PopupSubMenuMenuItem,
logger: null,
@ -150,7 +150,7 @@ const HistoryElement = new Lang.Class({
}
});
const CurrentImageElement = new Lang.Class({
var CurrentImageElement = new Lang.Class({
Name: 'CurrentImageElement',
Extends: HistoryElement,
@ -170,7 +170,7 @@ const CurrentImageElement = new Lang.Class({
*
* @type {Lang.Class}
*/
const NewWallpaperElement = new Lang.Class({
var NewWallpaperElement = new Lang.Class({
Name: 'NewWallpaperElement',
Extends: PopupMenu.PopupBaseMenuItem,
@ -221,7 +221,7 @@ const NewWallpaperElement = new Lang.Class({
}
});
const StatusElement = new Lang.Class({
var StatusElement = new Lang.Class({
Name: 'StatusElement',
Extends: St.Icon,

View file

@ -24,15 +24,28 @@ const Convenience = Self.imports.convenience;
let wallpaperController;
let extensionMeta;
let panelEntry;
function init(metaData) {
extensionMeta = metaData;
wallpaperController = new WallpaperController.WallpaperController(metaData);
}
let panelEntry;
function enable() {
// enable Extension
// UI
panelEntry = new RandomWallpaperEntry(0, "Random wallpaper");
let RandomWallpaperEntry = new Lang.Class({
// add to panel
Main.panel.addToStatusArea("random-wallpaper-menu", panelEntry);
}
function disable() {
// disable Extension
panelEntry.destroy();
}
var RandomWallpaperEntry = new Lang.Class({
Extends: PanelMenu.Button,
Name: "RandomWallpaperEntry",
logger: null,
@ -80,7 +93,6 @@ let RandomWallpaperEntry = new Lang.Class({
/*
add eventlistener
*/
wallpaperController.registerStartLoadingHook(this.statusIcon.startLoading.bind(this.statusIcon));
wallpaperController.registerStopLoadingHook(this.statusIcon.stopLoading.bind(this.statusIcon));
wallpaperController.registerStopLoadingHook(this.setHistoryList.bind(this));
@ -168,8 +180,6 @@ let RandomWallpaperEntry = new Lang.Class({
this.historySection.addMenuItem(tmp);
}
let _this = this;
function onLeave(actor) {
wallpaperController.resetWallpaper();
}
@ -196,18 +206,3 @@ let RandomWallpaperEntry = new Lang.Class({
},
});
function enable() {
// Extension enabled
// UI
panelEntry = new RandomWallpaperEntry(0, "Random wallpaper");
// add to panel
Main.panel.addToStatusArea("random-wallpaper-menu", panelEntry);
}
function disable() {
// Extension disabled
panelEntry.destroy();
}

View file

@ -9,7 +9,7 @@ const Prefs = Self.imports.settings;
const LoggerModule = Self.imports.logger;
let HistoryEntry = new Lang.Class({
var HistoryEntry = new Lang.Class({
Name: "HistoryEntry",
timestamp: null,
id: null,
@ -29,7 +29,7 @@ let HistoryEntry = new Lang.Class({
},
});
let HistoryController = new Lang.Class({
var HistoryController = new Lang.Class({
Name: "HistoryController",
_settings: null,
_wallpaperlocation: null,

View file

@ -1,4 +1,4 @@
let JSONPathParser = function () {
var JSONPathParser = function () {
/**
* Access a simple json path expression of an object.

View file

@ -1,6 +1,6 @@
const Lang = imports.lang;
let Logger = new Lang.Class({
var Logger = new Lang.Class({
Name: "Logger",
_prefix: null,
_callingClass: null,

View file

@ -32,7 +32,7 @@ function buildPrefsWidget() {
}
/* UI Setup */
const RandomWallpaperSettings = new Lang.Class({
var RandomWallpaperSettings = new Lang.Class({
Name: 'RandomWallpaper.Settings',
logger: null,

View file

@ -5,7 +5,7 @@ const Gio = imports.gi.Gio;
const Self = imports.misc.extensionUtils.getCurrentExtension();
const Convenience = Self.imports.convenience;
let Settings = new Lang.Class({
var Settings = new Lang.Class({
Name: "Settings",
_settings: null,

View file

@ -16,7 +16,7 @@ const HistoryModule = Self.imports.history;
const LoggerModule = Self.imports.logger;
const JSONPath = Self.imports.jsonpath.jsonpath;
let BaseAdapter = new Lang.Class({
var BaseAdapter = new Lang.Class({
Name: "BaseAdapter",
logger: null,
@ -45,7 +45,7 @@ let BaseAdapter = new Lang.Class({
});
let DesktopperAdapter = new Lang.Class({
var DesktopperAdapter = new Lang.Class({
Name: "DesktopperAdapter",
Extends: BaseAdapter,
@ -85,7 +85,7 @@ let DesktopperAdapter = new Lang.Class({
}
});
let UnsplashAdapter = new Lang.Class({
var UnsplashAdapter = new Lang.Class({
Name: "UnsplashAdapter",
Extends: BaseAdapter,
@ -177,7 +177,7 @@ let UnsplashAdapter = new Lang.Class({
}
});
let WallheavenAdapter = new Lang.Class({
var WallheavenAdapter = new Lang.Class({
Name: "WallheavenAdapter",
Extends: BaseAdapter,
_settings: null,
@ -280,7 +280,7 @@ let WallheavenAdapter = new Lang.Class({
}
});
let GenericJsonAdapter = new Lang.Class({
var GenericJsonAdapter = new Lang.Class({
Name: "GenericJsonAdapter",
Extends: BaseAdapter,

View file

@ -7,7 +7,7 @@ const Prefs = Self.imports.settings;
let _afTimerInstance = null;
// Singleton implementation of _AFTimer
let AFTimer = function() {
var AFTimer = function() {
if (!_afTimerInstance) {
_afTimerInstance = new _AFTimer();
}
@ -20,7 +20,7 @@ let AFTimer = function() {
* TODO: find way to store elapsed time on shutdown/logout/gnome-shell-restart/etc.
* @type {Lang}
*/
let _AFTimer = new Lang.Class({
var _AFTimer = new Lang.Class({
Name: 'AFTimer',
_timeout: null,

View file

@ -18,7 +18,7 @@ const HistoryModule = Self.imports.history;
const LoggerModule = Self.imports.logger;
let WallpaperController = new Lang.Class({
var WallpaperController = new Lang.Class({
Name: "WallpaperController",
extensionMeta: null,
logger: null,