entities are not links

This commit is contained in:
j 2015-04-16 20:03:38 +00:00
parent f624c86309
commit 4f7b9846d8
2 changed files with 17 additions and 5 deletions

View file

@ -218,7 +218,7 @@ Ox.AnnotationPanel = function(options, self) {
function renderEditMenu() { function renderEditMenu() {
var annotation, annotationTitle, folder, hasManualCalendarOrMap, var annotation, annotationTitle, folder, hasManualCalendarOrMap,
isDefined, isEditable, isEvent, isEventOrPlace, isPlace, isString, isDefined, isEditable, isEntity, isEvent, isEventOrPlace, isPlace, isString,
key, manageTitle, type, value; key, manageTitle, type, value;
if (self.options.selected) { if (self.options.selected) {
annotation = getAnnotation(self.options.selected); annotation = getAnnotation(self.options.selected);
@ -228,6 +228,7 @@ Ox.AnnotationPanel = function(options, self) {
type = folder.options('type'); type = folder.options('type');
value = annotation.entity ? annotation.entity.name : annotation.value; value = annotation.entity ? annotation.entity.name : annotation.value;
isEditable = annotation.editable; isEditable = annotation.editable;
isEntity = !!annotation.entity;
isEvent = type == 'event'; isEvent = type == 'event';
isPlace = type == 'place'; isPlace = type == 'place';
isEventOrPlace = isEvent || isPlace; isEventOrPlace = isEvent || isPlace;
@ -264,10 +265,16 @@ Ox.AnnotationPanel = function(options, self) {
] : [], ] : [],
isString ? [ isString ? [
{}, {},
{id: 'annotation', title: annotationTitle, disabled: true}, {id: 'annotation', title: annotationTitle, disabled: true}
{id: 'find', title: Ox._('Find in This {0}', [Ox.toTitleCase(self.options.itemName.singular)])}, ].concat(
{id: 'findannotations', title: Ox._('Find in All {0}', [Ox.toTitleCase(self.options.itemName.plural)])} isEntity ? [
] : [], {id: 'showentityinfo', title: Ox._('Show Entity Info')}
] : [],
[
{id: 'findannotations', title: Ox._('Find in All {0}', [Ox.toTitleCase(self.options.itemName.plural)])},
{id: 'find', title: Ox._('Find in This {0}', [Ox.toTitleCase(self.options.itemName.singular)])}
]
) : [],
[ [
{}, {},
{id: 'import', title: Ox._('Import Annotations...'), disabled: !self.options.enableImport}, {id: 'import', title: Ox._('Import Annotations...'), disabled: !self.options.enableImport},
@ -318,6 +325,8 @@ Ox.AnnotationPanel = function(options, self) {
}); });
} else if (data.id == 'save') { } else if (data.id == 'save') {
// ... // ...
} else if (data.id == 'showentityinfo') {
that.triggerEvent('showentityinfo', annotation.entity);
} else if (data.id == 'undo') { } else if (data.id == 'undo') {
// ... // ...
} }

View file

@ -894,6 +894,9 @@ Ox.VideoAnnotationPanel = function(options, self) {
select: function(data) { select: function(data) {
selectAnnotation(data, true); selectAnnotation(data, true);
}, },
showentityinfo: function(data) {
that.triggerEvent('showentityinfo', data);
},
submit: submitAnnotation, submit: submitAnnotation,
toggle: toggleAnnotations, toggle: toggleAnnotations,
togglecalendar: function(data) { togglecalendar: function(data) {