Compare commits
3 commits
c87ea9a577
...
776ef3c6c6
| Author | SHA1 | Date | |
|---|---|---|---|
| 776ef3c6c6 | |||
| 541aa201bf | |||
| 110c0b252a |
4 changed files with 16 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(', ');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) ? '; ' : ', ');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue