Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18789309
D9525.id22829.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D9525.id22829.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -45,7 +45,7 @@
'rsrc/css/application/config/config-template.css' => '25d446d6',
'rsrc/css/application/config/setup-issue.css' => '69e640e7',
'rsrc/css/application/conpherence/menu.css' => 'e1e0fdf1',
- 'rsrc/css/application/conpherence/message-pane.css' => '11a393ca',
+ 'rsrc/css/application/conpherence/message-pane.css' => 'eb300456',
'rsrc/css/application/conpherence/notification.css' => '04a6e10a',
'rsrc/css/application/conpherence/update.css' => '1099a660',
'rsrc/css/application/conpherence/widget-pane.css' => 'bf275a6c',
@@ -135,7 +135,7 @@
'rsrc/css/phui/phui-list.css' => '43ed2d93',
'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec',
'rsrc/css/phui/phui-object-item-list-view.css' => '46e12abc',
- 'rsrc/css/phui/phui-pinboard-view.css' => '874c22f9',
+ 'rsrc/css/phui/phui-pinboard-view.css' => '32e8e1a9',
'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
'rsrc/css/phui/phui-spacing.css' => '042804d6',
@@ -340,7 +340,7 @@
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '938aed89',
'rsrc/js/application/conpherence/behavior-menu.js' => '7ee23816',
- 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'd83a949c',
+ 'rsrc/js/application/conpherence/behavior-pontificate.js' => '3f8f3753',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90',
'rsrc/js/application/countdown/timer.js' => '361e3ed3',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
@@ -500,7 +500,7 @@
'changeset-view-manager' => 'db09a523',
'config-options-css' => '7fedf08b',
'conpherence-menu-css' => 'e1e0fdf1',
- 'conpherence-message-pane-css' => '11a393ca',
+ 'conpherence-message-pane-css' => 'eb300456',
'conpherence-notification-css' => '04a6e10a',
'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => 'bf275a6c',
@@ -540,7 +540,7 @@
'javelin-behavior-boards-filter' => '22f113af',
'javelin-behavior-config-reorder-fields' => '938aed89',
'javelin-behavior-conpherence-menu' => '7ee23816',
- 'javelin-behavior-conpherence-pontificate' => 'd83a949c',
+ 'javelin-behavior-conpherence-pontificate' => '3f8f3753',
'javelin-behavior-conpherence-widget-pane' => '40b1ff90',
'javelin-behavior-countdown-timer' => '361e3ed3',
'javelin-behavior-dark-console' => 'e9fdb5e5',
@@ -764,7 +764,7 @@
'phui-list-view-css' => '43ed2d93',
'phui-object-box-css' => 'ce92d8ec',
'phui-object-item-list-view-css' => '46e12abc',
- 'phui-pinboard-view-css' => '874c22f9',
+ 'phui-pinboard-view-css' => '32e8e1a9',
'phui-property-list-view-css' => '2f7199e8',
'phui-remarkup-preview-css' => '19ad512b',
'phui-spacing-css' => '042804d6',
@@ -1104,6 +1104,14 @@
1 => 'javelin-dom',
2 => 'phortune-credit-card-form',
),
+ '3f8f3753' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-dom',
+ 2 => 'javelin-util',
+ 3 => 'javelin-workflow',
+ 4 => 'javelin-stratcom',
+ ),
'40b1ff90' =>
array(
0 => 'javelin-behavior',
@@ -1869,14 +1877,6 @@
3 => 'javelin-dom',
4 => 'phabricator-keyboard-shortcut',
),
- 'd83a949c' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-dom',
- 2 => 'javelin-util',
- 3 => 'javelin-workflow',
- 4 => 'javelin-stratcom',
- ),
'd8e135db' =>
array(
0 => 'javelin-behavior',
diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php
--- a/src/applications/conpherence/view/ConpherenceTransactionView.php
+++ b/src/applications/conpherence/view/ConpherenceTransactionView.php
@@ -86,6 +86,15 @@
$transaction_view
->setImageURI($author->getImageURI())
->setActions(array($author->renderLink()));
+ $transaction_view->appendChild(
+ phutil_tag(
+ 'div',
+ array(
+ 'class' => 'transaction-hidden-info',
+ 'data-sigil' => 'conpherence-message-author',
+ ),
+ $author->getLinkName()));
+
break;
}
@@ -93,7 +102,8 @@
phutil_tag(
'div',
array(
- 'class' => $content_class
+ 'class' => $content_class,
+ 'data-sigil' => 'conpherence-message-content',
),
$content));
diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css
--- a/webroot/rsrc/css/application/conpherence/message-pane.css
+++ b/webroot/rsrc/css/application/conpherence/message-pane.css
@@ -236,3 +236,7 @@
.device .conpherence-message-pane .aphront-form-control-submit button {
margin: 7px 0 0 0;
}
+
+.conpherence-message-pane .transaction-hidden-info {
+ display: none;
+}
diff --git a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js
--- a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js
@@ -9,6 +9,41 @@
JX.behavior('conpherence-pontificate', function(config) {
+ var page_is_visible = true;
+ var hidden = "hidden";
+
+ var onchange = function(evt) {
+ var v = true;
+ var h = false;
+ var evtMap = {
+ focus:v, focusin:v, pageshow:v, blur:h, focusout:h, pagehide:h
+ };
+
+ evt = evt || window.event;
+ if (evt.type in evtMap) {
+ page_is_visible = evtMap[evt.type];
+ } else {
+ page_is_visible = !page_is_visible;
+ }
+ }
+
+ if (hidden in document) {
+ document.addEventListener("visibilitychange", onchange);
+ } else if ((hidden = "mozHidden") in document) {
+ document.addEventListener("mozvisibilitychange", onchange);
+ } else if ((hidden = "webkitHidden") in document) {
+ document.addEventListener("webkitvisibilitychange", onchange);
+ } else if ((hidden = "msHidden") in document) {
+ document.addEventListener("msvisibilitychange", onchange);
+ } else if ('onfocusin' in document) {
+ document.onfocusin = document.onfocusout = onchange;
+ } else {
+ window.onpageshow = onchange;
+ window.onpagehide = onchange;
+ window.onfocus = onchange;
+ window.onblur = onchange;
+ }
+
JX.Stratcom.listen('aphlict-receive-message', null, function(e) {
var message = e.getData();
@@ -47,6 +82,53 @@
JX.DOM.appendContent(messages, JX.$H(r.transactions));
messages.scrollTop = messages.scrollHeight;
+ if (!page_is_visible) {
+ var hierarchy = JX.$N('div', {}, JX.$H(r.transactions));
+ for (var i = 0; i < hierarchy.children.length; i++) {
+ var child = hierarchy.children[i];
+ var notificationTitle = JX.DOM.find(
+ child,
+ "div",
+ "conpherence-message-author").innerText;
+ var notificationBody = JX.DOM.find(
+ child,
+ "div",
+ "conpherence-message-content").innerText;
+ var notificationIcon = child.style.backgroundImage;
+ notificationIcon = notificationIcon.substr(
+ 4,
+ notificationIcon.length - 5);
+
+ if ("Notification" in window) {
+ if (Notification.permission === "granted") {
+ var notification = new Notification(
+ notificationTitle,
+ {
+ body: notificationBody,
+ icon: notificationIcon
+ });
+ notification.onclick = function() { window.focus(); };
+ } else if (Notification.permission !== "denied") {
+ Notification.requestPermission(function(permission) {
+ if (!("permission" in Notification)) {
+ Notification.permission = permission;
+ }
+
+ if (permission === "granted") {
+ var notification = new Notification(
+ notificationTitle,
+ {
+ body: notificationBody,
+ icon: notificationIcon
+ });
+ notification.onclick = function() { window.focus(); };
+ }
+ });
+ }
+ }
+ }
+ }
+
// TODO: Continued grossness from above.
infonode.value = r.latest_transaction_id;
})
@@ -57,6 +139,16 @@
var onsubmit = function(e) {
e.kill();
+ if ("Notification" in window) {
+ if (Notification.permission !== "denied") {
+ Notification.requestPermission(function(permission) {
+ if (!("permission" in Notification)) {
+ Notification.permission = permission;
+ }
+ });
+ }
+ }
+
var form = e.getNode('tag:form');
var root = e.getNode('conpherence-layout');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 16 2025, 9:03 AM (12 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8609163
Default Alt Text
D9525.id22829.diff (9 KB)
Attached To
Mode
D9525: [DRAFT] Implement desktop notifications for Conpherence
Attached
Detach File
Event Timeline
Log In to Comment