Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 5afedb2

Browse files
committed
Merge branch 'release-0.3.3'
2 parents 73b7d9e + 1ab1f38 commit 5afedb2

File tree

8 files changed

+41
-23
lines changed

8 files changed

+41
-23
lines changed

CHANGELOG

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

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+
39
PL-v0.3.2
410
- ADD: added .svn to the ignore dirs listing when checking the source dir
511
- FIX: top-level ignored dirs are now found properly

builder/builder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder CLI - v0.3.2
4+
* Pattern Lab Builder CLI - v0.3.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

builder/lib/builder.lib.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder Class - v0.3.2
4+
* Pattern Lab Builder Class - v0.3.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license
@@ -301,7 +301,7 @@ protected function gatherData() {
301301
foreach($patterns as $pattern => $path) {
302302
$patternName = $patternTypeName."-".$pattern;
303303
$path = str_replace("/","-",$path);
304-
$this->d->link->$patternName = "/patterns/".$path."/".$path.".html";
304+
$this->d->link->$patternName = "../../patterns/".$path."/".$path.".html";
305305
}
306306

307307
}

builder/lib/generator.lib.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Generator Class - v0.3.2
4+
* Pattern Lab Generator Class - v0.3.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

builder/lib/watcher.lib.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Watcher Class - v0.3.2
4+
* Pattern Lab Watcher Class - v0.3.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

source/_patternlab-files/pattern-header-footer/footer.html

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
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

source/_patternlab-files/styleguide.mustache

+12-10
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,28 @@
2323
</div> <!--end #patterns-->
2424
</div><!--End Style Guide Main Content-->
2525
<script>
26-
26+
27+
// alert the iframe parent that the pattern has loaded. for page follow.
2728
if (self != top) {
2829
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
2930
parent.postMessage( { "patternpartial": "all", "path": window.location.toString() }, targetOrigin);
3031
}
3132
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");
3335
body[0].onclick = function() {
3436
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
3537
parent.postMessage( { "bodyclick": "bodyclick" }, targetOrigin)
3638
};
3739
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+
};
4648
}
4749
}
4850

source/_patternlab-files/viewall.mustache

+9-8
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@
3131
parent.postMessage( { "patternpartial": "{{ patternPartial }}", "path": window.location.toString() }, targetOrigin);
3232
}
3333
34+
// if there are clicks on the iframe make sure the nav in the iframe parent closes
3435
var body = document.getElementsByTagName('body');
3536
body[0].onclick = function() {
3637
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
3738
parent.postMessage( { "bodyclick":"bodyclick" }, targetOrigin)
3839
};
3940
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+
};
4849
}
4950
}
5051

0 commit comments

Comments
 (0)