move 0xdb siteDialog special case into siteDialog.0xdb.js, fixes #767

This commit is contained in:
j 2012-06-11 10:17:15 +02:00
commit ef3c63badc
2 changed files with 167 additions and 36 deletions

View file

@ -32,7 +32,6 @@ pandora.ui.siteDialog = function(section) {
.appendTo($content);
} else {
pandora.api.getPage({name: id}, function(result) {
var $right, risk;
Ox.Editable({
clickLink: pandora.clickLink,
editable: isEditable,
@ -41,11 +40,7 @@ pandora.ui.siteDialog = function(section) {
placeholder: isEditable ? 'Doubleclick to insert text' : '',
value: result.data.text
})
.css(id == 'rights' ? {
// this will get applied twice,
// total is 144px
marginRight: '72px'
} : {
.css({
width: '100%'
})
.bindEvent({
@ -58,36 +53,6 @@ pandora.ui.siteDialog = function(section) {
}
})
.appendTo($content);
if (id == 'rights') {
$right = $('<div>')
.css({position: 'absolute', top: '16px', right: '16px', width: '128px'})
.appendTo($content);
$('<img>')
.attr({src: '/static/png/rights.png'})
.css({width: '128px', height: '128px', marginBottom: '8px'})
.appendTo($right);
risk = ['Unknown', 'Severe', 'High', 'Significant', 'General', 'Low'];
[].concat(
['Unknown'],
pandora.site.rightsLevels.map(function(rightsLevel) {
return rightsLevel.name;
}).reverse()
).forEach(function(name, i) {
Ox.Theme.formatColor(330 + 30 * i, 'gradient')
.css({
padding: '4px',
marginTop: '8px'
})
.html(
'<b>' + name + '</b><br/><div style="padding-top: 2px; font-size: 9px; opacity: 0.75">'
+ risk[i] + ' Risk'
+ (risk[i].length > 6 ? '<br/> of ' : ' of<br/>')
+ 'Legal Action</div>'
)
.appendTo($right);
});
}
});
}
return Ox.SplitPanel({
elements: [