Changes for page Get in Touch About Your XWiki Project
Last modified by Alex Cotiugă on 2026/05/04 06:15
From version 13.150
edited by Alex Cotiugă
on 2026/05/02 08:51
on 2026/05/02 08:51
Change comment:
There is no comment for this version
To version 13.100
edited by Alex Cotiugă
on 2026/05/02 08:20
on 2026/05/02 08:20
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,20 +18,3 @@ 1 -{{velocity wiki="false"}} 2 -#if ($xcontext.action == 'get') 3 - #set ($message = '') 4 - #set ($statusCode = 200) 5 - 6 - #foreach ($parameterName in $request.parameterNames) 7 - #set ($message = "$message $parameterName") 8 - #end 9 - 10 - ##set ($statusCode = 400) 11 - ##set ($message = 'error') 12 - 13 - #set ($discard = $response.setStatus($statusCode)) 14 - #jsonResponse({'message': "$request.parameterNames"}) 15 -#end 16 -{{/velocity}} 17 - 18 18 {{velocity}} 19 19 #set ($discard = $xwiki.ssx.use('contact.WebHome')) 20 20 #set ($xobject = $doc.getObject('Agnease.Code.ContactForm.ContactFormClass')) ... ... @@ -58,22 +58,6 @@ 58 58 ##<p>Your information will only be used to respond to this request. See the Privacy Policy for details.</p> 59 59 <input id="contactSubmit" type="submit" class="btn btn-primary" value="Send my request"> 60 60 </form> 61 - {{/html}} 62 - {{html clean="false" wiki="true"}} 63 - <div class="reviewNotifications"> 64 - <div class="hidden reviewNotificationSuccess"> 65 - 66 - {{success}}reviewNotification{{/success}} 67 - 68 - </div> 69 - <div class="hidden reviewNotificationError"> 70 - 71 - {{error}}reviewNotification{{/error}} 72 - 73 - </div> 74 - </div> 75 - {{/html}} 76 - {{html clean="false"}} 77 77 </div> 78 78 <div class="col-xs-5"> 79 79 <div class="widget"> ... ... @@ -95,6 +95,20 @@ 95 95 <li>If useful, we schedule a short call to discuss scope, timeline, and estimated effort.</li> 96 96 </ol> 97 97 </div> 65 + {{/html}} 66 + {{html clean="false" wiki="true"}} 67 + <div class="reviewNotifications"> 68 + <div class="hidden reviewNotificationSuccess"> 69 + 70 + {{success}}reviewNotification{{/success}} 71 + 72 + </div> 73 + <div class="hidden reviewNotificationError"> 74 + 75 + {{error}}reviewNotification{{/error}} 76 + 77 + </div> 78 + </div> 98 98 </div> 99 99 </div> 100 100 {{/html}}
- XWiki.JavaScriptExtension[0]
-
- code
-
... ... @@ -1,5 +1,5 @@ 1 1 require(['jquery'], function ($) { 2 - var serviceURL = new XWiki.Document('WebHome', 'cont act').getURL('get');2 + var serviceURL = new XWiki.Document('WebHome', 'content').getURL('get', 'xpage=plain'); 3 3 var form = $('#contactForm'); 4 4 var submitButton = $('#contactSubmit'); 5 5 ... ... @@ -6,13 +6,29 @@ 6 6 var successBox = $('.reviewNotificationSuccess'); 7 7 var errorBox = $('.reviewNotificationError'); 8 8 9 + var nameFieldName = 'Agnease.Code.ContactForm.ContactFormClass_0_name'; 10 + var emailFieldName = 'Agnease.Code.ContactForm.ContactFormClass_0_email'; 11 + 12 + function getFormData() { 13 + var data = {}; 14 + 15 + $.each(form.serializeArray(), function (_, field) { 16 + data[field.name] = field.value; 17 + }); 18 + console.log(data) 19 + 20 + return data; 21 + } 22 + 9 9 form.on('submit', function (event) { 10 10 event.preventDefault(); 11 11 12 - var data = $.param(form.serializeArray()); 26 + //var data = getFormData(); 27 + 28 + console.log(orm.serializeArray()) 13 13 14 14 submitButton.prop('disabled', true); 15 - 31 +/* 16 16 $.post({ 17 17 url: serviceURL, 18 18 data: data ... ... @@ -28,13 +28,12 @@ 28 28 form[0].reset(); 29 29 }).fail(function (xhr) { 30 30 var errorBoxContent = errorBox.find('.box div p'); 31 - errorBoxContent.text(xhr.s tatusText);47 + errorBoxContent.text(xhr.responseJSON.message); 32 32 errorBox.toggleClass('hidden'); 33 33 if (successBox.is(':visible')) { 34 34 successBox.toggleClass('hidden'); 35 35 } 36 - }).always(function () { 37 37 submitButton.prop('disabled', false); 38 - }); 53 + });*/ 39 39 }); 40 40 });