// vim: et:ts=4:sw=4:sts=4:ft=javascript 'use strict'; pandora.ui.siteDialog = function(section) { var dialogHeight = Math.round((window.innerHeight - 48) * 0.75), dialogWidth = Math.round(window.innerWidth * 0.75), isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level], tabs = pandora.site.sitePages.concat([{id: 'software', title: 'Software'}]); Ox.getObjectById(tabs, section).selected = true; var $tabPanel = Ox.TabPanel({ content: function(id) { var $content = Ox.Element().css({padding: '16px', overflowY: 'auto'}); if (id == 'contact') { pandora.$ui.contactForm = pandora.ui.contactForm().appendTo($content); } else if (id == 'news') { pandora.$ui.news = pandora.ui.news(dialogWidth, dialogHeight).appendTo($content); } else if (id == 'software') { Ox.Element() .html( '
' + pandora.site.site.name + ' is based on pan.do/ra, ' + 'a free open source framework for media archives.
' + 'pan.do/ra includes OxJS, ' + 'a new JavaScript library for web applications.' + 'Both pan.do/ra ' + 'and OxJS ' + 'will be released in 2012. More soon...' ) .appendTo($content); } else { pandora.api.getPage({name: id}, function(result) { var $right, risk; Ox.Editable({ clickLink: pandora.clickLink, editable: isEditable, tooltip: isEditable ? 'Doubleclick to edit' : '', type: 'textarea', placeholder: isEditable ? 'Doubleclick to insert text' : '', value: result.data.text }) .css(id == 'rights' ? { // this will get applied twice, // total is 144px marginRight: '72px' } : { width: '100%' }) .bindEvent({ submit: function(data) { Ox.Request.clearCache('getPage'); pandora.api.editPage({ name: id, text: data.value }); } }) .appendTo($content); if (id == 'rights') { $right = $('