[Erp5-report] r36802 ivan - /erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_w...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 2 12:46:56 CEST 2010
Author: ivan
Date: Fri Jul 2 12:46:54 2010
New Revision: 36802
URL: http://svn.erp5.org?rev=36802&view=rev
Log:
Allow in download widget to select from all possible convert to formats (incl. original).
Use explicitly MochiKit prefix in all KM JavaScript code.
Removed:
erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_widget_library/Document_viewDownloadWidget.xml
Removed: erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_widget_library/Document_viewDownloadWidget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_widget_library/Document_viewDownloadWidget.xml?rev=36801&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_widget_library/Document_viewDownloadWidget.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_widget_library/Document_viewDownloadWidget.xml (removed)
@@ -1,187 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
- <record id="1" aka="AAAAAAAAAAE=">
- <pickle>
- <tuple>
- <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
- <tuple/>
- </tuple>
- </pickle>
- <pickle>
- <dictionary>
- <item>
- <key> <string>Script_magic</string> </key>
- <value> <int>3</int> </value>
- </item>
- <item>
- <key> <string>_bind_names</string> </key>
- <value>
- <object>
- <klass>
- <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>_asgns</string> </key>
- <value>
- <dictionary>
- <item>
- <key> <string>name_container</string> </key>
- <value> <string>container</string> </value>
- </item>
- <item>
- <key> <string>name_context</string> </key>
- <value> <string>context</string> </value>
- </item>
- <item>
- <key> <string>name_m_self</string> </key>
- <value> <string>script</string> </value>
- </item>
- <item>
- <key> <string>name_subpath</string> </key>
- <value> <string>traverse_subpath</string> </value>
- </item>
- </dictionary>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>_body</string> </key>
- <value> <string encoding="cdata"><![CDATA[
-
-"""\n
- This script creates a button with links to PDF or printable\n
- formats of the current page.\n
-\n
- TODO:\n
- - support more portal types\n
- - produce PDF from HTML\n
- - add a button to make a page printage (this is another widget)\n
- - make sure everything is well translated (ex. Format word)\n
-"""\n
-\n
-request = context.REQUEST\n
-portal_path = request.get(\'current_web_site_url\', context.getPortalObject().absolute_url())\n
-object_url = context.absolute_url()\n
-title = context.getShortTitle()\n
-if not title:\n
- title = context.getReference()\n
-\n
-# Select the download format\n
-portal_type = context.getPortalType()\n
-if portal_type == \'Web Page\':\n
- format = \'text\'\n
-elif portal_type == \'Presentation\':\n
- format = \'pdf\'\n
-elif portal_type in (\'Text\', \'Presentation\', \'Spreadsheet\', \'Drawing\', \'PDF Document\'):\n
- format = \'pdf\'\n
-else:\n
- format = None\n
-\n
-if not format or not context.hasConversion(format=format):\n
- converted_size_html = \'\'\n
-else:\n
- converted_size = context.getConversionSize(format=format)\n
- if converted_size < 1024:\n
- converted_size_html = \'%sB - \' % converted_size\n
- elif converted_size < 1048576:\n
- converted_size_html = \'%.1fKB - \' % (converted_size / 1024.0)\n
- else:\n
- converted_size_html = \'%.1fMB - \' % (converted_size / 1048576.0)\n
-\n
-if format is None:\n
- return \'\'\n
-\n
-# Produce the HTML snippet\n
-download_html = """<a href="%s?format=%s"><img src="%s/km_img/download_%s.png" alt="%s icon"/></a>\n
- <p>\n
- <a href="%s?format=%s">%s</a><br/>%s%s Format\n
- </p>\n
- """ % (object_url, format, portal_path, format, format, object_url, format, title, \n
- converted_size_html, format.upper())\n
-\n
-return download_html\n
-
-
-]]></string> </value>
- </item>
- <item>
- <key> <string>_code</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>_params</string> </key>
- <value> <string></string> </value>
- </item>
- <item>
- <key> <string>errors</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- <item>
- <key> <string>func_code</string> </key>
- <value>
- <object>
- <klass>
- <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>co_argcount</string> </key>
- <value> <int>0</int> </value>
- </item>
- <item>
- <key> <string>co_varnames</string> </key>
- <value>
- <tuple>
- <string>_getattr_</string>
- <string>context</string>
- <string>request</string>
- <string>portal_path</string>
- <string>object_url</string>
- <string>title</string>
- <string>portal_type</string>
- <string>format</string>
- <string>None</string>
- <string>converted_size_html</string>
- <string>converted_size</string>
- <string>download_html</string>
- </tuple>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>func_defaults</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>id</string> </key>
- <value> <string>Document_viewDownloadWidget</string> </value>
- </item>
- <item>
- <key> <string>warnings</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- </dictionary>
- </pickle>
- </record>
-</ZopeData>
More information about the Erp5-report
mailing list