PageSourceSearch

https://esnmurcia.org/sites/all/modules/admin/themekey/themekey_redirect/themekey_redirect.js?teoar9

js esnmurcia.org collected 2026-10-07 15:15:03 UTC 1,679 bytes, 40 lines download raw bytes

1jQuery(document).ready(function($) {
2    var state = $.cookie('themekey_redirect_state');
3    if (state === null) {
4        // Cookie not set => state 0.
5        state = 0;
6    }
7    if (state == 0) {
8        // Check if the user has to be redirected.
9        $.ajax({
10            // add the current path and query to the url for ThemeKey's rule matching
11            url: Drupal.settings.basePath.replace(/\/$/, "") + '/index.php?q=themekey/redirect_callback' + window.location.pathname + window.location.search.replace(/^\?/, "&"),
12            dataType: 'json',
13            type: 'GET',
14            success: function(target) {
15                if (target) {
16                    if (Drupal.settings.ThemeKeyRedirect.redirectOnce) {
17                        // Set Domain A state to 2.
18                        $.cookie('themekey_redirect_state', 2, { path: '/'});
19                    }
20                    window.location.href = target;
21                    // If the targeted page runs ThemeKey Redirect it sets the
22                    // state to 1 or 2.
23                }
24            }
25        });
26        if (Drupal.settings.ThemeKeyRedirect.checkOnce) {
27            // Set Domain A state to 2.
28            $.cookie('themekey_redirect_state', 2, { path: '/'});
29        }
30    }
31    else if (state == 1) {
32        // The user has been redirected but is optionally allowed once to switch
33        // back manually.
34        $('#block-themekey-redirect-domain-selector').show();
35        // Set Domain B state to 2.
36        $.cookie('themekey_redirect_state', 2, { path: '/'});
37    }
38    // State 2 indicates that the user has been redirected and no further redirects will happen.
39});
40;

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.