implement 'view annotations at position / in selection / all'
This commit is contained in:
parent
9cc90ec245
commit
5f14ef0e4b
3 changed files with 68 additions and 24 deletions
|
@ -16,6 +16,7 @@
|
||||||
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
||||||
"canDeleteItems": {"admin": true},
|
"canDeleteItems": {"admin": true},
|
||||||
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
||||||
|
"canEditAnnotations": {"staff": true, "admin": true},
|
||||||
"canEditFeaturedLists": {"staff": true, "admin": true},
|
"canEditFeaturedLists": {"staff": true, "admin": true},
|
||||||
"canEditMetadata": {"staff": true, "admin": true},
|
"canEditMetadata": {"staff": true, "admin": true},
|
||||||
"canEditSitePages": {"staff": true, "admin": true},
|
"canEditSitePages": {"staff": true, "admin": true},
|
||||||
|
@ -496,25 +497,30 @@
|
||||||
{
|
{
|
||||||
"id": "privatenotes",
|
"id": "privatenotes",
|
||||||
"title": "Private Notes",
|
"title": "Private Notes",
|
||||||
"type": "text",
|
"canAddAnnotations": {"member": true, "friend": true, "staff": true, "admin": true},
|
||||||
"overlap": true,
|
"overlap": true,
|
||||||
"private": true
|
"private": true,
|
||||||
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "publicnotes",
|
"id": "publicnotes",
|
||||||
"title": "Public Notes",
|
"title": "Public Notes",
|
||||||
|
"canAddAnnotations": {"member": true, "friend": true, "staff": true, "admin": true},
|
||||||
"overlap": true,
|
"overlap": true,
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "subtitles",
|
"id": "subtitles",
|
||||||
"title": "Subtitles",
|
"title": "Subtitles",
|
||||||
"type": "text",
|
"canAddAnnotations": {"staff": true, "admin": true},
|
||||||
|
"hasEvents": true,
|
||||||
|
"hasPlaces": true,
|
||||||
"overlay": true,
|
"overlay": true,
|
||||||
"sort": [
|
"sort": [
|
||||||
{"id": "words", "title": "Words", "type": "words"},
|
{"id": "words", "title": "Words", "type": "words"},
|
||||||
{"id": "wordsperminute", "title": "Words per Minute", "type": "wordsperminute"}
|
{"id": "wordsperminute", "title": "Words per Minute", "type": "wordsperminute"}
|
||||||
]
|
],
|
||||||
|
"type": "text"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"listViews": [
|
"listViews": [
|
||||||
|
@ -588,6 +594,8 @@
|
||||||
"level": "guest",
|
"level": "guest",
|
||||||
"newsletter": true,
|
"newsletter": true,
|
||||||
"ui": {
|
"ui": {
|
||||||
|
"annotationsFont": "small",
|
||||||
|
"annotationsRange": "all",
|
||||||
"annotationsSize": 256,
|
"annotationsSize": 256,
|
||||||
"clipsColumns": 2,
|
"clipsColumns": 2,
|
||||||
"columns": {
|
"columns": {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
||||||
"canDeleteItems": {"admin": true},
|
"canDeleteItems": {"admin": true},
|
||||||
"canDownloadVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
"canDownloadVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||||
|
"canEditAnnotations": {"staff": true, "admin": true},
|
||||||
"canEditFeaturedLists": {"staff": true, "admin": true},
|
"canEditFeaturedLists": {"staff": true, "admin": true},
|
||||||
"canEditMetadata": {"staff": true, "admin": true},
|
"canEditMetadata": {"staff": true, "admin": true},
|
||||||
"canEditSitePages": {"staff": true, "admin": true},
|
"canEditSitePages": {"staff": true, "admin": true},
|
||||||
|
@ -317,9 +318,9 @@
|
||||||
"id": "size",
|
"id": "size",
|
||||||
"title": "Size",
|
"title": "Size",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"capability": "canSeeFiles",
|
||||||
"columnWidth": 60,
|
"columnWidth": 60,
|
||||||
"format": {"type": "value", "args": ["B"]},
|
"format": {"type": "value", "args": ["B"]}
|
||||||
"rightsLevel": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bitrate",
|
"id": "bitrate",
|
||||||
|
@ -332,16 +333,16 @@
|
||||||
"id": "numberoffiles",
|
"id": "numberoffiles",
|
||||||
"title": "Number of Files",
|
"title": "Number of Files",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"capability": "canSeeFiles",
|
||||||
"columnWidth": 60,
|
"columnWidth": 60,
|
||||||
"value": {"key": "files", "type": "length"},
|
"value": {"key": "files", "type": "length"}
|
||||||
"rightsLevel": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "filename",
|
"id": "filename",
|
||||||
"title": "Filename",
|
"title": "Filename",
|
||||||
"type": ["string"],
|
"type": ["string"],
|
||||||
"find": true,
|
"capability": "canSeeFiles",
|
||||||
"rightsLevel": 1
|
"find": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "modified",
|
"id": "modified",
|
||||||
|
@ -391,26 +392,37 @@
|
||||||
{
|
{
|
||||||
"id": "places",
|
"id": "places",
|
||||||
"title": "Places",
|
"title": "Places",
|
||||||
"type": "place",
|
"canAddAnnotations": {"member": true, "staff": true, "admin": true},
|
||||||
"overlap": true
|
"overlap": true,
|
||||||
|
"type": "place"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "events",
|
||||||
|
"title": "Events",
|
||||||
|
"canAddAnnotations": {"member": true, "staff": true, "admin": true},
|
||||||
|
"overlap": true,
|
||||||
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "keywords",
|
"id": "keywords",
|
||||||
"title": "Keywords",
|
"title": "Keywords",
|
||||||
|
"canAddAnnotations": {"member": true, "staff": true, "admin": true},
|
||||||
"overlap": true,
|
"overlap": true,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "descriptions",
|
"id": "descriptions",
|
||||||
"title": "Descriptions",
|
"title": "Descriptions",
|
||||||
"type": "text",
|
"canAddAnnotations": {"member": true, "staff": true, "admin": true},
|
||||||
"overlay": true
|
"overlay": true,
|
||||||
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "transcripts",
|
"id": "transcripts",
|
||||||
"title": "Transcripts",
|
"title": "Transcripts",
|
||||||
"type": "text",
|
"canAddAnnotations": {"member": true, "staff": true, "admin": true},
|
||||||
"overlay": true
|
"overlay": true,
|
||||||
|
"type": "text"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"listViews": [
|
"listViews": [
|
||||||
|
@ -477,6 +489,8 @@
|
||||||
"user": {
|
"user": {
|
||||||
"level": "guest",
|
"level": "guest",
|
||||||
"ui": {
|
"ui": {
|
||||||
|
"annotationsFont": "small",
|
||||||
|
"annotationsRange": "all",
|
||||||
"annotationsSize": 256,
|
"annotationsSize": 256,
|
||||||
"clipsColumns": 2,
|
"clipsColumns": 2,
|
||||||
"columns": {
|
"columns": {
|
||||||
|
|
|
@ -194,6 +194,8 @@ pandora.ui.item = function() {
|
||||||
} else if (pandora.user.ui.itemView == 'timeline') {
|
} else if (pandora.user.ui.itemView == 'timeline') {
|
||||||
pandora.$ui.contentPanel.replaceElement(1,
|
pandora.$ui.contentPanel.replaceElement(1,
|
||||||
pandora.$ui.editor = Ox.VideoEditor({
|
pandora.$ui.editor = Ox.VideoEditor({
|
||||||
|
annotationsFont: pandora.user.ui.annotationsFont,
|
||||||
|
annotationsRange: pandora.user.ui.annotationsRange,
|
||||||
annotationsSize: pandora.user.ui.annotationsSize,
|
annotationsSize: pandora.user.ui.annotationsSize,
|
||||||
censored: videoOptions.censored,
|
censored: videoOptions.censored,
|
||||||
cuts: result.data.cuts || [],
|
cuts: result.data.cuts || [],
|
||||||
|
@ -213,7 +215,11 @@ pandora.ui.item = function() {
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
id: 'editor',
|
id: 'editor',
|
||||||
'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'],
|
'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'],
|
||||||
layers: videoOptions.layers,
|
layers: videoOptions.layers.map(function(layer) {
|
||||||
|
return Ox.extend({
|
||||||
|
editable: layer.canAddAnnotations[pandora.user.level]
|
||||||
|
}, layer);
|
||||||
|
}),
|
||||||
muted: pandora.user.ui.videoMuted,
|
muted: pandora.user.ui.videoMuted,
|
||||||
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
||||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
||||||
|
@ -229,6 +235,15 @@ pandora.ui.item = function() {
|
||||||
volume: pandora.user.ui.videoVolume,
|
volume: pandora.user.ui.videoVolume,
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
|
annotationsFont: function(data) {
|
||||||
|
pandora.UI.set({annotationsFont: data.font});
|
||||||
|
},
|
||||||
|
annotationsRange: function(data) {
|
||||||
|
pandora.UI.set({annotationsRange: data.range});
|
||||||
|
},
|
||||||
|
annotationsSize: function(data) {
|
||||||
|
pandora.UI.set({annotationsSize: data.size});
|
||||||
|
},
|
||||||
find: function(data) {
|
find: function(data) {
|
||||||
pandora.UI.set('itemFind', data.find ? {
|
pandora.UI.set('itemFind', data.find ? {
|
||||||
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
conditions: [{key: 'subtitles', value: data.find, operator: '='}],
|
||||||
|
@ -256,9 +271,6 @@ pandora.ui.item = function() {
|
||||||
height: data.size
|
height: data.size
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
resizeend: function(data) {
|
|
||||||
pandora.UI.set({annotationsSize: data.size});
|
|
||||||
},
|
|
||||||
resolution: function(data) {
|
resolution: function(data) {
|
||||||
pandora.UI.set('videoResolution', data.resolution);
|
pandora.UI.set('videoResolution', data.resolution);
|
||||||
},
|
},
|
||||||
|
@ -270,9 +282,13 @@ pandora.ui.item = function() {
|
||||||
},
|
},
|
||||||
addannotation: function(data) {
|
addannotation: function(data) {
|
||||||
Ox.Log('', 'addAnnotation', data);
|
Ox.Log('', 'addAnnotation', data);
|
||||||
data.item = pandora.user.ui.item;
|
pandora.api.addAnnotation({
|
||||||
data.value = 'Click to edit';
|
'in': data['in'],
|
||||||
pandora.api.addAnnotation(data, function(result) {
|
item: pandora.user.ui.item,
|
||||||
|
layer: data.layer,
|
||||||
|
out: data.out,
|
||||||
|
value: 'Click to edit',
|
||||||
|
}, function(result) {
|
||||||
pandora.$ui.editor.addAnnotation(data.layer, result.data);
|
pandora.$ui.editor.addAnnotation(data.layer, result.data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -286,8 +302,14 @@ pandora.ui.item = function() {
|
||||||
pandora.UI.set('showAnnotations', data.showAnnotations);
|
pandora.UI.set('showAnnotations', data.showAnnotations);
|
||||||
},
|
},
|
||||||
updateannotation: function(data) {
|
updateannotation: function(data) {
|
||||||
|
Ox.Log('', 'editAnnotations', data);
|
||||||
//fixme: check that edit was successfull
|
//fixme: check that edit was successfull
|
||||||
pandora.api.editAnnotation(data, function(result) {
|
pandora.api.editAnnotation({
|
||||||
|
id: data.id,
|
||||||
|
'in': data['in'],
|
||||||
|
out: data.out,
|
||||||
|
value: data.value,
|
||||||
|
}, function(result) {
|
||||||
Ox.Log('', 'done updateAnnotation', result);
|
Ox.Log('', 'done updateAnnotation', result);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue