Compare commits
3 commits
fcc27eb900
...
e2ea4e3aab
| Author | SHA1 | Date | |
|---|---|---|---|
| e2ea4e3aab | |||
| 71311b323e | |||
| 7504d92230 |
3 changed files with 49 additions and 13 deletions
|
|
@ -212,11 +212,40 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
|
|||
}).join(find.operator);
|
||||
}
|
||||
|
||||
function getData() {
|
||||
var type = $input.type.value(),
|
||||
view = $list.options('selected')[0];
|
||||
return Ox.map($input, function($element, key) {
|
||||
return Ox.contains(Ox.getObjectById(views, view).inputs, key)
|
||||
&& (
|
||||
!Ox.contains(['map', 'calendar'], view)
|
||||
|| ($input.mapMode.value() == 'item' && key != 'find')
|
||||
|| ($input.mapMode.value() == 'find' && key != 'item')
|
||||
)
|
||||
&& $element.value ? $element.value() : void 0;
|
||||
})
|
||||
}
|
||||
|
||||
function formatHTML() {
|
||||
var type = $input.type.value();
|
||||
var type = $input.type.value(),
|
||||
view = $list.options('selected')[0],
|
||||
value = $input.link.value(),
|
||||
data = getData();
|
||||
if (view == 'document') {
|
||||
var prefix = type == 'iframe'
|
||||
? (pandora.site.site.https ? 'https' : 'http')
|
||||
+ '://' + pandora.site.site.url + '/'
|
||||
: '/',
|
||||
page = type == 'iframe' ? 'documents' : 'document',
|
||||
resolution = 480;
|
||||
if (value == '...' || !value.length) {
|
||||
value = '<img src="' + prefix + 'documents/' + data.document + '/' + resolution + 'p.jpg">';
|
||||
}
|
||||
return '<a href="' + prefix + page + '/' + data.document + '">' + value + '</a>';
|
||||
}
|
||||
return type == 'link'
|
||||
? '<a href="' + formatURL()
|
||||
+ '">' + $input.link.value()
|
||||
+ '">' + value
|
||||
+ '</a>'
|
||||
: '<iframe src="' + formatURL()
|
||||
+ '" width="' + $input.width.value()
|
||||
|
|
@ -227,15 +256,7 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) {
|
|||
function formatURL() {
|
||||
var type = $input.type.value(),
|
||||
view = $list.options('selected')[0],
|
||||
data = Ox.map($input, function($element, key) {
|
||||
return Ox.contains(Ox.getObjectById(views, view).inputs, key)
|
||||
&& (
|
||||
!Ox.contains(['map', 'calendar'], view)
|
||||
|| ($input.mapMode.value() == 'item' && key != 'find')
|
||||
|| ($input.mapMode.value() == 'find' && key != 'item')
|
||||
)
|
||||
&& $element.value ? $element.value() : void 0;
|
||||
}),
|
||||
data = getData(),
|
||||
options = Ox.serialize({
|
||||
title: data.title || void 0,
|
||||
showTimeline: data.showTimeline || void 0,
|
||||
|
|
|
|||
|
|
@ -938,6 +938,18 @@ pandora.ui.mainMenu = function() {
|
|||
key_control_p: function() {
|
||||
window.open(document.location.href + '#?print=true', '_blank');
|
||||
},
|
||||
key_control_e: function() {
|
||||
if (
|
||||
!pandora.hasDialogOrScreen() &&
|
||||
pandora.enableBatchEdit(ui.section)
|
||||
) {
|
||||
if (ui.section == 'documents') {
|
||||
pandora.ui.editDocumentsDialog().open();
|
||||
} else {
|
||||
pandora.ui.editDialog().open();
|
||||
}
|
||||
}
|
||||
},
|
||||
key_control_shift_e: function() {
|
||||
if (
|
||||
!pandora.hasDialogOrScreen() &&
|
||||
|
|
@ -1167,7 +1179,7 @@ pandora.ui.mainMenu = function() {
|
|||
return { id: 'itemMenu', title: Ox._('Item'), items: [
|
||||
{ id: 'add', title: Ox._('Add {0}...', [Ox._('Document')]), disabled: !pandora.hasCapability('canAddItems') },
|
||||
{ id: 'edit', title: Ox._('Edit {0}...', [Ox._('Document')]), disabled: true /*fixme: !canEdit */ },
|
||||
{ id: 'batchedit', title: Ox._('Batch Edit {0}...', [Ox._('Documents')]), disabled: !pandora.enableBatchEdit(ui.section), keyboard: 'shift control e' },
|
||||
{ id: 'batchedit', title: Ox._('Batch Edit {0}...', [Ox._('Documents')]), disabled: !pandora.enableBatchEdit(ui.section), keyboard: 'control e' },
|
||||
{},
|
||||
{ id: 'selectall', title: Ox._('Select All {0}', [listItemsName]), disabled: !canSelect, keyboard: 'control a' },
|
||||
{ id: 'selectnone', title: Ox._('Select None'), disabled: !canSelect, keyboard: 'shift control a' },
|
||||
|
|
|
|||
|
|
@ -312,7 +312,10 @@ if __name__ == "__main__":
|
|||
run('./manage.py', 'compile_pyc', '-p', '.')
|
||||
os.chdir(join(base, 'pandora'))
|
||||
diff = get('./manage.py', 'sqldiff', '-a').strip()
|
||||
if diff != '-- No differences':
|
||||
if diff not in [
|
||||
'-- No differences',
|
||||
'BEGIN;\n-- Model missing for table: cache\nCOMMIT;'
|
||||
]:
|
||||
print('Database has changed, please make a backup and run %s db' % sys.argv[0])
|
||||
elif not development:
|
||||
print('pan.do/ra is at the latest release,\nyou can run "%s dev" to update to the development version' % sys.argv[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue