1/** 2 * OpenMage 3 * 4 * This source file is subject to the Academic Free License (AFL 3.0) 5 * that is bundled with this package in the file LICENSE_AFL.txt. 6 * It is also available at https://opensource.org/license/afl-3-0-php 7 * 8 * @category Mage 9 * @package js 10 * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) 11 * @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org) 12 * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 13 */ 14// old school cookie functions grabbed off the web 15 16if (!window.Mage) var Mage = {}; 17 18Mage.Cookies = {}; 19Mage.Cookies.expires = null; 20Mage.Cookies.path = '/'; 21Mage.Cookies.domain = null; 22Mage.Cookies.secure = false; 23Mage.Cookies.set = function(name, value){ 24 var argv = arguments; 25 var argc = arguments.length; 26 var expires = (argc > 2) ? argv[2] : Mage.Cookies.expires; 27 var path = (argc > 3) ? argv[3] : Mage.Cookies.path; 28 var domain = (argc > 4) ? argv[4] : Mage.Cookies.domain; 29 var secure = (argc > 5) ? argv[5] : Mage.Cookies.secure; 30 document.cookie = name + "=" + escape (value) + 31 ((expires == null) ? "" : ("; expires=" + expires.toUTCString())) + 32 ((path == null) ? "" : ("; path=" + path)) + 33 ((domain == null) ? "" : ("; domain=" + domain)) + 34 ((secure == true) ? "; secure" : ""); 35}; 36 37Mage.Cookies.get = function(name){ 38 var arg = name + "="; 39 var alen = arg.length; 40 var clen = document.cookie.length; 41 var i = 0; 42 var j = 0; 43 while(i < clen){ 44 j = i + alen; 45 if (document.cookie.substring(i, j) == arg) 46 return Mage.Cookies.getCookieVal(j); 47 i = document.cookie.indexOf(" ", i) + 1; 48 if(i == 0) 49 break; 50 } 51 return null; 52}; 53 54Mage.Cookies.clear = function(name) { 55 if(Mage.Cookies.get(name)){ 56 Mage.Cookies.set(name, '', new Date(0)); 57 } 58}; 59 60Mage.Cookies.getCookieVal = function(offset){ 61 var endstr = document.cookie.indexOf(";", offset); 62 if(endstr == -1){ 63 endstr = document.cookie.length; 64 } 65 return unescape(document.cookie.substring(offset, endstr)); 66};
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.