'use strict'; pandora.ui.siteDialog = function(section) { var canSeeVersion = pandora.hasCapability('canSeeSoftwareVersion'), dialogHeight = Math.round((window.innerHeight - 48) * 0.75), dialogWidth = Math.round(window.innerWidth * 0.75), isEditable = pandora.hasCapability('canEditSitePages'), tabs = Ox.clone(pandora.site.sitePages, true).map(function(page) { page.title = Ox._(page.title); return page; }).concat([{id: 'software', title: Ox._('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') { $content.addClass('OxTextPage'); } 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 platform for media archives.
' + 'pan.do/ra includes OxJS, ' + 'a new JavaScript library for web applications.' + 'To learn more about pan.do/ra and OxJS, ' + 'please visit pan.do/ra ' + 'and oxjs.org.
' + ( canSeeVersion ? '' + pandora.site.site.name + ' is running pan.do/ra revision ' + pandora.site.site.version + '.' : '' ) ) .appendTo($content); } else { pandora.api.getPage({name: id}, function(result) { var $right, risk; Ox.Editable({ clickLink: pandora.clickLink, editable: isEditable, tooltip: isEditable ? pandora.getEditTooltip() : '', type: 'textarea', placeholder: isEditable ? Ox._('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 = $('