Skip to content

Commit 31632de

Browse files
committed
Merge pull request #1 from bradmb/work-hours
Adds support for after hours messaging
2 parents e7b638e + 0b2463f commit 31632de

File tree

13 files changed

+351
-41
lines changed

13 files changed

+351
-41
lines changed

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,32 @@ To bring up the interface, simply call this:
2626

2727
The configuration options listed above are the *minimum* options required. You are free to fill in additional parameters, including:
2828

29-
**visitorName**: If filled out, the script will skip the question that asks the user for their name. Fill this in if you have some way to automatically identify a user's name
29+
**visitorName** [*string*]: If filled out, the script will skip the question that asks the user for their name. Fill this in if you have some way to automatically identify a user's name
3030

31-
**visitorIcon**: This defaults to the *:speech_balloon:* emoji in Slack, but feel free to change this to any other emoji (default or custom) from your Slack instance.
31+
**visitorIcon** [*string*]: This defaults to the *:speech_balloon:* emoji in Slack, but feel free to change this to any other emoji (default or custom) from your Slack instance.
3232

33-
**applicationName**: This will override the default application name (SL.js) with your own. It's recommended you fill this parameter out, as it will show up to the user and in your Slack channel, allowing multiple sites or pages to point at one Slack channel, while easily identifying where the visitor is coming from.
33+
**applicationName** [*string*]: This will override the default application name (SL.js) with your own. It's recommended you fill this parameter out, as it will show up to the user and in your Slack channel, allowing multiple sites or pages to point at one Slack channel, while easily identifying where the visitor is coming from.
34+
35+
**supportGroupName** [*string*]: This shows in the user support interface, and will show what team the user is talking to. When the interface shows messages coming from Slack, it will attempt to show the Slack user's first name only, followed by this support group name. By default, this will show "*Support Team*".
36+
37+
**workDates** [*object*]: Allows you to specify the standard work hours that support is generally available. This will not prevent users from submitting messages, but display a notice that support may not be available. By responding to the user in Slack, this notice will be removed so the user can have a normal support conversation.
38+
39+
Start hour and stop hour must be provided using the UTC time zone. You can leave out a day of the week and it will consider that a non-working day.
40+
41+
**Example parameter configuration for work dates**
42+
43+
workDates: {
44+
monday: true,
45+
tuesday: true,
46+
wednesday: true,
47+
thursday: true,
48+
friday: true,
49+
startHourUtc: 15,
50+
startMinutes: 0,
51+
stopHourUtc: 1,
52+
stopMinutes: 30
53+
}
3454

35-
**supportGroupName**: This shows in the user support interface, and will show what team the user is talking to. When the interface shows messages coming from Slack, it will attempt to show the Slack user's first name only, followed by this support group name. By default, this will show "*Support Team*".
3655

3756
----------
3857

@@ -53,5 +72,5 @@ The first message from a user sent from this interface will include a message at
5372
- Add server-side features (id generation, traffic routing)
5473
- Add additional display methods (docking to left/right of page)
5574
- Add button binding options
56-
- Add message editing
57-
- Add support work hours
75+
- Add support for parsing Slack message edits
76+
- ~~Add support work hours~~

sl.js/release/sl.js

Lines changed: 129 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sl.js/release/sl.js.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@
8282
border-bottom: dotted 1px rgba(74, 74, 74, 0.36);
8383
}
8484

85+
#sljs-interface.sljs-chat .sljs-chat-messages .sljs-chat-item.sljs-chat-item-error {
86+
position: absolute;
87+
background-color: #ff2f00;
88+
background-color: rgba(255, 0, 0, 0.52);
89+
z-index: 9999;
90+
margin-top: 140px;
91+
padding-left: 10px;
92+
font-size: 14pt;
93+
border-bottom: none;
94+
color: #ffffff;
95+
text-align: center;
96+
97+
-moz-border-radius: 10px;
98+
-webkit-border-radius: 10px;
99+
border-radius: 10px;
100+
}
101+
85102
#sljs-interface.sljs-chat .sljs-chat-messages .sljs-chat-item a {
86103
color: #ff2f00;
87104
font-size: 10pt;

sl.js/release/sl.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)