UNPKG

automizy-js-api

Version:

JavaScript API library for Automizy Marketing Automation software

89 lines (86 loc) 3.97 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Slide Window Example</title> <link rel="stylesheet" href="css/jquery-ui.min.css" /> <link rel="stylesheet" href="../src/automizy.css" /> <script src="js/jquery.min.js"></script> <script src="js/jquery-ui.min.js"></script> <script src="js/require.js"></script> <script> var temp; $(function () { requirejs.config({ paths: { automizyJsDir: '../src', automizyJs: '../src/automizy' } }); require([ "automizyJs" ], function ($A) { function translate(a) { return a; } var form = $A.newForm({ inputs: [ { label: 'Subject', type: 'text', name: 'slide-window-subject', breakInput: true }, { label: 'Description', type: 'textarea', name: 'slide-window-description', breakInput: true } ] }); temp = $A.newSlideWindow({ tab: { text: 'FEEDBACK' }, title: 'If you have any issues please let us know here.', target: $('body'), position: "right", positionY: 'middle', content: form, buttons: [ { text: 'Send', click: function () { $.ajax({ method: 'POST', url: 'google.com', data: form.widget().serializeArray(), dataType: 'json', complete: function (data) { form.widget().fadeOut("slow").css({'background-color': '#ffffff'}); var $thanks = $('<div>Thank you!</div>').css({position: 'absolute', top: '30px'}); $thanks.appendTo(temp.d.$content).fadeIn("slow", function () { setTimeout(function () { temp.close(); setTimeout(function () { form.widget().trigger("reset").show(); }, 500); $thanks.stop().fadeOut(500, function () { $thanks.remove(); form.widget().show(); }); }, 3000); }); } }); } } ] }); }); }); </script> </head> <body></body> </html>