Sha256: b8f2258fabb1956bd9786cfa4c375a145b38df572b14baf2858417dd165b807d

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

function register()
{
  resize_colorbox("<p class='loading'>Registering...</p>");

	$.ajax({
		url: '/register',
		type: 'post',
		data: $('#register_form').serialize(),
		success: function(resp) {
		  if (resp.error)
		    resize_colorbox("<p class='note error'>" + resp.error + "</p>");
			else if (resp.redirect != false)
			  window.location = resp.redirect;
			else
			  parent.location.reload(true);
		},
		error: function() {	
			$('#message').html("<p class='note error'>Error</p>"); 
		}
	});
}

function resize_colorbox(html)
{
  $('#message').html(html);
  height = $('#modal_content').outerHeight(true);
  parent.$.fn.colorbox.resize({ innerHeight: '' + height + 'px' })
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
caboose-cms-0.2.4 app/assets/javascripts/caboose/register.js
caboose-cms-0.2.2 app/assets/javascripts/caboose/register.js
caboose-cms-0.2.1 app/assets/javascripts/caboose/register.js
caboose-cms-0.1.102 app/assets/javascripts/caboose/register.js