repres-hyper_text 1.1 → 1.2
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 +4 -4
- data/README.md +15 -14
- data/Rakefile +2 -2
- data/app/assets/config/repres-hyper_text_manifest.js +2 -0
- data/app/assets/javascripts/repres/hyper_text/application.js +1 -1
- data/app/assets/stylesheets/repres/hyper_text/application.css +3 -3
- data/app/controllers/repres/hyper_text/application_controller.rb +1 -0
- data/app/helpers/repres/hyper_text/application_helper.rb +4 -0
- data/app/jobs/repres/hyper_text/application_job.rb +2 -0
- data/app/mailers/repres/hyper_text/application_mailer.rb +4 -0
- data/app/models/repres/hyper_text/application_record.rb +3 -0
- data/app/views/layouts/repres/hyper_text/application.html.erb +2 -2
- data/app/views/repres/hyper_text/_script.html.erb +2 -2
- data/app/views/repres/hyper_text/_style.html.erb +3 -3
- data/lib/repres/hyper_text.rb +1 -0
- data/lib/repres/hyper_text/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 454bba1fe876a8fe64b9ca4efa3c824ecade1c26
|
4
|
+
data.tar.gz: bbaa01c020c009d0a676cc845447d7eb35529143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4172072f1d735e728024967b354e11b97c66ab79c3bc54f6a1866f647de741cdf102c033c0bf30daf5bb9da771ebbe36d9ead30c2ee16e6dfd948f8f1ac12217
|
7
|
+
data.tar.gz: 08eb18bf3ba01e3d009169e7935627dea3341eb9307d8c41ac4c5b78dbfada67de3133fc704fc4311966178dff1177ea151fc2e068923847d260abbf4f126b4a
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[](http://opensource.org/licenses/MIT)
|
4
4
|
[](https://badge.fury.io/rb/repres-hyper_text)
|
5
|
+
[](https://gemnasium.com/github.com/topbitdu/repres-hyper_text)
|
5
6
|
|
6
7
|
Repres (REsource PRESentation) is a series of resource presentation engines. The Hyper Text resource presentation engine includes HyperText-based resource presentation templates & snippets.
|
7
8
|
Repres (资源表现)是一系列的资源表现引擎。超文本资源表现引擎包括基于超文本的资源表现模版和片段。
|
@@ -9,12 +10,14 @@ Repres (资源表现)是一系列的资源表现引擎。超文本资源表现
|
|
9
10
|
|
10
11
|
|
11
12
|
## Recent Update
|
13
|
+
|
12
14
|
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
13
15
|
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
14
16
|
|
15
17
|
|
16
18
|
|
17
19
|
## Usage in Gemfile
|
20
|
+
|
18
21
|
```ruby
|
19
22
|
gem 'repres-hyper_text'
|
20
23
|
```
|
@@ -22,6 +25,7 @@ gem 'repres-hyper_text'
|
|
22
25
|
|
23
26
|
|
24
27
|
## Include the Helper in your Application Controller before Render the Style or Script
|
28
|
+
|
25
29
|
```ruby
|
26
30
|
helper Repres::HyperText::ApplicationHelper
|
27
31
|
```
|
@@ -29,6 +33,7 @@ helper Repres::HyperText::ApplicationHelper
|
|
29
33
|
|
30
34
|
|
31
35
|
## Render the Pre-defined Partials
|
36
|
+
|
32
37
|
```erb
|
33
38
|
<html>
|
34
39
|
|
@@ -64,9 +69,8 @@ helper Repres::HyperText::ApplicationHelper
|
|
64
69
|
</html>
|
65
70
|
```
|
66
71
|
|
67
|
-
|
68
|
-
|
69
72
|
### Render the Meta
|
73
|
+
|
70
74
|
The Meta partial includes the HTML meta tags for HTML 5.
|
71
75
|
```erb
|
72
76
|
<%= render partial: 'repres/hyper_text/meta' %>
|
@@ -84,9 +88,8 @@ The source codes of the Meta partial:
|
|
84
88
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
85
89
|
```
|
86
90
|
|
87
|
-
|
88
|
-
|
89
91
|
### Render the Favorite Icon
|
92
|
+
|
90
93
|
The Icon partial includes the HTML link tags for Favorite Icons.
|
91
94
|
```erb
|
92
95
|
<%= render partial: 'repres/hyper_text/icon',
|
@@ -102,10 +105,9 @@ The Icon partial includes the HTML link tags for Favorite Icons.
|
|
102
105
|
<%= hyper_text_icon safari_mask_icon_color: '#5bbad5', microsoft_application_title_color: '#da532c', theme_color: '#ffffff' %>
|
103
106
|
```
|
104
107
|
|
105
|
-
|
106
|
-
|
107
108
|
### Render the Script
|
108
|
-
|
109
|
+
|
110
|
+
The Script partial includes the HTML script tags. The [Boot CDN](http://cdn.bootcss.com/) server is supported by default. However, the :cdn option could be passed in to support other CDN servers. The CDN servers must syncrhonize with [cdnjs](https://github.com/cdnjs/cdnjs).
|
109
111
|
|
110
112
|
The following code snippet does not load any JavaScript library.
|
111
113
|
```erb
|
@@ -123,19 +125,18 @@ The following code snippet loads the latest jQuery.
|
|
123
125
|
|
124
126
|
The following code snippet loads the jQuery with the given version.
|
125
127
|
```erb
|
126
|
-
<%= render partial: 'repres/hyper_text/script', locals: { options: { jquery: { version: '2.2.0' } } } %>
|
128
|
+
<%= render partial: 'repres/hyper_text/script', locals: { options: { jquery: { version: '2.2.0', cdn: 'cdn.server.com' } } } %>
|
127
129
|
<!-- or the following line works identically -->
|
128
|
-
<%= hyper_text_script jquery: { version: '2.2.0' } %>
|
130
|
+
<%= hyper_text_script jquery: { version: '2.2.0', cdn: 'cdn.server.com' } %>
|
129
131
|
```
|
130
132
|
|
131
133
|
The following JavaScript libraries are switchable, and the version can be configurable:
|
132
134
|
- :modernizr
|
133
135
|
- :jquery
|
134
136
|
|
135
|
-
|
136
|
-
|
137
137
|
### Render the Style
|
138
|
-
|
138
|
+
|
139
|
+
The Style partial includes the HTML style tags. The [Boot CDN](http://cdn.bootcss.com/) server is supported by default. However, the :cdn option could be passed in to support other CDN servers. The CDN servers must syncrhonize with [cdnjs](https://github.com/cdnjs/cdnjs).
|
139
140
|
|
140
141
|
The following code snippet does not load any CSS library.
|
141
142
|
```erb
|
@@ -153,9 +154,9 @@ The following code snippet loads the latest Font Awesome.
|
|
153
154
|
|
154
155
|
The following code snippet loads the Font Awesome with the given version.
|
155
156
|
```erb
|
156
|
-
<%= render partial: 'repres/hyper_text/style', locals: { options: { :'font-awesome' => { version: '4.4.0' } } } %>
|
157
|
+
<%= render partial: 'repres/hyper_text/style', locals: { options: { :'font-awesome' => { version: '4.4.0', cdn: 'cdn.server.com' } } } %>
|
157
158
|
<!-- or the following line works identically -->
|
158
|
-
<%= hyper_text_style :'font-awesome' => { version: '4.4.0' } %>
|
159
|
+
<%= hyper_text_style :'font-awesome' => { version: '4.4.0', cdn: 'cdn.server.com' } %>
|
159
160
|
```
|
160
161
|
|
161
162
|
The following CSS libraries are switchable, and the version can be configurable:
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
11
|
rdoc.title = 'Repres HyperText'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
require 'bundler/gem_tasks'
|
24
24
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
10
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
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
|
10
|
-
*
|
11
|
-
* file per style scope.
|
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
12
|
*
|
13
13
|
*= require_self
|
14
14
|
*/
|
@@ -24,4 +24,8 @@ module Repres::HyperText::ApplicationHelper
|
|
24
24
|
render partial: 'repres/hyper_text/style', locals: { options: options }
|
25
25
|
end
|
26
26
|
|
27
|
+
def domain_name(name, options)
|
28
|
+
defined?(options) ? options.try(:[], name).try(:[], :cdn)||Repres::HyperText::CDN : Repres::HyperText::CDN
|
29
|
+
end
|
30
|
+
|
27
31
|
end
|
@@ -2,14 +2,14 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Repres HyperText</title>
|
5
|
-
<%= stylesheet_link_tag
|
5
|
+
<%= stylesheet_link_tag 'repres/hyper_text/application', media: 'all' %>
|
6
6
|
<%= csrf_meta_tags %>
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<%= yield %>
|
11
11
|
|
12
|
-
<%= javascript_include_tag '
|
12
|
+
<%= javascript_include_tag 'repres/hyper_text/application' %>
|
13
13
|
|
14
14
|
</body>
|
15
15
|
</html>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<% options = defined?(options) ? options : nil %>
|
2
2
|
|
3
|
-
<%= javascript_include_tag "
|
4
|
-
<%= javascript_include_tag "
|
3
|
+
<%= javascript_include_tag "//#{domain_name(:modernizr, options)}/modernizr/#{library_version(:modernizr, '2.8.3', options)}/modernizr.min.js" if library_enabled?(:modernizr, options) %>
|
4
|
+
<%= javascript_include_tag "//#{domain_name(:jquery, options)}/jquery/#{library_version(:jquery, '2.2.4', options)}/jquery.min.js" if library_enabled?(:jquery, options) %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% options = defined?(options) ? options : nil %>
|
2
2
|
|
3
|
-
<%= stylesheet_link_tag "
|
4
|
-
<%= stylesheet_link_tag "
|
5
|
-
<%= stylesheet_link_tag "
|
3
|
+
<%= stylesheet_link_tag "//#{domain_name(:'font-awesome', options)}/font-awesome/#{library_version(:'font-awesome', '4.6.3', options)}/css/font-awesome.min.css", media: 'all' if library_enabled?(:'font-awesome', options) %>
|
4
|
+
<%= stylesheet_link_tag "//#{domain_name(:buttons, options)}/Buttons/#{library_version(:buttons, '2.0.0', options)}/css/buttons.min.css", media: 'all' if library_enabled?(:buttons, options) %>
|
5
|
+
<%= stylesheet_link_tag "//#{domain_name(:'animate.css', options)}/animate.css/#{library_version(:'animate.css', '3.5.2', options)}/animate.min.css", media: 'all' if library_enabled?(:'animate.css', options) %>
|
data/lib/repres/hyper_text.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repres-hyper_text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,10 +36,14 @@ files:
|
|
36
36
|
- MIT-LICENSE
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
39
|
+
- app/assets/config/repres-hyper_text_manifest.js
|
39
40
|
- app/assets/javascripts/repres/hyper_text/application.js
|
40
41
|
- app/assets/stylesheets/repres/hyper_text/application.css
|
41
42
|
- app/controllers/repres/hyper_text/application_controller.rb
|
42
43
|
- app/helpers/repres/hyper_text/application_helper.rb
|
44
|
+
- app/jobs/repres/hyper_text/application_job.rb
|
45
|
+
- app/mailers/repres/hyper_text/application_mailer.rb
|
46
|
+
- app/models/repres/hyper_text/application_record.rb
|
43
47
|
- app/views/layouts/repres/hyper_text/application.html.erb
|
44
48
|
- app/views/repres/hyper_text/_icon.html.erb
|
45
49
|
- app/views/repres/hyper_text/_meta.html.erb
|