card-mod-content 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/card/content/chunk/link.rb +0 -1
- data/lib/card/content/chunk/nest.rb +0 -2
- data/lib/card/content/chunk/uri.rb +17 -17
- data/set/abstract/01_code_content.rb +19 -0
- data/set/abstract/{01_code_file.rb → 02_code_file.rb} +1 -18
- data/set/abstract/read_only.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af70b2c7dd6325fddf41719756af50e5c495b579e5f07d8b6099aa97df929135
|
4
|
+
data.tar.gz: 478c8eb7b8df2e7a1482cbc31422c2c9f55b34c1e19e37343c0380405797cb25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23920a9f1ce7783de6e6fc29a69235b2e04b5c3fafba390279e9e646c31095a7472513d55ca701aa8dd5b67d5efb3aa1a202a5474fb389e89da28327dcfe3f62
|
7
|
+
data.tar.gz: 9eb909a81cd2e2dd4eb38f14e6fd3d6d135882e3765b27ad9814f3a48e3f09c911d60fb7a7f060bb4a386f4560d50c3df61b8f4a9e0003b9278f0b26d68c07b0
|
@@ -2,26 +2,26 @@
|
|
2
2
|
|
3
3
|
require "uri"
|
4
4
|
|
5
|
-
# This wiki chunk matches arbitrary URIs, using patterns from the Ruby URI
|
6
|
-
# modules.
|
7
|
-
# It parses out a variety of fields that could be used by formats to format
|
8
|
-
# the links in various ways (shortening domain names, hiding email addresses)
|
9
|
-
# It matches email addresses and host.com.au domains without schemes (http://)
|
10
|
-
# but adds these on as required.
|
11
|
-
#
|
12
|
-
# The heuristic used to match a URI is designed to err on the side of caution.
|
13
|
-
# That is, it is more likely to not autolink a URI than it is to accidently
|
14
|
-
# autolink something that is not a URI. The reason behind this is it is easier
|
15
|
-
# to force a URI link by prefixing 'http://' to it than it is to escape and
|
16
|
-
# incorrectly marked up non-URI.
|
17
|
-
#
|
18
|
-
# I'm using a part of the [ISO 3166-1 Standard][iso3166] for country name
|
19
|
-
# suffixes.
|
20
|
-
# The generic names are from www.bnoack.com/data/countrycode2.html)
|
21
|
-
# [iso3166]: http://geotags.com/iso3166/
|
22
5
|
class Card
|
23
6
|
class Content
|
24
7
|
module Chunk
|
8
|
+
# This wiki chunk matches arbitrary URIs, using patterns from the Ruby URI
|
9
|
+
# modules.
|
10
|
+
# It parses out a variety of fields that could be used by formats to format
|
11
|
+
# the links in various ways (shortening domain names, hiding email addresses)
|
12
|
+
# It matches email addresses and host.com.au domains without schemes (http://)
|
13
|
+
# but adds these on as required.
|
14
|
+
#
|
15
|
+
# The heuristic used to match a URI is designed to err on the side of caution.
|
16
|
+
# That is, it is more likely to not autolink a URI than it is to accidently
|
17
|
+
# autolink something that is not a URI. The reason behind this is it is easier
|
18
|
+
# to force a URI link by prefixing 'http://' to it than it is to escape and
|
19
|
+
# incorrectly marked up non-URI.
|
20
|
+
#
|
21
|
+
# I'm using a part of the [ISO 3166-1 Standard][iso3166] for country name
|
22
|
+
# suffixes.
|
23
|
+
# The generic names are from www.bnoack.com/data/countrycode2.html)
|
24
|
+
# [iso3166]: http://geotags.com/iso3166/
|
25
25
|
class Uri < Abstract
|
26
26
|
SCHEMES = %w[irc http https ftp ssh git sftp file ldap ldaps mailto].freeze
|
27
27
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
format :html do
|
2
|
+
view :input do
|
3
|
+
# Localize
|
4
|
+
"Content is stored in file and can't be edited."
|
5
|
+
end
|
6
|
+
|
7
|
+
view :bar_middle do
|
8
|
+
short_content
|
9
|
+
end
|
10
|
+
|
11
|
+
def short_content
|
12
|
+
icon_tag(:warning, class: "text-muted pe-2") +
|
13
|
+
wrap_with(:span, "file", class: "text-muted")
|
14
|
+
end
|
15
|
+
|
16
|
+
def standard_submit_button
|
17
|
+
multi_card_editor? ? super : ""
|
18
|
+
end
|
19
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
include_set Abstract::Sources
|
2
|
+
include_set Abstract::CodeContent
|
2
3
|
|
3
4
|
class << self
|
4
5
|
def included host_class
|
@@ -25,25 +26,7 @@ def content
|
|
25
26
|
end
|
26
27
|
|
27
28
|
format :html do
|
28
|
-
view :input do
|
29
|
-
# Localize
|
30
|
-
"Content is stored in file and can't be edited."
|
31
|
-
end
|
32
|
-
|
33
29
|
view :file_size do
|
34
30
|
"#{card.name}: #{number_to_human_size card.content.bytesize}"
|
35
31
|
end
|
36
|
-
|
37
|
-
view :bar_middle do
|
38
|
-
short_content
|
39
|
-
end
|
40
|
-
|
41
|
-
def short_content
|
42
|
-
fa_icon("exclamation-circle", class: "text-muted pe-2") +
|
43
|
-
wrap_with(:span, "file", class: "text-muted")
|
44
|
-
end
|
45
|
-
|
46
|
-
def standard_submit_button
|
47
|
-
multi_card_editor? ? super : ""
|
48
|
-
end
|
49
32
|
end
|
data/set/abstract/read_only.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
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: 2023-
|
13
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.105.
|
21
|
+
version: 1.105.1
|
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.105.
|
28
|
+
version: 1.105.1
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|
@@ -43,7 +43,8 @@ files:
|
|
43
43
|
- lib/card/content/chunk/uri.rb
|
44
44
|
- lib/card/content/chunk/view_stub.rb
|
45
45
|
- set/abstract/00_sources.rb
|
46
|
-
- set/abstract/
|
46
|
+
- set/abstract/01_code_content.rb
|
47
|
+
- set/abstract/02_code_file.rb
|
47
48
|
- set/abstract/haml_file.rb
|
48
49
|
- set/abstract/lock.rb
|
49
50
|
- set/abstract/read_only.rb
|