Page MenuHomeIn-Portal Phabricator

advanced
No OneTemporary

File Metadata

Created
Wed, Feb 12, 1:48 PM

advanced

Index: branches/1.1.x/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl
===================================================================
--- branches/1.1.x/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 14058)
+++ branches/1.1.x/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 14059)
@@ -1,48 +1,52 @@
<inp2:m_DefineElement name="content">
- <inp2:poll-comment_PresetFormFields/>
<br/>
- <form method="post" id="poll_comment_form" action="<inp2:m_Link height='480' width='480' pass='m,poll,poll-comment' poll-comment_event='OnCreate' __NO_REWRITE__='1'/>">
- <table class="form-data fullwidth">
- <inp2:m_ifnot check="m_LoggedIn">
- <inp2:m_RenderElement name="inp_edit_box" prefix="poll-comment" field="GuestName" title="lu_fld_Name" style="width:200px"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="poll-comment" field="GuestEmail" title="lu_fld_Email" style="width:200px"/>
- </inp2:m_ifnot>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="poll-comment" field="CommentBody" rows="8" cols="40" title="lu_fld_Comment" is_last="1"/>
- <inp2:m_RenderElement design="inp_edit_buttons">
- <input type="hidden" name="success_template" value="in-bulletin/elements/content_boxes/poll_comments.elm" />
- <input class="button" id="add_comment_btn" type="button" name="events[poll-comment][OnCreate]" value="<inp2:m_Phrase label="lu_btn_Create" no_editing="1"/>" />
- <input class="button" type="reset" name="reset" value="<inp2:m_Phrase label="lu_btn_Reset" no_editing="1"/>" />
- </inp2:m_RenderElement>
- </table>
+
+ <inp2:poll-comment_PresetFormFields/>
+ <form method="post" id="poll_comment_form" action="<inp2:m_Link width='480' height='480' pass='m,poll'/>">
+ <table class="form-data fullwidth">
+ <inp2:m_ifnot check="m_LoggedIn">
+ <inp2:m_RenderElement name="inp_edit_box" prefix="poll-comment" field="GuestName" title="lu_fld_Name" style="width:200px"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="poll-comment" field="GuestEmail" title="lu_fld_Email" style="width:200px"/>
+ </inp2:m_ifnot>
+
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="poll-comment" field="CommentBody" rows="8" cols="40" title="lu_fld_Comment" is_last="1"/>
+
+ <inp2:m_RenderElement design="inp_edit_buttons">
+ <input type="hidden" name="events[poll-comment]" value="OnCreate"/>
+ <input type="hidden" name="success_template" value="in-bulletin/elements/content_boxes/poll_comments.elm" />
+ <input class="button" id="add_comment_btn" type="button" value="<inp2:m_Phrase label='lu_btn_Create' no_editing='1'/>" />
+ <input class="button" type="reset" name="reset" value="<inp2:m_Phrase label='lu_btn_Reset' no_editing='1'/>" />
+ </inp2:m_RenderElement>
+ </table>
</form>
<script language="javascript" type="text/javascript">
- $(document).ready(
- function() {
- $('#add_comment_btn').click(
- function ($e) {
- TB.show(
- {
- url: $('#poll_comment_form').attr('action'),
- postParams: $('#poll_comment_form').serializeArray(),
- showCallback: function() {
- var $match_redirect = new RegExp('^#redirect#(.*)').exec($('#TB_ajaxContent').html());
- if ($match_redirect != null) {
- // redirect to external template requested
- TB.show( {url: $match_redirect[1]+'&height=480&width=480'} );
- return true;
- }
- }
- }
- );
- }
- )
- }
- );
+ $(document).ready(
+ function() {
+ $('#add_comment_btn').click(
+ function ($e) {
+ TB.show(
+ {
+ url: $('#poll_comment_form').attr('action'),
+ postParams: $('#poll_comment_form').serialize(),
+ onDataReceived: function($data, params) {
+ var $match_redirect = new RegExp('^#redirect#(.*?)($|\\s.*)').exec($data);
+ if ($match_redirect != null) {
+ TB.show( {url: $match_redirect[1] + '&height=480&width=480'} );
+ return false;
+ }
+ return $data;
+ }
+ }
+ );
+ }
+ )
+ }
+ );
</script>
</inp2:m_DefineElement>
<inp2:m_include template="platform/designs/default_design_ajax.des" pass_params="1"/>
\ No newline at end of file

Event Timeline