Skip to content

Commit

Permalink
Improving a bit more the notifications by adding the full text and no…
Browse files Browse the repository at this point in the history
…t using jquery (using document.getElementById)
  • Loading branch information
IsmaelMartinez committed Oct 15, 2018
1 parent 02c8649 commit 0f79c9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
7 changes: 0 additions & 7 deletions app/lib/browser/native-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ exports = module.exports = ({ ipc, iconPath }) => {
body: this.options.body,
icon: icon.toDataURL()
});
// ipc.send('notification-shown',{
// title: this.title,
// options: {
// body: this.options.body,
// icon: icon.toDataURL()
// }
// });
notification.onclick = () => {
ipc.send('nativeNotificationClick');
};
Expand Down
7 changes: 3 additions & 4 deletions app/lib/browser/tray-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ exports = module.exports = ({ ipc, iconPath }) => {
console.log('notifications');
});
ipc.on('page-title', () => {
//console.log();
if (typeof angular === 'undefined') {
return;
}
var element = angular.element(document.documentElement).controller();
// console.log("document.documentElement", document.documentElement);
if (!element) {
return;
}
Expand All @@ -58,8 +56,9 @@ exports = module.exports = ({ ipc, iconPath }) => {

if (lastCount !== count) {
lastCount = count;
let toast = $.find('#toast-container > div > div > div.toast-message > p.title.app-max-2-lines-base')[0];
let innerText = (toast) ? toast.innerText : ""
let toast = document.getElementById('toast-container');
console.log('showing toast message');
let innerText = (toast) ? toast.innerText.replace(/(\r\n|\n|\r)/gm," ") : ""

buildIcon({ count, icon: nativeImage.createFromPath(iconPath) }).then(
icon => {
Expand Down
3 changes: 2 additions & 1 deletion app/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ app.on('ready', () => {

ipcMain.on('notifications', async (e, msg) => {
if (msg.count>0){
const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? "Notification from '<i>" + msg.text + "</i>'" : "");
const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? " <i>" + msg.text + "</i> " : "");
const notification = new NativeNotification(
"Microsoft Teams",
{
Expand All @@ -88,6 +88,7 @@ app.on('ready', () => {
});
if (notification.show !== undefined) {
notification.show();
notification.on('click', () => alert('this'));
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "0.1.0",
"version": "0.1.1",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/JamieMagee/teams-for-linux",
"keywords": [
Expand Down

0 comments on commit 0f79c9a

Please sign in to comment.