Skip to content

Instantly share code, notes, and snippets.

@rococodogs
Created June 28, 2018 13:34
Show Gist options
  • Save rococodogs/b6d6278e3b065162ebaef742dc0d236d to your computer and use it in GitHub Desktop.
Save rococodogs/b6d6278e3b065162ebaef742dc0d236d to your computer and use it in GitHub Desktop.
open a hyrax item in fedora (fcrepo)
(function () {
var url = new URL(window.location.href);
if (url.host.indexOf('localhost') == -1) {
return
}
var path = url.pathname;
if (path.indexOf('/concern/') != 0) {
return
}
var pieces = path.split('/');
var id = pieces[pieces.length - 1];
var id_path = (
'/' + id[0] + id[1] +
'/' + id[2] + id[3] +
'/' + id[4] + id[5] +
'/' + id[6] + id[7] +
'/' + id
);
var fedora_url = 'http://127.0.0.1:8984/rest/dev' + id_path;
window.open(fedora_url);
})()
(function(){var url=new URL(window.location.href);if(url.host.indexOf('localhost')==-1){return};var path=url.pathname;if(path.indexOf('/concern/')!=0){return};var pieces=path.split('/');var id=pieces[pieces.length-1];var id_path=('/'+id[0]+id[1]+'/'+id[2]+id[3]+'/'+id[4]+id[5]+'/'+id[6]+id[7]+'/'+id);var fedora_url='http://127.0.0.1:8984/rest/dev'+id_path;window.open(fedora_url)})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment