still working on layout

This commit is contained in:
John Bintz 2009-08-29 11:13:18 -04:00
parent 2c09f79528
commit 5854aaf6bf
3 changed files with 25 additions and 10 deletions

View File

@ -9,7 +9,6 @@ class ComicPressAddonBookmarkWidget extends ComicPressAddon {
$this->comicpress = $comicpress; $this->comicpress = $comicpress;
add_action('wp_head', array(&$this, 'wp_head')); add_action('wp_head', array(&$this, 'wp_head'));
$this->comicpress->additional_javascripts[] = '/js/bookmark.js';
wp_enqueue_script('prototype'); wp_enqueue_script('prototype');
wp_enqueue_script('cookiejar', get_template_directory_uri() . '/js/cookiejar.js', array('prototype')); wp_enqueue_script('cookiejar', get_template_directory_uri() . '/js/cookiejar.js', array('prototype'));
@ -34,4 +33,4 @@ class ComicPressAddonBookmarkWidget extends ComicPressAddon {
} }
} }
?> ?>

View File

@ -16,7 +16,9 @@ var LayoutEditor = Class.create({
this.section_handles = []; this.section_handles = [];
for (i = 0, il = this.sections.length; i < il; ++i) { for (i = 0, il = this.sections.length; i < il; ++i) {
var sh = Math.floor(this.height * this.sections[i][1]); var sh = Math.floor(this.height * this.sections[i][1]);
var section = new Element("div", { 'style': "height: " + sh + "px" }); var section = new Element("div", { 'style': "height: " + sh + "px", "class": this.sections[i][0] });
var inside = new Element("div");
section.insert(inside);
this.container.insert(section); this.container.insert(section);
this.section_handles.push(section); this.section_handles.push(section);
} }
@ -25,6 +27,8 @@ var LayoutEditor = Class.create({
var myThis = this; var myThis = this;
$w('left right').each(function(which) { $w('left right').each(function(which) {
myThis.sidebar_handles[which] = new Element("div", { 'style': 'position: absolute; z-index: 1' }); myThis.sidebar_handles[which] = new Element("div", { 'style': 'position: absolute; z-index: 1' });
var inside = new Element("div");
myThis.sidebar_handles[which].insert(inside);
myThis.container.insert(myThis.sidebar_handles[which]); myThis.container.insert(myThis.sidebar_handles[which]);
}); });
}, },
@ -95,4 +99,4 @@ Event.observe(window, 'load', function() {
l.register_info(info); l.register_info(info);
l.draw(); l.draw();
} }
}); });

View File

@ -4,17 +4,29 @@
<script type="text/javascript" src="prototype.js"></script> <script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="LayoutEditor.js"></script> <script type="text/javascript" src="LayoutEditor.js"></script>
<style type="text/css"> <style type="text/css">
#layout-editor-container div { #layout-editor-container > div {
border: solid red 1px ; }
background-color: #aaa
#layout-editor-container > div > div {
border: solid red 1px;
background-color: #aaa;
width: 100%;
height: 100%
} }
</style> </style>
</head> </head>
<body> <body>
<div id="layout-editor-container" style="width: 300px"></div> <div id="layout-editor-container" style="width: 300px"></div>
<form id="layout-editor-controls"> <form id="layout-editor-controls">
<fieldset> <h3>Sidebars</h3>
</fieldset> <?php foreach (array(
'left' => array(
'name' => 'Left Sidebar'
)
) as $key => $info) { ?>
<h4><?php echo $info['name'] ?></h4>
<?php } ?>
</form> </form>
</body> </body>
</html> </html>