remove site.flags, add 'flag' item key property; update 0xDB config; update filter.js

This commit is contained in:
rolux 2014-12-22 10:43:23 +00:00
parent 6c6693e922
commit f3af1b70a0
3 changed files with 11 additions and 12 deletions

View File

@ -86,10 +86,6 @@
included in find annotations.
*/
"clipLayers": ["subtitles"],
/*
"flags" sets if in filters, countries and languages have a flag icon.
*/
"flags": true,
/*
"help" specifies the sections of the help dialog.
There isn't much of a point in making changes to this.
@ -177,6 +173,7 @@
"columnWidth": 120,
"filter": true,
"find": true,
"flag": "country",
"sort": true
},
{
@ -198,6 +195,7 @@
"columnWidth": 120,
"filter": true,
"find": true,
"flag": "language",
"sort": true
},
{

View File

@ -126,11 +126,6 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
}
],
/*
If "flags" is set to true, then filters for countries and languages will
appear with a flag icon.
*/
"flags": false,
/*
"help" specifies the sections of the help dialog.
*/
"help": [
@ -176,6 +171,8 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
this key can be added in list view.
"filter": If true, one can filter results by this key
"find": If true, this key will appear as an option in the find element
"flag": Can be "country" or "language". If set (and filter is true), a
flag icon corresponding to the field's value will be displayed.
"format": {type: string, args: [value, value, ...]}, used for special
formatting. This will invoke Ox.formatType(args). For details, see
https://oxjs.org/#doc/Ox.formatArea etc.
@ -263,6 +260,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
"columnWidth": 180,
"filter": true,
"find": true,
"flag": "country",
"sort": true
},
{

View File

@ -15,12 +15,14 @@ pandora.ui.filter = function(id) {
align: 'left',
id: 'name',
format: function(value) {
return pandora.site.flags && ['country', 'language'].indexOf(id) > -1
return filter.flag
? $('<div>')
.append(
$('<img>')
.attr({src: Ox[
id == 'country' ? 'getFlagByGeoname' : 'getFlagByLanguage'
filter.flag == 'country'
? 'getFlagByGeoname'
: 'getFlagByLanguage'
](value, 16)})
.css({
float: 'left',
@ -35,7 +37,8 @@ pandora.ui.filter = function(id) {
.addClass('flagname')
.css({
float: 'left',
width: pandora.user.ui.filterSizes[i] - 68 - Ox.UI.SCROLLBAR_SIZE,
width: pandora.user.ui.filterSizes[i]
- 68 - Ox.UI.SCROLLBAR_SIZE,
textOverflow: 'ellipsis',
overflowX: 'hidden'
})