diff --git a/randomwallpaper@iflow.space/elements.js b/randomwallpaper@iflow.space/elements.js index 4558e5e..8217b8f 100644 --- a/randomwallpaper@iflow.space/elements.js +++ b/randomwallpaper@iflow.space/elements.js @@ -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, diff --git a/randomwallpaper@iflow.space/extension.js b/randomwallpaper@iflow.space/extension.js index 6344f7d..bf577bd 100644 --- a/randomwallpaper@iflow.space/extension.js +++ b/randomwallpaper@iflow.space/extension.js @@ -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(); -} diff --git a/randomwallpaper@iflow.space/history.js b/randomwallpaper@iflow.space/history.js index ab7a151..155f76b 100644 --- a/randomwallpaper@iflow.space/history.js +++ b/randomwallpaper@iflow.space/history.js @@ -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, diff --git a/randomwallpaper@iflow.space/jsonpath/jsonpath.js b/randomwallpaper@iflow.space/jsonpath/jsonpath.js index 81c75a4..2f1d0bd 100644 --- a/randomwallpaper@iflow.space/jsonpath/jsonpath.js +++ b/randomwallpaper@iflow.space/jsonpath/jsonpath.js @@ -1,4 +1,4 @@ -let JSONPathParser = function () { +var JSONPathParser = function () { /** * Access a simple json path expression of an object. diff --git a/randomwallpaper@iflow.space/logger.js b/randomwallpaper@iflow.space/logger.js index 9481ac9..3187c3c 100644 --- a/randomwallpaper@iflow.space/logger.js +++ b/randomwallpaper@iflow.space/logger.js @@ -1,6 +1,6 @@ const Lang = imports.lang; -let Logger = new Lang.Class({ +var Logger = new Lang.Class({ Name: "Logger", _prefix: null, _callingClass: null, diff --git a/randomwallpaper@iflow.space/prefs.js b/randomwallpaper@iflow.space/prefs.js index b466ffc..91d7e80 100644 --- a/randomwallpaper@iflow.space/prefs.js +++ b/randomwallpaper@iflow.space/prefs.js @@ -32,7 +32,7 @@ function buildPrefsWidget() { } /* UI Setup */ -const RandomWallpaperSettings = new Lang.Class({ +var RandomWallpaperSettings = new Lang.Class({ Name: 'RandomWallpaper.Settings', logger: null, diff --git a/randomwallpaper@iflow.space/settings.js b/randomwallpaper@iflow.space/settings.js index 84fe953..9db69eb 100644 --- a/randomwallpaper@iflow.space/settings.js +++ b/randomwallpaper@iflow.space/settings.js @@ -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, diff --git a/randomwallpaper@iflow.space/sourceAdapter.js b/randomwallpaper@iflow.space/sourceAdapter.js index ad80e7a..3d364e4 100644 --- a/randomwallpaper@iflow.space/sourceAdapter.js +++ b/randomwallpaper@iflow.space/sourceAdapter.js @@ -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, diff --git a/randomwallpaper@iflow.space/timer.js b/randomwallpaper@iflow.space/timer.js index c822261..a2d243e 100644 --- a/randomwallpaper@iflow.space/timer.js +++ b/randomwallpaper@iflow.space/timer.js @@ -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, diff --git a/randomwallpaper@iflow.space/wallpaperController.js b/randomwallpaper@iflow.space/wallpaperController.js index 408a72c..0298d18 100644 --- a/randomwallpaper@iflow.space/wallpaperController.js +++ b/randomwallpaper@iflow.space/wallpaperController.js @@ -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,