forked from martindrapeau/planbox-feedback-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
97 lines (73 loc) · 3.15 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Widget you can embed on your site to capture user feedback.
Saves the User Feedback in Planbox.
Planbox docs: http://www.planbox.com/help/user_feedback
FEATURES
- Supports any localization simply by settings options in global variable FeedbackOptions.
- Style it any way you want by modifying the CSS file feedback.css.
- Uses JSONP to call the Planbox REST API
REQUIREMENTS
- You need jQuery 1.5+
INSTALLATION
1) Copy feedback.js and feedback.css on your site.
2) Include them in your HTML document like this:
<link href="/js/feedback/feedback.css" rel="stylesheet" type="text/css" charset="utf-8" />
<script src="/js/feedback/feedback.js" type="text/javascript"></script>
3) Configure options:
<script type="text/javascript">
FeedbackOptions.planboxToken = '123hshdajh2galvnmxnwhruyfhdj';
FeedbackOptions.dialogTitle = 'Tell us what you think';
</script>
4) Modify feedback.css to suit your design style.
Note: Files are also hosted on www.planbox.com. You can load them like this as well:
<link href="http://www.planbox.com/feedback/feedback.css" rel="stylesheet" type="text/css" charset="utf-8" />
<script src="http://www.planbox.com/feedback/feedback.js" type="text/javascript"></script>
OPTIONS
// You can find your Planbox initiative token on the Manage page
// Instructions: http://www.planbox.com/help/user_feedback
planboxToken: '<TOKEN>',
// You can forward any incoming feedback to an email
// Keep empty not to. Only a single email is allowed.
forwardEmail: '',
// You can set the page URL. If empty will use window.location.href
pageUrl: '',
// You can specify a human readable page title
pageTitle: '',
// The button appears center-left by default. Modify in CSS.
// It is an image you can modify here.
// If you want your own custom button, set showButton to false.
// You can then call function FeedbackShow().
showButton: true,
buttonImageSrc: protocol+'://www.planbox.com/img/feedback_button.png',
buttonImageAlt: 'Feedback',
buttonTooltip: 'Send us Feedback',
// When you click on the button it opens a dialog
dialogTitle: 'User Feedback',
dialogCloseTooltip: 'Close dialog',
dialogEmailLabel: 'Your email',
dialogFeedbackLabel: 'Your feedback',
dialogCancelText: 'Cancel',
dialogSubmitText: 'Submit',
dialogCloseText: 'Close',
// You can prefill the email
dialogEmail: '',
// When the user clicks on Submit, do some validation
// and tell the user what's happening
emailIsRequired: true,
emailInvalidError: 'Please provide a valid email',
feedbackMissingError: 'Please type in feedback',
feedbackAjaxSuccess: 'We have received your feedback. Thank you!',
feedbackAjaxError: 'There was an error.',
// When the user opens the window
// The dialog element is passed as argument
onshow: function(){},
// Deprecated...
// When the user opens the window
// The jQuery content element is passed as argument
callback: function(){}
FUNCTIONS:
// If you have your own custom button, call this function to
// open the Feedback dialog.
FeedbackShow()
Author: Martin Drapeau
Copyright: Planbox Inc. 2011
License: MIT License (http://en.wikipedia.org/wiki/MIT_License)