Commit 605397db authored by Ivan Tyagov's avatar Ivan Tyagov

Allow in download widget to select from all possible convert to formats (incl. original).

Use explicitly MochiKit prefix in all KM JavaScript code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36802 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f131b02b
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>request/current_web_document/Document_viewDownloadWidget</string> </value> <value> <string>request/current_web_document/Base_viewDownloadWidget</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -1519,7 +1519,51 @@ div.centeredInner {\n ...@@ -1519,7 +1519,51 @@ div.centeredInner {\n
/* Search listbox styling */\n /* Search listbox styling */\n
div.searchDetails, span.found{\n div.searchDetails, span.found{\n
padding-top: 5px;\n padding-top: 5px;\n
} }\n
\n
/* Download widget */\n
div.download-document-format-list-container{\n
display:block;\n
float:left;\n
max-width: 200px;\n
}\n
div.download-document-format-list-container span{\n
cursor: pointer; \n
display:block;\n
float:right;\n
background:transparent url(km_img/collapse-down-arrow.gif) no-repeat scroll right 6px;\n
padding: 3px;\n
padding-right: 10px;\n
font-weight: bold;\n
}\n
\n
div.download-document-format-list-menu{\n
display:block;\n
float:left;\n
border: 1px solid #ECEBE2;\n
}\n
div.download-document-format-list-container span:hover,\n
div.download-document-format-list-menu ul li:hover{\n
background-color: #ECEBE2;\n
}\n
div.download-document-format-list-menu ul{\n
list-style-type:none;\n
padding:0.4em;\n
margin-bottom:0;\n
margin-top:0;\n
}\n
div.download-document-format-list-menu ul li{\n
margin-bottom:2px;\n
}\n
div.download-document-format-list-menu ul li.separator{\n
border-bottom: 1px solid #ECEBE2;\n
margin-bottom:5px;\n
padding-bottom:3px;\n
}\n
\n
\n
\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts77887532.32</string> </value> <value> <string>ts78059655.7</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
// Browser gadget toggle section\n // Browser gadget toggle section\n
function toggleSection(section_id, image_id){\n function toggleSection(section_id, image_id){\n
section_obj = getElement(section_id);\n section_obj = MochiKit.DOM.getElement(section_id);\n
image_obj = getElement(image_id);\n image_obj = MochiKit.DOM.getElement(image_id);\n
if(section_obj.style.display==\'none\'){\n if(section_obj.style.display==\'none\'){\n
section_obj.style.display=\'block\';\n section_obj.style.display=\'block\';\n
image_obj.src=\'images/tree_open.png\';}\n image_obj.src=\'images/tree_open.png\';}\n
...@@ -64,6 +64,12 @@ function toggleDocumentDetailsPopupWindow(dom_id, show, url){\n ...@@ -64,6 +64,12 @@ function toggleDocumentDetailsPopupWindow(dom_id, show, url){\n
}\n }\n
}\n }\n
\n \n
// Toggle any element\n
function toggleElement(tag_name, class_name){\n
dom_element = MochiKit.DOM.getFirstElementByTagAndClassName(tag_name, class_name);\n
MochiKit.Visual.toggle(dom_element);\n
}\n
\n
MochiKit.DOM.addLoadEvent(setScreenClass);\n MochiKit.DOM.addLoadEvent(setScreenClass);\n
connect(window, "onresize", setScreenClass);\n connect(window, "onresize", setScreenClass);\n
\n \n
...@@ -82,7 +88,7 @@ function setScreenClass(){\n ...@@ -82,7 +88,7 @@ function setScreenClass(){\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>1319</int> </value> <value> <int>1540</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block replace="nothing">\n
<!--\n
This widget displays download widget of a document.\n
\n
-->\n
</tal:block>\n
\n
<div class="download-document-format-list-container"\n
tal:define="target_format_item_list python: here.getTargetFormatItemList();\n
document_url here/absolute_url">\n
<span onClick="javascript:toggleElement(\'div\', \'download-document-format-list-menu\');"> Download</span>\n
<div class="download-document-format-list-menu" style="opacity: 0.999999; display: none;">\n
<ul>\n
<li class="separator"><a tal:attributes="href document_url"> Original </a></li>\n
<li tal:repeat="target_format_item target_format_item_list">\n
<a tal:attributes="href python: \'%s?format=%s\' %(document_url, target_format_item[1])"\n
tal:content="python: target_format_item[0]"/>\n
</li>\n
</ul>\n
</div>\n
\n
</div>
]]></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewDownloadWidget</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1476 1478
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment