pandora/static/js/pandora/editor.js

50 lines
1.6 KiB
JavaScript
Raw Normal View History

2011-07-29 18:37:11 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-08-17 15:20:43 +00:00
2011-11-05 17:04:10 +00:00
'use strict';
2011-08-17 15:20:43 +00:00
// fixme: this should be deleted!!
2011-05-25 19:42:45 +00:00
pandora.ui.annotations = function() {
2011-06-19 17:49:25 +00:00
var that = Ox.Element({
2011-05-25 19:42:45 +00:00
id: 'annotations'
})
.bindEvent({
2011-08-17 15:20:43 +00:00
resize: function(data) {
2011-09-17 17:40:15 +00:00
pandora.user.ui.annotationsSize = data.size;
2011-05-25 19:42:45 +00:00
},
2011-08-17 15:20:43 +00:00
resizeend: function(data) {
2011-09-17 17:40:15 +00:00
pandora.UI.set({annotationsSize: data.size});
2011-05-25 19:42:45 +00:00
},
2011-08-17 15:20:43 +00:00
toggle: function(data) {
2011-05-25 19:42:45 +00:00
pandora.UI.set({showAnnotations: !data.collapsed});
}
}),
$bins = [];
pandora.site.layers.forEach(function(layer) {
2011-06-19 17:49:25 +00:00
var $bin = Ox.CollapsePanel({
2011-05-25 19:42:45 +00:00
id: layer.id,
size: 16,
title: layer.title
});
$bins.push($bin);
$bin.$content.append(
$('<div>').css({ height: '20px' }).append(
$('<div>').css({ float: 'left', width: '16px', height: '16px', margin: '1px'}).append(
2011-08-09 17:07:24 +00:00
$('<img>').attr({ src: Ox.UI.getImageURL('iconFind') }).css({ width: '16px', height: '16px', border: 0, background: 'rgb(64, 64, 64)', WebkitBorderRadius: '2px' })
2011-05-25 19:42:45 +00:00
)
).append(
$('<div>').css({ float: 'left', width: '122px', height: '14px', margin: '2px' }).html('Foo')
).append(
$('<div>').css({ float: 'left', width: '40px', height: '14px', margin: '2px', textAlign: 'right' }).html('23')
)
);
});
$bins.forEach(function(bin) {
2011-05-25 19:42:45 +00:00
that.append(bin);
});
return that;
};