Commit 1605263e authored by Ivan Tyagov's avatar Ivan Tyagov

Clean up.

Initialize draggable & droppable functionality of new pad.
Use proper script name.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41039 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9070cf76
...@@ -208,8 +208,8 @@ ...@@ -208,8 +208,8 @@
</div>\n </div>\n
<div class="pad-switch"\n <div class="pad-switch"\n
tal:attributes="style python: test(is_active, \'display:none\', \'display:block\')">\n tal:attributes="style python: test(is_active, \'display:none\', \'display:block\')">\n
<!--\n \n
<span tal:attributes="onclick string:loadPadFromServer(\'${knowledge_pad_relative_url}\', \'${dom_id}\', \'${mode}\')" \n <!-- <span tal:attributes="onclick string:loadPadFromServer(\'${knowledge_pad_relative_url}\', \'${dom_id}\', \'${mode}\')" \n
tal:content="knowledge_pad/getTitle"/>-->\n tal:content="knowledge_pad/getTitle"/>-->\n
\n \n
<a tal:attributes="href python:\n <a tal:attributes="href python:\n
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
view_form_id gadget/getViewFormId;\n view_form_id gadget/getViewFormId;\n
render_type gadget/getRenderType;\n render_type gadget/getRenderType;\n
is_asynchronous_gadget python: render_type == \'asynchronous\';\n is_asynchronous_gadget python: render_type == \'asynchronous\';\n
force_synchronous_gadget_rendering python: request.get(\'force_synchronous_gadget_rendering\', False);\n
current_web_section python: context.REQUEST.get(\'current_web_section\',\n current_web_section python: context.REQUEST.get(\'current_web_section\',\n
here);\n here);\n
current_web_section python: \n current_web_section python: \n
...@@ -179,13 +178,13 @@ ...@@ -179,13 +178,13 @@
tal:define="view_form_object python: getattr(real_context, view_form_id);">\n tal:define="view_form_object python: getattr(real_context, view_form_id);">\n
\n \n
<!-- Synchronous Gadget -->\n <!-- Synchronous Gadget -->\n
<div tal:condition="python: not is_asynchronous_gadget or force_synchronous_gadget_rendering"\n <div tal:condition="python: not is_asynchronous_gadget"\n
tal:attributes="id view_form_dom_id"\n tal:attributes="id view_form_dom_id"\n
class="box_inner_content" \n class="box_inner_content" \n
tal:content="structure python: view_form_object(box=box)"/>\n tal:content="structure python: view_form_object(box=box)"/>\n
\n \n
<!-- Asynchronous Gadget -->\n <!-- Asynchronous Gadget -->\n
<tal:block tal:condition="python: is_asynchronous_gadget and not force_synchronous_gadget_rendering">\n <tal:block tal:condition="python: is_asynchronous_gadget">\n
<div tal:attributes="id view_form_dom_id" \n <div tal:attributes="id view_form_dom_id" \n
class="box_inner_content"\n class="box_inner_content"\n
i18n:translate="" \n i18n:translate="" \n
......
...@@ -36,18 +36,17 @@ ...@@ -36,18 +36,17 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<div tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n <div id="page_wrapper"\n
tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n
real_context python: options.get(\'real_context\', None);\n real_context python: options.get(\'real_context\', None);\n
cancel_url python: options.get(\'cancel_url\', None);\n cancel_url python: options.get(\'cancel_url\', None);\n
isAnon python: here.portal_membership.isAnonymousUser();\n isAnon python: here.portal_membership.isAnonymousUser();\n
is_tab_empty python: (len(layout)==1 and len(layout[0])==0) or\n is_tab_empty python: (len(layout)==1 and len(layout[0])==0) or\n
(len(layout)==3 and len(layout[0]+layout[1]+layout[2])==0);\n (len(layout)==3 and len(layout[0]+layout[1]+layout[2])==0);\n
page_wrapper_id python: options.get(\'page_wrapper_id\', \'page_wrapper\');\n
columns python: options.get(\'columns\', 3);\n columns python: options.get(\'columns\', 3);\n
column_css_class python: test(isAnon, \n column_css_class python: test(isAnon, \n
\'portal-column portal-column-undraggable\', \n \'portal-column portal-column-undraggable\', \n
\'portal-column\');"\n \'portal-column\');">\n
tal:attributes="id page_wrapper_id">\n
\n \n
<!-- No gadgets message -->\n <!-- No gadgets message -->\n
<span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/add_new_gadget_message"/> \n <span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/add_new_gadget_message"/> \n
......
...@@ -58,18 +58,12 @@ ...@@ -58,18 +58,12 @@
"""\n """\n
pad = context.restrictedTraverse(pad_relative_url)\n pad = context.restrictedTraverse(pad_relative_url)\n
\n \n
# we set this as a temp hack to force all gadgets rendering as synchronous\n
#context.REQUEST.set(\'force_synchronous_gadget_rendering\', 1)\n
\n
# render Pad\'s html\n # render Pad\'s html\n
body = pad.KnowledgePad_viewDashboardWidget(real_context=context, page_wrapper_id=\'\')\n body = pad.KnowledgePad_viewDashboardWidget(real_context=context)\n
\n \n
# toggle new active pad \n # toggle new active pad \n
context.ERP5Site_toggleActiveKnowledgePad(pad_relative_url, mode, redirect=False)\n context.ERP5Site_toggleActiveKnowledgePad(pad_relative_url, mode, redirect=False)\n
\n \n
# XXX: generate navigation\n
#navigation = pad.KnowledgePad_viewNavigationWidget(real_context=context, page_wrapper_id=\'\')\n
\n
# XXX: generate all JS updater code\n # XXX: generate all JS updater code\n
javascript = \'\'\'updater(\'http://localhost/km/ERP5Site_viewRssGadget\', \'knowledge_pad_module/65/2\', \'visual_2\', \'web_site_module/km_test_web_site\', \'0\', {});\n javascript = \'\'\'updater(\'http://localhost/km/ERP5Site_viewRssGadget\', \'knowledge_pad_module/65/2\', \'visual_2\', \'web_site_module/km_test_web_site\', \'0\', {});\n
updater(\'http://localhost/km/ERP5Site_viewRssGadget\', \'knowledge_pad_module/64/3\', \'visual_3\', \'\', \'0\', {}); \'\'\'\n updater(\'http://localhost/km/ERP5Site_viewRssGadget\', \'knowledge_pad_module/64/3\', \'visual_3\', \'\', \'0\', {}); \'\'\'\n
...@@ -139,7 +133,7 @@ return \'%s\' % result\n ...@@ -139,7 +133,7 @@ return \'%s\' % result\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>KnowledgePag_getPadAsHTML</string> </value> <value> <string>KnowledgePag_getPadAsJSON</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts91301986.39</string> </value> <value> <string>ts91303406.12</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -270,7 +270,7 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n ...@@ -270,7 +270,7 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n
/* Load Pad from server */\n /* Load Pad from server */\n
// XXX: show some animation ?\n // XXX: show some animation ?\n
\n \n
d = MochiKit.Async.loadJSONDoc(\'KnowledgePag_getPadAsHTML\', \n d = MochiKit.Async.loadJSONDoc(\'KnowledgePag_getPadAsJSON\', \n
{\'pad_relative_url\':pad_relative_url,\n {\'pad_relative_url\':pad_relative_url,\n
\'mode\':mode});\n \'mode\':mode});\n
//d.addCallback(handleServerSuccess);\n //d.addCallback(handleServerSuccess);\n
...@@ -303,8 +303,11 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n ...@@ -303,8 +303,11 @@ function loadPadFromServer(pad_relative_url, selected_pad_dom_id, mode){\n
javascript = meta.javascript\n javascript = meta.javascript\n
body_element = getElement(\'pad-body-wrapper\');\n body_element = getElement(\'pad-body-wrapper\');\n
body_element.innerHTML = body;\n body_element.innerHTML = body;\n
// init new Pad\n
initialize();\n
// execute JS code\n // execute JS code\n
eval(javascript);\n eval(javascript);\n
\n
}\n }\n
}\n }\n
\n \n
...@@ -475,7 +478,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n ...@@ -475,7 +478,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>17637</int> </value> <value> <int>17680</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
639 640
\ 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