Commit 87b96e02 authored by Ivan Tyagov's avatar Ivan Tyagov

Submit (when user press ENTER) add new pad popup dialog form.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40869 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48f93215
......@@ -107,31 +107,19 @@
class="toggable_dialog">\n
<h3 i18n:translate="" i18n:domain="ui"> Add new tab </h3>\n
<span i18n:translate="" i18n:domain="ui">Tab name</span>: \n
<input type="text" value="" name="pad_title" id="new_pad_title"/><br/><br/>\n
<input type="text" \n
value="" \n
name="pad_title" \n
id="new_pad_title"\n
tal:attributes="onkeypress string:addPadOnServerOnEnter(event, \'ERP5Site_addNewKnowledgePad\', \'${mode}\', \'view\')"/>\n
<br/>\n
<br/>\n
<button type="button"\n
onclick="toggleElementById(\'add_new_tab_dialog\');"\n
i18n:translate="" \n
i18n:domain="ui">Cancel</button>\n
<button type="button"\n
tal:condition="python: mode==\'erp5_front\'"\n
tal:attributes="onclick python: \n
\'\'\'addPadOnServer(\'ERP5Site_addNewKnowledgePad\', \n
\'/%s\', \'%s\',\n
\'view\')\'\'\'\n
%(context.getPortalObject().getId(),\n
mode)" \n
i18n:translate="" \n
i18n:domain="ui"\n
id="add_new_tab_dialog_add_button">Add</button>\n
<button type="button"\n
tal:condition="python: mode==\'web_front\'"\n
tal:attributes="onclick python: \n
\'\'\'addPadOnServer(\'ERP5Site_addNewKnowledgePad\', \n
\'/%s/%s\', \'%s\', \n
\'view\')\'\'\'\n
%(context.getPortalObject().getId(), \n
context.getRelativeUrl(),\n
mode)" \n
tal:attributes="onclick string:addPadOnServer(\'ERP5Site_addNewKnowledgePad\', \'${mode}\', \'view\')" \n
i18n:translate="" \n
i18n:domain="ui"\n
id="add_new_tab_dialog_add_button">Add</button>\n
......@@ -245,7 +233,7 @@
</tal:block>\n
<li class="tab"\n
tal:condition="not: isKnowledgePadTemplateUsed"\n
onclick="toggleElementById(\'add_new_tab_dialog\');"\n
onclick="showAddNewPadPopup(\'add_new_tab_dialog\', \'new_pad_title\');"\n
i18n:translate="title" i18n:domain="ui"\n
title="Add new tab"\n
id="add_new_tab_dialog_link">Add tab</li>\n
......
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts90516068.0</string> </value>
<value> <string>ts91031570.14</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -254,8 +254,19 @@ function addBoxToServer(url, dom_id, gadget_relative_url){\n
button.disabled = true;}\n
}\n
\n
function showAddNewPadPopup(popup_id, input_id){\n
toggleElementById(\'add_new_tab_dialog\'); \n
// MochiKit.DOM.getElement(\'new_pad_title\').focus();\n
}\n
\n
function addPadOnServerOnEnter(event, create_url, mode, cancel_url){\n
/* Catch and submit form when ENTER is pressed */\n
if(event.keyCode == 13){\n
addPadOnServer(create_url, mode, cancel_url);\n
}\n
}\n
\n
function addPadOnServer(create_url,\n
base_path,\n
mode,\n
cancel_url){\n
/* add pad on server and set cookie as its relative url this way we \n
......@@ -406,7 +417,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>15081</int> </value>
<value> <int>15402</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
621
\ No newline at end of file
623
\ 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