api_docs 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +8 -0
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +67 -148
- data/Rakefile +29 -14
- data/VERSION +1 -1
- data/api_docs.gemspec +66 -25
- data/app/assets/javascripts/api_docs.js +11 -0
- data/app/assets/stylesheets/api_docs.css +62 -0
- data/app/controllers/api_docs/docs_controller.rb +8 -0
- data/app/views/api_docs/docs/_action.html.erb +41 -0
- data/app/views/api_docs/docs/_request_params.html.erb +16 -0
- data/app/views/api_docs/docs/index.html.erb +32 -0
- data/config/routes.rb +3 -0
- data/lib/api_docs/configuration.rb +16 -11
- data/lib/api_docs/engine.rb +3 -6
- data/lib/api_docs/test_helper.rb +81 -0
- data/lib/api_docs.rb +4 -26
- data/script/rails +8 -0
- data/test/api_docs_test.rb +15 -0
- data/test/docs_controller_test.rb +11 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/images/glyphicons-halflings-white.png +0 -0
- data/test/dummy/app/assets/images/glyphicons-halflings.png +0 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/javascripts/bootstrap.min.js +6 -0
- data/test/dummy/app/assets/stylesheets/application.css +14 -0
- data/test/dummy/app/assets/stylesheets/bootstrap.min.css +9 -0
- data/test/dummy/app/controllers/application_controller.rb +25 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +16 -0
- data/test/dummy/config/application.rb +65 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +31 -0
- data/test/dummy/config/environments/production.rb +64 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +10 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/test_helper.rb +14 -0
- data/test/test_helper_test.rb +104 -0
- metadata +119 -79
- data/app/assets/javascripts/api_docs.js.coffee +0 -37
- data/app/assets/javascripts/prettify.js +0 -28
- data/app/assets/stylesheets/prettify.css +0 -53
- data/app/views/api_docs/_api_docs.html.haml +0 -11
- data/app/views/api_docs/_curl.html.haml +0 -4
- data/app/views/api_docs/_form.html.haml +0 -18
- data/app/views/api_docs/_panel.html.haml +0 -33
- data/app/views/api_docs/_params.html.haml +0 -15
- data/app/views/api_docs/_response.html.haml +0 -16
- data/lib/api_docs/railtie.rb +0 -12
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
class ActionController::TestCase
|
10
|
+
setup :use_engine_routes
|
11
|
+
def use_engine_routes
|
12
|
+
@routes = ApiDocs::Engine.routes
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require File.expand_path('test_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class TestHelperTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
def setup
|
6
|
+
ApiDocs.config.ignored_attributes = %(created_at updated_at)
|
7
|
+
Dir.glob(ApiDocs.config.docs_path.join('*.yml')).each do |file_path|
|
8
|
+
FileUtils.rm(file_path)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_api_deep_clean_params
|
13
|
+
assert_equal ({'a' => 'b'}),
|
14
|
+
api_deep_clean_params({:a => 'b'})
|
15
|
+
|
16
|
+
assert_equal ({'a' => {'b' => 'c'}}),
|
17
|
+
api_deep_clean_params({:a => {:b => 'c'}})
|
18
|
+
|
19
|
+
assert_equal ([{'a' => 'b'}, {'c' => 'd'}]),
|
20
|
+
api_deep_clean_params([{:a => 'b'}, {:c => 'd'}])
|
21
|
+
|
22
|
+
assert_equal ({'a'=>[{'b'=>'c'}]}),
|
23
|
+
api_deep_clean_params({:a => [{:b => 'c'}]})
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_api_deep_clean_params_with_file_handler
|
27
|
+
assert_equal ({'a' => 'BINARY'}),
|
28
|
+
api_deep_clean_params({:a => Rack::Test::UploadedFile.new(__FILE__)})
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_api_deep_clean_params_with_ignored_params
|
32
|
+
ApiDocs.config.ignored_attributes = ['c']
|
33
|
+
assert_equal ({'c' => 'IGNORED'}),
|
34
|
+
api_deep_clean_params({:c => 'c'}, :as_response)
|
35
|
+
|
36
|
+
assert_equal ({'a' => [{'b' => 'c', 'c' => 'IGNORED'}]}),
|
37
|
+
api_deep_clean_params({:a => [:b => 'c', :c => 'd']}, :as_response)
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_api_call
|
41
|
+
api_call(:get, '/users/:id', :id => 12345) do |doc|
|
42
|
+
assert_response :success
|
43
|
+
assert_equal ({
|
44
|
+
'id' => 12345,
|
45
|
+
'name' => 'Test User'
|
46
|
+
}), JSON.parse(response.body)
|
47
|
+
end
|
48
|
+
|
49
|
+
api_call(:get, '/users/:id', :id => 'invalid') do |doc|
|
50
|
+
doc.description = 'Invalid user id'
|
51
|
+
assert_response :not_found
|
52
|
+
assert_equal ({
|
53
|
+
'message' => 'User not found'
|
54
|
+
}), JSON.parse(response.body)
|
55
|
+
end
|
56
|
+
|
57
|
+
output = begin
|
58
|
+
YAML.load_file(ApiDocs.config.docs_path.join('application.yml'))
|
59
|
+
rescue
|
60
|
+
fail 'api doc file not written'
|
61
|
+
end
|
62
|
+
|
63
|
+
assert output['show'].present?
|
64
|
+
assert_equal 2, output['show'].keys.size
|
65
|
+
|
66
|
+
object = output['show'][output['show'].keys.first]
|
67
|
+
assert_equal 'GET', object['method']
|
68
|
+
assert_equal '/users/:id', object['path']
|
69
|
+
assert_equal ({'id' => '12345'}), object['params']
|
70
|
+
assert_equal 200, object['status']
|
71
|
+
assert_equal ({'id' => 12345, 'name' => 'Test User'}), object['body']
|
72
|
+
|
73
|
+
object = output['show'][output['show'].keys.last]
|
74
|
+
assert_equal 'GET', object['method']
|
75
|
+
assert_equal '/users/:id', object['path']
|
76
|
+
assert_equal ({'id' => 'invalid'}), object['params']
|
77
|
+
assert_equal 404, object['status']
|
78
|
+
assert_equal ({'message' => 'User not found'}), object['body']
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_api_call_with_ignored_attribute
|
82
|
+
api_call(:get, '/users/:id', :id => 12345) do
|
83
|
+
assert_response :success
|
84
|
+
end
|
85
|
+
output = YAML.load_file(ApiDocs.config.docs_path.join('application.yml'))
|
86
|
+
assert_equal 1, output['show'].keys.size
|
87
|
+
|
88
|
+
ApiDocs.config.ignored_attributes << 'random'
|
89
|
+
api_call(:get, '/users/:id', :id => 12345, :random => 1) do
|
90
|
+
assert_response :success
|
91
|
+
end
|
92
|
+
output = YAML.load_file(ApiDocs.config.docs_path.join('application.yml'))
|
93
|
+
assert_equal 2, output['show'].keys.size
|
94
|
+
object = output['show'][output['show'].keys.last]
|
95
|
+
assert_not_equal 'IGNORED', object['body']['random']
|
96
|
+
|
97
|
+
api_call(:get, '/users/:id', :id => 12345, :random => 1) do
|
98
|
+
assert_response :success
|
99
|
+
end
|
100
|
+
output = YAML.load_file(ApiDocs.config.docs_path.join('application.yml'))
|
101
|
+
assert_equal 2, output['show'].keys.size
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
metadata
CHANGED
@@ -1,117 +1,157 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_docs
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 4
|
10
|
-
version: 0.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
8
|
+
- Oleg Khabarov
|
13
9
|
- Jack Neto
|
14
10
|
- The Working Group Inc.
|
15
11
|
autorequire:
|
16
12
|
bindir: bin
|
17
13
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2012-09-11 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
23
17
|
name: rails
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
26
19
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 3
|
31
|
-
segments:
|
32
|
-
- 3
|
33
|
-
- 1
|
34
|
-
- 0
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
35
23
|
version: 3.1.0
|
36
24
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: bootstrap_builder
|
40
25
|
prerelease: false
|
41
|
-
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
27
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 3.1.0
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: jquery-rails
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
52
40
|
type: :runtime
|
53
|
-
|
54
|
-
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: jeweler
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
description: Generate API documentation using integration tests in Ruby on Rails 3
|
55
65
|
email: jack@twg.ca
|
56
66
|
executables: []
|
57
|
-
|
58
67
|
extensions: []
|
59
|
-
|
60
|
-
|
61
|
-
- LICENSE.txt
|
68
|
+
extra_rdoc_files:
|
69
|
+
- LICENSE
|
62
70
|
- README.md
|
63
|
-
files:
|
64
|
-
-
|
71
|
+
files:
|
72
|
+
- Gemfile
|
73
|
+
- LICENSE
|
65
74
|
- README.md
|
66
75
|
- Rakefile
|
67
76
|
- VERSION
|
68
77
|
- api_docs.gemspec
|
69
|
-
- app/assets/javascripts/api_docs.js
|
70
|
-
- app/assets/
|
71
|
-
- app/
|
72
|
-
- app/views/api_docs/
|
73
|
-
- app/views/api_docs/
|
74
|
-
- app/views/api_docs/
|
75
|
-
-
|
76
|
-
- app/views/api_docs/_params.html.haml
|
77
|
-
- app/views/api_docs/_response.html.haml
|
78
|
+
- app/assets/javascripts/api_docs.js
|
79
|
+
- app/assets/stylesheets/api_docs.css
|
80
|
+
- app/controllers/api_docs/docs_controller.rb
|
81
|
+
- app/views/api_docs/docs/_action.html.erb
|
82
|
+
- app/views/api_docs/docs/_request_params.html.erb
|
83
|
+
- app/views/api_docs/docs/index.html.erb
|
84
|
+
- config/routes.rb
|
78
85
|
- lib/api_docs.rb
|
79
86
|
- lib/api_docs/configuration.rb
|
80
87
|
- lib/api_docs/engine.rb
|
81
|
-
- lib/api_docs/
|
82
|
-
|
88
|
+
- lib/api_docs/test_helper.rb
|
89
|
+
- script/rails
|
90
|
+
- test/api_docs_test.rb
|
91
|
+
- test/docs_controller_test.rb
|
92
|
+
- test/dummy/README.rdoc
|
93
|
+
- test/dummy/Rakefile
|
94
|
+
- test/dummy/app/assets/images/glyphicons-halflings-white.png
|
95
|
+
- test/dummy/app/assets/images/glyphicons-halflings.png
|
96
|
+
- test/dummy/app/assets/javascripts/application.js
|
97
|
+
- test/dummy/app/assets/javascripts/bootstrap.min.js
|
98
|
+
- test/dummy/app/assets/stylesheets/application.css
|
99
|
+
- test/dummy/app/assets/stylesheets/bootstrap.min.css
|
100
|
+
- test/dummy/app/controllers/application_controller.rb
|
101
|
+
- test/dummy/app/helpers/application_helper.rb
|
102
|
+
- test/dummy/app/mailers/.gitkeep
|
103
|
+
- test/dummy/app/models/.gitkeep
|
104
|
+
- test/dummy/app/views/layouts/application.html.erb
|
105
|
+
- test/dummy/config.ru
|
106
|
+
- test/dummy/config/application.rb
|
107
|
+
- test/dummy/config/boot.rb
|
108
|
+
- test/dummy/config/environment.rb
|
109
|
+
- test/dummy/config/environments/development.rb
|
110
|
+
- test/dummy/config/environments/production.rb
|
111
|
+
- test/dummy/config/environments/test.rb
|
112
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
113
|
+
- test/dummy/config/initializers/inflections.rb
|
114
|
+
- test/dummy/config/initializers/mime_types.rb
|
115
|
+
- test/dummy/config/initializers/secret_token.rb
|
116
|
+
- test/dummy/config/initializers/session_store.rb
|
117
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
118
|
+
- test/dummy/config/locales/en.yml
|
119
|
+
- test/dummy/config/routes.rb
|
120
|
+
- test/dummy/lib/assets/.gitkeep
|
121
|
+
- test/dummy/log/.gitkeep
|
122
|
+
- test/dummy/public/404.html
|
123
|
+
- test/dummy/public/422.html
|
124
|
+
- test/dummy/public/500.html
|
125
|
+
- test/dummy/public/favicon.ico
|
126
|
+
- test/dummy/script/rails
|
127
|
+
- test/test_helper.rb
|
128
|
+
- test/test_helper_test.rb
|
83
129
|
homepage: http://github.com/twg/api_docs
|
84
|
-
licenses:
|
130
|
+
licenses:
|
85
131
|
- MIT
|
86
132
|
post_install_message:
|
87
133
|
rdoc_options: []
|
88
|
-
|
89
|
-
require_paths:
|
134
|
+
require_paths:
|
90
135
|
- lib
|
91
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
137
|
none: false
|
93
|
-
requirements:
|
94
|
-
- -
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
|
97
|
-
segments:
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
segments:
|
98
143
|
- 0
|
99
|
-
|
100
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
hash: -2540942962609113030
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
146
|
none: false
|
102
|
-
requirements:
|
103
|
-
- -
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
version: "0"
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
109
151
|
requirements: []
|
110
|
-
|
111
152
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.
|
153
|
+
rubygems_version: 1.8.23
|
113
154
|
signing_key:
|
114
155
|
specification_version: 3
|
115
|
-
summary:
|
156
|
+
summary: Generate API documentation using integration tests in Ruby on Rails 3
|
116
157
|
test_files: []
|
117
|
-
|
@@ -1,37 +0,0 @@
|
|
1
|
-
$ ->
|
2
|
-
prettyPrint()
|
3
|
-
|
4
|
-
# Select the first panel
|
5
|
-
$('ul.main-tabs li:first').removeClass('active') # wheir hack
|
6
|
-
$('ul.main-tabs a:first').tab('show')
|
7
|
-
|
8
|
-
# Select the first sub-panel of each tab
|
9
|
-
$('ul.sub-tabs').each ->
|
10
|
-
$(this).find('a:first').tab('show')
|
11
|
-
|
12
|
-
# Select a tab based on the URL
|
13
|
-
selectPanel window.location.hash
|
14
|
-
|
15
|
-
|
16
|
-
# --- Clicking on a tab link ---
|
17
|
-
$('ul.main-tabs li a, ul.sub-tabs li a').click (event) ->
|
18
|
-
window.location.hash = $(this).attr('href')
|
19
|
-
|
20
|
-
|
21
|
-
# --- Submitting the form ---
|
22
|
-
$('.tab-pane form').live 'submit', (event) ->
|
23
|
-
url = $(this).data('url')
|
24
|
-
ids = url.match(/\/(:\w*)/g)
|
25
|
-
for id in ids
|
26
|
-
input_field = $(this).find('input[name=' + id.substring(2) + ']')
|
27
|
-
url = url.replace(id, '/' + input_field.attr('value'))
|
28
|
-
$(this).attr('action', url)
|
29
|
-
|
30
|
-
|
31
|
-
selectPanel = (url)->
|
32
|
-
if url != ''
|
33
|
-
url_parts = window.location.hash.substring(1).split('-')
|
34
|
-
$('ul.main-tabs a[href="#' + url_parts[0] + '"]').tab('show')
|
35
|
-
|
36
|
-
if url_parts.length > 1
|
37
|
-
$('ul.sub-tabs a[href="' + url + '"]').tab('show')
|
@@ -1,28 +0,0 @@
|
|
1
|
-
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
2
|
-
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
3
|
-
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
4
|
-
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
5
|
-
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
6
|
-
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
7
|
-
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
8
|
-
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
9
|
-
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
10
|
-
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
11
|
-
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
12
|
-
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
13
|
-
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
14
|
-
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
15
|
-
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
16
|
-
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
17
|
-
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
18
|
-
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
19
|
-
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
20
|
-
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
21
|
-
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
22
|
-
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
23
|
-
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
24
|
-
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
25
|
-
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
26
|
-
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
27
|
-
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
28
|
-
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
@@ -1,53 +0,0 @@
|
|
1
|
-
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
2
|
-
|
3
|
-
/* Pretty printing styles. Used with prettify.js. */
|
4
|
-
/* Vim sunburst theme by David Leibovic */
|
5
|
-
|
6
|
-
pre .str, code .str { color: #65B042; } /* string - green */
|
7
|
-
pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
|
8
|
-
pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
|
9
|
-
pre .typ, code .typ { color: #89bdff; } /* type - light blue */
|
10
|
-
pre .lit, code .lit { color: #3387CC; } /* literal - blue */
|
11
|
-
pre .pun, code .pun { color: #fff; } /* punctuation - white */
|
12
|
-
pre .pln, code .pln { color: #fff; } /* plaintext - white */
|
13
|
-
pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
|
14
|
-
pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
|
15
|
-
pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
|
16
|
-
pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
|
17
|
-
|
18
|
-
pre.prettyprint, code.prettyprint {
|
19
|
-
background-color: rgba(20, 20,20, .8);
|
20
|
-
-moz-border-radius: 8px;
|
21
|
-
-webkit-border-radius: 8px;
|
22
|
-
-o-border-radius: 8px;
|
23
|
-
-ms-border-radius: 8px;
|
24
|
-
-khtml-border-radius: 8px;
|
25
|
-
border-radius: 8px;
|
26
|
-
}
|
27
|
-
|
28
|
-
pre.prettyprint {
|
29
|
-
width: 95%;
|
30
|
-
margin: 1em auto;
|
31
|
-
padding: 1em;
|
32
|
-
white-space: pre-wrap;
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
/* Specify class=linenums on a pre to get line numbering */
|
37
|
-
ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
|
38
|
-
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
|
39
|
-
/* Alternate shading for lines */
|
40
|
-
li.L1,li.L3,li.L5,li.L7,li.L9 { }
|
41
|
-
|
42
|
-
@media print {
|
43
|
-
pre .str, code .str { color: #060; }
|
44
|
-
pre .kwd, code .kwd { color: #006; font-weight: bold; }
|
45
|
-
pre .com, code .com { color: #600; font-style: italic; }
|
46
|
-
pre .typ, code .typ { color: #404; font-weight: bold; }
|
47
|
-
pre .lit, code .lit { color: #044; }
|
48
|
-
pre .pun, code .pun { color: #440; }
|
49
|
-
pre .pln, code .pln { color: #000; }
|
50
|
-
pre .tag, code .tag { color: #006; font-weight: bold; }
|
51
|
-
pre .atn, code .atn { color: #404; }
|
52
|
-
pre .atv, code .atv { color: #060; }
|
53
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
.tabbable
|
2
|
-
%ul.nav.nav-tabs.main-tabs
|
3
|
-
- @api_docs.keys.each_with_index do |api_tab_label, i|
|
4
|
-
%li{:class => (:active if i == 0)}
|
5
|
-
= link_to api_tab_label.humanize.capitalize, "##{api_tab_label.underscore}", "data-toggle" => "tab"
|
6
|
-
|
7
|
-
.tab-content
|
8
|
-
- @api_docs.each do |api_tab_label, api|
|
9
|
-
.tab-pane{:id => api_tab_label.underscore}
|
10
|
-
- unless api.blank?
|
11
|
-
= render :partial => 'api_docs/panel', :locals => {:label => api_tab_label, :api => api}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
- if api_details['method'].present? && %{post get}.include?(api_details['method'].downcase)
|
2
|
-
%hr/
|
3
|
-
%p
|
4
|
-
%strong Try it out:
|
5
|
-
- full_url = "#{ApiDocs.config.api_url}#{api_details['url']}"
|
6
|
-
%em #{api_details['method']} #{full_url}
|
7
|
-
= bootstrap_form_for '', :url => full_url, :html => {:method => api_details['method'], :target => '_blank', :class => 'form-horizontal', 'data-url' => full_url} do |f|
|
8
|
-
- case params
|
9
|
-
- when Array
|
10
|
-
- api_details['params'].each do |param|
|
11
|
-
= f.text_field param, :label => param, :name => param
|
12
|
-
- when Hash
|
13
|
-
- api_details['params'].each do |param, description|
|
14
|
-
= f.text_field param, :label => param, :name => param, :help_block => description
|
15
|
-
|
16
|
-
.form-actions
|
17
|
-
= f.submit :send, :class => 'btn-primary'
|
18
|
-
|
@@ -1,33 +0,0 @@
|
|
1
|
-
.tabbable.tabs-left
|
2
|
-
.row
|
3
|
-
- if api.length > 1
|
4
|
-
.span2
|
5
|
-
%ul.nav.nav-tabs.sub-tabs
|
6
|
-
- api.each do |api_path, api_details|
|
7
|
-
%li
|
8
|
-
= link_to "##{label}-#{api_path.gsub(/[\/\: ]/, '')}".downcase, "data-toggle" => "tab" do
|
9
|
-
= api_path
|
10
|
-
|
11
|
-
%div{:class => (api.length > 1 ? 'span10' : 'span12')}
|
12
|
-
%div{:class => ('tab-content' if api.length > 1)}
|
13
|
-
- api.each do |api_path, api_details|
|
14
|
-
.tab-pane{:id => "#{label}-#{api_path.gsub(/[\/\: ]/, '')}".downcase}
|
15
|
-
%h3
|
16
|
-
= api_path
|
17
|
-
- if api_details['method']
|
18
|
-
%span.label.label-important= api_details['method']
|
19
|
-
%small #{ApiDocs.config.api_url}#{api_details['url']}
|
20
|
-
|
21
|
-
- if api_details['description']
|
22
|
-
%pre= api_details['description'].html_safe
|
23
|
-
|
24
|
-
= render :partial => 'api_docs/params', :object => api_details['params']
|
25
|
-
|
26
|
-
.row
|
27
|
-
= render :partial => 'api_docs/response', :object => api_details, :locals => {:response_type => 'success'}
|
28
|
-
= render :partial => 'api_docs/response', :object => api_details, :locals => {:response_type => 'fail'}
|
29
|
-
|
30
|
-
= render :partial => 'api_docs/curl', :locals => {:api_details => api_details}
|
31
|
-
|
32
|
-
= render :partial => 'api_docs/form', :locals => {:api_details => api_details}
|
33
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- if params
|
2
|
-
%p
|
3
|
-
%strong Parameters:
|
4
|
-
- case params
|
5
|
-
- when Array
|
6
|
-
%pre= params.join("\n")
|
7
|
-
- when Hash
|
8
|
-
%table.table.table-striped.table-bordered.table-condensed
|
9
|
-
%tr
|
10
|
-
%th Param
|
11
|
-
%th Description
|
12
|
-
- params.each do |param, description|
|
13
|
-
%tr
|
14
|
-
%td= param
|
15
|
-
%td= description
|