card-mod-style 0.14.1 → 0.15.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
  SHA256:
3
- metadata.gz: cdf4658d37e16b6af9fc0011e4465ec216363bb3590c7fb19c96d2b9304bf9ee
4
- data.tar.gz: f79c9dea3e99694506ff861124616da3d962ac54a3c1628ee6c888af30b766c2
3
+ metadata.gz: d84026d8cb380633f07a36b003c4de59c6501d51569c28ce4cb399705db51f64
4
+ data.tar.gz: 1f93318fe756b901ef0d358b56ffd27c3f52078b873032036fdc6bc945abd9d7
5
5
  SHA512:
6
- metadata.gz: c8c96f33e5fd71591a5ac2769f8f31fcbf0a18f41f1289d4704785970b65870d8646a0f6687ac1faa148ea442883c350421d529034877eeb414849d8b2f6ca95
7
- data.tar.gz: 882d53505dea8acabc3e45b7096bd5a6466be67c7cb6001eab3f8f59e756b8416417e4f6c3a3176fe1563ffce6a17dd1c106d38309fbfac2bc774032bfa62768
6
+ metadata.gz: '0961488d122847da619f68cb1a3ca3587fc752ff200337140d68ef1ad2915fb0ee833bf2d8c953dd004bee9b08ff60a46209705685186aa8f2eaa604282f0d57'
7
+ data.tar.gz: 792de55241b6965ca832bf283f97639279e52be74d2b091842cb190dcae368bf62596bdc18916e4448c91d374a023a9eb4fac6c848b21c663da37512452121c8
@@ -0,0 +1,15 @@
1
+ .ui-menu-icons .ui-menu-item a {
2
+ padding-left: 0;
3
+ }
4
+
5
+ .ui-icon {
6
+ background-image: url([[/mod/style/jquery-ui-smoothness/ui-icons_454545_256x240.png]])
7
+ }
8
+
9
+ .ui-menu-item {
10
+ .glyphicon {
11
+ float: left;
12
+ font-size: 10px;
13
+ padding: 3px 0 3px 0px;
14
+ }
15
+ }
data/data/real.yml ADDED
@@ -0,0 +1,60 @@
1
+ ---
2
+ - :name: "style: mods"
3
+ :type: :list
4
+ :codename: style_mods
5
+
6
+ - :name: Local style folder group
7
+ :type: :cardtype
8
+ :codename: local_style_folder_group
9
+ - :name: Local style manifest group
10
+ :type: :cardtype
11
+ :codename: local_style_manifest_group
12
+
13
+
14
+ - :name: CSS
15
+ :type: :cardtype
16
+ :codename: css
17
+ :fields:
18
+ :description: |-
19
+ <p>Customize styles for [[Skins]]. [[http://decko.org/CSS|more]]</p>
20
+ :type:
21
+ :fields:
22
+ :create: Shark
23
+ :update: Shark
24
+ :delete: Shark
25
+ - :name: SCSS
26
+ :type: :cardtype
27
+ :codename: scss
28
+ :fields:
29
+ :description: |-
30
+ <p>Customize styles for [[Skins]]. [[http://decko.org/SCSS|more]]</p>
31
+ :type:
32
+ :fields:
33
+ :create: Shark
34
+ :update: Shark
35
+ :delete: Shark
36
+ - :name: Skin
37
+ :type: :cardtype
38
+ :codename: skin
39
+ :fields:
40
+ :description: |-
41
+ <p>
42
+ A [[skin]] determines a page's look and feel.
43
+ [[http://decko.org/Skins|more]]
44
+ </p>
45
+ :type:
46
+ :fields:
47
+ :create: Shark
48
+ :update: Shark
49
+ :delete: Shark
50
+ - :name: "*style"
51
+ :type: :setting
52
+ :codename: style
53
+ :fields:
54
+ :right:
55
+ :fields:
56
+ :input_type: radio
57
+ :content_options:
58
+ :type: :search_type
59
+ :content: '{"type": "bootswatch_skin", "sort": "name"}'
60
+ :content_option_view: Image
data/locales/de.yml ADDED
@@ -0,0 +1,2 @@
1
+ de:
2
+ style_delete_error_skin_in_use: Skin kann nicht gelöscht werden, weil es verwendet wird.
data/locales/en.yml ADDED
@@ -0,0 +1,2 @@
1
+ en:
2
+ style_delete_error_skin_in_use: Can't delete skin because it's used.
@@ -65,7 +65,7 @@ format :css do
65
65
  compress? ? compile(input) : compile(input, :nested)
66
66
  end
67
67
 
68
- # FIXME: method is repeated called with "nested", but there is no handling for it
68
+ # FIXME: method is repeatedly called with "nested", but there is no handling for it
69
69
  def compile input, _style=:compressed
70
70
  SassC::Engine.new(input, style: :compressed).render
71
71
  rescue StandardError => e
@@ -1,4 +1 @@
1
- .d-flex.justify-content-center.align-items-center
2
- .btn-group
3
- = select_button
4
- = render_customize_button
1
+ -#TODO
@@ -7,24 +7,12 @@ format :html do
7
7
 
8
8
  view :box_bottom, template: :haml
9
9
 
10
- view :customize_button, cache: :never do
11
- customize_button
12
- end
13
-
14
- def customize_button target: parent&.card, text: "Apply and customize"
15
- return "" unless card.codename.present?
16
-
17
- theme = card.codename.match(/^(?<theme_name>.+)_skin$/).capture(:theme_name)
18
- link_to_card target, text,
19
- path: { action: :update, card: { content: "[[#{card.name}]]" },
20
- customize: true, theme: theme },
21
- class: "btn btn-sm btn-outline-primary mr-2"
10
+ view :customize_button do
11
+ ""
22
12
  end
23
13
 
24
14
  view :box_middle do
25
- return unless card.field(:image)
26
-
27
- field_nest(:image, view: :full_width, size: :large)
15
+ field_nest :image, view: :full_width, size: :large if card.fetch :image
28
16
  end
29
17
 
30
18
  def select_button target=parent.card
data/set/type/css.rb CHANGED
@@ -1,2 +1,16 @@
1
1
  include_set Abstract::Css
2
2
  include_set Abstract::AssetInputter, input_format: :css, input_view: :compressed
3
+
4
+ # require 'w3c_validators'
5
+ require "sass"
6
+
7
+ event :validate_css, :validate, on: :save, changed: %i[type_id content] do
8
+ # validator = W3CValidators::CSSValidator.new
9
+ # results = validator.validate_text(content)
10
+ # results.errors.each do |error|
11
+ # errors.add :content, "#{error.message} (line #{error.line})"
12
+ # en
13
+ ::Sass::SCSS::Parser.new(content, nil, nil).parse
14
+ rescue ::Sass::SyntaxError => e
15
+ errors.add :content, e.message
16
+ end
@@ -1,2 +1,4 @@
1
1
  include_set Abstract::FolderGroup
2
2
  include_set Abstract::StyleGroup
3
+
4
+ basket[:non_createable_types] << :local_style_folder_group
@@ -1,2 +1,4 @@
1
1
  include_set Abstract::LocalManifestGroup
2
2
  include_set Abstract::StyleGroup
3
+
4
+ basket[:non_createable_types] << :local_style_manifest_group
data/set/type/scss.rb CHANGED
@@ -1,2 +1,23 @@
1
1
  include_set Abstract::Scss
2
2
  include_set Abstract::AssetInputter, input_format: :scss
3
+
4
+ event :validate_scss_syntax, :validate, on: :save, changed: %i[type_id content] do
5
+ variables = Card[:all, :style]&.joined_items_content
6
+ return unless variables.present? # happens during card:seed:build
7
+
8
+ SassC::Engine.new([variables.strip, content].join("\n")).render
9
+ rescue SassC::SyntaxError => e
10
+ match = e.message.match(/line (\d+)/)
11
+ message =
12
+ if match
13
+ offset = 6
14
+ corrected_line = match[1].to_i - variables.lines.count + offset
15
+ e.message
16
+ .sub(/line \d+:(\d+) of stdin/, "line #{corrected_line}:\\1")
17
+ .sub(/>>.*$/, ">> #{content.lines[corrected_line - 1]}")
18
+ # e.message
19
+ else
20
+ e.message
21
+ end
22
+ errors.add(:content, "<pre>#{message}</pre>".html_safe)
23
+ end
data/set/type/skin.rb CHANGED
@@ -9,3 +9,9 @@ format :css do
9
9
  end.join("\n")
10
10
  end
11
11
  end
12
+
13
+ event :no_deletion_if_used, :validate, on: :delete do
14
+ if Card[:all, :style].item_keys.include? key
15
+ errors.add :delete, t(:style_delete_error_skin_used)
16
+ end
17
+ end
@@ -22,6 +22,14 @@ format :html do
22
22
  nest icard, view: :stylesheet_include_tag
23
23
  end.join("\n")
24
24
  end
25
+
26
+ view :remote_include_tags do
27
+ map_remote_items do |tag_args|
28
+ tag "link",
29
+ href: tag_args.delete("src"),
30
+ media: "all", rel: "stylesheet", type: "text/css"
31
+ end
32
+ end
25
33
  end
26
34
 
27
35
  def asset_input_needs_refresh?
@@ -1,6 +1,6 @@
1
1
  .album.bg-light
2
2
  .container
3
- .row
3
+ .d-flex.flex-wrap.justify-content-around
4
4
  - selectable_themes.each do |theme|
5
- .col-md-4
5
+ .m-2.my-4
6
6
  = nest theme, view: :box
@@ -1,10 +1,9 @@
1
- require "sassc"
2
-
3
- include_set Abstract::Css
4
1
  include_set Abstract::AssetOutputter, output_format: :css, output_view: :compressed
5
2
 
6
- def output_filetype
7
- "css"
3
+ assign_type :pointer
4
+
5
+ def ok_item_types
6
+ %i[css scss skin bootswatch_skin]
8
7
  end
9
8
 
10
9
  def ok_to_read
@@ -12,7 +11,7 @@ def ok_to_read
12
11
  end
13
12
 
14
13
  def make_asset_output_coded
15
- super ENV["STYLE_OUTPUT_MOD"]
14
+ super Cardio.config.seed_mods.first
16
15
  end
17
16
 
18
17
  format do
@@ -26,11 +25,15 @@ format :html do
26
25
  HIDDEN_SKINS = %w[bootstrap_default_skin themeless_bootstrap_skin bootstrap_default_skin
27
26
  classic_bootstrap_skin].freeze
28
27
 
28
+ def input_type
29
+ :box_select
30
+ end
31
+
29
32
  def default_item_view
30
33
  :bar
31
34
  end
32
35
 
33
- view :input, template: :haml
36
+ # view :input, template: :haml
34
37
 
35
38
  def themes
36
39
  card.rule_card(:content_options).item_cards
@@ -44,29 +47,6 @@ format :html do
44
47
  end
45
48
  end
46
49
 
47
- event :customize_theme, :prepare_to_validate, on: :update, when: :customize_theme? do
48
- skin_name = free_skin_name
49
- subcard skin_name, type_id: CustomizedBootswatchSkinID
50
- self.content = "[[#{skin_name}]]"
51
- end
52
-
53
- event :update_theme_input, :finalize,
54
- before: :update_asset_output_file, changed: :content do
55
- item_cards.each do |theme_card|
56
- next unless theme_card.respond_to? :theme_name
57
- theme_card.update_asset_input
58
- end
59
- end
60
-
61
- def free_skin_name
62
- name = "#{@theme} skin customized"
63
- if Card.exist?(name)
64
- name = "#{name} 1"
65
- name.next! while Card.exist?(name)
66
- end
67
- name
68
- end
69
-
70
- def customize_theme?
71
- Env.params[:customize].present? && (@theme = Env.params[:theme]).present?
50
+ def joined_items_content
51
+ item_cards.map(&:content).compact.join "\n"
72
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-01-04 00:00:00.000000000 Z
13
+ date: 2023-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.104.1
21
+ version: 1.105.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.104.1
28
+ version: 1.105.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-assets
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.14.1
35
+ version: 0.15.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.14.1
42
+ version: 0.15.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-list
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.14.1
49
+ version: 0.15.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.14.1
56
+ version: 0.15.0
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -61,9 +61,11 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
+ - assets/style/jquery_ui_decko.scss
64
65
  - assets/style/jquery_ui_smoothness.css
65
- - assets/style/style_cards.scss
66
- - db/migrate_core_cards/20200805112346_add_mod_style_assets_type.rb
66
+ - data/real.yml
67
+ - locales/de.yml
68
+ - locales/en.yml
67
69
  - public/jquery-ui-smoothness/ui-bg_glass_55_fbf9ee_1x400.png
68
70
  - public/jquery-ui-smoothness/ui-bg_glass_65_ffffff_1x400.png
69
71
  - public/jquery-ui-smoothness/ui-bg_glass_75_dadada_1x400.png
@@ -90,7 +92,6 @@ files:
90
92
  - set/type/local_style_manifest_group.rb
91
93
  - set/type/scss.rb
92
94
  - set/type/skin.rb
93
- - set/type_plus_right/customized_bootswatch_skin/stylesheets.rb
94
95
  - set/type_plus_right/mod/style.rb
95
96
  - set/type_plus_right/set/style.rb
96
97
  - set/type_plus_right/set/style/input.haml
@@ -104,6 +105,7 @@ metadata:
104
105
  wiki_uri: https://decko.org
105
106
  documentation_url: http://docs.decko.org/
106
107
  card-mod: style
108
+ card-mod-group: gem-defaults
107
109
  post_install_message:
108
110
  rdoc_options: []
109
111
  require_paths:
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  - !ruby/object:Gem::Version
120
122
  version: '0'
121
123
  requirements: []
122
- rubygems_version: 3.2.15
124
+ rubygems_version: 3.3.11
123
125
  signing_key:
124
126
  specification_version: 4
125
127
  summary: Skins, CSS, SCSS, etc