-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from manexim/open-corresponding-tab-when-clicki…
…ng-a-notification Open corresponding tab when clicking a notification
- Loading branch information
Showing
4 changed files
with
89 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,10 @@ | |
* Authored by: Marius Meisenzahl <[email protected]> | ||
*/ | ||
|
||
public class Services.Messengers { | ||
public class Services.Messengers : Object { | ||
private static Messengers instance; | ||
private Models.Messenger[] _data; | ||
private Array<Models.Messenger> _data; | ||
private string _visible; | ||
|
||
public static Messengers get_default () { | ||
if (instance == null) { | ||
|
@@ -31,32 +32,59 @@ public class Services.Messengers { | |
return instance; | ||
} | ||
|
||
public Models.Messenger[] data { | ||
public Array<Models.Messenger> data { | ||
get { | ||
return _data; | ||
} | ||
} | ||
|
||
public string visible { | ||
get { | ||
return _visible; | ||
} | ||
set { | ||
foreach (var m in _data.data) { | ||
if (m.id == value) { | ||
_visible = value; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
private Messengers () { | ||
_data = new Models.Messenger[4]; | ||
_data[0] = new Models.Messenger (); | ||
_data[0].id = "com.messenger"; | ||
_data[0].name = "Messenger"; | ||
_data[0].url = "https://www.messenger.com/"; | ||
|
||
_data[1] = new Models.Messenger (); | ||
_data[1].id = "com.slack"; | ||
_data[1].name = "Slack"; | ||
_data[1].url = "https://slack.com/signin/"; | ||
|
||
_data[2] = new Models.Messenger (); | ||
_data[2].id = "org.telegram.web"; | ||
_data[2].name = "Telegram"; | ||
_data[2].url = "https://web.telegram.org/"; | ||
|
||
_data[3] = new Models.Messenger (); | ||
_data[3].id = "com.whatsapp.web"; | ||
_data[3].name = "WhatsApp"; | ||
_data[3].url = "https://web.whatsapp.com/"; | ||
_data = new Array<Models.Messenger> (); | ||
|
||
{ | ||
var messenger = new Models.Messenger (); | ||
messenger.id = "com.messenger"; | ||
messenger.name = "Messenger"; | ||
messenger.url = "https://www.messenger.com/"; | ||
_data.append_val (messenger); | ||
} | ||
|
||
{ | ||
var messenger = new Models.Messenger (); | ||
messenger.id = "com.slack"; | ||
messenger.name = "Slack"; | ||
messenger.url = "https://slack.com/signin/"; | ||
_data.append_val (messenger); | ||
} | ||
|
||
{ | ||
var messenger = new Models.Messenger (); | ||
messenger.id = "org.telegram.web"; | ||
messenger.name = "Telegram"; | ||
messenger.url = "https://web.telegram.org/"; | ||
_data.append_val (messenger); | ||
} | ||
|
||
{ | ||
var messenger = new Models.Messenger (); | ||
messenger.id = "com.whatsapp.web"; | ||
messenger.name = "WhatsApp"; | ||
messenger.url = "https://web.whatsapp.com/"; | ||
_data.append_val (messenger); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters