1/* 2* 2018 Areama 3* 4* NOTICE OF LICENSE 5* 6* This source file is subject to the Academic Free License (AFL 3.0) 7* that is bundled with this package in the file LICENSE.txt. 8* It is also available through the world-wide-web at this URL: 9* http://opensource.org/licenses/afl-3.0.php 10* If you did not receive a copy of the license and are unable to 11* obtain it through the world-wide-web, please send an email 12* to [email protected] so we can send you a copy immediately. 13* 14* 15* @author Areama <[email protected]> 16* @copyright 2018 Areama 17 18* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 19* International Registered Trademark & Property of Areama 20*/ 21 22if (typeof $ === 'function'){ 23 $(function(){ 24 arSeoProParseHash(); 25 }); 26}else{ 27 window.addEventListener('load', function(){ 28 arSeoProParseHash(); 29 }); 30} 31 32function arSeoProParseHash(){ 33 var hash = window.location.hash; 34 hash = hash.replace('#/', ''); 35 hash = hash.replace('#', ''); 36 if (hash.length == 0) { 37 return false; 38 } 39 var data = hash.split('/'); 40 if (data) { 41 $.each(data, function(i){ 42 var value = data[i].match(/^(\d+)-/); 43 if (value){ 44 arSeoProSelectAttribute(value[1]); 45 } 46 }); 47 } 48 49 prestashop.emit('updateProduct', { 50 eventType: 'updatedProductCombination', 51 event: this, 52 // Following variables are not used anymore, but kept for backward compatibility 53 resp: {}, 54 reason: { 55 productUrl: prestashop.urls.pages.product || '', 56 }, 57 }); 58} 59 60function arSeoProSelectAttribute(value){ 61 var $el = $('[data-product-attribute][value="' + value + '"]'); 62 if ($el.length){ 63 if ($el.is('[type="checkbox"]') || $el.is('[type="radio"]')){ 64 $el.prop("checked", "checked"); 65 } 66 }else{ 67 $el = $('[data-product-attribute] [value="' + value + '"]').parent(); 68 if ($el.length && $el.is('select')) { 69 $el.val(value); 70 } 71 } 72}
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.