[Products.SilvaExternalSources][Emiliano D'Alterio] Fixed cs_ifr...

[email protected] Mon, 21 Oct 2013 20:10:16 +0200
Newsgroups gmane.comp.web.zope.silva.cvs
Message-ID <[email protected]>
author:    Emiliano D'Alterio
date:      Mon Oct 21 20:10:11 2013 +0200
revision:  1124:ec5066b69d3a in Products.SilvaExternalSources
branch:    2.4
details:   https://hg.infrae.com/Products.SilvaExternalSources?cmd=changeset;node=ec5066b69d3a
modified:  Products/SilvaExternalSources/codesources/cs_iframe/iframe_renderer.pt Products/SilvaExternalSources/codesources/cs_iframe/iframe_url_validator.py Products/SilvaExternalSources/codesources/cs_iframe/parameters.xml Products/SilvaExternalSources/codesources/cs_iframe/source.ini Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt
added:     Products/SilvaExternalSources/codesources/cs_iframe/source.ini
removed:   
log:       Fixed cs_iframe to make it installable. Fixed html5 validation
	problem in Twitter CS.


diffstat:

 Products/SilvaExternalSources/codesources/cs_iframe/iframe_renderer.pt            |   2 +-
 Products/SilvaExternalSources/codesources/cs_iframe/iframe_url_validator.py       |   9 ++-
 Products/SilvaExternalSources/codesources/cs_iframe/parameters.xml                |   2 +-
 Products/SilvaExternalSources/codesources/cs_iframe/source.ini                    |   9 +++
 Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml      |  16 ++--
 Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini          |   1 -
 Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt |  27 +++++----
 7 files changed, 42 insertions(+), 24 deletions(-)

diffs (140 lines):

diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_iframe/iframe_renderer.pt
--- a/Products/SilvaExternalSources/codesources/cs_iframe/iframe_renderer.pt	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_iframe/iframe_renderer.pt	Mon Oct 21 20:10:11 2013 +0200
@@ -3,4 +3,4 @@
                         width options/width;
                         height options/height;
                         scrolling options/scrolling">
-</iframe>
\ No newline at end of file
+</iframe>
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_iframe/iframe_url_validator.py
--- a/Products/SilvaExternalSources/codesources/cs_iframe/iframe_url_validator.py	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_iframe/iframe_url_validator.py	Mon Oct 21 20:10:11 2013 +0200
@@ -1,5 +1,12 @@
+## Script (Python) "iframe_url_validator"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
 ##parameters=value, REQUEST
-
+##title=
+##
 if not value:
     return False
 
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_iframe/parameters.xml
--- a/Products/SilvaExternalSources/codesources/cs_iframe/parameters.xml	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_iframe/parameters.xml	Mon Oct 21 20:10:11 2013 +0200
@@ -101,7 +101,7 @@
         <values>
           <alternate_name></alternate_name>
           <css_class></css_class>
-          <default></default>
+          <default>auto</default>
           <description></description>
           <enabled type="int">1</enabled>
           <external_validator></external_validator>
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_iframe/source.ini
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_iframe/source.ini	Mon Oct 21 20:10:11 2013 +0200
@@ -0,0 +1,9 @@
+[source]
+id = cs_iframe
+title = Iframe
+render_id = iframe_renderer
+usuable = yes
+previewable = yes
+cacheable = no
+description = The Code Source allows Authors to embed iframes in a document. IMPORTANT: in order to use this CS you need to create a property named 'allowed_urls' of type 'lines', where allowed urls reside (one per line).
+
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml
--- a/Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml	Mon Oct 21 20:10:11 2013 +0200
@@ -71,22 +71,23 @@
           <message name="too_long">Too much input was given.</message>
         </messages>
       </field>
-      <field><id>height</id> <type>IntegerField</type>
+      <field><id>height</id> <type>StringField</type>
         <values>
           <alternate_name></alternate_name>
           <css_class></css_class>
-          <default>600</default>
-          <description>Choose the height of the Twitter widget (units are pixels).</description>
+          <default>auto</default>
+          <description>Choose the height of the Twitter widget (you have to specify units, e.g: 500px or 2em).</description>
           <display_maxwidth></display_maxwidth>
           <display_width type="int">20</display_width>
           <enabled type="int">1</enabled>
-          <end></end>
           <external_validator></external_validator>
           <extra></extra>
           <hidden type="int">0</hidden>
+          <max_length></max_length>
           <required type="int">0</required>
-          <start></start>
-          <title>Height</title>
+          <title>Widget height</title>
+          <truncate type="int">0</truncate>
+          <unicode type="int">0</unicode>
           <whitespace_preserve type="int">0</whitespace_preserve>
         </values>
         <tales>
@@ -94,8 +95,7 @@
         <messages>
           <message name="external_validator_failed">The input failed the external validator.</message>
           <message name="required_not_found">Input is required but no input given.</message>
-          <message name="not_integer">You did not enter an integer.</message>
-          <message name="integer_out_of_range">The integer you entered was out of range.</message>
+          <message name="too_long">Too much input was given.</message>
         </messages>
       </field>
       <field><id>data-theme</id> <type>StringField</type>
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini
--- a/Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini	Mon Oct 21 20:10:11 2013 +0200
@@ -6,4 +6,3 @@
 previewable = yes
 cacheable = no
 description = Displays a configurable Twitter Timeline Widget.
-
diff -r 08f9903b91b5 -r ec5066b69d3a Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt
--- a/Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt	Wed Oct 09 17:15:22 2013 +0200
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt	Mon Oct 21 20:10:11 2013 +0200
@@ -13,18 +13,21 @@
 <div tal:attributes="class cssclass"
   tal:omit-tag="not:cssclass">
   <h3 tal:condition="wtitle" tal:content="wtitle"></h3>
-  <a tal:attributes="
-    href string:https://twitter.com/$username;
-    class string:twitter-timeline;
-    data-widget-id widgetid;
-    data-theme theme;
-    data-link-color linkcolor;
-    height height;
-    data-chrome chrome;
-    data-border-color bordercolor;
-    data-tweet-limit tweetlimit;"
-    tal:content="string:Tweets by $username">
-  </a>
+  <div tal:omit-tag="not:height"
+    tal:attributes="style python: 'height: %s;; overflow: hidden;;' % (height);">
+    <a tal:attributes="
+      href string:https://twitter.com/$username;
+      class string:twitter-timeline;
+      data-widget-id widgetid;
+      data-theme theme;
+      data-link-color linkcolor;
+      height height;
+      data-chrome chrome;
+      data-border-color bordercolor;
+      data-tweet-limit tweetlimit;"
+      tal:content="string:Tweets by $username">
+    </a>
+  </div>
   <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
   </script>
 </div>