Commit 1e09e218 authored by Ivan Tyagov's avatar Ivan Tyagov

Make pressing an enter in gadget preferences form submit the right gadget form...

Make pressing an enter in gadget preferences form submit the right gadget form and update preferences accordingly.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39432 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd120559
...@@ -6,6 +6,14 @@ ...@@ -6,6 +6,14 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>extra</string>
</list>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_gadget_preferences_integer_field</string> </value> <value> <string>my_gadget_preferences_integer_field</string> </value>
...@@ -44,6 +52,12 @@ ...@@ -44,6 +52,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>extra</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -63,6 +77,10 @@ ...@@ -63,6 +77,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_integer_field</string> </value> <value> <string>my_integer_field</string> </value>
...@@ -81,4 +99,17 @@ ...@@ -81,4 +99,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/KnowledgeBox_generateSubmitFormJavaScriptCode</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>display_width</string> <string>display_width</string>
<string>extra</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -52,6 +53,16 @@ ...@@ -52,6 +53,16 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -75,6 +86,10 @@ ...@@ -75,6 +86,10 @@
<key> <string>display_width</string> </key> <key> <string>display_width</string> </key>
<value> <int>20</int> </value> <value> <int>20</int> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_password</string> </value> <value> <string>my_password</string> </value>
...@@ -93,4 +108,17 @@ ...@@ -93,4 +108,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/KnowledgeBox_generateSubmitFormJavaScriptCode</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>display_width</string> <string>display_width</string>
<string>extra</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -52,6 +53,16 @@ ...@@ -52,6 +53,16 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -75,6 +86,10 @@ ...@@ -75,6 +86,10 @@
<key> <string>display_width</string> </key> <key> <string>display_width</string> </key>
<value> <int>20</int> </value> <value> <int>20</int> </value>
</item> </item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value> <value> <string>my_string_field</string> </value>
...@@ -93,4 +108,17 @@ ...@@ -93,4 +108,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/KnowledgeBox_generateSubmitFormJavaScriptCode</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</item> </item>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<tal:block \n <tal:block \n
tal:define="mode python: \'erp5_front\';\n tal:define="mode python: \'erp5_front\';\n
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</tal:block>\n </tal:block>\n
]]></string> </value> ]]></unicode> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
...@@ -137,9 +137,13 @@ ...@@ -137,9 +137,13 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_viewHomeAreaRenderer</string> </value> <value> <string>ERP5Site_viewHomeAreaRenderer</string> </value>
</item> </item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <unicode></unicode> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>pad_relative_url = context.getRelativeUrl()\n
return \'\'\'onkeypress="submitGadgetPreferenceFormOnEnter(event, \'%s\',\'%s\');"\'\'\' \\\n
%(\'gadget_preference_%s_field\' %pad_relative_url.replace(\'/\', \'_\'), pad_relative_url)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</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>pad_relative_url</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>KnowledgeBox_generateSubmitFormJavaScriptCode</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -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>ts84965558.43</string> </value> <value> <string>ts87651539.15</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -154,6 +154,14 @@ function createDefaultPadOnServer(timeout, create_url,\n ...@@ -154,6 +154,14 @@ function createDefaultPadOnServer(timeout, create_url,\n
checkForActivitiesOnServer(timeout, return_url);};\n checkForActivitiesOnServer(timeout, return_url);};\n
};\n };\n
\n \n
// This function can be used to submit gadget preferences form whenever\n
// an enter is pressed in form\n
function submitGadgetPreferenceFormOnEnter(event, form_fields_main_prefix, box_relative_url){\n
if(event.keyCode == 13){\n
submitSynchronousGadgetPreferenceForm(form_fields_main_prefix, box_relative_url);\n
}\n
}\n
\n
function submitSynchronousGadgetPreferenceForm(\n function submitSynchronousGadgetPreferenceForm(\n
form_fields_main_prefix, \n form_fields_main_prefix, \n
box_relative_url){\n box_relative_url){\n
...@@ -398,7 +406,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n ...@@ -398,7 +406,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>14766</int> </value> <value> <int>15083</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -37,7 +34,7 @@ ...@@ -37,7 +34,7 @@
</item> </item>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<div id="page_wrapper" \n <div id="page_wrapper" \n
tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n
...@@ -106,7 +103,7 @@ ...@@ -106,7 +103,7 @@
</div>\n </div>\n
]]></string> </value> ]]></unicode> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
...@@ -120,9 +117,13 @@ ...@@ -120,9 +117,13 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_viewDashboardWidget</string> </value> <value> <string>WebSection_viewDashboardWidget</string> </value>
</item> </item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Render draggable and droppable column structure</string> </value> <value> <unicode>Render draggable and droppable column structure</unicode> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
574 575
\ 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