1
0
mirror of https://github.com/pattern-lab/patternlab-php.git synced 2025-01-17 22:29:12 +01:00

the changes necessary to run pattern lab without apache

biggest change is the location of styleguide. not sure the viewer files
should go in a directory named "styleguide"
This commit is contained in:
Dave Olsen 2013-07-06 11:30:59 -04:00
parent 6ee5f58f03
commit f5627393d9
11 changed files with 39 additions and 34 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
.DS_Store
public/index.html
public/styleguide.html
public/styleguide/html/styleguide.html
public/css/*.css
public/patterns/*
config.ini

View File

@ -173,7 +173,7 @@ class Builder {
$r = $this->mfs->render('index',$nd);
file_put_contents(__DIR__."/../../public/index.html",$r);
$s = $this->mfs->render('styleguide',$sd);
file_put_contents(__DIR__."/../../public/styleguide.html",$s);
file_put_contents(__DIR__."/../../public/styleguide/html/styleguide.html",$s);
}

View File

@ -18,7 +18,7 @@ var wsnConnected = false;
var wsc;
var wscConnected = false;
var dataPrevious = 0;
var host = window.location.host;
var host = (window.location.host != "") ? window.location.host : "127.0.0.1";
// handle page updates from one browser to another
function connectNavSync() {
@ -49,7 +49,7 @@ function connectNavSync() {
// when receiving a message from WebSocket update the iframe source
wsn.onmessage = function (event) {
var vpLocation = document.getElementById('sg-viewport').contentWindow.location.href;
var mLocation = "http://"+window.location.host+event.data;
var mLocation = "http://"+host+event.data;
if (vpLocation != mLocation) {
$("#sg-viewport").attr('src',mLocation);
}

View File

@ -2,20 +2,20 @@
"atoms": {
"images": {
"landscape-4x3": {
"src": "/images/fpo_4x3.png",
"src": "../../images/fpo_4x3.png",
"alt": "4x3 Image"
},
"landscape-16x9": {
"src": "/images/fpo_16x9.png",
"src": "../../images/fpo_16x9.png",
"alt": "16x9 Image"
},
"logo": {
"href": "#",
"src": "/images/logo.png",
"src": "../../images/logo.png",
"alt": "Logo for a Company"
},
"square": {
"src": "/images/fpo_square.png",
"src": "../../images/fpo_square.png",
"alt": "Square Thumbnail"
}
},

View File

@ -1 +1 @@
<img src="images/fpo_avatar.png" alt="Avatar" />
<img src="../../images/fpo_avatar.png" alt="Avatar" />

View File

@ -1,2 +1,2 @@
<img src="images/favicon_16x16.jpg" alt="Favicon 16x16" />
<img src="images/favicon_32x32.jpg" alt="Favicon 32x32" />
<img src="../../images/favicon_16x16.jpg" alt="Favicon 16x16" />
<img src="../../images/favicon_32x32.jpg" alt="Favicon 32x32" />

View File

@ -1 +1 @@
<img src="images/ajax-loader.gif" alt="Loading" />
<img src="../../images/ajax-loader.gif" alt="Loading" />

View File

@ -4,7 +4,7 @@
<title>Pattern Lab</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="/styleguide/css/styleguide.css" media="all" />
<link rel="stylesheet" href="styleguide/css/styleguide.css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/styleguide/js/jquery.js"><\/script>')</script>
</head>
@ -23,7 +23,7 @@
<div id="sg-vp-wrap">
<div id="sg-cover"></div>
<div id="sg-gen-container">
<iframe id="sg-viewport" src="/styleguide.html"></iframe>
<iframe id="sg-viewport" src="styleguide/html/styleguide.html"></iframe>
<div id="sg-rightpull-container">
<div id="sg-rightpull"></div>
</div>
@ -31,9 +31,9 @@
</div>
<!--end iFrame-->
<script src="/js/data-saver.js"></script>
<script src="/styleguide/js/styleguide.js"></script>
<script src="js/data-saver.js"></script>
<script src="styleguide/js/styleguide.js"></script>
{{> websockets }}
<script src="/listeners/synclisteners.js"></script>
<script src="listeners/synclisteners.js"></script>
</body>
</html>

View File

@ -1,12 +1,15 @@
<!-- End of Pattern -->
<script>
parent.postMessage(window.location.href,"http://"+window.location.host);
var body = document.getElementsByTagName('body');
body[0].onclick = function() {
parent.postMessage('body-click',"http://"+window.location.host)
};
var host = window.location.host;
if (host != '') {
parent.postMessage(host,"http://"+host);
var body = document.getElementsByTagName('body');
body[0].onclick = function() {
parent.postMessage('body-click',"http://"+host)
};
}
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Pattern Lab</title>
<title>Pattern Lab Pattern</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="/styleguide/css/styleguide.css" media="all" />
<link rel="stylesheet" href="/css/style.css" media="all" />
<script src="/js/modernizr.js"></script>
<link rel="stylesheet" href="../../styleguide/css/styleguide.css" media="all" />
<link rel="stylesheet" href="../../css/style.css" media="all" />
<script src="../../js/modernizr.js"></script>
</head>
<body>

View File

@ -4,8 +4,8 @@
<title>Style Guide</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="/styleguide/css/styleguide.css" media="all" />
<link rel="stylesheet" href="/css/style.css" media="all" />
<link rel="stylesheet" href="../../styleguide/css/styleguide.css" media="all" />
<link rel="stylesheet" href="../../css/style.css" media="all" />
</head>
<body>
@ -16,17 +16,19 @@
<div id="patterns">
{{# partials }}
<div class="sg-pattern">
<h2 class="sg-head sg-sub" ><a href="/patterns/{{ patternLink }}">{{ patternName }}</a></h2>
<h2 class="sg-head sg-sub" ><a href="../../patterns/{{ patternLink }}">{{ patternName }}</a></h2>
{{{ patternPartial }}}
</div>
{{/ partials }}
</div> <!--end #patterns-->
</div><!--End Style Guide Main Content-->
<script>
var body = document.getElementsByTagName('body');
body[0].onclick = function() {
parent.postMessage('body-click',"http://"+window.location.host)
};
if (window.location.host != '') {
var body = document.getElementsByTagName('body');
body[0].onclick = function() {
parent.postMessage('body-click',"http://"+window.location.host)
};
}
</script>
</body>
</html>