• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/woocommerce-multilingual/res/js/jquery.cookie.js
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
     
    1
    /*!
    2
     * jQuery Cookie Plugin v1.3.1
    3
     * https://github.com/carhartl/jquery-cookie
    4
     *
    5
     * Copyright 2013 Klaus Hartl
    6
     * Released under the MIT license
    7
     */
    8
    (function (factory) {
    9
        if (typeof define === 'function' && define.amd) {
    10
            // AMD. Register as anonymous module.
    11
            define(['jquery'], factory);
    12
        } else {
    13
            // Browser globals.
    14
            factory(jQuery);
    15
        }
    16
    }(function ($) {
    17
    ​
    18
        var pluses = /\+/g;
    19
    ​
    20
        function raw(s) {
    21
            return s;
    22
        }
    23
    ​
    24
        function decoded(s) {
    25
            return decodeURIComponent(s.replace(pluses, ' '));
    26
        }
    27
    ​
    28
        function converted(s) {
    29
            if (s.indexOf('"') === 0) {
    30
                // This is a quoted cookie as according to RFC2068, unescape
    31
                s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
    32
            }
    33
            try {
    34
                return config.json ? JSON.parse(s) : s;
    35
            } catch(er) {}
    36
        }
    37
    ​
    38
        var config = $.cookie = function (key, value, options) {
    39
    ​
    40
            // write
    41
            if (value !== undefined) {
    42
                options = $.extend({}, config.defaults, options);
    43
    ​
    44
                if (typeof options.expires === 'number') {
    45
                    var days = options.expires, t = options.expires = new Date();
    46
                    t.setDate(t.getDate() + days);
    47
                }
    48
    ​
    49
                value = config.json ? JSON.stringify(value) : String(value);
    50
    ​
    51
                return (document.cookie = [
    52
                    config.raw ? key : encodeURIComponent(key),
    53
                    '=',
    54
                    config.raw ? value : encodeURIComponent(value),
    55
                    options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
    56
                    options.path    ? '; path=' + options.path : '',
    57
                    options.domain  ? '; domain=' + options.domain : '',
    58
                    options.secure  ? '; secure' : ''
    59
                ].join(''));
    60
            }
    61
    ​
    62
            // read
    63
            var decode = config.raw ? raw : decoded;
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.