This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree 8 files changed +41
-23
lines changed
8 files changed +41
-23
lines changed Original file line number Diff line number Diff line change 1
1
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
2
2
3
+ PL-v0.3.3
4
+ - FIX: links created with {{ link.pattern }} now have the correct path
5
+ - FIX: links within a pattern now properly update the history
6
+ - FIX: simplified the history updates from a pattern
7
+ - THX: thanks to @kevin-heil for the fix for {{ link.pattern }}
8
+
3
9
PL-v0.3.2
4
10
- ADD: added .svn to the ignore dirs listing when checking the source dir
5
11
- FIX: top-level ignored dirs are now found properly
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
/*!
4
- * Pattern Lab Builder CLI - v0.3.2
4
+ * Pattern Lab Builder CLI - v0.3.3
5
5
*
6
6
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
7
7
* Licensed under the MIT license
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
/*!
4
- * Pattern Lab Builder Class - v0.3.2
4
+ * Pattern Lab Builder Class - v0.3.3
5
5
*
6
6
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
7
7
* Licensed under the MIT license
@@ -301,7 +301,7 @@ protected function gatherData() {
301
301
foreach ($ patterns as $ pattern => $ path ) {
302
302
$ patternName = $ patternTypeName ."- " .$ pattern ;
303
303
$ path = str_replace ("/ " ,"- " ,$ path );
304
- $ this ->d ->link ->$ patternName = "/patterns/ " .$ path ."/ " .$ path .".html " ;
304
+ $ this ->d ->link ->$ patternName = "../.. /patterns/ " .$ path ."/ " .$ path .".html " ;
305
305
}
306
306
307
307
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
/*!
4
- * Pattern Lab Generator Class - v0.3.2
4
+ * Pattern Lab Generator Class - v0.3.3
5
5
*
6
6
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
7
7
* Licensed under the MIT license
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
/*!
4
- * Pattern Lab Watcher Class - v0.3.2
4
+ * Pattern Lab Watcher Class - v0.3.3
5
5
*
6
6
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
7
7
* Licensed under the MIT license
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 23
23
</div > <!-- end #patterns-->
24
24
</div ><!-- End Style Guide Main Content-->
25
25
<script >
26
-
26
+
27
+ // alert the iframe parent that the pattern has loaded. for page follow.
27
28
if (self != top) {
28
29
var targetOrigin = (window.location.protocol == " file:" ) ? " *" : window.location.protocol+" //" +window.location.host;
29
30
parent.postMessage( { " patternpartial" : " all" , " path" : window.location.toString() } , targetOrigin);
30
31
}
31
32
32
- var body = document .getElementsByTagName (' body' );
33
+ // if there are clicks on the iframe make sure the nav in the iframe parent closes
34
+ var body = document .getElementsByTagName (" body" );
33
35
body[0 ].onclick = function () {
34
36
var targetOrigin = (window.location.protocol == " file:" ) ? " *" : window.location.protocol+" //" +window.location.host;
35
37
parent.postMessage( { " bodyclick" : " bodyclick" } , targetOrigin)
36
38
} ;
37
39
38
- var els = document . getElementsByClassName ( " patternLink " );
39
- for (i in els ) {
40
- els[i].onclick = function() {
41
- if (self != top ) {
42
- var targetOrigin = (window.location.protocol == " file: " ) ? " * " : window.location.protocol+ " // " +window.location.host;
43
- parent.postMessage( { " patternpartial " : this.getAttribute( " data-patternpartial " ), " path " : " foo " } , targetOrigin );
44
- return false ;
45
- }
40
+ // find all links and add an onclick handler for replacing the iframe address so the history works
41
+ if ( self != top ) {
42
+ var aTags = document.getElementsByTagName( " a " );
43
+ for (a in aTags ) {
44
+ aTags[a].onclick = function(e) {
45
+ e.preventDefault( );
46
+ window.location.replace(this.getAttribute( " href " )) ;
47
+ } ;
46
48
}
47
49
}
48
50
Original file line number Diff line number Diff line change 31
31
parent.postMessage( { " patternpartial" : " { { patternPartial } } " , " path" : window.location.toString() } , targetOrigin);
32
32
}
33
33
34
+ // if there are clicks on the iframe make sure the nav in the iframe parent closes
34
35
var body = document .getElementsByTagName (' body' );
35
36
body[0 ].onclick = function () {
36
37
var targetOrigin = (window.location.protocol == " file:" ) ? " *" : window.location.protocol+" //" +window.location.host;
37
38
parent.postMessage( { " bodyclick" :" bodyclick" } , targetOrigin)
38
39
} ;
39
40
40
- var els = document . getElementsByClassName ( " patternLink " );
41
- for (i in els ) {
42
- els[i].onclick = function() {
43
- if (self != top ) {
44
- var targetOrigin = (window.location.protocol == " file: " ) ? " * " : window.location.protocol+ " // " +window.location.host;
45
- parent.postMessage( { " patternpartial " : this.getAttribute( " data-patternpartial " ), " path " : " foo " } , targetOrigin );
46
- return false ;
47
- }
41
+ // find all links and add an onclick handler for replacing the iframe address so the history works
42
+ if ( self != top ) {
43
+ var aTags = document.getElementsByTagName( ' a ' );
44
+ for (a in aTags ) {
45
+ aTags[a].onclick = function(e) {
46
+ e.preventDefault( );
47
+ window.location.replace(this.getAttribute( " href " )) ;
48
+ } ;
48
49
}
49
50
}
50
51
You can’t perform that action at this time.
0 commit comments