torba 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23e2abb7390731963e44e6ebdcb5bedd5d27e57f
4
- data.tar.gz: 9a9489f4884a201b605276a00020608dd3a64818
3
+ metadata.gz: 9bd70287a39a252b5d531289c3c2781d5ba05ac4
4
+ data.tar.gz: 773eb4868c3e708319809c17b02c4a8dc4218457
5
5
  SHA512:
6
- metadata.gz: 72a08348248dd5590983fc017f4c6852fd47d566a17f15e23602f1cb86548ad518392bf62fe860e3229d388ec52a55c3bff3f0139ce4c81f92492361b659057b
7
- data.tar.gz: 3349f620649fad89b2767ad4ff1be60e443459b212d2cf7b236122897f85de603db9b0e5d73a5a7366a50443cb04e936cd511e2ff8a1aae5cb9f940d38a139a2
6
+ metadata.gz: ea7e6774e31e07ef6453ef8880ed6c8c183ebfdb6395aefa680880023ca1544573a58cf6cce91707e7029b9646915e9a1cc9ca591e39a664532cac46f4b7cc89
7
+ data.tar.gz: b640e1c881277a412cf045e2fd35e9e42a81cbc22ac74bd88935e44dc072a7e7110457332f923a30b23b0a48fec4d39fdfa61099e88bad712ba8c96e5de101c3
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- test/Torbafile
2
1
  /.bundle/
3
2
  /.yardoc
4
3
  /Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Unreleased
2
2
 
3
+ ## Version 0.6.0
4
+
5
+ ### Enhancements
6
+
7
+ * Torba.cache_path= setter
8
+
9
+ ### Bug fixes
10
+
11
+ * Handle stylesheets that mention nonexisting assets (e.g. with SCSS variables)
12
+
3
13
  ## Version 0.5.1
4
14
 
5
15
  ### Bug fixes
data/README.md CHANGED
@@ -17,7 +17,7 @@ Production ready.
17
17
 
18
18
  ## Documentation
19
19
 
20
- [Released version](http://rubydoc.info/gems/torba/0.5.1)
20
+ [Released version](http://rubydoc.info/gems/torba/0.6.0)
21
21
 
22
22
  ## Why
23
23
 
data/lib/torba.rb CHANGED
@@ -30,6 +30,14 @@ module Torba
30
30
  @cache_path ||= ENV["TORBA_CACHE_PATH"] || File.join(home_path, "cache")
31
31
  end
32
32
 
33
+ # Override cache path with a new value
34
+ # @param val [String] new cache path
35
+ # @return [void]
36
+ # @since 0.6.0
37
+ def self.cache_path=(val)
38
+ @cache_path = val
39
+ end
40
+
33
41
  # @return [Ui]
34
42
  def self.ui
35
43
  @ui ||= Ui.new
@@ -90,7 +98,7 @@ module Torba
90
98
  ui.suggest "Make sure that the path has trailing '/' if its a directory."
91
99
  exit(false)
92
100
  rescue Errors::AssetNotFound => e
93
- ui.error "Couldn't find an asset with path '#{e.message}'."
101
+ ui.error "Unknown asset to process with path '#{e.message}'."
94
102
  ui.suggest "Make sure that you've imported all image/font assets mentioned in a stylesheet(-s)."
95
103
  exit(false)
96
104
  end
@@ -52,7 +52,11 @@ module Torba
52
52
  content.gsub(URL_RE) do
53
53
  absolute_image_file_path = File.expand_path($2, File.dirname(file_path))
54
54
  sprockets_file_path = yield absolute_image_file_path
55
- "#{$1}<%= asset_path('#{sprockets_file_path}') %>#{$3}"
55
+ if sprockets_file_path
56
+ "#{$1}<%= asset_path('#{sprockets_file_path}') %>#{$3}"
57
+ else
58
+ $&
59
+ end
56
60
  end
57
61
  end
58
62
  end
@@ -28,7 +28,7 @@ module Torba
28
28
  #
29
29
  # @overload self.build
30
30
  # Reads Torbafile from current directory
31
- def self.build(file_path = nil)
31
+ def self.build(file_path = ENV["TORBA_FILE"])
32
32
  file_path ||= File.join(Dir.pwd, "Torbafile")
33
33
 
34
34
  manifest = new
data/lib/torba/package.rb CHANGED
@@ -155,18 +155,22 @@ module Torba
155
155
  end
156
156
 
157
157
  def process_stylesheets
158
- import_list.css_assets.each do |asset|
159
- content = File.read(asset.absolute_path)
160
-
161
- new_content = CssUrlToErbAssetPath.call(content, asset.absolute_path) do |image_file_path|
162
- image_asset = import_list.find_by_absolute_path(image_file_path)
163
- image_asset.logical_path
158
+ import_list.css_assets.each do |css_asset|
159
+ content = File.read(css_asset.absolute_path)
160
+
161
+ new_content = CssUrlToErbAssetPath.call(content, css_asset.absolute_path) do |asset_file_path|
162
+ if File.exist?(asset_file_path)
163
+ asset = import_list.find_by_absolute_path(asset_file_path)
164
+ asset.logical_path
165
+ else
166
+ nil
167
+ end
164
168
  end
165
169
 
166
170
  if content == new_content
167
- new_absolute_path = File.join(load_path, asset.logical_path)
171
+ new_absolute_path = File.join(load_path, css_asset.logical_path)
168
172
  else
169
- new_absolute_path = File.join(load_path, asset.logical_path + ".erb")
173
+ new_absolute_path = File.join(load_path, css_asset.logical_path + ".erb")
170
174
  end
171
175
 
172
176
  ensure_directory(new_absolute_path)
@@ -2,86 +2,72 @@ require "test_helper"
2
2
 
3
3
  module Torba
4
4
  class AcceptanceTest < Minitest::Test
5
- def manifest
6
- @manifest ||= Manifest.build("test/Torbafile")
7
- end
8
-
9
- def find_path(file_path)
10
- manifest.load_path.map{ |lp| File.join(lp, file_path) }.find{ |full_path| File.exists?(full_path) }
11
- end
5
+ include Torba::Test::Exec
12
6
 
13
- def assert_exists(file_path)
14
- assert find_path(file_path), "'#{file_path}' should exist"
7
+ def test_pack_zip
8
+ out, err, status = torba("pack", torbafile: "01_zip.rb")
9
+ assert status.success?, err
10
+ assert_includes out, "Torba has been packed!"
11
+ compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
15
12
  end
16
13
 
17
- def refute_exists(file_path)
18
- refute find_path(file_path), "'#{file_path}' should not exist"
14
+ def test_pack_targz
15
+ out, err, status = torba("pack", torbafile: "01_targz.rb")
16
+ assert status.success?, err
17
+ assert_includes out, "Torba has been packed!"
18
+ compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
19
19
  end
20
20
 
21
- def read_path(file_path)
22
- File.read(find_path(file_path))
21
+ def test_pack_gh_release
22
+ out, err, status = torba("pack", torbafile: "01_gh_release.rb")
23
+ assert status.success?, err
24
+ assert_includes out, "Torba has been packed!"
25
+ compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
23
26
  end
24
27
 
25
- def pack_torbafile(content)
26
- File.write("test/Torbafile", content)
27
- manifest.pack
28
+ def test_pack_npm
29
+ out, err, status = torba("pack", torbafile: "02_npm.rb")
30
+ assert status.success?, err
31
+ assert_includes out, "Torba has been packed!"
32
+ compare_dirs "test/fixtures/home_path/02", path_to_packaged("lo_dash")
28
33
  end
29
34
 
30
- def test_zip
31
- pack_torbafile <<-TORBA
32
- zip "trumbowyg-from-zip",
33
- url: "https://github.com/torba-rb/Trumbowyg/archive/1.1.6.zip",
34
- import: ["dist/trumbowyg.js"]
35
- TORBA
36
-
37
- assert_exists "trumbowyg-from-zip/trumbowyg.js"
38
- refute_exists "trumbowyg-from-zip/trumbowyg.css.erb"
39
- refute_exists "trumbowyg-from-zip/icons.png"
40
- refute_exists "trumbowyg-from-zip/icons-2x.png"
35
+ def test_pack_without_image_asset_specified_in_import
36
+ out, err, status = torba("pack", torbafile: "03_image_asset_not_specified.rb")
37
+ refute status.success?, err
38
+ assert_includes out, <<OUT
39
+ Unknown asset to process with path '#{path_to_packaged "Trumbowyg", Test::TempHome.persistent_tmp_dir}/dist/ui/images/icons-2x.png'.
40
+ Make sure that you've imported all image/font assets mentioned in a stylesheet(-s).
41
+ OUT
41
42
  end
42
43
 
43
- def test_gh_release
44
- pack_torbafile <<-TORBA
45
- gh_release "trumbowyg", source: "torba-rb/Trumbowyg", tag: "1.1.7", import: %w[
46
- dist/trumbowyg.js
47
- dist/ui/*.css
48
- dist/ui/images/
49
- ]
50
- TORBA
51
-
52
- assert_exists "trumbowyg/trumbowyg.js"
53
- assert_exists "trumbowyg/trumbowyg.css.erb"
54
- assert_exists "trumbowyg/icons.png"
55
- assert_exists "trumbowyg/icons-2x.png"
56
-
57
- css = read_path "trumbowyg/trumbowyg.css.erb"
58
- assert_includes css, %[background: transparent url("<%= asset_path('trumbowyg/icons.png') %>") no-repeat;]
59
- assert_includes css, %[background-image: url("<%= asset_path('trumbowyg/icons-2x.png') %>")]
44
+ def test_pack_with_not_existed_assets_mentioned_in_stylesheets
45
+ out, err, status = torba("pack", torbafile: "04_not_existed_assets.rb")
46
+ assert status.success?, err
47
+ assert_includes out, "Torba has been packed!"
48
+ compare_dirs "test/fixtures/home_path/04", path_to_packaged("bourbon")
60
49
  end
61
50
 
62
- def test_targz
63
- pack_torbafile <<-TORBA
64
- targz "trumbowyg-from-tar",
65
- url: "https://github.com/torba-rb/Trumbowyg/archive/1.1.7.tar.gz",
66
- import: ["dist/ui/"]
67
- TORBA
68
-
69
- refute_exists "trumbowyg-from-tar/trumbowyg.js"
70
- assert_exists "trumbowyg-from-tar/trumbowyg.css.erb"
71
- assert_exists "trumbowyg-from-tar/images/icons.png"
72
- assert_exists "trumbowyg-from-tar/images/icons-2x.png"
73
-
74
- css = read_path "trumbowyg-from-tar/trumbowyg.css.erb"
75
- assert_includes css, %[background: transparent url("<%= asset_path('trumbowyg-from-tar/images/icons.png') %>") no-repeat;]
76
- assert_includes css, %[background-image: url("<%= asset_path('trumbowyg-from-tar/images/icons-2x.png') %>")]
51
+ def test_verify_unpacked
52
+ out, err, status = torba("verify", torbafile: "01_zip.rb")
53
+ refute status.success?, err
54
+ assert_equal <<OUT, out
55
+ Your Torba is not packed yet.
56
+ Missing packages:
57
+ * trumbowyg
58
+ Run `bundle exec torba pack` to install missing packages.
59
+ OUT
77
60
  end
78
61
 
79
- def test_npm
80
- pack_torbafile <<-TORBA
81
- npm "lo_dash", package: "lodash", version: "0.1.0", import: ["lodash.js"]
82
- TORBA
62
+ def test_verify_packed
63
+ _, err, status = torba("pack", torbafile: "01_zip.rb")
64
+ assert status.success?, err
83
65
 
84
- assert_exists "lo_dash/lodash.js"
66
+ out, err, status = torba("verify", torbafile: "01_zip.rb")
67
+ assert status.success?, err
68
+ assert_equal <<OUT, out
69
+ Torba is prepared!
70
+ OUT
85
71
  end
86
72
  end
87
73
  end
@@ -32,6 +32,11 @@ module Torba
32
32
  assert_equal "background-image: url('/icons.png');", filter.call(css, "/current_file")
33
33
  end
34
34
 
35
+ def test_block_returns_nil
36
+ css = "background-image: url('icons.png');"
37
+ assert_equal css, filter.call(css, "/current_file") { nil }
38
+ end
39
+
35
40
  def test_stylesheet_and_image_in_same_directory
36
41
  current_file = "/home/package/dist/ui/stylesheet.css"
37
42
  css = "background-image: url('icons.png');"
@@ -0,0 +1,471 @@
1
+ /**
2
+ * Trumbowyg v1.1.6 - A lightweight WYSIWYG editor
3
+ * Default stylesheet for Trumbowyg editor
4
+ * ------------------------
5
+ * @link http://alex-d.github.io/Trumbowyg
6
+ * @license MIT
7
+ * @author Alexandre Demode (Alex-D)
8
+ * Twitter : @AlexandreDemode
9
+ * Website : alex-d.fr
10
+ */
11
+
12
+ .trumbowyg-box, .trumbowyg-editor {
13
+ display: block;
14
+ position: relative;
15
+ border: 1px solid #DDD;
16
+ width: 96%;
17
+ min-height: 300px;
18
+ margin: 17px auto; }
19
+
20
+ .trumbowyg-box .trumbowyg-editor {
21
+ margin: 0 auto; }
22
+
23
+ .trumbowyg-box.trumbowyg-fullscreen {
24
+ background: #FEFEFE; }
25
+
26
+ .trumbowyg-editor, .trumbowyg-textarea {
27
+ position: relative;
28
+ -webkit-box-sizing: border-box;
29
+ -moz-box-sizing: border-box;
30
+ box-sizing: border-box;
31
+ padding: 1% 2%;
32
+ min-height: 300px;
33
+ width: 100%;
34
+ border-style: none;
35
+ resize: none;
36
+ outline: none; }
37
+
38
+ .trumbowyg-box-blur .trumbowyg-editor * {
39
+ color: transparent !important;
40
+ text-shadow: 0 0 7px #333; }
41
+ .trumbowyg-box-blur .trumbowyg-editor img {
42
+ opacity: 0.2; }
43
+
44
+ .trumbowyg-textarea {
45
+ position: relative;
46
+ display: block;
47
+ overflow: auto;
48
+ border: none;
49
+ white-space: normal; }
50
+
51
+ .trumbowyg-editor[contenteditable=true]:empty:before {
52
+ content: attr(placeholder);
53
+ color: #999; }
54
+
55
+ .trumbowyg-button-pane {
56
+ position: relative;
57
+ width: 100%;
58
+ background: #ecf0f1;
59
+ border-bottom: 1px solid #d7e0e2;
60
+ margin: 0;
61
+ padding: 0;
62
+ list-style-type: none;
63
+ line-height: 10px;
64
+ -webkit-backface-visibility: hidden;
65
+ backface-visibility: hidden; }
66
+ .trumbowyg-button-pane li {
67
+ display: inline-block;
68
+ text-align: center;
69
+ overflow: hidden; }
70
+ .trumbowyg-button-pane li.trumbowyg-separator {
71
+ width: 1px;
72
+ background: #d7e0e2;
73
+ margin: 0 5px;
74
+ height: 35px; }
75
+ .trumbowyg-button-pane.trumbowyg-disable li:not(.trumbowyg-not-disable) button:not(.trumbowyg-active) {
76
+ opacity: 0.2;
77
+ cursor: default; }
78
+ .trumbowyg-button-pane.trumbowyg-disable li.trumbowyg-separator {
79
+ background: #e3e9eb; }
80
+ .trumbowyg-button-pane:not(.trumbowyg-disable) li button:hover, .trumbowyg-button-pane:not(.trumbowyg-disable) li button:focus, .trumbowyg-button-pane li button.trumbowyg-active, .trumbowyg-button-pane li.trumbowyg-not-disable button:hover, .trumbowyg-button-pane li.trumbowyg-not-disable button:focus {
81
+ background-color: #FFF;
82
+ outline: none; }
83
+ .trumbowyg-button-pane li .trumbowyg-open-dropdown:after {
84
+ display: block;
85
+ content: " ";
86
+ position: absolute;
87
+ top: 25px;
88
+ right: 3px;
89
+ height: 0;
90
+ width: 0;
91
+ border: 3px solid transparent;
92
+ border-top-color: #555; }
93
+ .trumbowyg-button-pane .trumbowyg-buttons-right {
94
+ float: right;
95
+ width: auto; }
96
+ .trumbowyg-button-pane .trumbowyg-buttons-right button {
97
+ float: left; }
98
+
99
+ .trumbowyg-dropdown {
100
+ width: 200px;
101
+ border: 1px solid #ecf0f1;
102
+ padding: 5px 0;
103
+ border-top: none;
104
+ background: #FFF;
105
+ margin-left: -1px;
106
+ -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0 2px 3px;
107
+ box-shadow: rgba(0, 0, 0, 0.1) 0 2px 3px; }
108
+ .trumbowyg-dropdown button {
109
+ display: block;
110
+ width: 100%;
111
+ height: 35px;
112
+ line-height: 35px;
113
+ text-decoration: none;
114
+ background: #FFF;
115
+ padding: 0 14px;
116
+ color: #333;
117
+ border: none;
118
+ cursor: pointer;
119
+ text-align: left;
120
+ font-size: 15px;
121
+ -webkit-transition: all 0.15s;
122
+ -o-transition: all 0.15s;
123
+ transition: all 0.15s; }
124
+ .trumbowyg-dropdown button:hover, .trumbowyg-dropdown button:focus {
125
+ background: #ecf0f1; }
126
+
127
+ /* Modal box */
128
+ .trumbowyg-modal {
129
+ position: absolute;
130
+ top: 0;
131
+ left: 50%;
132
+ margin-left: -260px;
133
+ width: 520px;
134
+ height: 290px;
135
+ overflow: hidden; }
136
+
137
+ .trumbowyg-modal-box {
138
+ position: absolute;
139
+ top: 0;
140
+ left: 50%;
141
+ margin-left: -250px;
142
+ width: 500px;
143
+ height: 275px;
144
+ z-index: 1;
145
+ background-color: #FFF;
146
+ text-align: center;
147
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 3px;
148
+ box-shadow: rgba(0, 0, 0, 0.2) 0 2px 3px;
149
+ -webkit-backface-visibility: hidden;
150
+ backface-visibility: hidden; }
151
+ .trumbowyg-modal-box .trumbowyg-modal-title {
152
+ font-size: 24px;
153
+ font-weight: bold;
154
+ margin: 0 0 20px;
155
+ padding: 15px 0 13px;
156
+ display: block;
157
+ border-bottom: 1px solid #EEE;
158
+ color: #333;
159
+ background: #fbfcfc; }
160
+ .trumbowyg-modal-box .trumbowyg-progress {
161
+ width: 100%;
162
+ background: #F00;
163
+ height: 3px;
164
+ position: absolute;
165
+ top: 58px; }
166
+ .trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar {
167
+ background: #2BC06A;
168
+ height: 100%;
169
+ -webkit-transition: width 0.15s linear;
170
+ -o-transition: width 0.15s linear;
171
+ transition: width 0.15s linear; }
172
+ .trumbowyg-modal-box label {
173
+ display: block;
174
+ position: relative;
175
+ margin: 15px 12px;
176
+ height: 27px;
177
+ line-height: 27px;
178
+ overflow: hidden; }
179
+ .trumbowyg-modal-box label .trumbowyg-input-infos {
180
+ display: block;
181
+ text-align: left;
182
+ height: 25px;
183
+ line-height: 25px;
184
+ -webkit-transition: all 0.15;
185
+ -o-transition: all 0.15;
186
+ transition: all 0.15; }
187
+ .trumbowyg-modal-box label .trumbowyg-input-infos span {
188
+ display: block;
189
+ color: #859fa5;
190
+ background-color: #fbfcfc;
191
+ border: 1px solid #DEDEDE;
192
+ padding: 0 2%;
193
+ width: 19.5%; }
194
+ .trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error {
195
+ color: #e74c3c; }
196
+ .trumbowyg-modal-box label.trumbowyg-input-error input, .trumbowyg-modal-box label.trumbowyg-input-error textarea {
197
+ border: 1px solid #e74c3c; }
198
+ .trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos {
199
+ margin-top: -27px; }
200
+ .trumbowyg-modal-box label input {
201
+ position: absolute;
202
+ top: 0;
203
+ right: 0;
204
+ height: 25px;
205
+ line-height: 25px;
206
+ border: 1px solid #DEDEDE;
207
+ background: transparent;
208
+ width: 72%;
209
+ padding: 0 2%;
210
+ margin: 0 0 0 23%;
211
+ -webkit-transition: all 0.15s;
212
+ -o-transition: all 0.15s;
213
+ transition: all 0.15s; }
214
+ .trumbowyg-modal-box label input:hover, .trumbowyg-modal-box label input:focus {
215
+ outline: none;
216
+ border: 1px solid #95a5a6; }
217
+ .trumbowyg-modal-box label input:focus {
218
+ background: rgba(230, 230, 255, 0.1); }
219
+ .trumbowyg-modal-box .error {
220
+ margin-top: 25px;
221
+ display: block;
222
+ color: red; }
223
+ .trumbowyg-modal-box .trumbowyg-modal-button {
224
+ position: absolute;
225
+ bottom: 10px;
226
+ right: 0;
227
+ text-decoration: none;
228
+ color: #FFF;
229
+ display: block;
230
+ width: 100px;
231
+ height: 35px;
232
+ line-height: 33px;
233
+ margin: 0 10px;
234
+ background-color: #333;
235
+ border: none;
236
+ border-top: none;
237
+ cursor: pointer;
238
+ font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif;
239
+ font-size: 16px;
240
+ -webkit-transition: all 0.15s;
241
+ -o-transition: all 0.15s;
242
+ transition: all 0.15s; }
243
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit {
244
+ right: 110px;
245
+ background: #2bc069; }
246
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover, .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus {
247
+ background: #40d47d;
248
+ outline: none; }
249
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active {
250
+ background: #25a259; }
251
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset {
252
+ color: #555;
253
+ background: #e6e6e6; }
254
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover, .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus {
255
+ background: #fbfbfb;
256
+ outline: none; }
257
+ .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active {
258
+ background: #d4d4d4; }
259
+
260
+ .trumbowyg-overlay {
261
+ position: absolute;
262
+ background-color: rgba(255, 255, 255, 0.5);
263
+ width: 100%;
264
+ left: 0;
265
+ display: none; }
266
+
267
+ /**
268
+ * Fullscreen
269
+ */
270
+ .trumbowyg-fullscreen {
271
+ position: fixed;
272
+ top: 0;
273
+ left: 0;
274
+ width: 100%;
275
+ height: 100%;
276
+ margin: 0;
277
+ padding: 0;
278
+ z-index: 99999; }
279
+ .trumbowyg-fullscreen.trumbowyg-box, .trumbowyg-fullscreen .trumbowyg-editor {
280
+ border: none; }
281
+ .trumbowyg-fullscreen .trumbowyg-overlay {
282
+ height: 100% !important; }
283
+
284
+ /*
285
+ * Reset for resetCss option
286
+ */
287
+ .trumbowyg-editor object, .trumbowyg-editor embed, .trumbowyg-editor video, .trumbowyg-editor img {
288
+ width: auto;
289
+ max-width: 100%; }
290
+ .trumbowyg-editor video, .trumbowyg-editor img {
291
+ height: auto; }
292
+ .trumbowyg-editor img {
293
+ cursor: move; }
294
+ .trumbowyg-editor.trumbowyg-reset-css {
295
+ background: #FEFEFE !important;
296
+ font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif !important;
297
+ font-size: 14px !important;
298
+ line-height: 1.45em !important;
299
+ white-space: normal !important;
300
+ color: #333; }
301
+ .trumbowyg-editor.trumbowyg-reset-css a {
302
+ color: #15c !important;
303
+ text-decoration: underline !important; }
304
+ .trumbowyg-editor.trumbowyg-reset-css div, .trumbowyg-editor.trumbowyg-reset-css p, .trumbowyg-editor.trumbowyg-reset-css ul, .trumbowyg-editor.trumbowyg-reset-css ol, .trumbowyg-editor.trumbowyg-reset-css blockquote {
305
+ -webkit-box-shadow: none !important;
306
+ box-shadow: none !important;
307
+ background: none !important;
308
+ margin: 0 !important;
309
+ margin-bottom: 15px !important;
310
+ line-height: 1.4em !important;
311
+ font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif !important;
312
+ font-size: 14px !important;
313
+ border: none; }
314
+ .trumbowyg-editor.trumbowyg-reset-css iframe, .trumbowyg-editor.trumbowyg-reset-css object, .trumbowyg-editor.trumbowyg-reset-css hr {
315
+ margin-bottom: 15px !important; }
316
+ .trumbowyg-editor.trumbowyg-reset-css blockquote {
317
+ margin-left: 32px !important;
318
+ font-style: italic !important;
319
+ color: #555; }
320
+ .trumbowyg-editor.trumbowyg-reset-css ul, .trumbowyg-editor.trumbowyg-reset-css ol {
321
+ padding-left: 20px !important; }
322
+ .trumbowyg-editor.trumbowyg-reset-css ul ul, .trumbowyg-editor.trumbowyg-reset-css ol ol, .trumbowyg-editor.trumbowyg-reset-css ul ol, .trumbowyg-editor.trumbowyg-reset-css ol ul {
323
+ border: none;
324
+ margin: 2px !important;
325
+ padding: 0 !important;
326
+ padding-left: 24px !important; }
327
+ .trumbowyg-editor.trumbowyg-reset-css hr {
328
+ display: block;
329
+ height: 1px;
330
+ border: none;
331
+ border-top: 1px solid #CCC; }
332
+ .trumbowyg-editor.trumbowyg-reset-css h1, .trumbowyg-editor.trumbowyg-reset-css h2, .trumbowyg-editor.trumbowyg-reset-css h3, .trumbowyg-editor.trumbowyg-reset-css h4 {
333
+ color: #111;
334
+ background: none;
335
+ margin: 0 !important;
336
+ padding: 0 !important;
337
+ font-weight: bold; }
338
+ .trumbowyg-editor.trumbowyg-reset-css h1 {
339
+ font-size: 32px !important;
340
+ line-height: 38px !important;
341
+ margin-bottom: 20px !important; }
342
+ .trumbowyg-editor.trumbowyg-reset-css h2 {
343
+ font-size: 26px !important;
344
+ line-height: 34px !important;
345
+ margin-bottom: 15px !important; }
346
+ .trumbowyg-editor.trumbowyg-reset-css h3 {
347
+ font-size: 22px !important;
348
+ line-height: 28px !important;
349
+ margin-bottom: 7px !important; }
350
+ .trumbowyg-editor.trumbowyg-reset-css h4 {
351
+ font-size: 16px !important;
352
+ line-height: 22px !important;
353
+ margin-bottom: 7px !important; }
354
+
355
+ /*
356
+ * Buttons icons
357
+ */
358
+ .trumbowyg-button-pane li button {
359
+ display: block;
360
+ position: relative;
361
+ text-indent: -9999px;
362
+ width: 35px;
363
+ height: 35px;
364
+ overflow: hidden;
365
+ background: transparent url("<%= asset_path('trumbowyg/icons.png') %>") no-repeat;
366
+ border: none;
367
+ cursor: pointer;
368
+ -webkit-transition: background-color 0.15s, background-image 0.15s, opacity 0.15s;
369
+ -o-transition: background-color 0.15s, background-image 0.15s, opacity 0.15s;
370
+ transition: background-color 0.15s, background-image 0.15s, opacity 0.15s;
371
+ /* English and others */ }
372
+ .trumbowyg-button-pane li button.trumbowyg-viewHTML-button {
373
+ background-position: 5px -545px; }
374
+ .trumbowyg-button-pane li button.trumbowyg-formatting-button {
375
+ background-position: 5px -120px; }
376
+ .trumbowyg-button-pane li button.trumbowyg-bold-button, .trumbowyg-button-pane li button.trumbowyg-strong-button {
377
+ background-position: 5px -45px; }
378
+ .trumbowyg-button-pane li button.trumbowyg-italic-button, .trumbowyg-button-pane li button.trumbowyg-em-button {
379
+ background-position: 5px 5px; }
380
+ .trumbowyg-button-pane li button.trumbowyg-underline-button {
381
+ background-position: 5px -470px; }
382
+ .trumbowyg-button-pane li button.trumbowyg-strikethrough-button, .trumbowyg-button-pane li button.trumbowyg-del-button {
383
+ background-position: 5px -445px; }
384
+ .trumbowyg-button-pane li button.trumbowyg-link-button {
385
+ background-position: 5px -345px; }
386
+ .trumbowyg-button-pane li button.trumbowyg-insertImage-button {
387
+ background-position: 5px -245px; }
388
+ .trumbowyg-button-pane li button.trumbowyg-justifyLeft-button {
389
+ background-position: 5px -320px; }
390
+ .trumbowyg-button-pane li button.trumbowyg-justifyCenter-button {
391
+ background-position: 5px -70px; }
392
+ .trumbowyg-button-pane li button.trumbowyg-justifyRight-button {
393
+ background-position: 5px -395px; }
394
+ .trumbowyg-button-pane li button.trumbowyg-justifyFull-button {
395
+ background-position: 5px -295px; }
396
+ .trumbowyg-button-pane li button.trumbowyg-unorderedList-button {
397
+ background-position: 5px -495px; }
398
+ .trumbowyg-button-pane li button.trumbowyg-orderedList-button {
399
+ background-position: 5px -370px; }
400
+ .trumbowyg-button-pane li button.trumbowyg-horizontalRule-button {
401
+ background-position: 5px -220px; }
402
+ .trumbowyg-button-pane li button.trumbowyg-fullscreen-button {
403
+ background-position: 5px -170px; }
404
+ .trumbowyg-button-pane li button.trumbowyg-close-button {
405
+ background-position: 5px -95px; }
406
+
407
+ .trumbowyg-fullscreen .trumbowyg-button-pane li button.trumbowyg-fullscreen-button {
408
+ background-position: 5px -145px; }
409
+
410
+ .trumbowyg-button-pane li:first-child button {
411
+ margin-left: 6px; }
412
+ .trumbowyg-button-pane li:last-child button {
413
+ margin-right: 6px; }
414
+
415
+ /* French */
416
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button, .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button {
417
+ background-position: 5px -195px; }
418
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button {
419
+ background-position: 5px -420px; }
420
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button, .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button {
421
+ background-position: 5px -270px; }
422
+
423
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 4/3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
424
+ /* French */
425
+ .trumbowyg-button-pane li button {
426
+ -webkit-background-size: 25px 575px !important;
427
+ background-size: 25px 575px !important;
428
+ background-image: url("<%= asset_path('trumbowyg/icons-2x.png') %>") !important;
429
+ /* English and others */ }
430
+ .trumbowyg-button-pane li button.trumbowyg-viewHTML-button {
431
+ background-position: 5px -545px; }
432
+ .trumbowyg-button-pane li button.trumbowyg-formatting-button {
433
+ background-position: 5px -120px; }
434
+ .trumbowyg-button-pane li button.trumbowyg-bold-button, .trumbowyg-button-pane li button.trumbowyg-strong-button {
435
+ background-position: 5px -45px; }
436
+ .trumbowyg-button-pane li button.trumbowyg-italic-button, .trumbowyg-button-pane li button.trumbowyg-em-button {
437
+ background-position: 5px 5px; }
438
+ .trumbowyg-button-pane li button.trumbowyg-underline-button {
439
+ background-position: 5px -470px; }
440
+ .trumbowyg-button-pane li button.trumbowyg-strikethrough-button, .trumbowyg-button-pane li button.trumbowyg-del-button {
441
+ background-position: 5px -445px; }
442
+ .trumbowyg-button-pane li button.trumbowyg-link-button {
443
+ background-position: 5px -345px; }
444
+ .trumbowyg-button-pane li button.trumbowyg-insertImage-button {
445
+ background-position: 5px -245px; }
446
+ .trumbowyg-button-pane li button.trumbowyg-justifyLeft-button {
447
+ background-position: 5px -320px; }
448
+ .trumbowyg-button-pane li button.trumbowyg-justifyCenter-button {
449
+ background-position: 5px -70px; }
450
+ .trumbowyg-button-pane li button.trumbowyg-justifyRight-button {
451
+ background-position: 5px -395px; }
452
+ .trumbowyg-button-pane li button.trumbowyg-justifyFull-button {
453
+ background-position: 5px -295px; }
454
+ .trumbowyg-button-pane li button.trumbowyg-unorderedList-button {
455
+ background-position: 5px -495px; }
456
+ .trumbowyg-button-pane li button.trumbowyg-orderedList-button {
457
+ background-position: 5px -370px; }
458
+ .trumbowyg-button-pane li button.trumbowyg-horizontalRule-button {
459
+ background-position: 5px -220px; }
460
+ .trumbowyg-button-pane li button.trumbowyg-fullscreen-button {
461
+ background-position: 5px -170px; }
462
+ .trumbowyg-button-pane li button.trumbowyg-close-button {
463
+ background-position: 5px -95px; }
464
+ .trumbowyg-fullscreen .trumbowyg-button-pane li a.trumbowyg-fullscreen-button {
465
+ background-position: 5px -145px; }
466
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button, .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button {
467
+ background-position: 5px -195px; }
468
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button {
469
+ background-position: 5px -420px; }
470
+ .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button, .trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button {
471
+ background-position: 5px -270px; } }