-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ad0e492
commit d30ed09
Showing
3 changed files
with
77 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import View from '../core/view'; | ||
import { source, item as itemNs } from '../jsonld/ns'; | ||
import { Namespace } from '../jsonld/vocabulary'; | ||
import ldChannel from '../jsonld/radio'; | ||
import Node from '../jsonld/node'; | ||
import Controller from './explorer-event-controller'; | ||
|
||
function obtainer<T extends readonly string[]>(namespace: Namespace<T>) { | ||
return function(serial: string) { | ||
return ldChannel.request('obtain', namespace(serial)); | ||
} | ||
} | ||
|
||
export const getSource = obtainer(source); | ||
export const getItem = obtainer(itemNs); | ||
|
||
export function sourceWithoutAnnotations(control: Controller, node: Node) { | ||
return control.resetSource(node, false); | ||
} | ||
|
||
export function sourceWithAnnotations(control: Controller, node: Node) { | ||
return control.resetSourcePair(node); | ||
} | ||
|
||
export function item(control: Controller, node: Node) { | ||
return control.resetItem(node); | ||
} | ||
|
||
export function itemInEditMode(control: Controller, node: Node) { | ||
return control.editAnnotation(item(control, node), node); | ||
} | ||
|
||
export function itemWithRelations(control: Controller, node: Node) { | ||
return control.listRelated(item(control, node), node); | ||
} | ||
|
||
export function itemWithEditRelations(control: Controller, node: Node) { | ||
return control.editRelated(itemWithRelations(control, node), node); | ||
} | ||
|
||
export function itemWithExternal(control: Controller, node: Node) { | ||
return control.listExternal(item(control, node), node); | ||
} | ||
|
||
export function itemWithEditExternal(control: Controller, node: Node) { | ||
return control.editExternal(itemWithExternal(control, node)); | ||
} | ||
|
||
export function itemWithOccurrences(control: Controller, node: Node) { | ||
// listItemAnnotations does not return the created panel | ||
// see #342 | ||
control.listItemAnnotations(item(control, node), node); | ||
} |
This file was deleted.
Oops, something went wrong.