bugherd 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -30,34 +30,24 @@ Now add to the *head* tag in your layout(s):
30
30
  <%= bugherd_tag %>
31
31
  ```
32
32
 
33
+ If you use turbolinks, please be sure to use this instead:
34
+
35
+ ```ruby
36
+ <%= bugherd_turbolinks_tag %>
37
+ ```
38
+
33
39
  ## Meta data
34
40
 
35
41
  BugHerd allows you to pass in extra data which will be added as metadata to any bug your users may log on the page where the widget is rendered.
36
42
 
37
43
  ```ruby
38
- <%= bugherd_tag :metadata => {
39
- :user_id => current_user.id.to_s,
40
- :controller => controller.controller_name
41
- } %>
44
+ <%= bugherd_tag metadata: { user_id: current_user.id.to_s, controller: controller.controller_name } %>
42
45
  ```
43
46
 
44
- ## Translation
47
+ ## Pre-populate email addresses
45
48
 
46
- If you are using the public "Send Feedback" option on your project, you can customise the display text:
49
+ If your site has logged in users and you use public feedback, have the email addresses pre-populated:
47
50
 
48
51
  ```ruby
49
- <%= bugherd_tag :feedback => {
50
- :tab_text => "Stuur commentaar",
51
- :option_title_text => "Kies een optie",
52
- :option_pin_text => "Ik wil graag iets op deze pagina aanwijzen.",
53
- :option_site_text => "Ik heb commentaar over deze pagina in z'n geheel.",
54
- :feedback_entry_placeholder => "schrijf hier uw commentaar",
55
- :feedback_email_placeholder => "uw email adres",
56
- :feedback_submit_text => "verstuur commentaar",
57
- :confirm_success_text => "Commentaar is verstuurd.",
58
- :confirm_loading_text => "Commentaar wordt verstuurd...",
59
- :confirm_close_text => "sluiten",
60
- :confirm_error_text => "Er is een fout opgetreden en commentaar kon niet verstuurd worden.",
61
- :confirm_retry_text => "Probeer opnieuw",
62
- } %>
52
+ <%= bugherd_tag reporter: { email: current_user.email, required: "true" } %>
63
53
  ```
@@ -13,4 +13,22 @@ module BugHerdHelper
13
13
  "
14
14
  end
15
15
 
16
+ def bugherd_turbolinks_tag(options = {})
17
+ key = ENV['BUGHERD_PROJECT_KEY'] || BugHerd.configuration.project_key
18
+ javascript_tag "
19
+ var BugHerdConfig = #{options.to_json};
20
+ $(function() {
21
+ if (window._bugHerd) {
22
+ window._bugHerd.loadingComplete = false;
23
+ }
24
+ (function (d, t) {
25
+ var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
26
+ bh.type = 'text/javascript';
27
+ bh.src = '//www.bugherd.com/sidebarv2.js?apikey=#{key}';
28
+ s.parentNode.insertBefore(bh, s);
29
+ })(document, 'script');
30
+ });
31
+ "
32
+ end
33
+
16
34
  end
@@ -1,3 +1,3 @@
1
1
  module BugHerd
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugherd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2014-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.0'
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
30
  - !ruby/object:Gem::Dependency