This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UmbracoBootstrap.Infrastructure.Extensions | |
{ | |
#region Using | |
using System.Diagnostics.CodeAnalysis; | |
#endregion | |
/// <summary> | |
/// Encapsulates a series of time saving extension methods to <see cref="T:System.String">String</see>s. | |
/// </summary> | |
public static class StringExtensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup CSRF safety for AJAX: | |
$.ajaxPrefilter(function(options, originalOptions, jqXHR) { | |
if (options.type.toUpperCase() === "POST") { | |
// We need to add the verificationToken to all POSTs | |
var token = $("input[name^=__RequestVerificationToken]").first(); | |
if (!token.length) return; | |
var tokenName = token.attr("name"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
NewerOlder