unpoly-rails 0.31.2 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -5
  3. data/README.md +21 -15
  4. data/README_RAILS.md +2 -2
  5. data/Rakefile +1 -1
  6. data/bower.json +4 -3
  7. data/design/homepage.txt +2 -2
  8. data/dist/unpoly-bootstrap3.css +3 -0
  9. data/dist/unpoly-bootstrap3.min.css +1 -1
  10. data/dist/unpoly.css +4 -4
  11. data/dist/unpoly.js +114 -80
  12. data/dist/unpoly.min.css +1 -1
  13. data/dist/unpoly.min.js +3 -3
  14. data/lib/assets/javascripts/unpoly/browser.js.coffee +1 -1
  15. data/lib/assets/javascripts/unpoly/bus.js.coffee +3 -3
  16. data/lib/assets/javascripts/unpoly/flow.js.coffee +15 -11
  17. data/lib/assets/javascripts/unpoly/form.js.coffee +1 -1
  18. data/lib/assets/javascripts/unpoly/layout.js.coffee +12 -9
  19. data/lib/assets/javascripts/unpoly/link.js.coffee +22 -7
  20. data/lib/assets/javascripts/unpoly/log.js.coffee +3 -2
  21. data/lib/assets/javascripts/unpoly/modal.js.coffee +11 -13
  22. data/lib/assets/javascripts/unpoly/motion.js.coffee +1 -1
  23. data/lib/assets/javascripts/unpoly/navigation.js.coffee +5 -5
  24. data/lib/assets/javascripts/unpoly/popup.js.coffee +8 -9
  25. data/lib/assets/javascripts/unpoly/proxy.js.coffee +2 -2
  26. data/lib/assets/javascripts/unpoly/syntax.js.coffee +19 -15
  27. data/lib/assets/javascripts/unpoly/util.js.coffee +19 -3
  28. data/lib/assets/stylesheets/unpoly-bootstrap3/modal-ext.css.sass +6 -1
  29. data/lib/assets/stylesheets/unpoly/modal.css.sass +7 -2
  30. data/lib/unpoly/rails/version.rb +1 -1
  31. data/package.json +2 -2
  32. data/spec_app/Gemfile.lock +1 -1
  33. data/spec_app/app/assets/javascripts/bootstrap_manifest.coffee +2 -2
  34. data/spec_app/app/views/css_test/modal.erb +4 -0
  35. data/spec_app/app/views/css_test/modal_contents_wide.erb +5 -0
  36. data/spec_app/app/views/layouts/integration_test.erb +1 -0
  37. data/spec_app/spec/javascripts/helpers/knife.js.coffee +1 -1
  38. data/spec_app/spec/javascripts/up/browser_spec.js.coffee +1 -1
  39. data/spec_app/spec/javascripts/up/bus_spec.js.coffee +1 -1
  40. data/spec_app/spec/javascripts/up/flow_spec.js.coffee +63 -5
  41. data/spec_app/spec/javascripts/up/form_spec.js.coffee +2 -2
  42. data/spec_app/spec/javascripts/up/history_spec.js.coffee +1 -1
  43. data/spec_app/spec/javascripts/up/layout_spec.js.coffee +27 -1
  44. data/spec_app/spec/javascripts/up/link_spec.js.coffee +3 -3
  45. data/spec_app/spec/javascripts/up/log_spec.js.coffee +1 -1
  46. data/spec_app/spec/javascripts/up/modal_spec.js.coffee +3 -3
  47. data/spec_app/spec/javascripts/up/motion_spec.js.coffee +1 -1
  48. data/spec_app/spec/javascripts/up/popup_spec.js.coffee +21 -3
  49. data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +1 -1
  50. data/spec_app/spec/javascripts/up/syntax_spec.js.coffee +1 -1
  51. data/spec_app/spec/javascripts/up/tooltip_spec.js.coffee +1 -1
  52. data/spec_app/spec/javascripts/up/util_spec.js.coffee +2 -2
  53. data/spec_app/vendor/assets/bower_components/jasmine-jquery/README.md +2 -2
  54. data/unpoly-rails.gemspec +1 -1
  55. metadata +5 -4
@@ -2,7 +2,7 @@ describe 'up.modal', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  assumedScrollbarWidth = 15
8
8
 
@@ -352,7 +352,7 @@ describe 'up.modal', ->
352
352
  Trigger.click(@$link)
353
353
  expect(@followSpy).toHaveBeenCalledWith(@$link)
354
354
 
355
- # IE does not call Javascript and always performs the default action on right clicks
355
+ # IE does not call JavaScript and always performs the default action on right clicks
356
356
  unless navigator.userAgent.match(/Trident/)
357
357
  it 'does nothing if the right mouse button is used', ->
358
358
  @stubFollow()
@@ -392,7 +392,7 @@ describe 'up.modal', ->
392
392
  Trigger.click(@$link)
393
393
  expect(@followSpy).not.toHaveBeenCalled()
394
394
 
395
- # IE does not call Javascript and always performs the default action on right clicks
395
+ # IE does not call JavaScript and always performs the default action on right clicks
396
396
  unless navigator.userAgent.match(/Trident/)
397
397
  it 'does nothing if the right mouse button is pressed down', ->
398
398
  Trigger.mousedown(@$link, button: 2)
@@ -2,7 +2,7 @@ describe 'up.motion', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  describe 'up.animate', ->
8
8
 
@@ -2,7 +2,7 @@ describe 'up.popup', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  describe 'up.popup.attach', ->
8
8
 
@@ -164,7 +164,7 @@ describe 'up.popup', ->
164
164
  Trigger.click(@$link)
165
165
  expect(@attachSpy).toHaveBeenCalledWith(@$link)
166
166
 
167
- # IE does not call Javascript and always performs the default action on right clicks
167
+ # IE does not call JavaScript and always performs the default action on right clicks
168
168
  unless navigator.userAgent.match(/Trident/)
169
169
  it 'does nothing if the right mouse button is used', ->
170
170
  @stubAttach()
@@ -228,7 +228,7 @@ describe 'up.popup', ->
228
228
  Trigger.click(@$link)
229
229
  expect(@attachSpy).not.toHaveBeenCalled()
230
230
 
231
- # IE does not call Javascript and always performs the default action on right clicks
231
+ # IE does not call JavaScript and always performs the default action on right clicks
232
232
  unless navigator.userAgent.match(/Trident/)
233
233
  it 'does nothing if the right mouse button is pressed down', ->
234
234
  Trigger.mousedown(@$link, button: 2)
@@ -276,6 +276,24 @@ describe 'up.popup', ->
276
276
  expect(backgroundClicked).not.toHaveBeenCalled()
277
277
  done()
278
278
 
279
+ describe 'when clicked inside a popup when a modal is open', ->
280
+
281
+ it 'closes the popup, but not the modal', (done) ->
282
+
283
+ up.modal.extract '.modalee', '<div class="modalee"></div>'
284
+ $modalee = $('.up-modal .modalee')
285
+ $opener = $modalee.affix('a')
286
+ up.popup.attach($opener, html: '<div class="popupee">text</div>', target: '.popupee')
287
+ $popupee = $('.up-popup .popupee')
288
+ $closer = $popupee.affix('a[up-close]') # link is within the popup
289
+ up.hello($closer)
290
+ Trigger.clickSequence($closer)
291
+ u.nextFrame ->
292
+ expect(up.popup.isOpen()).toBe(false)
293
+ expect(up.modal.isOpen()).toBe(true)
294
+ expect(backgroundClicked).not.toHaveBeenCalled()
295
+ done()
296
+
279
297
  describe 'when no popup is open', ->
280
298
 
281
299
  it 'does nothing and allows the event chain to continue', (done) ->
@@ -2,7 +2,7 @@ describe 'up.proxy', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  beforeEach ->
8
8
  jasmine.clock().install()
@@ -1,6 +1,6 @@
1
1
  describe 'up.syntax', ->
2
2
 
3
- describe 'Javascript functions', ->
3
+ describe 'JavaScript functions', ->
4
4
 
5
5
  describe 'up.compiler', ->
6
6
 
@@ -2,7 +2,7 @@ describe 'up.tooltip', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  describe 'up.tooltip.attach', ->
8
8
 
@@ -2,7 +2,7 @@ describe 'up.util', ->
2
2
 
3
3
  u = up.util
4
4
 
5
- describe 'Javascript functions', ->
5
+ describe 'JavaScript functions', ->
6
6
 
7
7
  describe 'up.util.previewable', ->
8
8
 
@@ -229,7 +229,7 @@ describe 'up.util', ->
229
229
  up.util.setTimer(0, callback)
230
230
  expect(callback).toHaveBeenCalled()
231
231
 
232
- it "returns undefined so the return value won't be mistaken with a Javascript timer ID", ->
232
+ it "returns undefined so the return value won't be mistaken with a JavaScript timer ID", ->
233
233
  callback = -> 'function return value'
234
234
  timerReturnValue = up.util.setTimer(0, callback)
235
235
  expect(timerReturnValue).toBeUndefined()
@@ -276,7 +276,7 @@ By default, fixtures are loaded from `spec/javascripts/fixtures/json`. You can c
276
276
 
277
277
  Your fixture data is loaded into an object stashed by the JSONFixtures structure. You fetch the data using the filename as the key. This allows you to load multiple chunks of test data in a spec.
278
278
 
279
- Because a deep copy of Javascript objects can be a little tricky, this module will refetch data each time you call `load`. If you modify the data within a spec, you must call `load` or `loadJSONFixtures` again to repopulate the data.
279
+ Because a deep copy of JavaScript objects can be a little tricky, this module will refetch data each time you call `load`. If you modify the data within a spec, you must call `load` or `loadJSONFixtures` again to repopulate the data.
280
280
 
281
281
  To invoke fixture related methods, obtain Fixtures singleton through a factory and invoke a method on it:
282
282
 
@@ -356,7 +356,7 @@ Under Windows 7, you have to launch `C:\Users\[UserName]\AppData\Local\Google\Ch
356
356
 
357
357
  [jasmine-ajax](https://github.com/jasmine/jasmine-ajax) library doesn't let user to manually start / stop XMLHttpRequest mocking, but instead it overrides XMLHttpRequest automatically when loaded. This breaks jasmine-jquery fixtures as fixture loading mechanism uses jQuery.ajax, that stops to function the very moment jasmine-ajax is loaded. A workaround for this may be to invoke jasmine-jquery `preloadFixtures` function (specifying all required fixtures) before jasmine-ajax is loaded. This way subsequent calls to `loadFixtures` or `readFixtures` methods will get fixtures content from cache, without need to use jQuery.ajax and thus will work correctly even after jasmine-ajax is loaded.
358
358
 
359
- ## Testing with Javascript Test Driver
359
+ ## Testing with JavaScript Test Driver
360
360
 
361
361
  When using [jstd](http://code.google.com/p/js-test-driver/) and the jasmine adapter you will need to include jasmine-jquery.js after your jasmine-jstd-adapter files, otherwise jasmine-jquery matchers will not be available when tests are executed. Check out [this issue](https://github.com/velesin/jasmine-jquery/issues/95#issuecomment-9293180) for a thorough configuration example too.
362
362
 
data/unpoly-rails.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Unpoly::Rails::VERSION
9
9
  spec.authors = ["Henning Koch"]
10
10
  spec.email = ["henning.koch@makandra.de"]
11
- spec.description = 'Rails bindings for Unpoly, the progressive enhancement Javascript framework'
11
+ spec.description = 'Rails bindings for Unpoly, the unobtrusive JavaScript framework'
12
12
  spec.summary = spec.description
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unpoly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.2
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Rails bindings for Unpoly, the progressive enhancement Javascript framework
55
+ description: Rails bindings for Unpoly, the unobtrusive JavaScript framework
56
56
  email:
57
57
  - henning.koch@makandra.de
58
58
  executables: []
@@ -159,6 +159,7 @@ files:
159
159
  - spec_app/app/models/concerns/.keep
160
160
  - spec_app/app/views/css_test/modal.erb
161
161
  - spec_app/app/views/css_test/modal_contents.erb
162
+ - spec_app/app/views/css_test/modal_contents_wide.erb
162
163
  - spec_app/app/views/css_test/popup.erb
163
164
  - spec_app/app/views/css_test/popup_contents.erb
164
165
  - spec_app/app/views/css_test/tooltip.erb
@@ -446,5 +447,5 @@ rubyforge_project:
446
447
  rubygems_version: 2.2.2
447
448
  signing_key:
448
449
  specification_version: 4
449
- summary: Rails bindings for Unpoly, the progressive enhancement Javascript framework
450
+ summary: Rails bindings for Unpoly, the unobtrusive JavaScript framework
450
451
  test_files: []