This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 parent . postMessage ( { "bodyclick" : "bodyclick" } , targetOrigin )
2222 } ;
2323
24+ // find all links and add an onclick handler for replacing the iframe address so the history works
25+ var aTags = document . getElementsByTagName ( 'a' ) ;
26+ for ( a in aTags ) {
27+ aTags [ a ] . onclick = function ( e ) {
28+ e . preventDefault ( ) ;
29+ window . location . replace ( this . getAttribute ( "href" ) ) ;
30+ } ;
31+ }
32+
2433 // watch the iframe source so that it can be sent back to everyone else.
2534 function receiveIframeMessage ( event ) {
2635
Original file line number Diff line number Diff line change 3737 parent.postMessage( { " bodyclick" : " bodyclick" } , targetOrigin)
3838 } ;
3939
40+ // find all links and add an onclick handler for replacing the iframe address so the history works
41+ var aTags = document .getElementsByTagName (' a' );
42+ for (a in aTags) {
43+ aTags[a].onclick = function(e) {
44+ e.preventDefault();
45+ if (this.getAttribute(" class" ) != " patternLink" ) {
46+ window.location.replace(this.getAttribute(" href" ));
47+ }
48+ } ;
49+ }
50+
51+
4052 var els = document .getElementsByClassName (" patternLink" );
4153 for (i in els) {
4254 els[i].onclick = function() {
Original file line number Diff line number Diff line change 3838 parent.postMessage( { " bodyclick" :" bodyclick" } , targetOrigin)
3939 } ;
4040
41+ // find all links and add an onclick handler for replacing the iframe address so the history works
42+ var aTags = document .getElementsByTagName (' a' );
43+ for (a in aTags) {
44+ aTags[a].onclick = function(e) {
45+ e.preventDefault();
46+ if ((self != top) && (this.getAttribute(" class" ) != " patternLink" )) {
47+ window.location.replace(this.getAttribute(" href" ));
48+ }
49+ } ;
50+ }
51+
4152 var els = document .getElementsByClassName (" patternLink" );
4253 for (i in els) {
4354 els[i].onclick = function() {
You can’t perform that action at this time.
0 commit comments