view src/main/webapp/annotationBrowser/js/annotation-core.js @ 105:7417f5915181 default tip

check admin permission before changing permissions. Enum for typesafe actions.
author casties
date Fri, 10 Feb 2017 15:45:35 +0100
parents 875a97f8b8da
children
line wrap: on
line source

var annotServer;
var viewerAddress;
var docNamespace;

var dcDataPath;
var textPath;

var tokenGenerator="";
var username="";
var token="";

function getToken(tokenGenerator,username){
	$.get(tokenGenerator+"?user="+username,function(data){
		
		token=data;
	});
}

function createLinkFromURI(uri){
    if (uri == null) return "";
	var docUri = uri.replace(docNamespace,viewerAddress);
	docUri = docUri.replace("?pn","&pn");
	return docUri;
}

function getDCdata(path,obj){
    if (path == null) return;
	var splitted = path.split("?");
	var docUri=splitted[0];
	
	docUri = docUri.replace(docNamespace,textPath);
	var md = dcDataPath+docUri+"/index.meta";
	
	 $('<div/>', {
		    'class': 'annotationMetaData',
		  }).load(md, function (){
			 $(this).children().children().addClass('dcMetaData');
		  }).appendTo(obj);
	
}

function tokenGeneratorInit(tok,un){
	tokenGenerator=tok;
	username=un;
}