-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gregor Herdmann
committed
Apr 10, 2017
1 parent
56db472
commit b12240c
Showing
8 changed files
with
879 additions
and
719 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
app/script/system_notification/PermissionStatusState.coffee
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2017 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.system_notification = z.system_notification || {}; | ||
|
||
// https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state | ||
z.system_notification.PermissionStatusState = { | ||
DEFAULT: 'default', | ||
DENIED: 'denied', | ||
GRANTED: 'granted', | ||
IGNORED: 'ignored', | ||
PROMPT: 'prompt', | ||
UNSUPPORTED: 'unsupported', | ||
}; |
38 changes: 0 additions & 38 deletions
38
app/script/system_notification/SystemNotificationError.coffee
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2017 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.system_notification = z.system_notification || {}; | ||
|
||
z.system_notification.SystemNotificationError = class SystemNotificationError extends Error { | ||
constructor(type) { | ||
super(); | ||
|
||
this.name = this.constructor.name; | ||
this.stack = (new Error()).stack; | ||
this.type = type || z.cryptography.CryptographyError.TYPE.UNKNOWN; | ||
|
||
switch (this.type) { | ||
case z.system_notification.SystemNotificationError.TYPE.HIDE_NOTIFICATION: | ||
this.message = 'Do not show notification for this message'; | ||
break; | ||
default: | ||
this.message = 'Unknown SystemNotificationError'; | ||
} | ||
} | ||
|
||
static get TYPE() { | ||
return { | ||
HIDE_NOTIFICATION: 'z.system_notification.SystemNotificationError.TYPE.HIDE_NOTIFICATION', | ||
UNKNOWN: 'z.system_notification.SystemNotificationError.TYPE.UNKNOWN', | ||
}; | ||
} | ||
}; |
27 changes: 0 additions & 27 deletions
27
app/script/system_notification/SystemNotificationPreference.coffee
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
app/script/system_notification/SystemNotificationPreference.js
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2017 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.system_notification = z.system_notification || {}; | ||
|
||
// Enum of notification preferences. | ||
z.system_notification.SystemNotificationPreference = { | ||
NONE: 'none', | ||
OBFUSCATE: 'obfuscate', | ||
OBFUSCATE_MESSAGE: 'obfuscate-message', | ||
ON: 'on', | ||
}; |
Oops, something went wrong.