scrivito_sdk 1.2.0.rc1 → 1.2.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcb9c6155591fdd6da194ee62f1955f9e9b25ec8
4
- data.tar.gz: cb2daf392549cf48499a181784fa0f620de21aa7
3
+ metadata.gz: 8ca1483bfaa6bc0f4e828febc645bb29bbfc64fd
4
+ data.tar.gz: 5553e717e83725f8615cd3ed50a2472f33e3d3e1
5
5
  SHA512:
6
- metadata.gz: 739a7d0f4c0a4614c34424e1a987646b9b25cbef8488d95cdc3c3badf544619345458833e299cd0d9ba595b1ff42a305813a8b38a0d2f25f00cfcd83d3fd764f
7
- data.tar.gz: 273463e6a3f62f8b6b637f2b9e4ec2a9a456c1323a4c994fccaed96e67b2a5532c92700ebca89839fc58c28677791e44f4280c82e8e6957c3cf3fdb891157f33
6
+ metadata.gz: bb9eafb3c7a3eb56a7098fe3d1da5aad406d420aa81c50b6d134f89b127c33e5d9be53535b760c3dc1f8c39f3017bef608101b2d685aae9f3e156f7405771947
7
+ data.tar.gz: 9820a4784112eae5ebc653948e849e6c5d1992eac60bca37589ab6972630be8aa4a657a1eb936c2b3977be14470afcb6bf74745b0e685c91573d08b38d199e19
@@ -1,7 +1,7 @@
1
1
  ##
2
2
  ## Bundle of CA Root Certificates
3
3
  ##
4
- ## Certificate data from Mozilla as of: Wed Feb 24 15:30:51 2016
4
+ ## Certificate data from Mozilla as of: Fri Feb 26 13:19:56 2016
5
5
  ##
6
6
  ## This is a bundle of X.509 certificates of public Certificate Authorities
7
7
  ## (CA). These were automatically extracted from Mozilla's root certificates
@@ -190,6 +190,7 @@ class BasicWidget
190
190
  # @example Duplicate the first widget contained in the +my_widget+ field.
191
191
  # obj.update(my_widgets: obj.my_widgets.push(obj.my_widgets.first.copy))
192
192
  #
193
+ # @return [Scrivito::BasicWidget] a copy of this widget
193
194
  def copy
194
195
  attributes = {}
195
196
  attribute_definitions.each do |attribute_definition|
@@ -319,11 +320,14 @@ class BasicWidget
319
320
 
320
321
  # Returns the entity ({Scrivito::BasicObj} or {Scrivito::BasicWidget}) that references this widget.
321
322
  # @api public
323
+ #
324
+ # @return [Scrivito::AttributeContent] the entity that references this widget.
322
325
  def container
323
326
  @container || container_and_attribute_name.first
324
327
  end
325
328
 
326
329
  # Returns the name of the +widgetlist+ attribute that references this widget.
330
+ # @return [String] the name of the attribute that references this widget.
327
331
  # @api public
328
332
  def container_attribute_name
329
333
  @container_attribute_name || container_and_attribute_name.second
@@ -331,6 +335,7 @@ class BasicWidget
331
335
 
332
336
  # Returns the name of the 'widgetlist' field that references this widget.
333
337
  # @api public
338
+ # @return [String] the name of the attribute that references this widget.
334
339
  # @deprecated
335
340
  def container_field_name
336
341
  Scrivito::Deprecation.warn('Scrivito::BasicWidget#container_field_name is deprecated'\
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.rc1
4
+ version: 1.2.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infopark AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -385,8 +385,6 @@ files:
385
385
  - lib/scrivito/tag_renderer.rb
386
386
  - lib/scrivito/task.rb
387
387
  - lib/scrivito/test_request.rb
388
- - lib/scrivito/text_link.rb
389
- - lib/scrivito/text_link_conversion.rb
390
388
  - lib/scrivito/type_computer.rb
391
389
  - lib/scrivito/ui_config.rb
392
390
  - lib/scrivito/uploaded_binary.rb
@@ -1,52 +0,0 @@
1
- module Scrivito
2
-
3
- class TextLink
4
-
5
- def initialize(link_data)
6
- @data = link_data
7
- end
8
-
9
- def query_and_fragment
10
- query = @data["query"]
11
- fragment = @data["fragment"]
12
-
13
- str = ''
14
- str << "?#{query}" if query.present?
15
- str << "##{fragment}" if fragment.present?
16
- str
17
- end
18
-
19
- def internal?
20
- !url
21
- end
22
-
23
- def external_url
24
- url =~ /(external:)?(.*)/
25
- $2
26
- end
27
-
28
- def obj_id
29
- @data["destination"]
30
- end
31
-
32
- def html_attribute_snippet
33
- tag_name = @data["tag_name"]
34
- title = @data["title"]
35
- target = @data["target"]
36
-
37
- parts = []
38
- parts << %{alt="#{title}"} if tag_name == 'img' || tag_name == 'input'
39
- parts << %{title="#{title}"} if (tag_name == 'a' || tag_name == 'link') && title.present?
40
- parts << %{target="#{target}"} if target.present?
41
- parts.join(' ')
42
- end
43
-
44
- private
45
-
46
- def url
47
- @data["url"]
48
- end
49
-
50
- end
51
-
52
- end
@@ -1,52 +0,0 @@
1
- module Scrivito
2
-
3
- class TextLinkConversion
4
-
5
- def initialize(text_links)
6
- @text_links = text_links
7
- end
8
-
9
- def convert(html)
10
- return html unless @text_links
11
-
12
- if html
13
- html.gsub(%r{<?\binternallink:(\d+)\b>?(['"]?)}) do
14
- link = @text_links[$1]
15
- postfix = $2
16
- if link
17
- attach_snippet("#{convert_link(link)}#{postfix}", link)
18
- else
19
- "#__text_link_missing#{postfix}"
20
- end
21
- end
22
- end
23
- end
24
-
25
- private
26
-
27
- def convert_link(link)
28
- link.internal? ? convert_internal_link(link) : convert_external_link(link)
29
- end
30
-
31
- def attach_snippet(text, link)
32
- snippet = link.html_attribute_snippet
33
- if snippet.present?
34
- "#{text} #{snippet}"
35
- else
36
- text
37
- end
38
- end
39
-
40
- def convert_internal_link(link)
41
- if link.obj_id
42
- "objid:#{link.obj_id}#{link.query_and_fragment}"
43
- end
44
- end
45
-
46
- def convert_external_link(link)
47
- link.external_url
48
- end
49
-
50
- end
51
-
52
- end