conversation_forms 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 114abff1112432e5e5b32d1cef737f7725b2100b
4
- data.tar.gz: 837eb6940b9388e5352a1098fc2355f3fb23d3cd
3
+ metadata.gz: 73a4b62ab78bfaf9f4d28fd29592c47b00bc9656
4
+ data.tar.gz: 0f619ec9115977f9fdbcbddf28b6cdf465a61f12
5
5
  SHA512:
6
- metadata.gz: 2bf7c5d4d49123337040598848eceecfa60755027bef4deae4d8ded87566b44f2672ebf317824d165d9ff85400323d185e0c57bdd08ff22b47cb49b6a00defbe
7
- data.tar.gz: b0b3138e71aca1f10c0c3ec166e4de86beec805acb47aaf5507a4b5bb090c2eb6d0d0053ad49fb3e747e992f76885ef651b0eda741ced1d8b8eb9e63702a5466
6
+ metadata.gz: 385196147cad12498dbbb4112680dc0c3190950a7af9685f83f1dfa4b342a7cffe50916ac0b30876d4cd387665cd051466667e7c335d3b4c9b29cf2588484afa
7
+ data.tar.gz: 6a670fe7f67e0cbccd7eec8460d46ac086bc3f23a969764c6dc889eb3cbf9e00cd57c91651f166ff6175377a31be07f1711627b962fb0f6faa580af6594f6a85
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- conversation_forms (0.6.0)
4
+ conversation_forms (0.7.0)
5
5
  autoprefixer-rails (>= 5.2.1)
6
6
  rails (~> 5.0.0, >= 5.0.0.1)
7
7
  railties
@@ -7,69 +7,70 @@ $ ->
7
7
  window.wrapUp = ->
8
8
  console.log('done')
9
9
  convoForm.show()
10
- convoForm.submit()
11
10
  $('#convo-form-enter').prop('disabled', true)
12
11
 
13
- doc = $('body')
14
- convoForm = $('#convo-form')
15
- convoForm.hide()
16
- doc.append("""
17
- <div class="convo-window">
18
- <ol class="convo-chat-history">
19
- </ol>
20
- <input id="input-box" class="input-box" placeholder="Type your answer here ...">
21
- <button id="convo-form-enter">Next</button>
22
- </div>
23
- """
24
- )
12
+ converse = ->
13
+ doc = $('body')
14
+ convoForm = $('#convo-form')
15
+ convoForm.hide()
16
+ doc.append("""
17
+ <div class="convo-window">
18
+ <ol class="convo-chat-history">
19
+ </ol>
20
+ <input id="input-box" class="input-box" placeholder="Type your answer here ...">
21
+ <button id="convo-form-enter">Next</button>
22
+ </div>
23
+ """
24
+ )
25
25
 
26
- inputIds = [];
26
+ inputIds = [];
27
27
 
28
- $('.convo input[name]').each ->
29
- inputIds.push($(this).attr('id'))
28
+ $('#convo-form input[name]').each ->
29
+ inputIds.push($(this).attr('id'))
30
30
 
31
- endIndex = inputIds.length - 1
32
- sequenceIndex = 0
33
- item = inputIds[sequenceIndex]
34
- inputBox = $('#input-box')
35
-
36
-
37
- openDialog = ->
31
+ endIndex = inputIds.length - 1
32
+ sequenceIndex = 0
38
33
  item = inputIds[sequenceIndex]
39
- $('.convo-window .convo-chat-history').append('
40
- <li class="other">
41
- <div class="msg">
42
- <p>Please enter your ' + item + '</p>
43
- </div>
44
- </li>
45
- ')
46
- $('.convo-window .convo-chat-history').scrollTop($('.convo-window .convo-chat-history')[0].scrollHeight);
34
+ inputBox = $('#input-box')
35
+
47
36
 
48
- $('#convo-form-enter').click ->
49
- if sequenceIndex <= endIndex
50
- submitted = inputBox.val()
51
- inputBox.val(null)
52
- $('#' + item).val(submitted)
37
+ openDialog = ->
38
+ item = inputIds[sequenceIndex]
53
39
  $('.convo-window .convo-chat-history').append('
54
- <li class="self">
40
+ <li class="other">
55
41
  <div class="msg">
56
- <p>' + submitted + '</p>
42
+ <p>Please enter your ' + item + '</p>
57
43
  </div>
58
44
  </li>
59
45
  ')
60
46
  $('.convo-window .convo-chat-history').scrollTop($('.convo-window .convo-chat-history')[0].scrollHeight);
61
- sequenceIndex++
62
- if sequenceIndex == endIndex
63
- $('#convo-form-enter').html 'submit'
64
- if sequenceIndex > endIndex
65
- wrapUp()
66
- else
67
- openDialog()
68
47
 
69
- inputBox.keyup (e) ->
70
- if e.which is 13
71
- $('#convo-form-enter').click()
48
+ $('#convo-form-enter').click ->
49
+ if sequenceIndex <= endIndex
50
+ submitted = inputBox.val()
51
+ inputBox.val(null)
52
+ $('#' + item).val(submitted)
53
+ $('.convo-window .convo-chat-history').append('
54
+ <li class="self">
55
+ <div class="msg">
56
+ <p>' + submitted + '</p>
57
+ </div>
58
+ </li>
59
+ ')
60
+ $('.convo-window .convo-chat-history').scrollTop($('.convo-window .convo-chat-history')[0].scrollHeight);
61
+ sequenceIndex++
62
+ if sequenceIndex == endIndex
63
+ $('#convo-form-enter').html 'submit'
64
+ if sequenceIndex > endIndex
65
+ wrapUp()
66
+ else
67
+ openDialog()
72
68
 
69
+ inputBox.keyup (e) ->
70
+ if e.which is 13
71
+ $('#convo-form-enter').click()
73
72
 
73
+ openDialog(inputIds)
74
74
 
75
- openDialog(inputIds)
75
+ if document.getElementById('convo-form') != null ->
76
+ converse()
@@ -1,3 +1,3 @@
1
1
  module ConversationForms
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conversation_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley
@@ -241,8 +241,6 @@ files:
241
241
  - README.md
242
242
  - Rakefile
243
243
  - assets/javascripts/conversation_forms.coffee
244
- - assets/javascripts/index.js
245
- - assets/stylesheets/application.css
246
244
  - assets/stylesheets/conversation_forms.scss
247
245
  - bin/test
248
246
  - conversation_forms.gemspec
@@ -1,4 +0,0 @@
1
- //= require jquery
2
- //= require jquery_ujs
3
- //= require turbolinks
4
- //= require_tree .
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */