Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit 872883a

Browse files
author
Zach Richardson
committed
added requested changes by VisitPay
1 parent ea0293a commit 872883a

File tree

7 files changed

+44
-5
lines changed

7 files changed

+44
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ required argument is `token` which must match an organizational `ephermeral-user
3333

3434
For example:
3535
```html
36-
<iframe src="https://app.forsta.io/@embed?token=TESTING&first_name=Demo&[email protected]&to=@support:forsta.io"></iframe>
36+
<iframe src="http://localhost:1080/@embed?token=TESTING&first_name=Demo&[email protected]&to=@support:forsta.io"></iframe>
3737
```
3838

3939
And with calling support (NOTE the `allow` attribute required for new browsers):

app/views/compose.js

+2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@
8787
this.allowCalling = options.allowCalling;
8888
this.forceScreenSharing = options.forceScreenSharing;
8989
this.disableCommands = options.disableCommands;
90+
this.disableRecipientsPrompt = options.disableRecipientsPrompt;
9091
},
9192

9293
render_attributes: async function() {
9394
return Object.assign({
9495
titleNormalized: this.model.getNormalizedTitle(),
9596
allowCalling: this.allowCalling,
9697
forceScreenSharing: this.forceScreenSharing,
98+
disableRecipientsPrompt: this.disableRecipientsPrompt
9799
}, await F.View.prototype.render_attributes.apply(this, arguments));
98100
},
99101

app/views/conversation.js

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
this.allowCalling = options.allowCalling;
2929
this.forceScreenSharing = options.forceScreenSharing;
3030
this.disableCommands = options.disableCommands;
31+
this.disableMessageInfo = options.disableMessageInfo;
32+
this.disableSenderInfo = options.disableSenderInfo;
33+
this.disableRecipientsPrompt = options.disableRecipientsPrompt;
3134
this.onReadMarksChange = _.debounce(this._onReadMarksChange.bind(this), 200);
3235
F.ThreadView.prototype.initialize.apply(this, arguments);
3336
},
@@ -36,6 +39,8 @@
3639
await F.ThreadView.prototype.render.call(this);
3740
this.messagesView = new F.MessagesView({
3841
collection: this.model.messages,
42+
disableMessageInfo: this.disableMessageInfo,
43+
disableSenderInfo: this.disableSenderInfo
3944
});
4045
this.$('.f-messages').append(this.messagesView.$el);
4146
this.messagesView.setScrollElement(this.$('.f-messages')[0]);
@@ -46,6 +51,7 @@
4651
allowCalling: this.allowCalling,
4752
forceScreenSharing: this.forceScreenSharing,
4853
disableCommands: this.disableCommands,
54+
disableRecipientsPrompt: this.disableRecipientsPrompt
4955
});
5056
this.listenTo(this.composeView, 'send', this.onSend);
5157
await Promise.all([

app/views/embed.js

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
this.allowCalling = urlQuery.has('allowCalling');
2121
this.forceScreenSharing = urlQuery.has('forceScreenSharing');
2222
this.disableCommands = urlQuery.has('disableCommands');
23+
this.disableMessageInfo = urlQuery.has('disableMessageInfo');
24+
this.disableSenderInfo = urlQuery.has('disableSenderInfo');
25+
this.disableRecipientsPrompt = urlQuery.has('disableRecipientsPrompt');
2326
// Strip redundant and unsafe query values before sending them up in the beacon.
2427
const urlParamBlacklist = [
2528
'token',
@@ -32,6 +35,9 @@
3235
'threadId',
3336
'disableCommands',
3437
'logLevel',
38+
'disableMessageInfo',
39+
'disableSenderInfo',
40+
'disableRecipientsPrompt'
3541
];
3642
this.beaconExtraUrlParams = Array.from(urlQuery.entries())
3743
.filter(([k, v]) => urlParamBlacklist.indexOf(k) === -1)
@@ -62,6 +68,9 @@
6268
allowCalling: this.allowCalling,
6369
forceScreenSharing: this.forceScreenSharing,
6470
disableCommands: this.disableCommands,
71+
disableMessageInfo: this.disableMessageInfo,
72+
disableSenderInfo: this.disableSenderInfo,
73+
disableRecipientsPrompt: this.disableRecipientsPrompt
6574
});
6675
await F.state.put('mostRecentThread', thread.id);
6776
},

app/views/message.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,17 @@
8989
senderName = 'Forsta';
9090
} else {
9191
const sender = await this.model.getSender();
92+
console.log(sender);
9293
senderName = sender.getName();
93-
avatar = await sender.getAvatar();
94+
avatar = await sender.getAvatar({nolink: this.disableSenderInfo});
9495
}
9596
const attrs = F.View.prototype.render_attributes.call(this);
9697
const replies = await Promise.all(this.model.replies.map(async reply => {
9798
const sender = await reply.getSender();
9899
return Object.assign({
99100
senderName: sender.getName(),
100101
senderInitials: sender.getInitials(),
101-
avatar: await sender.getAvatar()
102+
avatar: await sender.getAvatar({nolink: this.disableSenderInfo})
102103
}, reply.attributes);
103104
}));
104105
let actions = this.model.get('actions');
@@ -115,6 +116,8 @@
115116
replies,
116117
safe_html: attrs.safe_html && F.emoji.replace_unified(attrs.safe_html),
117118
actions,
119+
disableMessageInfo: this.disableMessageInfo,
120+
disableSenderInfo: this.disableSenderInfo
118121
});
119122
},
120123

@@ -399,6 +402,7 @@
399402
},
400403

401404
onDisplayToggle: function(ev) {
405+
console.log("here");
402406
const $section = this.$('section');
403407
const $minIcon = this.$('.f-display-toggle.minimize');
404408
const $maxIcon = this.$('.f-display-toggle.maximize');
@@ -664,6 +668,8 @@
664668
options.reverse = true;
665669
options.remove = false;
666670
F.ListView.prototype.initialize.call(this, options);
671+
this.ItemView.prototype.disableMessageInfo = options.disableMessageInfo;
672+
this.ItemView.prototype.disableSenderInfo = options.disableSenderInfo;
667673
this.onScroll = this._onScroll.bind(this);
668674
this.onTouchStart = this._onTouchStart.bind(this);
669675
this.onTouchEnd = this._onTouchEnd.bind(this);

templates/views/compose.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
<div class="f-message"
55
{{#if blocked}}{{else if left}}{{else}}contenteditable="true"{{/if}}
66
role="textbox" spellcheck="true" tabindex="0" autocorrect="on"></div>
7-
<div class="f-placeholder">Send message to {{{titleNormalized}}}</div>
7+
<div class="f-placeholder">
8+
{{#if disableRecipientsPrompt}}
9+
Send message
10+
{{else}}
11+
Send message to {{{titleNormalized}}}
12+
{{/if}}
13+
</div>
814
</div>
915

1016
<div class="f-actions large">

templates/views/message-item.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<div class="label">
2+
{{#if disableSenderInfo}}
23
{{> f-avatar avatar}}
4+
{{else}}
5+
{{> f-avatar avatar}}
6+
{{/if}}
37
</div>
48
<div class="content">
59
<div class="ui segment {{avatar.color}}">
610
<div class="summary">
711
{{#if sender}}
12+
{{#if disableSenderInfo}}
13+
<p class="f-user">{{senderName}}</p>
14+
{{else}}
815
<a class="f-user" data-user-card="{{sender}}">{{senderName}}</a>
16+
{{/if}}
917
{{else}}
1018
<div class="f-user">{{senderName}}</div>
1119
{{/if}}
@@ -19,7 +27,9 @@
1927
<i title="Sent from {{mobile}}" class="icon mobile"></i>
2028
{{/if}}
2129
<i title="Reply to this message" class="f-reply icon link reply"></i>
22-
<i title="Toggle detailed view" class="f-details-toggle icon link zoom"></i>
30+
{{#if disableMessageInfo}}{{else}}
31+
<i title="Toggle detailed view" class="f-details-toggle icon link zoom"></i>
32+
{{/if}}
2333
</div>
2434
<div class="icon-bar autodim">
2535
{{#if keyChange}}

0 commit comments

Comments
 (0)