diff --git a/EXTENSIONS.GNOME.ORG.md b/EXTENSIONS.GNOME.ORG.md index f9c7c5b..9a6a440 100644 --- a/EXTENSIONS.GNOME.ORG.md +++ b/EXTENSIONS.GNOME.ORG.md @@ -1,5 +1,7 @@ # corona-tracker +This file contains in one place all the required data of the GNOME Shell extension for extensions.gnome.org website to make perfect control of them and keep it in every aspect the up-to-date extraction of main README document. + ## Homepage https://github.com/lachhebo/corona-tracker @@ -35,8 +37,9 @@ GNU - General Public License v3+: https://www.gnu.org/licenses/gpl-3.0.en.html ----- MORE DETAILS ----- -https://github.com/lachhebo/corona-tracker/blob/master/README.md +GENERAL INFO: https://github.com/lachhebo/corona-tracker +RELEASE NOTES: https://github.com/lachhebo/corona-tracker/releases ``` --- -[^1]: HighRes official GNOME Shell extension like puzzle in GNOME HIG color palette '**Green 5**' color *(#3d3846)* with the extension's GNOME Panel icon in GNOME HIG color palette '**Dark 3**' color *(#3d3846)* rendered in 256x256px with 16px margin. \ No newline at end of file +[^1]: HighRes official GNOME Shell extension like puzzle in GNOME HIG color palette '**Green 5**' color *(#3d3846)* with the extension's GNOME Panel icon in GNOME HIG color palette '**Light 3**' color *(#deddda)* rendered in 256x256px with 16px margin. \ No newline at end of file diff --git a/extension.js b/extension.js index 955e8e0..d5cfe13 100644 --- a/extension.js +++ b/extension.js @@ -1,9 +1,9 @@ // Imports + const St = imports.gi.St; const Gio = imports.gi.Gio; // Just for custom icon const Main = imports.ui.main; -const Tweener = imports.ui.tweener; - +const Tweener = imports.tweener.tweener; const Lang = imports.lang; const PanelMenu = imports.ui.panelMenu; @@ -29,7 +29,6 @@ const LOOP_UPDATE_TIME = 60*60*12; // every 12 hour, the result will be updated // Functions - const CoronaItem = new Lang.Class({ Name: 'CoronaItem', Extends: PopupMenu.PopupBaseMenuItem, @@ -38,12 +37,11 @@ const CoronaItem = new Lang.Class({ this.parent(); this.connect('activate', function () { }); - this._label = label; - this._value = value; + this._label = new St.Label({text: label}); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38. + this._value = new St.Label({text: value}, {x_align: St.Align.END}); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38. - - this.actor.add(new St.Label({text: label})); - this.actor.add(new St.Label({text: value}), {align: St.Align.END}); + this.actor.add(this._label); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38. + this.actor.add(this._value); // Restructured as StBoxLayout's child meta was deprecated in 3.36 and removed in 3.38. if(type){ this.actor.add(new St.Icon({ icon_name: type, icon_size : 12})); // COVID-19 panel icons } @@ -62,9 +60,6 @@ const CoronaItem = new Lang.Class({ }, }); - - - const CoronaMenuButton = new Lang.Class({ Name: 'CoronaMenuButton', Extends: PanelMenu.Button, @@ -108,12 +103,10 @@ const CoronaMenuButton = new Lang.Class({ }, - _fetchSettings: function () { COUNTRY_NAME = this._settings.get_string(Prefs.Fields.COUNTRY_NAME); }, - _onSettingsChange: function () { var that = this; @@ -123,7 +116,6 @@ const CoronaMenuButton = new Lang.Class({ }, - _get_soup_session: function() { if(_SESSION === null) { _SESSION = new Soup.Session(); @@ -136,7 +128,7 @@ const CoronaMenuButton = new Lang.Class({ } return _SESSION; - }, + }, _queryAPI: function(){ let request; @@ -151,7 +143,6 @@ const CoronaMenuButton = new Lang.Class({ this._updateDisplay(result); }, - _updateDisplay: function(result){ this.menu.removeAll(); let section = new PopupMenu.PopupMenuSection("COVID"); @@ -179,7 +170,6 @@ const CoronaMenuButton = new Lang.Class({ let death_proportion = new CoronaItem(null, 'Deaths / 1M pop:', result.deathsPerOneMillion.toLocaleString()); let separator3 = new PopupMenu.PopupSeparatorMenuItem(); - total_case.setMainSensor(); section.addMenuItem(total_case); proportion.setMainSensor(); @@ -229,7 +219,6 @@ const CoronaMenuButton = new Lang.Class({ }, - _openSettings: function () { Util.spawn([ "gnome-shell-extension-prefs", @@ -237,11 +226,8 @@ const CoronaMenuButton = new Lang.Class({ ]); }, - }); - - let coronaMenu; function init() { @@ -252,8 +238,7 @@ function enable() { Main.panel.addToStatusArea('coronaMenu', coronaMenu, 1, 'right'); } - function disable() { coronaMenu.destroy(); coronaMenu = null; -} +} \ No newline at end of file diff --git a/metadata.json b/metadata.json index cbaf8e8..1c05170 100644 --- a/metadata.json +++ b/metadata.json @@ -1,8 +1,14 @@ { - "name": "corona-tracker", - "uuid": "corona-tracker@lachhebo.github.io", "description": "A GNOME Shell extension (GNOME Panel applet) to notify you every day with information about the COVID-19 virus spread.", + "name": "corona-tracker", + "shell-version": [ + "3.30", + "3.34", + "3.32", + "3.36", + "3.38" + ], "url": "https://github.com/lachhebo/corona-tracker", - "version": 8, - "shell-version": ["3.30", "3.32", "3.34", "3.36", "3.38"] -} + "uuid": "corona-tracker@lachhebo.github.io", + "version": 10 +} \ No newline at end of file diff --git a/resources/extensions.gnome.org.png b/resources/extensions.gnome.org.png index 64c8c9f..b82a149 100644 Binary files a/resources/extensions.gnome.org.png and b/resources/extensions.gnome.org.png differ