Compare commits

...

3 commits

4 changed files with 16 additions and 2 deletions

View file

@ -75,6 +75,7 @@ def get_positions(ids, pos, decode_id=False):
if decode_id:
positions[i] = ids.index(ox.fromAZ(i))
else:
i = unicodedata.normalize('NFKD', i)
positions[i] = ids.index(i)
except:
pass

View file

@ -423,8 +423,10 @@ pandora.ui.documentInfoView = function(data, isMixed) {
function formatLink(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
var documentKey = Ox.getObjectById(pandora.site.documentKeys, key),
op = documentKey && documentKey.filter ? '==' : '=';
return key
? '<a href="/documents/' + key + '=' + pandora.escapeQueryValue(value) + '">' + value + '</a>'
? '<a href="/documents/' + key + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(value)) + '">' + value + '</a>'
: value;
}).join(', ');
}

View file

@ -528,10 +528,12 @@ pandora.ui.infoView = function(data, isMixed) {
linkValue = linkValue || value
linkValue = Ox.isArray(linkValue) ? linkValue: [linkValue]
return (Ox.isArray(value) ? value : [value]).map(function(value, idx) {
var itemKey = Ox.getObjectById(pandora.site.itemKeys, key),
op = itemKey && itemKey.filter ? '==' : '=';
return key
? '<a href="/' + (
key == 'alternativeTitles' ? 'title' : key
) + '=' + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
) + op + pandora.escapeQueryValue(Ox.decodeHTMLEntities(linkValue[idx])) + '">' + value + '</a>'
: value;
}).join(Ox.contains(specialListKeys, key) ? '; ' : ', ');
}

View file

@ -1654,6 +1654,11 @@ pandora.getItem = function(state, str, callback) {
}
});
} else if (state.type == 'documents') {
if (!pandora.isBase26(str)) {
state.item = '';
callback();
return
}
pandora.api.getDocument({
id: str,
// send keys so that subsequent request when parsing
@ -1702,6 +1707,10 @@ pandora.getItem = function(state, str, callback) {
}
};
pandora.isBase26 = function(value) {
return /^[A-Z]+$/.test(value)
};
pandora.getItemFind = function(find) {
var itemFind = '';
Ox.forEach(find.conditions, function(condition) {