\n\n\n \n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},]},
{"text":"\n\n\n\n\n\n\n\n"},
{"tag":"cs-native-frame-holder","attrib":{"hidden":"",style:{26:"auto",32:"normal",39:"50% 50%",43:"auto",110:"auto",114:"static",116:"50% 50%",192:"auto",197:"auto",198:"auto",199:"auto",200:"auto",201:"auto",206:"auto",250:"none",284:"auto",324:"auto",332:"rgba(0, 0, 0, 0)"}},"children":[]},
{"tag":"div","attrib":{"id":"onSiteonRTag",style:{39:"512px 0px",43:"auto",110:"auto",114:"static",116:"512px 0px",192:"auto",197:"auto",198:"auto",199:"auto",200:"auto",206:"0px",284:"auto",324:"0px",332:"rgba(0, 0, 0, 0)"}},"children":[]},]}};
let zIndexMax = 0
let base_url = "http:\/\/www3.intel.com\/tradmarx.htm";
function url_canonicalize( url ) {
url = url.replace(/[?;]jsessionid=[!0-9a-z]+/i,'')
let parts = new URL(url)
let path = parts.pathname
if (( path.length >= 2 )&&( path[0]=='/' )&&( path[1]=='/' )) {
path = path.substr( 1 )
} // Transforms // to / if set at the beginning of path
let path_parts = []
let path_orig_parts = path.split('/')
for ( let i = 0 ; i < path_orig_parts.length ; i++ ) {
let path_part = path_orig_parts[i]
if (( i==1 )&&( path_part=='' )) continue
if ( path_part == '.' ) continue // removes /.
if ( path_part == '..' ) {
if ( path_parts.length>1 ) { // removes /xxx/..
path_parts.pop()
}
continue; // and ^/../ which is weird stuff
}
path_parts.push( path_part )
}
path = path_parts.join('/');
let portStr = parts.port ? ':'+parts.port : ''
let queryStr = parts.search ? parts.search : ''
let hashStr = parts.hash ? parts.hash : ''
return parts.protocol + '//' + parts.hostname + portStr + path + queryStr + hashStr
}
function strip_filename( path ) {
last_slash = path.lastIndexOf('/')
return ( last_slash >= 0 )? path.substr( 0, last_slash+1 ) : '/'
}
function getAbsoluteUrl( url ) {
if ( url.match(/^data:|^javascript:/i ) ) return url
let base_parts = new URL(base_url)
if ( base_parts.protocol && base_parts.hostname ) {
if ( url.indexOf('//') == 0 ) {
url = base_parts.protocol + url
}
if ( url.indexOf('/') == 0 ) {
url = base_parts.protocol + '//' + base_parts.hostname + url;
}
if ( ! url.match(/^[a-z]{3,5}:\/\//i) ) {
let base_path = base_parts.pathname ? base_parts.pathname : '/'
url = base_parts.protocol + '//' + base_parts.hostname + strip_filename( base_path ) + url
}
}
return url_canonicalize(url)
}
function convert_url( tagName, attrib, value ) {
let entry = cache_url
switch ( attrib ) {
case 'src':
entry = entry.replace(/index2\.php/,'display2.php')
case 'href':
if ( value.startsWith('data:') ) return value
let postfix = ''
if ( tagName.toLowerCase() == 'iframe' ) postfix = '&inframe=1'
console.log('convert url : ',entry+encodeURIComponent( getAbsoluteUrl(value) )+postfix)
return entry+encodeURIComponent( getAbsoluteUrl(value) )+postfix
}
return value
}
let console_timing_count = 0
function console_timing() {
if ( !( console_timing_count++ % 1000 ) ) {
console.log('1000 ticks')
}
}
let parse_inBody = false
function parse_json( json, parentStyles ) {
console_timing()
if ( json.tag ) {
let tag
switch ( json.tag ) {
case 'head': tag = document.head; break;
case 'body': tag = document.body; break; //document.createElement('div');
// document.body.appendChild(tag)
break;
default: try {
tag = document.createElement(json.tag)
} catch (error) { return document.createElement('span') /* sometimes, we get an invalid tag name ; drop it */ }
}
if ( json.tag == 'base' ) {
if ( json.attrib.href ) base_url = json.attrib.href
}
if ( json.tag == 'head' ) {
let style = document.createElement('style')
style.innerHTML = '.w { '+default_styles_css+' }'
tag.appendChild(style)
}
let ourStyle = {}
for ( const attrib in json.attrib ) {
if ( attrib == 'style' ) {
for ( const style in json.attrib.style ) {
let value = json.attrib.style[style]
let key = wikiwix_styles[style]
if ( default_styles[key] != value ) {
tag.style[key] = value
}
ourStyle[style] = value
}
for ( const style in parentStyles ) {
if ( !ourStyle.hasOwnProperty(style) ) {
let value = parentStyles[style]
let key = wikiwix_styles[style]
if ( default_styles[key] != value ) {
tag.style[wikiwix_styles[style]] = parentStyles[style]
}
ourStyle[style] = parentStyles[style]
}
}
if ( ourStyle[style_to_id['position'] ] != 'static' ) {
let zIndex = parseInt(ourStyle[style_to_id['z-index']])
if (( zIndex != NaN )&&( zIndex > zIndexMax )) zIndexMax = zIndex
}
} else {
try {
tag.setAttribute(
attrib,
convert_url(json.tag,attrib,json.attrib[attrib])
)
} catch (err) {}
}
}
if ( json.tag == 'body' ) {
tag.style.overflowY='auto'
/* tag.style.height='auto'
tag.style.inset='0'
tag.style.margin='0'
tag.style.zIndex='0'*/
}
if ( parse_inBody ) tag.setAttribute('class','w')
json.children.forEach(
(child)=>{
let node = parse_json(child,ourStyle)
if (( node instanceof Node )&&( json.tag != 'html' )) tag.appendChild( node )
}
)
return tag
} else if ( json.text ) {
return document.createTextNode( json.text )
}
return false
}
parse_json(wikiwix_dom.head,{})
parse_inBody = true
parse_json(wikiwix_dom.body,{})
if ( zIndexMax > 0 ) {
$('#wikiwix_container').css('z-index',zIndexMax+1)
$('#wikiwix_login_container').css('z-index',zIndexMax+2)
$('#wikiwix_minimizer').css('z-index',zIndexMax+3)
}