ImageGrid/ui/experiments/panels.html

107 lines
2.0 KiB
HTML
Raw Normal View History

<html>
<link rel="stylesheet" href="../css/ui-lightness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="../css/editor.css">
<style>
body {
overflow: hidden;
}
body.dark {
background: #0a0a0a;
color: silver;
}
body.gray {
background: #333;
color: silver;
}
</style>
<script src="../ext-lib/jquery.js"></script>
<script src="../ext-lib/jquery-ui.js"></script>
<script src="../lib/panels.js"></script>
<script src="../lib/editor.js"></script>
<script>
function toggleThemes(){
var b = $('body')
if(b.hasClass('gray')){
b.removeClass('gray')
b.addClass('dark')
} else if(b.hasClass('dark')){
b.removeClass('dark')
} else {
b.addClass('gray')
}
}
function toggleAutoHide(){
var elem = $('.side-panel')
if(elem.attr('autohide') == 'off'){
elem.attr('autohide', 'on')
} else {
elem.attr('autohide', 'off')
}
return false
}
$(function(){
toggleThemes()
PANEL_ROOT = 'body'
makeSidePanel('left')
makeSidePanel('right')
var panel = makePanel('Test Panel A')
.css({
top: 50,
left: 50,
})
makeSubPanel('Test Sub Panel A', $('<h1>Panel A</h1>'), panel, true, true)
makeSubPanel('Test Sub Panel B', $('<h2>Panel B</h2>'), panel, true)
makeSubPanel('Test Sub Panel C', $('<h3>Panel C</h3>'), panel, false)
openGroupedPanels([
'Edit: Filters',
'Edit: Snapshots'
],
panel)
makeSubPanel('Test Sub Panel D', $('<h2>Panel D</h2>'))
.parents('.panel')
.css({
top: 100,
left: 400,
})
Panel('Test Sub Panel E',
function(){
return $('<h1>Panel E</h1>')
},
function(panel){
panel
.on('panelOpening', function(){ console.log('>>> opening!') })
.on('panelClosing', function(){ console.log('>>> closing!') })
},
true)
})
</script>
<body>
<p>click <a href="javascript:openPanel('Edit: Filters')">to show the editor panel</a> and <a href="javascript:toggleThemes()">here to toggle theme...</a></p>
</body>
</html>
<!-- vim:set ts=4 sw=4 : -->