hocus_pocus 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/engines/editor/app/assets/stylesheets/editor.css.sass +68 -0
- data/engines/editor/app/views/hocus_pocus/editor/editor/_editor.html.erb +4 -4
- data/engines/editor/lib/hocus_pocus/editor/middleware.rb +3 -3
- data/engines/generator/app/assets/stylesheets/generator.css.sass +105 -0
- data/engines/generator/app/views/hocus_pocus/generator/generator/index.html.erb +28 -18
- data/engines/recorder/app/assets/stylesheets/recorder.css.sass +44 -0
- data/engines/recorder/app/views/hocus_pocus/recorder/recorder/index.js.erb +1 -1
- data/engines/recorder/lib/hocus_pocus/recorder/middleware.rb +3 -3
- data/lib/hocus_pocus/middleware.rb +1 -1
- data/lib/hocus_pocus/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca0d66944e5a36d17491259d52e0fd076578425
|
4
|
+
data.tar.gz: 9b6c14bd4bc5f261bfed810594ef31303267ec63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e05c8b8f5937608cae75370ea4ec7958e2e521d7b11b1e30a8517a3925c0f9704468ca7e4844f3af9dc8c09c4c89bf1d5498ddd0bbed6b6b2c91c57474492eed
|
7
|
+
data.tar.gz: f0116cac8f20e54c9f5df6fcb374b119d6a0744b99ca447fd9dd43e0575e6ed3b10df43fee75feb4f2b66803a0194169a0f149e08d0da4271b493bf3ebc57e90
|
@@ -0,0 +1,68 @@
|
|
1
|
+
$black: #444444
|
2
|
+
$white: white
|
3
|
+
$yellow: #fffe89
|
4
|
+
$button_yellow: #fffe89
|
5
|
+
$background-color: rgba(0, 0, 0, 0.6)
|
6
|
+
$background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNM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wvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Uo8+OAAAACFJREFUeNpi+P//vzwQMxDCTAxEglGFeAELlJYnpBAgwADObh41Cq6M2wAAAABJRU5ErkJggg==)
|
7
|
+
|
8
|
+
#__editor__
|
9
|
+
=button($button-color: $button_yellow)
|
10
|
+
display: block
|
11
|
+
color: lighten($black, 8%)
|
12
|
+
font-size: 18px
|
13
|
+
font-weight: bold
|
14
|
+
line-height: 18px
|
15
|
+
text-decoration: none
|
16
|
+
border-radius: 4px
|
17
|
+
text-shadow: rgba(255, 255, 255, 0.4) 0 1px 0
|
18
|
+
padding: 8px 20px
|
19
|
+
border: darken($button-color, 22%) solid 1px
|
20
|
+
box-shadow: rgba(255, 255, 255, 0.2) 0 1px 0 inset, rgba(0, 0, 0, 0.1) 0 1px 0
|
21
|
+
background: linear-gradient($button-color, darken($button-color, 18%))
|
22
|
+
cursor: pointer
|
23
|
+
&:hover
|
24
|
+
background: linear-gradient(darken($button-color, 6%), darken($button-color, 12%))
|
25
|
+
&:active
|
26
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 1px inset, rgba(255, 255, 255, 0.1) 0 1px 0
|
27
|
+
padding: 30px 0
|
28
|
+
font-size: 16px
|
29
|
+
background: $background-color $background-image repeat top right
|
30
|
+
font-family: arial,sans-serif
|
31
|
+
color: $black
|
32
|
+
position: absolute
|
33
|
+
left: 0
|
34
|
+
top: 0
|
35
|
+
width: 100%
|
36
|
+
p, ul, ol, dl, p, li, dt, dd, tr, td, form, h1, h2
|
37
|
+
margin: 0
|
38
|
+
padding: 0
|
39
|
+
|
40
|
+
input
|
41
|
+
font-family: arial,sans-serif
|
42
|
+
border: none
|
43
|
+
|
44
|
+
h3
|
45
|
+
margin: 0 0 30px
|
46
|
+
text-align: center
|
47
|
+
font-size: 22px
|
48
|
+
color: $white
|
49
|
+
|
50
|
+
#file
|
51
|
+
display: block
|
52
|
+
margin: 0 auto 30px
|
53
|
+
|
54
|
+
#actions
|
55
|
+
clear: both
|
56
|
+
width: 200px
|
57
|
+
margin: 0 auto
|
58
|
+
overflow: hidden
|
59
|
+
.hide
|
60
|
+
+button(#f8f8f8)
|
61
|
+
float: left
|
62
|
+
.save
|
63
|
+
+button
|
64
|
+
float: right
|
65
|
+
|
66
|
+
#generate_submit
|
67
|
+
+button
|
68
|
+
margin: 0 auto
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<div id="__editor__">
|
2
|
+
<link href="/assets/editor.css" media="all" rel="stylesheet" type="text/css">
|
2
3
|
<h3>editing <%= @path %>...</h3>
|
3
4
|
|
4
5
|
<%= form_tag save_editor_path, :remote => true, :id => HocusPocus::Editor::EDITOR do %>
|
5
6
|
<%= hidden_field_tag :path, @path %>
|
6
7
|
<%= text_area_tag :file, @file, :size => '100x30' %>
|
7
|
-
<div
|
8
|
-
<%= button_to_function 'Hide', "$('#__editor__').hide()"
|
9
|
-
<%= submit_tag 'Save!' %>
|
8
|
+
<div id="actions">
|
9
|
+
<%= button_to_function 'Hide', "$('#__editor__').hide()", :class => "hide" %>
|
10
|
+
<%= submit_tag 'Save!', :class => "save" %>
|
10
11
|
</div>
|
11
12
|
<% end %>
|
12
13
|
|
13
|
-
<hr>
|
14
14
|
</div>
|
@@ -13,7 +13,7 @@ module HocusPocus
|
|
13
13
|
@app.call(env).tap do |status, headers, body|
|
14
14
|
if body.is_a?(ActionDispatch::Response) && body.request.format.html?
|
15
15
|
if Thread.current[HocusPocus::Editor::VIEW_FILENAME]
|
16
|
-
body.body = insert_text body.body, :after, /<div id="#{HocusPocus::CONTAINER}" .*?>/i, %Q[#{edit_link}
|
16
|
+
body.body = insert_text body.body, :after, /<div id="#{HocusPocus::CONTAINER}" .*?>/i, %Q[#{edit_link}#{partials}]
|
17
17
|
Thread.current[HocusPocus::Editor::VIEW_FILENAME] = nil
|
18
18
|
end
|
19
19
|
end
|
@@ -22,11 +22,11 @@ module HocusPocus
|
|
22
22
|
|
23
23
|
private
|
24
24
|
def edit_link
|
25
|
-
%Q[<a href="/hocus_pocus/editor?template=#{Thread.current[HocusPocus::Editor::VIEW_FILENAME]}" data-remote="true" onclick="$(this).closest('div').find('div.partials').toggle()">edit</a>]
|
25
|
+
%Q[<a href="/hocus_pocus/editor?template=#{Thread.current[HocusPocus::Editor::VIEW_FILENAME]}" data-remote="true" onclick="$(this).closest('div').find('div.partials').toggle()" class="edit">edit</a>]
|
26
26
|
end
|
27
27
|
|
28
28
|
def partials
|
29
|
-
%Q[<div class="partials" style="display:none">#{(Thread.current[HocusPocus::Editor::PARTIAL_FILENAMES] || []).map(&:virtual_path).map {|v| '<a href="/hocus_pocus/editor?template=' + v + '" data-remote="true">' + v + '</a>'}.join('
|
29
|
+
%Q[<div class="partials" style="display:none">#{(Thread.current[HocusPocus::Editor::PARTIAL_FILENAMES] || []).map(&:virtual_path).map {|v| '<a href="/hocus_pocus/editor?template=' + v + '" data-remote="true" class="partials">' + v + '</a>'}.join('')}</div>]
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
$black: #444444
|
2
|
+
$white: white
|
3
|
+
$yellow: #fffe89
|
4
|
+
$button_yellow: #fffe89
|
5
|
+
$background-color: rgba(0, 0, 0, 0.6)
|
6
|
+
$background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0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15
|
+
padding: 20px
|
16
|
+
font-size: 16px
|
17
|
+
background: $background-color $background-image repeat top right
|
18
|
+
font-family: arial,sans-serif
|
19
|
+
color: $black
|
20
|
+
|
21
|
+
input
|
22
|
+
font-family: arial,sans-serif
|
23
|
+
|
24
|
+
h1
|
25
|
+
margin: 0 0 30px
|
26
|
+
text-align: center
|
27
|
+
font-size: 26px
|
28
|
+
|
29
|
+
#container
|
30
|
+
text-align: center
|
31
|
+
|
32
|
+
#add_attr_type
|
33
|
+
margin: 12px auto 0
|
34
|
+
display: block
|
35
|
+
|
36
|
+
#generate
|
37
|
+
background: rgba(255, 255, 255, .8)
|
38
|
+
padding: 30px 40px
|
39
|
+
margin: 0 auto 0
|
40
|
+
display: inline-block
|
41
|
+
text-align: left
|
42
|
+
h2
|
43
|
+
float: left
|
44
|
+
margin: 0 20px 0 0
|
45
|
+
font-size: 16px
|
46
|
+
font-weight: normal
|
47
|
+
line-height: 40px
|
48
|
+
#attrs
|
49
|
+
float: left
|
50
|
+
#actions
|
51
|
+
clear: both
|
52
|
+
|
53
|
+
#action
|
54
|
+
padding: 30px 0 0
|
55
|
+
clear: both
|
56
|
+
|
57
|
+
=button($button-color: $button_yellow)
|
58
|
+
display: block
|
59
|
+
color: lighten($black, 8%)
|
60
|
+
font-size: 20px
|
61
|
+
font-weight: bold
|
62
|
+
line-height: 20px
|
63
|
+
text-decoration: none
|
64
|
+
border-radius: 6px
|
65
|
+
text-shadow: rgba(255, 255, 255, 0.4) 0 1px 0
|
66
|
+
padding: 8px 20px
|
67
|
+
border: darken($button-color, 32%) solid 1px
|
68
|
+
box-shadow: rgba(255, 255, 255, 0.8) 0 1px 0 inset, rgba(0, 0, 0, 0.2) 0 1px 0
|
69
|
+
background: linear-gradient($button-color, darken($button-color, 18%))
|
70
|
+
cursor: pointer
|
71
|
+
&:hover
|
72
|
+
background: linear-gradient(darken($button-color, 6%), darken($button-color, 12%))
|
73
|
+
&:active
|
74
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 1px inset, rgba(255, 255, 255, 0.1) 0 1px 0
|
75
|
+
|
76
|
+
#generate_submit
|
77
|
+
+button
|
78
|
+
margin: 0 auto
|
79
|
+
|
80
|
+
.new_attr
|
81
|
+
display: block
|
82
|
+
background: rgba(0, 0, 0, .1)
|
83
|
+
padding: 8px 12px
|
84
|
+
margin: 0 0 6px
|
85
|
+
.separator
|
86
|
+
display: inline-block
|
87
|
+
margin: 0 8px
|
88
|
+
input[type="text"]
|
89
|
+
width: 220px
|
90
|
+
|
91
|
+
#__hocus_pocus_container__
|
92
|
+
background: rgba(0, 0, 0, .4)
|
93
|
+
position: absolute
|
94
|
+
right: 0
|
95
|
+
top: 0
|
96
|
+
padding: 20px
|
97
|
+
color: $white
|
98
|
+
a
|
99
|
+
color: $white
|
100
|
+
text-decoration: none
|
101
|
+
&:hover
|
102
|
+
color: #FFC3C3
|
103
|
+
pre
|
104
|
+
color: $yellow
|
105
|
+
margin: 20px 40px
|
@@ -1,33 +1,43 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
3
|
<title>generator</title>
|
4
|
+
<%= stylesheet_link_tag 'generator' %>
|
4
5
|
<%= javascript_include_tag 'application' %>
|
5
6
|
<%= csrf_meta_tags %>
|
6
7
|
<script type="text/javascript">
|
7
8
|
$(document).on('click', '#add_attr_type', function() {
|
8
9
|
var i = $('#attr_type input').length;
|
9
|
-
$('#attr_type').append('
|
10
|
+
$('#attr_type').append('<span class="new_attr"><%= escape_javascript text_field_tag('attr[@]', '') %><span class="separator">:</span><%= escape_javascript(type_select 'type[@]', :class => 'type') %></span>'.replace(/@/g, i));
|
10
11
|
$('#attr_' + i).focus();
|
11
12
|
})
|
12
13
|
</script>
|
13
14
|
</head>
|
14
15
|
<body>
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
16
|
+
<div id="container">
|
17
|
+
<div id="generate">
|
18
|
+
<h1>Generate Scaffold</h1>
|
19
|
+
<%= form_tag scaffold_generator_path, :remote => true, :id => 'generator_form' do %>
|
20
|
+
<h2>
|
21
|
+
<% if @name.include? '_' %>
|
22
|
+
g scaffold
|
23
|
+
<%= select_tag :name, options_for_select([@name, @name.gsub('_', '/')]) %>
|
24
|
+
<% else %>
|
25
|
+
g scaffold <%= @name %>
|
26
|
+
<%= hidden_field_tag :name, @name %>
|
27
|
+
<% end %>
|
28
|
+
</h2>
|
29
|
+
<%= hidden_field_tag :return_path, params[:return_path] %>
|
30
|
+
<div id="attrs">
|
31
|
+
<div id="attr_type">
|
32
|
+
<span class="new_attr"><%= text_field_tag 'attr[0]', '', :autofocus => true %><span class="separator">:</span><%= type_select 'type[0]', :class => 'type' %></span>
|
33
|
+
</div>
|
34
|
+
<input type="button" value="add attribute" id="add_attr_type">
|
35
|
+
</div>
|
36
|
+
<div id="action">
|
37
|
+
<%= submit_tag 'Generate', :id => "generate_submit" %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
</div>
|
32
42
|
</body>
|
33
43
|
</html>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#__hocus_pocus_container__
|
2
|
+
=button($button-color: #ffffff)
|
3
|
+
display: block
|
4
|
+
color: #444444
|
5
|
+
font-size: 10px
|
6
|
+
font-weight: bold
|
7
|
+
line-height: 12px
|
8
|
+
text-decoration: none
|
9
|
+
border-radius: 4px
|
10
|
+
text-shadow: rgba(255, 255, 255, 0.4) 0 1px 0
|
11
|
+
padding: 4px 0
|
12
|
+
box-shadow: rgba(255, 255, 255, 0.4) 0 1px 0 inset
|
13
|
+
background: linear-gradient($button-color, darken($button-color, 18%))
|
14
|
+
cursor: pointer
|
15
|
+
width: 70px
|
16
|
+
text-align: center
|
17
|
+
&:hover
|
18
|
+
background: linear-gradient(darken($button-color, 6%), darken($button-color, 12%))
|
19
|
+
&:active
|
20
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 1px inset
|
21
|
+
background: rgba(0, 0, 0, .2)
|
22
|
+
position: absolute
|
23
|
+
right: 0
|
24
|
+
top: 0
|
25
|
+
padding: 12px
|
26
|
+
color: #fff
|
27
|
+
a
|
28
|
+
color: #fff
|
29
|
+
text-decoration: none
|
30
|
+
display: block
|
31
|
+
&.edit,
|
32
|
+
&.partials
|
33
|
+
margin: 0 0 12px
|
34
|
+
+button(#ffffff)
|
35
|
+
&.spec
|
36
|
+
+button(#ffffff)
|
37
|
+
&.clear:hover
|
38
|
+
background: transparent
|
39
|
+
|
40
|
+
pre
|
41
|
+
color: #ffff4f
|
42
|
+
background: transparent
|
43
|
+
margin: 0
|
44
|
+
padding: 20px 40px
|
@@ -1 +1 @@
|
|
1
|
-
$('#<%= HocusPocus::CONTAINER %> div.spec').toggle().html('<pre><%= escape_javascript(flash[HocusPocus::Recorder::SPEC]) + '\n end' if flash[HocusPocus::Recorder::SPEC] %></pre><div align="right"><a href="/hocus_pocus/recorder" data-remote="true" data-method="delete">Clear</a></div></div>')
|
1
|
+
$('#<%= HocusPocus::CONTAINER %> div.spec').toggle().html('<pre><%= escape_javascript(flash[HocusPocus::Recorder::SPEC]) + '\n end' if flash[HocusPocus::Recorder::SPEC] %></pre><div align="right"><a href="/hocus_pocus/recorder" data-remote="true" data-method="delete" class="clear">Clear</a></div></div>')
|
@@ -13,19 +13,19 @@ module HocusPocus
|
|
13
13
|
@app.call(env).tap do |status, headers, body|
|
14
14
|
if body.is_a?(ActionDispatch::Response) && body.request.format.html? && (body.request.path !~ %r[^/*hocus_pocus/])
|
15
15
|
body.body = insert_text body.body, :before, /<\/head>/i, %Q[<script src="/assets/recorder.js"></script>]
|
16
|
-
body.body = insert_text body.body, :after, /<div id="#{HocusPocus::CONTAINER}" .*?>/i, %Q[#{spec_link}
|
16
|
+
body.body = insert_text body.body, :after, /<div id="#{HocusPocus::CONTAINER}" .*?>/i, %Q[#{spec_link}#{spec}]
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
22
|
def spec_link
|
23
|
-
%Q[<a href="/hocus_pocus/recorder" data-remote="true">spec</a>]
|
23
|
+
%Q[<a href="/hocus_pocus/recorder" data-remote="true" class="spec">spec</a>]
|
24
24
|
end
|
25
25
|
|
26
26
|
def spec
|
27
27
|
#FIXME more assertions
|
28
|
-
%Q[<div class="spec" style="display:none"><div align="right"><a href="/hocus_pocus/recorder" data-remote="true" data-method="delete">Clear</a></div></div>]
|
28
|
+
%Q[<div class="spec" style="display:none"><div align="right"><a href="/hocus_pocus/recorder" data-remote="true" data-method="delete" class="clear">Clear</a></div></div>]
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -11,7 +11,7 @@ module HocusPocus
|
|
11
11
|
def call(env)
|
12
12
|
@app.call(env).tap do |status, headers, body|
|
13
13
|
if body.is_a?(ActionDispatch::Response) && (body.request.path !~ %r[^/*hocus_pocus/])
|
14
|
-
body.body = insert_text body.body, :before, /<\/body>/i, %Q[<div id="#{HocusPocus::CONTAINER}" style="position:absolute; top:0; right: 0;
|
14
|
+
body.body = insert_text body.body, :before, /<\/body>/i, %Q[<div id="#{HocusPocus::CONTAINER}" style="position:absolute; top:0; right: 0;"><link href="/assets/recorder.css" media="all" rel="stylesheet" type="text/css"></div>]
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/lib/hocus_pocus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hocus_pocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nested_scaffold
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- engines/command_line/lib/hocus_pocus/command_line/engine.rb
|
46
46
|
- engines/command_line/lib/hocus_pocus/command_line/middleware.rb
|
47
47
|
- engines/command_line/lib/hocus_pocus/command_line/railtie.rb
|
48
|
+
- engines/editor/app/assets/stylesheets/editor.css.sass
|
48
49
|
- engines/editor/app/controllers/hocus_pocus/editor/editor_controller.rb
|
49
50
|
- engines/editor/app/views/hocus_pocus/editor/editor/_editor.html.erb
|
50
51
|
- engines/editor/app/views/hocus_pocus/editor/editor/index.js.erb
|
@@ -53,6 +54,7 @@ files:
|
|
53
54
|
- engines/editor/lib/hocus_pocus/editor/engine.rb
|
54
55
|
- engines/editor/lib/hocus_pocus/editor/middleware.rb
|
55
56
|
- engines/editor/lib/hocus_pocus/editor/railtie.rb
|
57
|
+
- engines/generator/app/assets/stylesheets/generator.css.sass
|
56
58
|
- engines/generator/app/controllers/hocus_pocus/generator/generator_controller.rb
|
57
59
|
- engines/generator/app/helpers/hocus_pocus/generator/generator_helper.rb
|
58
60
|
- engines/generator/app/views/hocus_pocus/generator/generator/index.html.erb
|
@@ -60,6 +62,7 @@ files:
|
|
60
62
|
- engines/generator/config/routes.rb
|
61
63
|
- engines/generator/lib/hocus_pocus/generator/engine.rb
|
62
64
|
- engines/generator/lib/hocus_pocus/generator/railtie.rb
|
65
|
+
- engines/recorder/app/assets/stylesheets/recorder.css.sass
|
63
66
|
- engines/recorder/app/controllers/hocus_pocus/recorder/recorder_controller.rb
|
64
67
|
- engines/recorder/app/views/hocus_pocus/recorder/recorder/destroy.js.erb
|
65
68
|
- engines/recorder/app/views/hocus_pocus/recorder/recorder/index.js.erb
|