Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(function()
{
jQuery.noConflict();
var changing = false;
var nodes = {};
/* depending on where we are (fb or gmail) define a "replacement node" that we can just use later */
if (/facebook/.test(window.location.href))
{
nodes['div.conversation'] = '.fbChatConvItem .messages span'; // chat messages in the inbox
nodes['li.webMessengerMessageGroup'] = 'span'; // the docked chat window messages
var imgNode = (function(key, img)
{
return "<span style="\"display:none\"">" + key + "</span><img alt="\":)\"" style="\"background-position:" src="\""">";
});
}
else
{
console.debug('not facebook');
}
/****
* now do the actual replacement of said node (defined above)
****/
}
if ( cart_hash && ( cart_created === null || cart_created === undefined || cart_created === '' ) ) {
throw 'No cart_created';
}
if ( cart_created ) {
var cart_expiration = ( ( 1 * cart_created ) + day_in_ms ),
timestamp_now = ( new Date() ).getTime();
if ( cart_expiration < timestamp_now ) {
throw 'Fragment expired';
}
cart_timeout = setTimeout( refresh_cart_fragment, ( cart_expiration - timestamp_now ) );
}
if ( wc_fragments && wc_fragments['div.widget_shopping_cart_content'] && cart_hash === cookie_hash ) {
$.each( wc_fragments, function( key, value ) {
$( key ).replaceWith(value);
});
$( document.body ).trigger( 'wc_fragments_loaded' );
} else {
throw 'No fragment';
}
// Refresh when the display language changes
var prev_pll_lang = sessionStorage.getItem('pll_language'),
pll_lang = get_pll_language();
if (prev_pll_lang === null || prev_pll_lang === undefined || prev_pll_lang === '') {
prev_pll_lang = '';
str = '/logo';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
str = '/logo/';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
assert.ok(utils.GUID(40).length === 40, 'utils.GUID(40)');
assert.ok(utils.encode('<b>total.js</b>" ') === '<b>total.js</b>"&nbsp;', 'utils.encode()');
assert.ok(utils.decode('<b>total.js</b>&nbsp;') === '<b>total.js</b> ', 'utils.decode()');
var result = utils.parseXML('<div><b>Peter&Janko</b><i style="color:red">Ita'lic</i></div>');
assert.ok(result['div.b'] === 'Peter&Janko', 'XML Parser 1');
assert.ok(result['div.i'] === 'Ita\'lic', 'XML Parser 2');
assert.ok(result['div.i[]'].style === 'color:red', 'XML Parser Attributes');
result = utils.parseXML('OK');
obj = { a: ' 1 ', b: { a: ' 2 '}, c: [' 1 ', '2', [' 3', ' 5 ']]};
utils.trim(obj);
assert.ok(JSON.stringify(obj) === '{"a":"1","b":{"a":"2"},"c":["1","2",["3","5"]]}', 'utils.trim()');
var async = new utils.Async();
var value = [];
async.on('error', function(err, name) {
console.log('ERROR', err, name);
});
async.await('0', function(next) {
str = '/logo';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
str = '/logo/';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
assert.ok(utils.GUID(40).length === 40, 'utils.GUID(40)');
assert.ok(utils.encode('<b>total.js</b>" ') === '<b>total.js</b>"&nbsp;', 'utils.encode()');
assert.ok(utils.decode('<b>total.js</b>&nbsp;') === '<b>total.js</b> ', 'utils.decode()');
var result = utils.parseXML('<div><b>Peter&Janko</b><i style="color:red">Ita'lic</i></div>');
assert.ok(result['div.b'] === 'Peter&Janko', 'XML Parser 1');
assert.ok(result['div.i'] === 'Ita\'lic', 'XML Parser 2');
assert.ok(result['div.i[]'].style === 'color:red', 'XML Parser Attributes');
result = utils.parseXML('OK');
obj = { a: ' 1 ', b: { a: ' 2 '}, c: [' 1 ', '2', [' 3', ' 5 ']]};
utils.trim(obj);
assert.ok(JSON.stringify(obj) === '{"a":"1","b":{"a":"2"},"c":["1","2",["3","5"]]}', 'utils.trim()');
var async = new utils.Async();
var value = [];
async.on('error', function(err, name) {
console.log('ERROR', err, name);
});
async.await('0', function(next) {
assert.ok(utils.getContentType(str) === 'application/octet-stream', 'utils.getContentType(): ' + str);
str = '/logo';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
str = '/logo/';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
assert.ok(utils.GUID(40).length === 40, 'utils.GUID(40)');
assert.ok(utils.encode('<b>total.js</b>" ') === '<b>total.js</b>"&nbsp;', 'utils.encode()');
assert.ok(utils.decode('<b>total.js</b>&nbsp;') === '<b>total.js</b> ', 'utils.decode()');
var result = utils.parseXML('<div><b>Peter&Janko</b><i style="color:red">Ita'lic</i></div>');
assert.ok(result['div.b'] === 'Peter&Janko', 'XML Parser 1');
assert.ok(result['div.i'] === 'Ita\'lic', 'XML Parser 2');
assert.ok(result['div.i[]'].style === 'color:red', 'XML Parser Attributes');
result = utils.parseXML('OK');
obj = { a: ' 1 ', b: { a: ' 2 '}, c: [' 1 ', '2', [' 3', ' 5 ']]};
utils.trim(obj);
assert.ok(JSON.stringify(obj) === '{"a":"1","b":{"a":"2"},"c":["1","2",["3","5"]]}', 'utils.trim()');
var async = new utils.Async();
var value = [];
async.on('error', function(err, name) {
console.log('ERROR', err, name);
});
assert.ok(utils.etag(str) === '974', 'utils.etag(): ' + str);
str = '/logo';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
str = '/logo/';
assert.ok(utils.path(str) === '/logo/', 'utils.path(): ' + str);
assert.ok(utils.GUID(40).length === 40, 'utils.GUID(40)');
assert.ok(utils.encode('<b>total.js</b>" ') === '<b>total.js</b>"&nbsp;', 'utils.encode()');
assert.ok(utils.decode('<b>total.js</b>&nbsp;') === '<b>total.js</b> ', 'utils.decode()');
var result = utils.parseXML('<div><b>Peter&Janko</b><i style="color:red">Ita'lic</i></div>');
assert.ok(result['div.b'] === 'Peter&Janko', 'XML Parser 1');
assert.ok(result['div.i'] === 'Ita\'lic', 'XML Parser 2');
assert.ok(result['div.i[]'].style === 'color:red', 'XML Parser Attributes');
result = utils.parseXML('OK');
obj = { a: ' 1 ', b: { a: ' 2 '}, c: [' 1 ', '2', [' 3', ' 5 ']]};
utils.trim(obj);
assert.ok(JSON.stringify(obj) === '{"a":"1","b":{"a":"2"},"c":["1","2",["3","5"]]}', 'utils.trim()');
var async = new utils.Async();
var value = [];
async.on('error', function(err, name) {
console.log('ERROR', err, name);
});
import sum from 'sum'
import div from 'div'
import mul from 'mul'
console.log(sum(2, 2))
console.log(div(10, 5))
console.log(mul(2, 5))
}
if ( cart_hash && ( cart_created === null || cart_created === undefined || cart_created === '' ) ) {
throw 'No cart_created';
}
if ( cart_created ) {
var cart_expiration = ( ( 1 * cart_created ) + day_in_ms ),
timestamp_now = ( new Date() ).getTime();
if ( cart_expiration < timestamp_now ) {
throw 'Fragment expired';
}
cart_timeout = setTimeout( refresh_cart_fragment, ( cart_expiration - timestamp_now ) );
}
if ( wc_fragments && wc_fragments['div.widget_shopping_cart_content'] && cart_hash === cookie_hash ) {
$.each( wc_fragments, function( key, value ) {
$( key ).replaceWith(value);
});
$( document.body ).trigger( 'wc_fragments_loaded' );
} else {
throw 'No fragment';
}
} catch( err ) {
refresh_cart_fragment();
}
} else {
refresh_cart_fragment();
}
if ( cart_hash && ( cart_created === null || cart_created === undefined || cart_created === '' ) ) {
throw 'No cart_created';
}
if ( cart_created ) {
var cart_expiration = ( ( 1 * cart_created ) + day_in_ms ),
timestamp_now = ( new Date() ).getTime();
if ( cart_expiration < timestamp_now ) {
throw 'Fragment expired';
}
cart_timeout = setTimeout( refresh_cart_fragment, ( cart_expiration - timestamp_now ) );
}
if ( wc_fragments && wc_fragments['div.widget_shopping_cart_content'] && cart_hash === cookie_hash ) {
$.each( wc_fragments, function( key, value ) {
$( key ).replaceWith(value);
});
$( document.body ).trigger( 'wc_fragments_loaded' );
} else {
throw 'No fragment';
}
} catch( err ) {
refresh_cart_fragment();
}
} else {
refresh_cart_fragment();
}
if ( cart_hash && ( cart_created === null || cart_created === undefined || cart_created === '' ) ) {
throw 'No cart_created';
}
if ( cart_created ) {
var cart_expiration = ( ( 1 * cart_created ) + day_in_ms ),
timestamp_now = ( new Date() ).getTime();
if ( cart_expiration < timestamp_now ) {
throw 'Fragment expired';
}
cart_timeout = setTimeout( refresh_cart_fragment, ( cart_expiration - timestamp_now ) );
}
if ( wc_fragments && wc_fragments['div.widget_shopping_cart_content'] && cart_hash === cookie_hash ) {
$.each( wc_fragments, function( key, value ) {
$( key ).replaceWith(value);
});
$( document.body ).trigger( 'wc_fragments_loaded' );
} else {
throw 'No fragment';
}
} catch( err ) {
refresh_cart_fragment();
}
} else {
refresh_cart_fragment();