forked from simplebits/Pears
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreview.php
More file actions
41 lines (37 loc) · 1.08 KB
/
preview.php
File metadata and controls
41 lines (37 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once('../../../wp-load.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Preview</title>
<link rel="stylesheet/less" media="screen, projection" href="<?php echo get_template_directory_uri(); ?>/css/screen.less" />
<style type="text/css">
body {
background: #fff !important;
}
.wrap {
padding: 20px;
}
</style>
<style id="preview" type="text/css">
<?php $key="css"; echo get_post_meta($_GET['p'], $key, true); ?>
</style>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/less.js"></script>
</head>
<body>
<div class="wrap">
<?php $key="html"; echo get_post_meta($_GET['p'], $key, true); ?>
</div><!-- /wrap -->
<script type="text/javascript">
$(document).ready(function() {
// calculating preview width
$('#width-control span', top.document).html($(window).width() + ' px');
});
$(window).resize(function() {
$('#width-control span', top.document).html($(window).width() + ' px');
});
</script>
</body>
</html>