mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
Add Press Center with resources, FAQ and interviewees
This commit is contained in:
parent
a5250261ec
commit
f383f2a201
32 changed files with 610 additions and 13 deletions
68
js/main.js
68
js/main.js
|
@ -1,4 +1,9 @@
|
|||
function cancelEvent(e){if(!e)var e=window.event;(e.preventDefault)?e.preventDefault():e.returnValue=false;}
|
||||
|
||||
|
||||
function getEventTarget(e){if(!e)var e=window.event;return (e.target&&e.target.nodeType==3)?e.target.parentNode:(e.target)?e.target:e.srcElement;}
|
||||
|
||||
|
||||
function supportsSVG(){
|
||||
//Old FF 3.5 and Safari 3 versions have a very poor svg support
|
||||
//http://www.w3.org/TR/SVG11/feature#Image Defeat FF 3.5 only
|
||||
|
@ -10,12 +15,40 @@ if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image
|
|||
if(!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute","1.1")&&!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Animation","1.1")&&!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Text","1.1"))return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function getStyle(a,b){
|
||||
if(window.getComputedStyle)return document.defaultView.getComputedStyle(a,null).getPropertyValue(b);
|
||||
var n=b.indexOf('-');
|
||||
if(n!==-1)b=b.substr(0,n)+b.substr(n+1,1).toUpperCase()+b.substr(n+2);
|
||||
return a.currentStyle[b];
|
||||
}
|
||||
|
||||
|
||||
function getWidth(a){
|
||||
var w=getStyle(a,'width');
|
||||
if(w.indexOf('px')!==-1)return parseInt(w.replace('px',''));
|
||||
var p=[getStyle(a,'padding-top'),getStyle(a,'padding-right'),getStyle(a,'padding-bottom'),getStyle(a,'padding-left')];
|
||||
for(var i=0;i<4;i++){
|
||||
if(p[i].indexOf('px')!==-1)p[i]=parseInt(p[i]);
|
||||
else p[i]=0;
|
||||
}
|
||||
return Math.max(0,a.offsetWidth-p[1]-p[3]);
|
||||
}
|
||||
|
||||
|
||||
function getHeight(a){
|
||||
var h=getStyle(a,'height');
|
||||
if(h.indexOf('px')!==-1)return parseInt(h.replace('px',''));
|
||||
var p=[getStyle(a,'padding-top'),getStyle(a,'padding-right'),getStyle(a,'padding-bottom'),getStyle(a,'padding-left')];
|
||||
for(var i=0;i<4;i++){
|
||||
if(p[i].indexOf('px')!==-1)p[i]=parseInt(p[i]);
|
||||
else p[i]=0;
|
||||
}
|
||||
return Math.max(0,a.offsetHeight-p[0]-p[2]);
|
||||
}
|
||||
|
||||
|
||||
function svgfallback(){
|
||||
if(supportsSVG())return;
|
||||
for(var i=0,nd=document.getElementsByTagName('*'),n=nd.length;i<n;i++){
|
||||
|
@ -24,6 +57,8 @@ for(var i=0,nd=document.getElementsByTagName('*'),n=nd.length;i<n;i++){
|
|||
if(/\.svg/.test(getStyle(nd[i],'background')))nd[i].style.background=getStyle(nd[i],'background').replace('.svg','.png');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function walletshow(){
|
||||
for(var i=0,nd=document.getElementsByTagName('*'),n=nd.length;i<n;i++){
|
||||
if(nd[i].getAttribute('data-id')===null||nd[i].getAttribute('data-id')=='')continue;
|
||||
|
@ -38,6 +73,8 @@ for(var i=0,nd=document.getElementsByTagName('*'),n=nd.length;i<n;i++){
|
|||
dd.innerHTML=ss.innerHTML;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mobileshow(e){
|
||||
cancelEvent(e);
|
||||
var mm=document.getElementById('menu');
|
||||
|
@ -49,3 +86,34 @@ else{mf.style.display='block';mm.style.display='block';ml.style.display='inline-
|
|||
t.parentNode.removeChild(t);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function faqshow(e){
|
||||
var p=t=getEventTarget(e);
|
||||
while(p.nodeType!=1||p.nodeName!='DIV')p=p.nextSibling;
|
||||
var pp=p.cloneNode(true);
|
||||
pp.style.visibility='hidden';
|
||||
pp.style.height='auto';
|
||||
p.parentNode.appendChild(pp);
|
||||
var nhe=getHeight(pp);
|
||||
pp.parentNode.removeChild(pp);
|
||||
if(p.style.height!='0px'&&p.style.height!='')p.style.height='0px';
|
||||
else p.style.height=nhe+'px';
|
||||
cancelEvent(e);
|
||||
}
|
||||
|
||||
|
||||
function materialshow(e){
|
||||
var p=t=getEventTarget(e);
|
||||
while(p.nodeType!=1||p.nodeName!='DIV')p=p.previousSibling;
|
||||
var pp=p.cloneNode(true);
|
||||
pp.style.visibility='hidden';
|
||||
pp.style.height='auto';
|
||||
p.parentNode.appendChild(pp);
|
||||
var nhe=getHeight(pp);
|
||||
pp.parentNode.removeChild(pp);
|
||||
if(p.style.height!='0px'&&p.style.height!='')p.style.height='0px';
|
||||
else p.style.height=nhe+'px';
|
||||
t.style.display='none';
|
||||
cancelEvent(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue