This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 21
21
parent . postMessage ( { "bodyclick" : "bodyclick" } , targetOrigin )
22
22
} ;
23
23
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
+
24
33
// watch the iframe source so that it can be sent back to everyone else.
25
34
function receiveIframeMessage ( event ) {
26
35
Original file line number Diff line number Diff line change 37
37
parent.postMessage( { " bodyclick" : " bodyclick" } , targetOrigin)
38
38
} ;
39
39
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
+
40
52
var els = document .getElementsByClassName (" patternLink" );
41
53
for (i in els) {
42
54
els[i].onclick = function() {
Original file line number Diff line number Diff line change 38
38
parent.postMessage( { " bodyclick" :" bodyclick" } , targetOrigin)
39
39
} ;
40
40
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
+
41
52
var els = document .getElementsByClassName (" patternLink" );
42
53
for (i in els) {
43
54
els[i].onclick = function() {
You can’t perform that action at this time.
0 commit comments