Sha256: b9b8327ffbb5aeb8b6701237c3fc8495621866c0cea298aded2dfa619d2ecd7c

Contents?: true

Size: 824 Bytes

Versions: 4

Compression:

Stored size: 824 Bytes

Contents

$('.remote_site a').live('click', function(event) {
  var link = $(this);
  link.addClass('cloning');
  
  jQuery.ajax('/sites.json', {data: {remote: link.attr('data-remote'), remote_id: link.attr('data-remote-id'), name: link.attr('data-site-name')}, type: 'POST', success: function(data) {
    if(data.success)
      if(data.url)
        window.location = data.url;
      else
        alert("The site was created successfully, but no default url was returned. Please try refreshing this page, and visiting the site manually.");
    else
      alert("Sorry, an error occurred while cloninng this site: " + data.reason);
	}, error: function(jqXHR, textStatus, errorThrown) {
	  alert("Sorry, an error occurred while cloning this site.");
	}, complete: function(jqXHR, textStatus) {
	  link.removeClass('cloning');
	}});
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yodel_development_environment-0.0.7 lib/public/js/main.js
yodel_development_environment-0.0.4 lib/public/js/main.js
yodel_development_environment-0.0.2 lib/public/js/main.js
yodel_development_environment-0.0.1 lib/public/js/main.js