mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 08:43:31 +02:00
redefine selectize templates without escaping + translate "Add"
git-svn-id: http://piwigo.org/svn/trunk@28613 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -170,6 +170,23 @@
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// redefine Selectize templates without escape
|
||||
AbstractSelectizer.getRender = function(field_label, lang) {
|
||||
lang = lang || { 'Add': 'Add' };
|
||||
|
||||
return {
|
||||
'option': function(data, escape) {
|
||||
return '<div class="option">' + data[field_label] + '</div>';
|
||||
},
|
||||
'item': function(data, escape) {
|
||||
return '<div class="item">' + data[field_label] + '</div>';
|
||||
},
|
||||
'option_create': function(data, escape) {
|
||||
return '<div class="create">' + lang['Add'] + ' <strong>' + data.input + '</strong>…</div>';
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -206,7 +223,8 @@
|
||||
labelField: 'fullname',
|
||||
sortField: 'global_rank',
|
||||
searchField: ['fullname'],
|
||||
plugins: ['remove_button']
|
||||
plugins: ['remove_button'],
|
||||
render: AbstractSelectizer.getRender('fullname', options.lang)
|
||||
});
|
||||
|
||||
this._selectize($target, options);
|
||||
@@ -253,7 +271,8 @@
|
||||
labelField: 'name',
|
||||
sortField: 'name',
|
||||
searchField: ['name'],
|
||||
plugins: ['remove_button']
|
||||
plugins: ['remove_button'],
|
||||
render: AbstractSelectizer.getRender('name', options.lang)
|
||||
});
|
||||
|
||||
this._selectize($target, options);
|
||||
@@ -294,7 +313,8 @@
|
||||
labelField: 'name',
|
||||
sortField: 'name',
|
||||
searchField: ['name'],
|
||||
plugins: ['remove_button']
|
||||
plugins: ['remove_button'],
|
||||
render: AbstractSelectizer.getRender('name', options.lang)
|
||||
});
|
||||
|
||||
this._selectize($target, options);
|
||||
@@ -347,7 +367,8 @@
|
||||
labelField: 'username',
|
||||
sortField: 'username',
|
||||
searchField: ['username'],
|
||||
plugins: ['remove_button']
|
||||
plugins: ['remove_button'],
|
||||
render: AbstractSelectizer.getRender('username', options.lang)
|
||||
});
|
||||
|
||||
this._selectize($target, options);
|
||||
|
||||
@@ -74,7 +74,9 @@ jQuery(document).ready(function() {ldelim}
|
||||
rootUrl: '{$ROOT_URL}'
|
||||
});
|
||||
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'));
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'), { lang: {
|
||||
'Add': '{'Create'|translate}'
|
||||
}});
|
||||
|
||||
{* <!-- CATEGORIES --> *}
|
||||
var categoriesCache = new CategoriesCache({
|
||||
|
||||
@@ -16,7 +16,9 @@ var tagsCache = new TagsCache({
|
||||
rootUrl: '{$ROOT_URL}'
|
||||
});
|
||||
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'));
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'), { lang: {
|
||||
'Add': '{'Create'|translate}'
|
||||
}});
|
||||
|
||||
{* <!-- DATEPICKER --> *}
|
||||
jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *}
|
||||
|
||||
@@ -25,7 +25,9 @@ var tagsCache = new TagsCache({
|
||||
rootUrl: '{$ROOT_URL}'
|
||||
});
|
||||
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'));
|
||||
tagsCache.selectize(jQuery('[data-selectize=tags]'), { lang: {
|
||||
'Add': '{'Create'|translate}'
|
||||
}});
|
||||
|
||||
{* <!-- DATEPICKER --> *}
|
||||
jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *}
|
||||
|
||||
Reference in New Issue
Block a user