public/js/lib/jquery.pjax.js
File jquery.pjax.js
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// jquery.pjax.js
// copyright chris wanstrath
// https://github.com/defunkt/jquery-pjax
(function($){
Function pjax
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function pjax(options) {
options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
if ($.isFunction(options.url)) {
options.url = options.url()
Function onPjaxPopstate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onPjaxPopstate(event) {
var state = event.state
if (state && state.container) {
var container = $(state.container)
Function success
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
options.success = function(data, status, xhr) {
var container = extractContainer(data, xhr, options)
if (!container.contents) {
locationReplace(container.url)
Function extractContainer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function extractContainer(data, xhr, options) {
var obj = {}
// Prefer X-PJAX-URL header if it was set, otherwise fallback to
// using the original requested url.
Function fallbackPjax
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fallbackPjax(options) {
var url = $.isFunction(options.url) ? options.url() : options.url,
method = options.type ? options.type.toUpperCase() : 'GET'
var form = $('<form>', {