xray-rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,9 +5,9 @@ Xray
5
5
 
6
6
  The dev tools available to web developers in modern browsers are great. Many of us can't remember what life was like before "Inspect Element". But what we see in the compiled output sent to our browser is often the wrong level of detail - what about being able to visualize the higher level components of your UI? Controllers, templates, partials, Backbone views, etc.
7
7
 
8
- Xray is the missing link between the browser and your app code. Press **cmd+ctrl+x** to reveal an overlay of what files are powering your UI - click anything to open the associated file in your editor. [Here's a GIF](http://f.cl.ly/items/1A0o3y1y3Q13103V3F1l/xray-rails-large.gif) of Xray in action.
8
+ Xray is the missing link between the browser and your app code. Press **cmd+shift+x** (Mac) or **ctrl+shift+x** to reveal an overlay of what files are powering your UI - click anything to open the associated file in your editor. [Here's a GIF](http://f.cl.ly/items/1A0o3y1y3Q13103V3F1l/xray-rails-large.gif) of Xray in action.
9
9
 
10
- ![Screenshot](http://dl.dropbox.com/u/156655/Screenshots/xgf7ukh3fya-.png)
10
+ ![Screenshot](https://dl.dropboxusercontent.com/u/156655/xray-screenshot.png)
11
11
 
12
12
  ## Current Support
13
13
 
@@ -22,7 +22,7 @@ So far, Xray can reveal:
22
22
 
23
23
  Xray depends on **jQuery**, so it will need to be included in your layout. Backbone is optional.
24
24
 
25
- Xray should only be present during development. Add it to your Gemfile like so:
25
+ This gem should only be present during development. Add it to your Gemfile like so:
26
26
 
27
27
  ```ruby
28
28
  group :development do
@@ -36,7 +36,7 @@ Then bundle and delete your cached assets:
36
36
  $ bundle && rm -rf tmp/cache/assets
37
37
  ```
38
38
 
39
- Restart your app, visit it in your browser, and press `cmd+ctrl+x` to see the overlay.
39
+ Restart your app, visit it in your browser, and press **cmd+shift+x** (Mac) or **ctrl+shift+x** to reveal the overlay.
40
40
 
41
41
  **Note:** for Xray to insert itself into your views automatically, `config.assets.debug = true` (the default) must be set in development.rb. If you disabled this because of slow assets in Rails 3.2.13, [try this monkey patch instead](http://stackoverflow.com/a/15520932/24848) in an initializer.
42
42
 
@@ -9,9 +9,12 @@ Xray.init = do ->
9
9
  return if Xray.initialized
10
10
  Xray.initialized = true
11
11
 
12
+ is_mac = navigator.platform.toUpperCase().indexOf('MAC') isnt -1
13
+
12
14
  # Register keyboard shortcuts
13
15
  $(document).keydown (e) ->
14
- if e.ctrlKey and e.metaKey and e.keyCode is 88 # cmd+ctrl+x
16
+ # cmd+shift+x on Mac, ctrl+shift+x on other platforms
17
+ if (is_mac and e.metaKey or !is_mac and e.ctrlKey) and e.shiftKey and e.keyCode is 88
15
18
  if Xray.isShowing then Xray.hide() else Xray.show()
16
19
  if Xray.isShowing and e.keyCode is 27 # esc
17
20
  Xray.hide()
@@ -22,7 +25,7 @@ Xray.init = do ->
22
25
  # Go ahead and do a pass on the DOM to find templates.
23
26
  Xray.findTemplates()
24
27
  # Ready to rock.
25
- console?.log "Ready to Xray. Press cmd+ctrl+x to scan your UI."
28
+ console?.log "Ready to Xray. Press #{if is_mac then 'cmd+shift+x' else 'ctrl+shift+x'} to scan your UI."
26
29
 
27
30
  # Returns all currently created Xray.Specimen objects.
28
31
  Xray.specimens = ->
data/lib/xray/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xray
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xray-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-02 00:00:00.000000000 Z
12
+ date: 2013-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails