[Products.SilvaExternalSources][Emiliano D'Alterio] Added a new ...
[email protected] Wed, 25 Sep 2013 12:09:53 +0200
| Newsgroups | gmane.comp.web.zope.silva.cvs |
|---|---|
| Message-ID | <[email protected]> |
author: Emiliano D'Alterio
date: Wed Sep 25 12:09:36 2013 +0200
revision: 1112:fa3ba92d4858 in Products.SilvaExternalSources
branch: 2.4
details: https://hg.infrae.com/Products.SilvaExternalSources?cmd=changeset;node=fa3ba92d4858
modified: Products/SilvaExternalSources/codesources/cs_twitter_timeline/LICENSE.txt Products/SilvaExternalSources/codesources/cs_twitter_timeline/README.txt 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_twitter_timeline/LICENSE.txt Products/SilvaExternalSources/codesources/cs_twitter_timeline/README.txt 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
removed:
log: Added a new configurable Code Source for the Twitter Timeline.
diffstat:
Products/SilvaExternalSources/codesources/cs_twitter_timeline/LICENSE.txt | 30 +
Products/SilvaExternalSources/codesources/cs_twitter_timeline/README.txt | 39 +
Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml | 244 ++++++++++
Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini | 9 +
Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt | 24 +
5 files changed, 346 insertions(+), 0 deletions(-)
diffs (366 lines):
diff -r ab9668c78e28 -r fa3ba92d4858 Products/SilvaExternalSources/codesources/cs_twitter_timeline/LICENSE.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/LICENSE.txt Wed Sep 25 12:09:36 2013 +0200
@@ -0,0 +1,30 @@
+LICENSE.txt
+
+Copyright (c) 2002-2013 Infrae. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. Neither the name of Infrae nor the names of its contributors may be
+ used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS
+IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INFRAE OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -r ab9668c78e28 -r fa3ba92d4858 Products/SilvaExternalSources/codesources/cs_twitter_timeline/README.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/README.txt Wed Sep 25 12:09:36 2013 +0200
@@ -0,0 +1,39 @@
+README for Twitter Widget Code Source
+=====================================
+
+This README should reside inside a Silva Code Source named 'cs_twitter_timeline'.
+The Code Source allows to place a configurable Twitter Timeline Widget in a document.
+In order to use this CS you have to first create a Twitter widget in your profile
+and then input the widget ID in this CS (https://twitter.com/settings/widgets/new).
+This widget ID is the value of the "data-widget-id" attribute in the HTML code
+that Twitter provides you after saving the widget in your profile.
+
+Customizing the Twitter CS
+--------------------------
+You can set many parameters to customize the Twitter Widget but only two of them
+are required: the Twitter Username and the Widget ID. Here follows a brief description
+of each parameter you can set:
+
+- Username: your Twitter username
+- Widget ID: the value of the "data-widget-id" attribute in the HTML code Twitter
+ provides you after saving the widget in your profile.
+- Height: the height of the Twitter widget (units are pixels).
+- Theme: light or dark widget theme.
+- Chrome: the widget layout, you can use a space-separated set of the following options:
+ - noheader: hides the timeline header.
+ - nofooter: hides the timeline footer and Tweet box, if included.
+ - noborders: removes all borders within the widget.
+ - noscrollbar: crops and hides the main timeline scrollbar, if visible.
+ - transparent: removes the background color.
+- Tweet limit: this is to fix the size of a timeline to a preset number of Tweets.
+- Link color: the link color used by the widget. Use the hexadecimal notation.
+- Border color: the border color used by the widget. Use the hexadecimal notation.
+
+Optional Twitter Card
+---------------------
+The Twitter Card is not strictly related with this Twitter CS
+but it might be a useful feature you might want to consider in addition
+to displaying the Twitter timeline widget.
+For more info:
+https://dev.twitter.com/docs/cards
+https://dev.twitter.com/docs/cards/validation/validator
diff -r ab9668c78e28 -r fa3ba92d4858 Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/parameters.xml Wed Sep 25 12:09:36 2013 +0200
@@ -0,0 +1,244 @@
+<?xml version="1.0"?>
+
+<form>
+ <title>Parameters form</title>
+ <row_length>4</row_length>
+ <name>form</name>
+ <action></action>
+ <method>POST</method>
+ <enctype></enctype>
+ <encoding>UTF-8</encoding>
+ <stored_encoding>ISO-8859-1</stored_encoding>
+ <unicode_mode>true</unicode_mode>
+ <i18n_domain></i18n_domain>
+ <groups>
+ <group>
+ <title>Default</title>
+ <fields>
+
+ <field><id>username</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>infrae</default>
+ <description>Your Twitter username</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">1</required>
+ <title>Username</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ <field><id>data-widget-id</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>345115773511016448</default>
+ <description>In order to use this CS you have to create a Twitter user widget in your profile and then input the widget ID in this field (https://twitter.com/settings/widgets/new).
+This widget ID is the value of the "data-widget-id" attribute in the HTML code Twitter provides you after saving the widget in your profile.</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">1</required>
+ <title>Widget ID</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ <field><id>height</id> <type>IntegerField</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>
+ <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>
+ <required type="int">0</required>
+ <start></start>
+ <title>Height</title>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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>
+ </messages>
+ </field>
+ <field><id>data-theme</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>light</default>
+ <description>You can choose between light and dark theme.</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">0</required>
+ <title>Theme</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ <field><id>data-chrome</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>noheader nofooter noborders noscrollbar transparent</default>
+ <description>Control the widget layout, you can use a space-separated set of the following options:
+1. noheader: hides the timeline header.
+2. nofooter: hides the timeline footer and Tweet box, if included.
+3. noborders: removes all borders within the widget.
+4. noscrollbar: crops and hides the main timeline scrollbar, if visible.
+5. transparent: removes the background color.</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">0</required>
+ <title>Chrome</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ <field><id>data-tweet-limit</id> <type>IntegerField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>5</default>
+ <description>This is to fix the size of a timeline to a preset number of Tweets.</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>
+ <required type="int">0</required>
+ <start></start>
+ <title>Tweet limit</title>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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>
+ </messages>
+ </field>
+ <field><id>data-link-color</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>#cc0000</default>
+ <description>You can change the links color used by the widget. Use the hexadecimal notation.</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">0</required>
+ <title>Link color</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ <field><id>data-border-color</id> <type>StringField</type>
+ <values>
+ <alternate_name></alternate_name>
+ <css_class></css_class>
+ <default>#cc0000</default>
+ <description>You can change the border color used by the widget. Use hexadecimal notation.</description>
+ <display_maxwidth></display_maxwidth>
+ <display_width type="int">20</display_width>
+ <enabled type="int">1</enabled>
+ <external_validator></external_validator>
+ <extra></extra>
+ <hidden type="int">0</hidden>
+ <max_length></max_length>
+ <required type="int">0</required>
+ <title>Border color</title>
+ <truncate type="int">0</truncate>
+ <unicode type="int">0</unicode>
+ <whitespace_preserve type="int">0</whitespace_preserve>
+ </values>
+ <tales>
+ </tales>
+ <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="too_long">Too much input was given.</message>
+ </messages>
+ </field>
+ </fields>
+ </group>
+ </groups>
+</form>
diff -r ab9668c78e28 -r fa3ba92d4858 Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/source.ini Wed Sep 25 12:09:36 2013 +0200
@@ -0,0 +1,9 @@
+[source]
+id = cs_twitter_timeline
+title = Twitter Timeline
+render_id = twitter_timeline
+usuable = yes
+previewable = yes
+cacheable = no
+description = Displays a configurable Twitter Timeline Widget.
+
diff -r ab9668c78e28 -r fa3ba92d4858 Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Products/SilvaExternalSources/codesources/cs_twitter_timeline/twitter_timeline.pt Wed Sep 25 12:09:36 2013 +0200
@@ -0,0 +1,24 @@
+<tal:twitter_timeline>
+ <tal:def tal:define="username options/username;
+ widgetid options/data-widget-id;
+ theme options/data-theme | nothing;
+ linkcolor options/data-link-color | nothing;
+ height options/height | nothing;
+ chrome options/data-chrome | nothing;
+ bordercolor options/data-border-color | nothing;
+ tweetlimit options/data-tweet-limit | nothing;" >
+ <a tal:attributes="href python:'https://twitter.com/%s' % 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="python:'Tweets by @%s' % username">
+ </a>
+ <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>
+ </tal:def>
+</tal:twitter_timeline>