Sha256: fcdc47eec8684cde9388ae5bb216f97ce8e9b29c47bb7202956156b186c9c460

Contents?: true

Size: 717 Bytes

Versions: 16

Compression:

Stored size: 717 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

16 entries across 16 versions & 2 rubygems

Version Path
gitdocs-0.5.0.pre6 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0.pre5 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0.pre3 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0.pre2 lib/gitdocs/public/js/settings.js
gitdocs-0.5.0.pre1 lib/gitdocs/public/js/settings.js
gitdocs-0.4.15 lib/gitdocs/public/js/settings.js
siuying-gitdocs-0.4.16 lib/gitdocs/public/js/settings.js
siuying-gitdocs-0.4.15 lib/gitdocs/public/js/settings.js
siuying-gitdocs-0.4.14 lib/gitdocs/public/js/settings.js
siuying-gitdocs-0.4.14.md lib/gitdocs/public/js/settings.js
gitdocs-0.4.14 lib/gitdocs/public/js/settings.js
gitdocs-0.4.13 lib/gitdocs/public/js/settings.js
gitdocs-0.4.12 lib/gitdocs/public/js/settings.js
gitdocs-0.4.11 lib/gitdocs/public/js/settings.js
gitdocs-0.4.10 lib/gitdocs/public/js/settings.js
gitdocs-0.4.9 lib/gitdocs/public/js/settings.js