Skip to content

Commit

Permalink
Merge pull request #2 from bradmb/panel-docking
Browse files Browse the repository at this point in the history
Panel docking and improved README file
  • Loading branch information
bradmb committed Mar 8, 2016
2 parents f168ee7 + 0302702 commit 8a3def2
Show file tree
Hide file tree
Showing 11 changed files with 293 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,4 @@ FakesAssemblies/
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
/sl.js/release/release.zip
61 changes: 31 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,44 @@ You'll also need to grab your Slack token (or generate a new one) and locate the
Running the script will fully display the interface, but a button binding will be coming soon. Until then, you will need to setup your own binding on a button to initialize the code.

To bring up the interface, simply call this:
```javascript
var slConfig = {
token: 'SLACK-TOKEN',
channel: 'SLACK-CHANNEL',
element: 'PAGE-DIV-ID'
};

var slConfig = {
token: 'SLACK-TOKEN',
channel: 'SLACK-CHANNEL',
element: 'PAGE-DIV-ID'
};

var sl = new SLjs.Application(slConfig);
var sl = new SLjs.Application(slConfig);
```

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

**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

**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.

**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.

**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*".

**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.
Parameter | Type | Description | Options
--- | --- | --- | ---
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 | N/A
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. | N/A
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. | N/A
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*". | N/A
position | string | Allows for docking the support interface to the left, right, or floating it in the center of the page. By default, this will float in the center of the page.| left, right, float
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. | See Below

## Work Dates: How To Configure ##
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.

**Example parameter configuration for work dates**

workDates: {
monday: true,
tuesday: true,
wednesday: true,
thursday: true,
friday: true,
startHourUtc: 15,
startMinutes: 0,
stopHourUtc: 1,
stopMinutes: 30
}

```javascript
workDates: {
monday: true,
tuesday: true,
wednesday: true,
thursday: true,
friday: true,
startHourUtc: 15,
startMinutes: 0,
stopHourUtc: 1,
stopMinutes: 30
}
```

----------

Expand All @@ -70,7 +71,7 @@ The first message from a user sent from this interface will include a message at
## To do ##
- Add non-websocket backup feature
- Add server-side features (id generation, traffic routing)
- Add additional display methods (docking to left/right of page)
- ~~Add additional display methods (docking to left/right of page)~~
- Add button binding options
- Add support for parsing Slack message edits
- ~~Add support work hours~~
110 changes: 64 additions & 46 deletions sl.js/release/sl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8a3def2

Please sign in to comment.