Skip to content

Commit

Permalink
use the new jquery.oembed implementation provided by collecetive.oembed
Browse files Browse the repository at this point in the history
  • Loading branch information
toutpt committed Dec 19, 2012
1 parent 335a8c0 commit b617fb8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions collective/portlet/oembed/jsoembed.pt
@@ -0,0 +1 @@
<a class="oembed" tal:attributes="href view/data/remote_url; data-maxwidth view/data/maxwidth; data-maxheight view/data/maxheight" tal:content="view/data/header"></a>
3 changes: 1 addition & 2 deletions collective/portlet/oembed/portlet.pt
Expand Up @@ -18,13 +18,12 @@
</dt>

<dd class="portletItem odd">
<div tal:replace="structure view/embed" />
<tal:corners condition="not:view/has_footer">
<span class="portletBottomLeft"></span>
<span class="portletBottomRight"></span>
</tal:corners>
</dd>

<dd class="portletFooter" tal:condition="view/has_footer">
<span class="portletBottomLeft"></span>
<span>
Expand Down
4 changes: 4 additions & 0 deletions collective/portlet/oembed/portlet.py
Expand Up @@ -92,6 +92,7 @@ class Renderer(static.Renderer):

render = ViewPageTemplateFile('portlet.pt')
jsoembedall = ViewPageTemplateFile('jsoembedall.pt')
jsoembed = ViewPageTemplateFile('jsoembed.pt')

def get_rendering(self):
registry = component.getUtility(IRegistry)
Expand All @@ -102,6 +103,9 @@ def get_rendering(self):
def embed(self):
if self.get_rendering() == "collective.js.oembedall":
return self.jsoembedall()
if self.get_rendering() == "collective.oembed.jquery":
return self.jsoembed()
#rendering should be "collective.oembed"
return self.embed_collective_oembed()

def embed_collective_oembed(self):
Expand Down
2 changes: 1 addition & 1 deletion collective/portlet/oembed/profiles/default/registry.xml
Expand Up @@ -3,6 +3,6 @@
<field type="plone.registry.field.ASCIILine">
<title>Rendering</title>
</field>
<value>collective.oembed</value>
<value>collective.oembed.jquery</value>
</record>
</registry>
1 change: 1 addition & 0 deletions docs/HISTORY.txt
Expand Up @@ -5,6 +5,7 @@ Changelog
----------------

- Add collective.js.oembedall rendering option
- Add collective.oembed.jquery rendering option and activate it by default


1.1 (2012-07-10)
Expand Down

0 comments on commit b617fb8

Please sign in to comment.