test( 'Index normalization', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' ); // These start out as 1-4-4 and should normalize to 0-1-1 equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' ); });
addQueryArgs( lockedDialogButtons[ 2 ].getAttribute( 'href' ), { calypsoify: 1, 'frame-nonce': getQueryArg( window.location.href, 'frame-nonce' ),
var updateStyle = function(stylePathName){ for(var i = stylesheets.length;i--;){ var href = stylesheets[i].getAttribute("href"); stylesheets[i].setAttribute("href",cacheBuster(stylesheets[i].getAttribute("href")));
/* On each tag marked with the CSS class "spaLink" we do dynamically add a "onClick" handler */ const bindSpaLinks = function () { const links = document.getElementsByClassName("spaLink"); for(let i=0; i<links.length; i++){ const href = links[i].getAttribute("href"); const fragment = extractFragment(href); links[i].onclick = () => toPage(fragment); } }
// https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value it('properly decode attribute values when parsing templates from DOM', () => { const el = document.createElement('div') el.innerHTML = '<a href="/a?foo=bar&baz=qux" name="<abc>" single=\'"hi"\'></a>' const vm = new Vue({ el }) expect(vm.$el.children[0].getAttribute('href')).toBe('/a?foo=bar&baz=qux') expect(vm.$el.children[0].getAttribute('name')).toBe('<abc>') expect(vm.$el.children[0].getAttribute('single')).toBe('"hi"') })
(function(){jbeeb.PathInfo=function(){function c(a,b){var h,k,o,p,v,z,n,m,q,s,r,w,t,y,a=a||"";k=a.replace(/\\/g,"/");k.match(/:\//)||(m="",m=b?d:f,m=c(m,false),k.substr(0,1)=="/"?k=m.host+(e?"":"/")+k:k.substr(0,3)=="../"?(m=m.parenturl.split("/"),k=k.split("../"),o=k.pop(),m.splice(m.length-k.length,k.length,o),k=m.join("/")):k=m.pathurl+(e?"":"/")+k);k.substr(-1)=="/"&&(k=k.substr(0,k.length-1));h=k.split("://");k=h.shift();m=(h.shift()||"").replace("//","/");m=m.split("/");o=m.shift()||"";o.indexOf("@")> -1&&(h=o.split("@"),t=h[0].split(":"),w=t[0],t=t[1],o=h[1]);o.indexOf(":")>-1&&(h=o.split(":"),p=h[1],o=h[0]);m=m.join("/");m.indexOf("#")!=-1&&(h=m.split("#"),r=h[1],m=h[0]);m.indexOf("?")!=-1&&(h=m.split("?"),s=h[1],m=h[0]);h=m.split("/");n=h.pop();m=h.join("/");n==".."&&(n="");h=n.split(".");h.length>1&&(z=h.pop().toLowerCase(),v=h.join("."));y=k+"://"+o+(p?":"+p:"");m="/"+m+(m.length>0?"/":"");q=y+m;h=y+m+n+(s?"?"+s:"")+(r?"#"+r:"");var l=m,u=q;z?(m+=n,q+=n):(m+=n+(n!=""?"/":""),q+=n+(n!=""?"/": ""),v=n,!s&&!r&&h.substr(-1)!="/"&&(h+="/"));e===false&&(l.substr(-1)=="/"&&(l=l.substr(0,l.length-1)),u.substr(-1)=="/"&&(u=u.substr(0,u.length-1)),z||(m.substr(-1)=="/"&&(m=m.substr(0,m.length-1)),q.substr(-1)=="/"&&(q=q.substr(0,q.length-1)),h.substr(-1)=="/"&&(h=h.substr(0,h.length-1))));return{source:a||null,url:h||null,protocol:k||null,domain:o||null,port:p||null,basename:v||null,ext:z||null,filename:n||null,path:m||null,pathurl:q||null,parent:l||null,parenturl:u||null,query:s||null,fragment:r|| null,username:w||null,password:t||null,host:y||null}}function b(a){return(a||"").split("?")[0].split("/").pop()}function a(a){a=a.split("/");a.pop();return a.join("/").toString()+(a.length>0?"/":"")}function h(b){var h=document.getElementsByTagName("script");return(h=h[h.length-1].getAttribute("src"))?b?h.split("?")[0]:a(h.split("?")[0]):""}var e=true,d=h(),f=a(window.location.href);return{parse:c,filename:b,basename:function(a){a=b(a).split(".");a.pop();return a.join(".")},basepath:a,scriptPath:d, getScriptPath:h,pagePath:f,ext:function(a){return(a||"").split("?")[0].split("/").pop().split(".").pop().toLowerCase()}}}()})();
function F(){var b=m.length;if(b>0)for(var c=0;c<b;c++){var d=m[c].id,e=m[c].callbackFn,f={success:!1,id:d};if(y.pv[0]>0){var g=P(d);if(g)if(S(m[c].swfVersion)&&!(y.wk&&y.wk<312))U(d,!0),e&&(f.success=!0,f.ref=G(d),e(f));else if(m[c].expressInstall&&H()){var h={};h.data=m[c].expressInstall,h.width=g.getAttribute("width")||"0",h.height=g.getAttribute("height")||"0",g.getAttribute("class")&&(h.styleclass=g.getAttribute("class")),g.getAttribute("align")&&(h.align=g.getAttribute("align"));var i={},j=g.getElementsByTagName("param"),k=j.length;for(var l=0;l<k;l++)j[l].getAttribute("name").toLowerCase()!="movie"&&(i[j[l].getAttribute("name")]=j[l].getAttribute("value"));I(h,i,d,e)}else J(g),e&&e(f)}else{U(d,!0);if(e){var n=G(d);n&&typeof n.SetVariable!=a&&(f.success=!0,f.ref=n),e(f)}}}}
componentDidUpdate() { const reactD3Elements = document.querySelectorAll('[data-react-d3-id]'); const state = this.props.data.state; for(let i = 0; i < reactD3Elements.length; i++) { const rd3Id = reactD3Elements[i].getAttribute('data-react-d3-id'); const that = this; if(!state[rd3Id]) continue; applyData(reactD3Elements, state, rd3Id, i); applyZoomData(reactD3Elements, state, rd3Id, i); applyTransitionData(reactD3Elements, state, rd3Id, i); applyChartData(reactD3Elements, state, rd3Id, i); mountD3Functions(state, rd3Id, that); registerOnListeners(reactD3Elements, state, rd3Id, i); registerEventListeners(reactD3Elements, state, rd3Id, i); } }
test( 'Index generation', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' ); // These have no indices defined to start with equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' ); });
var updateStyle = function(stylePathName){ for(var i = stylesheets.length;i--;){ var href = stylesheets[i].getAttribute("href"); stylesheets[i].setAttribute("href",cacheBuster(stylesheets[i].getAttribute("href")));
test( 'Index normalization', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' ); // These start out as 1-4-4 and should normalize to 0-1-1 equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' ); });
test( 'Index generation', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' ); // These have no indices defined to start with equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' ); });
// https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value it('properly decode attribute values when parsing templates from DOM', () => { const el = document.createElement('div') el.innerHTML = '<a href="/a?foo=bar&baz=qux" name="<abc>" single=\'"hi"\'></a>' const vm = new Vue({ el }) expect(vm.$el.children[0].getAttribute('href')).toBe('/a?foo=bar&baz=qux') expect(vm.$el.children[0].getAttribute('name')).toBe('<abc>') expect(vm.$el.children[0].getAttribute('single')).toBe('"hi"') })
test( 'Index generation', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' ); // These have no indices defined to start with equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' ); });
test( 'Index normalization', function() { var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' ); // These start out as 1-4-4 and should normalize to 0-1-1 equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' ); equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' ); });