Sha256: 40e99d08fbf77c92141047f8c826d1588ea785f931d1f25e1cbcc5a3ca479d06

Contents?: true

Size: 758 Bytes

Versions: 5

Compression:

Stored size: 758 Bytes

Contents

GitDocs.settings = {
  // To make the settings form ajax-y
  observeSettingsForm : function() {
    $('#settings').submit(function(e) {
      e.preventDefault();
      $.ajax({
        type: 'POST', url: this.action, data: $(this).serialize(),
        success: function() {
          GitDocs.showAlert(
            '<p><strong>Settings saved!</strong> Gitdocs has been restarted with your new settings.</p>',
            'success'
          );
        }
      });
      return false;
    });
  }
};

$(document).ready(function() {
  GitDocs.settings.observeSettingsForm();
});

// Handle delete for settings form
$('input.remove_share').live('click', function(e){
  $(this).siblings("input[type=hidden]").val("true");
  $(this).parents("form").submit();
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gitdocs-0.6.2 lib/gitdocs/public/js/settings.js
gitdocs-0.6.1 lib/gitdocs/public/js/settings.js
gitdocs-0.6.0 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0.pre7 lib/gitdocs/public/js/settings.js