Skip to content

Commit 770049c

Browse files
committed
adding widget
1 parent dda62b2 commit 770049c

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

_includes/widget.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script>
2+
// Include the UserVoice JavaScript SDK (only needed once on a page)
3+
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/4a4IvDVZKokz6bHpdbN6Q.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})();
4+
5+
//
6+
// UserVoice Javascript SDK developer documentation:
7+
// https://www.uservoice.com/o/javascript-sdk
8+
//
9+
10+
// Set colors
11+
UserVoice.push(['set', {
12+
accent_color: '#e23a39',
13+
trigger_color: 'white',
14+
trigger_background_color: '#e23a39',
15+
contact_menu_label: 'Have a question? Ask away!'
16+
}]);
17+
18+
// Identify the user and pass traits
19+
// To enable, replace sample data with actual user traits and uncomment the line
20+
UserVoice.push(['identify', {
21+
//email: 'john.doe@example.com', // User’s email address
22+
//name: 'John Doe', // User’s real name
23+
//created_at: 1364406966, // Unix timestamp for the date the user signed up
24+
//id: 123, // Optional: Unique id of the user (if set, this should not change)
25+
//type: 'Owner', // Optional: segment your users by type
26+
//account: { // Account traits are only available on some plans
27+
// id: 123, // Optional: associate multiple users with a single account
28+
// name: 'Acme, Co.', // Account name
29+
// created_at: 1364406966, // Unix timestamp for the date the account was created
30+
// monthly_rate: 9.99, // Decimal; monthly rate of the account
31+
// ltv: 1495.00, // Decimal; lifetime value of the account
32+
// plan: 'Enhanced' // Plan name for the account
33+
//}
34+
}]);
35+
36+
// Add default trigger to the bottom-right corner of the window:
37+
UserVoice.push(['addTrigger', {mode: 'contact', trigger_position: 'bottom-right' }]);
38+
39+
// Or, use your own custom trigger:
40+
//UserVoice.push(['addTrigger', '#id', { mode: 'contact' }]);
41+
42+
// Autoprompt for NPS® Rating and SmartVote (only displayed under certain conditions)
43+
UserVoice.push(['autoprompt', {}]);
44+
$('.pane-title').text('Have a question? Ask away!')
45+
</script>

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ <h1>Research Computing Lessons</h1>
4141
</div>
4242
</section>
4343

44+
{% include widget.html %}
4445
{% include footer.html %}
4546
<script>
4647
$(function() {

_layouts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ <h1>Research Computing Lessons</h1>
4141
</div>
4242
</section>
4343

44+
{% include widget.html %}
4445
<footer>
4546
<div class="wrapper" style='margin-left:none;margin:auto'>
4647
<p class="edit-footer"><a class="editor-link btn" href="cloudcannon:collections/_data/footer.yml" class="btn" style="padding: 5px;"><strong>&#9998;</strong> Edit footer</a></p>

0 commit comments

Comments
 (0)