1/** 2 * @file 3 * Drupal AJAX adapter for HTML 5 History API methods. 4 */ 5 6(function (window, Drupal) { 7 'use strict'; 8 9 /** 10 * Command to go back one frame in the history stack. 11 * 12 * @param {Drupal.Ajax} ajax 13 * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. 14 * @param {object} response 15 * The response from the Ajax request. 16 */ 17 Drupal.AjaxCommands.prototype.history_back = function(ajax, response) { 18 Drupal.html5history.back(); 19 } 20 21 /** 22 * Command to go forward one frame in the history stack. 23 * 24 * @param {Drupal.Ajax} ajax 25 * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. 26 * @param {object} response 27 * The response from the Ajax request. 28 */ 29 Drupal.AjaxCommands.prototype.history_forward = function(ajax, response) { 30 Drupal.html5history.forward(); 31 } 32 /** 33 * Command to go n frames forward or backward in the history stack. 34 * 35 * @param {Drupal.Ajax} ajax 36 * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. 37 * @param {object} response 38 * The response from the Ajax request. 39 */ 40 Drupal.AjaxCommands.prototype.history_go = function(ajax, response) { 41 Drupal.html5history.go(response.cursor); 42 } 43 44 /** 45 * Command to push a frame onto the browser history stack. 46 * 47 * @param {Drupal.Ajax} ajax 48 * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. 49 * @param {object} response 50 * The response from the Ajax request. 51 */ 52 Drupal.AjaxCommands.prototype.history_push_state = function(ajax, response) { 53 if (response.url != (window.location.pathname + window.location.search)) { 54 Drupal.html5history.pushState(response.state, response.title, response.url); 55 } 56 } 57 58 /** 59 * Command to replace the current frame on the browser history stack. 60 * 61 * @param {Drupal.Ajax} ajax 62 * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. 63 * @param {object} response 64 * The response from the Ajax request. 65 */ 66 Drupal.AjaxCommands.prototype.history_replace_state = function(ajax, response) { 67 if (response.url != (window.location.pathname + window.location.search)) { 68 Drupal.html5history.replaceState(response.state, response.title, response.url); 69 } 70 } 71 72})(window, Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.