torba 0.5.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -1
- data/.travis.yml +6 -2
- data/.yardopts +2 -0
- data/CHANGELOG.md +59 -0
- data/README.md +16 -78
- data/lib/torba.rb +15 -1
- data/lib/torba/cli.rb +45 -0
- data/lib/torba/css_url_to_erb_asset_path.rb +5 -1
- data/lib/torba/manifest.rb +11 -1
- data/lib/torba/package.rb +12 -8
- data/lib/torba/rake_task.rb +10 -3
- data/lib/torba/remote_sources/common.rb +1 -1
- data/lib/torba/remote_sources/targz.rb +1 -1
- data/lib/torba/ui.rb +13 -0
- data/lib/torba/verify.rb +4 -11
- data/test/acceptance-cli/open_test.rb +101 -0
- data/test/acceptance-cli/pack_test.rb +49 -0
- data/test/acceptance-cli/show_test.rb +61 -0
- data/test/acceptance-cli/verify_test.rb +25 -0
- data/test/css_url_to_erb_asset_path_test.rb +5 -0
- data/test/fixtures/home_path/01/trumbowyg/icons-2x.png +0 -0
- data/test/fixtures/home_path/01/trumbowyg/icons.png +0 -0
- data/test/fixtures/home_path/01/trumbowyg/trumbowyg.css.erb +471 -0
- data/test/fixtures/home_path/01/trumbowyg/trumbowyg.js +1124 -0
- data/test/fixtures/home_path/02/lo_dash/lodash.js +2793 -0
- data/test/fixtures/home_path/03/bourbon/_border-image.scss +59 -0
- data/test/fixtures/home_path/03/bourbon/_font-source-declaration.scss +43 -0
- data/test/fixtures/home_path/03/bourbon/_retina-image.scss +25 -0
- data/test/fixtures/torbafiles/01_gh_release.rb +8 -0
- data/test/fixtures/torbafiles/01_image_asset_not_specified.rb +7 -0
- data/test/fixtures/torbafiles/01_targz.rb +7 -0
- data/test/fixtures/torbafiles/01_zip.rb +7 -0
- data/test/fixtures/torbafiles/02_npm.rb +1 -0
- data/test/fixtures/torbafiles/03_not_existed_assets.rb +5 -0
- data/test/fixtures/torbafiles/04_similar_names.rb +2 -0
- data/test/manifest_test.rb +27 -0
- data/test/package_test.rb +10 -0
- data/test/rake_task_test.rb +13 -0
- data/test/test_helper.rb +55 -8
- data/test/torba_test.rb +13 -0
- data/torba.gemspec +5 -4
- metadata +73 -18
- data/lib/torba/rails.rb +0 -13
- data/test/acceptance_test.rb +0 -87
@@ -10,7 +10,7 @@ module Torba
|
|
10
10
|
def [](pattern)
|
11
11
|
ensure_cached
|
12
12
|
|
13
|
-
Dir.glob(File.join(cache_path, pattern)).reject{ |path| File.directory?(path) }.map do |path|
|
13
|
+
Dir.glob(File.join(cache_path, pattern)).sort.reject{ |path| File.directory?(path) }.map do |path|
|
14
14
|
[File.absolute_path(path), path.sub(/#{cache_path}\/?/, "")]
|
15
15
|
end
|
16
16
|
end
|
@@ -25,7 +25,7 @@ module Torba
|
|
25
25
|
|
26
26
|
tempfile = GetFile.process(url)
|
27
27
|
|
28
|
-
command = "gzip -qcd #{tempfile.path} | tar -mxpf - --strip-components=1 -C #{cache_path}"
|
28
|
+
command = "gzip -qcd #{tempfile.path} | tar --no-same-owner -mxpf - --strip-components=1 -C #{cache_path}"
|
29
29
|
system(command) || raise(Errors::ShellCommandFailed.new(command))
|
30
30
|
end
|
31
31
|
rescue
|
data/lib/torba/ui.rb
CHANGED
@@ -22,5 +22,18 @@ module Torba
|
|
22
22
|
def error(message)
|
23
23
|
@shell.say(message, :red)
|
24
24
|
end
|
25
|
+
|
26
|
+
# @return [Integer] index of chosen option.
|
27
|
+
# @return [nil] if exit was chosen.
|
28
|
+
# @since 0.7.0
|
29
|
+
def choose_one(options)
|
30
|
+
options.each_with_index do |option, index|
|
31
|
+
info("#{index + 1} : #{option}")
|
32
|
+
end
|
33
|
+
info("0 : - exit -")
|
34
|
+
|
35
|
+
index = @shell.ask("> ").to_i - 1
|
36
|
+
(0..options.size - 1).cover?(index) ? index : nil
|
37
|
+
end
|
25
38
|
end
|
26
39
|
end
|
data/lib/torba/verify.rb
CHANGED
@@ -1,14 +1,7 @@
|
|
1
1
|
require "torba"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
#
|
8
|
-
unless ENV["TORBA_DONT_VERIFY"] || defined?(Rake::Task)
|
9
|
-
if STDOUT.tty?
|
10
|
-
Torba.pretty_errors { Torba.verify }
|
11
|
-
else
|
12
|
-
Torba.verify
|
13
|
-
end
|
3
|
+
if STDOUT.tty?
|
4
|
+
Torba.pretty_errors { Torba.verify }
|
5
|
+
else
|
6
|
+
Torba.verify
|
14
7
|
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class OpenTest < Minitest::Test
|
5
|
+
def test_complains_no_editor_set
|
6
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
7
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => nil
|
8
|
+
})
|
9
|
+
refute status.success?, err
|
10
|
+
assert_includes out, "To open a package, set $EDITOR or $TORBA_EDITOR"
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_runs_pack
|
14
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
15
|
+
"TORBA_EDITOR" => "echo torba_editor", "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
16
|
+
})
|
17
|
+
assert status.success?, err
|
18
|
+
assert_dirs_equal "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_uses_torba_editor_first
|
22
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
23
|
+
"TORBA_EDITOR" => "echo torba_editor", "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
24
|
+
})
|
25
|
+
assert status.success?, err
|
26
|
+
assert_includes out, "torba_editor #{path_to_packaged "trumbowyg"}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_uses_visual_editor_second
|
30
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
31
|
+
"TORBA_EDITOR" => nil, "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
32
|
+
})
|
33
|
+
assert status.success?, err
|
34
|
+
assert_includes out, "visual #{path_to_packaged "trumbowyg"}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_uses_editor_third
|
38
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
39
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
40
|
+
})
|
41
|
+
assert status.success?, err
|
42
|
+
assert_includes out, "editor #{path_to_packaged "trumbowyg"}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_finds_by_partial_package_name
|
46
|
+
out, err, status = torba("open trumbo", torbafile: "01_zip.rb", env: {
|
47
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
48
|
+
})
|
49
|
+
assert status.success?, err
|
50
|
+
assert_includes out, "editor #{path_to_packaged "trumbowyg"}"
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_could_not_find_package
|
54
|
+
out, err, status = torba("open dumbo", torbafile: "01_zip.rb", env: {
|
55
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
56
|
+
})
|
57
|
+
refute status.success?, err
|
58
|
+
assert_includes out, "Could not find package 'dumbo'."
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_similar_names_show_options
|
62
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", env: {
|
63
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
64
|
+
})
|
65
|
+
refute status.success?, err
|
66
|
+
assert_includes out, <<OUT
|
67
|
+
1 : bourbon
|
68
|
+
2 : bourbon-neat
|
69
|
+
0 : - exit -
|
70
|
+
OUT
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_similar_names_chosen_option
|
74
|
+
skip_java_capture3_bug
|
75
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "2", env: {
|
76
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
77
|
+
})
|
78
|
+
assert status.success?, err
|
79
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
80
|
+
assert_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_similar_names_chosen_exit
|
84
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "0", env: {
|
85
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
86
|
+
})
|
87
|
+
refute status.success?, err
|
88
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
89
|
+
refute_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_similar_names_chosen_unexisted_option
|
93
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "7", env: {
|
94
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
95
|
+
})
|
96
|
+
refute status.success?, err
|
97
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
98
|
+
refute_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class PackTest < Minitest::Test
|
5
|
+
def test_zip
|
6
|
+
out, err, status = torba("pack", torbafile: "01_zip.rb")
|
7
|
+
assert status.success?, err
|
8
|
+
assert_includes out, "Torba has been packed!"
|
9
|
+
assert_dirs_equal "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_targz
|
13
|
+
out, err, status = torba("pack", torbafile: "01_targz.rb")
|
14
|
+
assert status.success?, err
|
15
|
+
assert_includes out, "Torba has been packed!"
|
16
|
+
assert_dirs_equal "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_gh_release
|
20
|
+
out, err, status = torba("pack", torbafile: "01_gh_release.rb")
|
21
|
+
assert status.success?, err
|
22
|
+
assert_includes out, "Torba has been packed!"
|
23
|
+
assert_dirs_equal "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_npm
|
27
|
+
out, err, status = torba("pack", torbafile: "02_npm.rb")
|
28
|
+
assert status.success?, err
|
29
|
+
assert_includes out, "Torba has been packed!"
|
30
|
+
assert_dirs_equal "test/fixtures/home_path/02", path_to_packaged("lo_dash")
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_without_image_asset_specified_in_import
|
34
|
+
out, err, status = torba("pack", torbafile: "01_image_asset_not_specified.rb")
|
35
|
+
refute status.success?, err
|
36
|
+
assert_includes out, <<OUT
|
37
|
+
Unknown asset to process with path '#{path_to_packaged "Trumbowyg", Test::TempHome.persistent_tmp_dir}/dist/ui/images/icons-2x.png'.
|
38
|
+
Make sure that you've imported all image/font assets mentioned in a stylesheet(-s).
|
39
|
+
OUT
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_with_not_existed_assets_mentioned_in_stylesheets
|
43
|
+
out, err, status = torba("pack", torbafile: "03_not_existed_assets.rb")
|
44
|
+
assert status.success?, err
|
45
|
+
assert_includes out, "Torba has been packed!"
|
46
|
+
assert_dirs_equal "test/fixtures/home_path/03", path_to_packaged("bourbon")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class ShowTest < Minitest::Test
|
5
|
+
def test_runs_pack
|
6
|
+
out, err, status = torba("show trumbowyg", torbafile: "01_zip.rb")
|
7
|
+
assert status.success?, err
|
8
|
+
assert_dirs_equal "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_outputs_package_directory
|
12
|
+
out, err, status = torba("show trumbowyg", torbafile: "01_zip.rb")
|
13
|
+
assert status.success?, err
|
14
|
+
assert_includes out, path_to_packaged("trumbowyg")
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_finds_by_partial_package_name
|
18
|
+
out, err, status = torba("show trumbo", torbafile: "01_zip.rb")
|
19
|
+
assert status.success?, err
|
20
|
+
assert_includes out, path_to_packaged("trumbowyg")
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_could_not_find_package
|
24
|
+
out, err, status = torba("show dumbo", torbafile: "01_zip.rb")
|
25
|
+
refute status.success?, err
|
26
|
+
assert_includes out, "Could not find package 'dumbo'."
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_similar_names_show_options
|
30
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb")
|
31
|
+
refute status.success?, err
|
32
|
+
assert_includes out, <<OUT
|
33
|
+
1 : bourbon
|
34
|
+
2 : bourbon-neat
|
35
|
+
0 : - exit -
|
36
|
+
OUT
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_similar_names_chosen_option
|
40
|
+
skip_java_capture3_bug
|
41
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "2")
|
42
|
+
assert status.success?, err
|
43
|
+
refute_includes out, path_to_packaged("bourbon")
|
44
|
+
assert_includes out, path_to_packaged("bourbon-neat")
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_similar_names_chosen_exit
|
48
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "0")
|
49
|
+
refute status.success?, err
|
50
|
+
refute_includes out, path_to_packaged("bourbon")
|
51
|
+
refute_includes out, path_to_packaged("bourbon-neat")
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_similar_names_chosen_unexisted_option
|
55
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "7")
|
56
|
+
refute status.success?, err
|
57
|
+
refute_includes out, path_to_packaged("bourbon")
|
58
|
+
refute_includes out, path_to_packaged("bourbon-neat")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class VerifyTest < Minitest::Test
|
5
|
+
def test_unpacked
|
6
|
+
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
7
|
+
refute status.success?, err
|
8
|
+
assert_equal <<OUT, out
|
9
|
+
Your Torba is not packed yet.
|
10
|
+
Missing packages:
|
11
|
+
* trumbowyg
|
12
|
+
Run `bundle exec torba pack` to install missing packages.
|
13
|
+
OUT
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_packed
|
17
|
+
_, err, status = torba("pack", torbafile: "01_zip.rb")
|
18
|
+
assert status.success?, err
|
19
|
+
|
20
|
+
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
21
|
+
assert status.success?, err
|
22
|
+
assert_includes out, "Torba is prepared!"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
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');"
|
Binary file
|
Binary file
|
@@ -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; } }
|