Commit b8ff13eb authored by Lukas Haemmerle's avatar Lukas Haemmerle
Browse files

Merge branch 'gip-renater/SWITCHwayf-renater/master'

parents 2196f58e 31524b60
......@@ -66,6 +66,7 @@
// Enabling this will use JavaScript to convert the select element containing
// all Identity Providers to a searchable search-as-you-type list that also
// displays logos if available
// Please note that select2 activation superseeds improveDropDown activation
//$useImprovedDropDownList = true;
// If true the improved drop-down-list will not display logos that
......
......@@ -11,14 +11,15 @@
$topLevelDir = dirname(__DIR__);
if (isset($_SERVER{'SWITCHWAYF_CONFIG'})) {
require_once($_SERVER{'SWITCHWAYF_CONFIG'});
if (isset($_SERVER['SWITCHWAYF_CONFIG'])) {
require_once($_SERVER['SWITCHWAYF_CONFIG']);
} else {
require_once($topLevelDir . '/etc/config.php');
}
require_once($topLevelDir . '/lib/languages.php');
require_once($topLevelDir . '/lib/functions.php');
require_once($topLevelDir . '/lib/templates.php');
require_once($topLevelDir . '/lib/idpApiObjects.php');
// Set default config options
initConfigOptions();
......@@ -33,8 +34,8 @@ if (file_exists($topLevelDir . '/lib/custom-languages.php')) {
/*------------------------------------------------*/
if ($developmentMode) {
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');
ini_set('log_erros', 'Off');
ini_set('display_errors', 'Off');
ini_set('log_errors', 'On');
} else {
error_reporting(0);
}
......@@ -91,3 +92,28 @@ if (isset($_COOKIE[$SAMLDomainCookieName])) {
} else {
$IDPArray = array();
}
/*------------------------------------------------*/
// Initialize IdpRepository (for API)
/*------------------------------------------------*/
if (array_key_exists("idpCookie", $_GET)) {
// Small tweaks, because for unknown reason, the cookie value provided in GET
// param is not formatted as in regular cookie.
$idpCookie = str_replace(
array("%3D", "%2B", "+"),
array("=", " ", " "),
$_GET["idpCookie"]
);
$IDPArray = getIdPArrayFromValue($idpCookie);
}
$idpRepository = new IdpRepository($IDProviders, $IDPArray);
/*------------------------------------------------*/
// Set CORS
/*------------------------------------------------*/
global $allowedCORSDomain;
header('Access-Control-Allow-Origin: '.$allowedCORSDomain);
......@@ -144,16 +144,10 @@ var wayf_return_url = "https://my-app.switch.ch/aai/index.php?page=show_welcome"
// which might be loaded from a remote domain. While generally not especially
// dangerous, there is always a risk when loading content (in this case
// images) from third party hosts.
// Please note that select2 activation superseeds improveDropDown activation
// [Optional, default: false]
// var wayf_use_improved_drop_down_list = false;
// Whether or not use Select2 drop down
// Attention: setting this to true, overrides $useImprovedDropDownList param
// For this to fully work, one must also add useSelect2 query Param to the
// embedded-wayf.js script loading URL.
// Page size is contrrolled by WAYF server directly.
// var wayf_use_select2 = false;
// If true the improved drop-down-list will not display IdP logos that
// have to be loaded from remote URLs. That way the web browser
// does not have to make requests to third party hosts.
......@@ -336,7 +330,8 @@ var wayf_return_url = "https://my-app.switch.ch/aai/index.php?page=show_welcome"
//-->
</script>
<!-- To fully enable select2, one have to add useSelect2 query param: -->
<!-- To fully enable select2, one have to add useSelect2 query param: -->
<!-- <script type="text/javascript" src="https://<?php echo $host ?><?php echo $path ?>/embedded-wayf.js?useSelect2=true"></script> -->
<script type="text/javascript" src="https://<?php echo $host ?><?php echo $path ?>/embedded-wayf.js"></script>
......
......@@ -15,7 +15,7 @@
<?php
if (isUseSelect2()) {
echo '<link rel="stylesheet" href="'. $_SERVER['SCRIPT_NAME'] .'/select2.css" type="text/css" >'.PHP_EOL;
echo '<link rel="stylesheet" href="'. $_SERVER['SCRIPT_NAME'] .'/select2.min.css" type="text/css" >'.PHP_EOL;
// Version of select2 : 4.0.6-rc.0
// Availability https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js
// Languages available at https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/i18n/<2letterCode>.js
......@@ -111,8 +111,23 @@
escapeMarkup: function (text) { return text; }
});
// Auto-submit when an idp is selected
$('.userIdPSelection').on('select2:select', function (e) {
document.getElementById("IdPList").submit();
// $('.userIdPSelection').on('select2:select', function (e) {
// document.getElementById("IdPList").submit();
// });
// Preselect last used IdP
// Fetch the preselected item, and add to the control
var idpSelect = $('.userIdPSelection');
$.ajax({
type: 'GET',
url: <?php echo "'".$apiURL."/idps?lastIdp'" ?>,
}).then(function (data) {
// create the option and append to Select2
// in order ot pass all info from data, we pass it in JSON String as
// text, ans select2Functions will build it back
if(data.id != null) {
var option = new Option(JSON.stringify(data), data.id, true, true);
idpSelect.append(option).trigger('change');
}
});
<?php
} elseif ($bodyType == "notice" && $permanentUserIdP != '') {
......
......@@ -963,17 +963,19 @@ function convertToShibDSStructure($IDProviders)
// Sorts the IDProviders array
function sortIdentityProviders(&$IDProviders)
{
global $language;
$orderedCategories = array();
// Create array with categories and IdPs in categories
$unknownCategory = array();
foreach ($IDProviders as $entityId => $IDProvider) {
// Add categories
if ($IDProvider['Type'] == 'category') {
if (isset($IDProvider['Type']) && $IDProvider['Type'] == 'category') {
$orderedCategories[$entityId]['data'] = $IDProvider;
}
}
// Add category 'unknown' if not present
if (!isset($orderedCategories['unknown'])) {
$orderedCategories['unknown']['data'] = array(
......@@ -985,7 +987,7 @@ function sortIdentityProviders(&$IDProviders)
foreach ($IDProviders as $entityId => $IDProvider) {
// Skip categories
if ($IDProvider['Type'] == 'category') {
if (isset($IDProvider['Type']) && $IDProvider['Type'] == 'category') {
continue;
}
......@@ -1001,6 +1003,16 @@ function sortIdentityProviders(&$IDProviders)
// Add IdP
$orderedCategories[$IDProvider['Type']]['IdPs'][$entityId] = $IDProvider;
if (isset($IDProvider['Type'])) {
$orderedCategories[$IDProvider['Type']]['IdPs'][$entityId]['TypeForSort'] = removeAccents($IDProvider['Type']);
}
if (isset($IDProvider['Index'])) {
$orderedCategories[$IDProvider['Type']]['IdPs'][$entityId]['IndexForSort'] = removeAccents($IDProvider['Index']);
}
$localName = (isset($IDProvider[$language]['Name'])) ? $IDProvider[$language]['Name'] : $IDProvider['Name'];
$orderedCategories[$IDProvider['Type']]['IdPs'][$entityId]['NameForSort'] = removeAccents($localName);
}
// Relocate all IdPs for which no category with a name was defined
......@@ -1047,15 +1059,13 @@ function sortUsingTypeIndexAndName($a, $b)
{
global $language;
if ($a['Type'] != $b['Type']) {
return strcasecmp(removeAccents($a['Type']), removeAccents($b['Type']));
} elseif (isset($a['Index']) && isset($b['Index']) && $a['Index'] != $b['Index']) {
return strcasecmp(removeAccents($a['Index']), removeAccents($b['Index']));
if (isset($a['TypeForSort']) && isset($b['TypeForSort']) && $a['TypeForSort'] != $b['TypeForSort']) {
return strcasecmp($a['TypeForSort'], $b['TypeForSort']);
} elseif (isset($a['IndexForSort']) && isset($b['IndexForSort']) && $a['IndexForSort'] != $b['IndexForSort']) {
return strcasecmp($a['IndexForSort'], $b['IndexForSort']);
} else {
// Sort using locale names
$localNameB = (isset($a[$language]['Name'])) ? $a[$language]['Name'] : $a['Name'];
$localNameA = (isset($b[$language]['Name'])) ? $b[$language]['Name'] : $b['Name'];
return strcasecmp(removeAccents($localNameB), removeAccents($localNameA));
return strcasecmp($a['NameForSort'], $b['NameForSort']);
}
}
......@@ -1063,6 +1073,7 @@ function sortUsingTypeIndexAndName($a, $b)
// Return given Strring without accents
function removeAccents($string)
{
$accents = array("À","Á","Â","Ã","Ä","Å","à","á","â","ã","ä","å","Ò","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","È","É","Ê","Ë","è","é","ê","ë","Ç","ç","Ì","Í","Î","Ï","ì","í","î","ï","Ù","Ú","Û","Ü","ù","ú","û","ü","ÿ","Ñ","ñ");
$nonAccents = array("a","a","a","a","a","a","a","a","a","a","a","a","o","o","o","o","o","o","o","o","o","o","o","o","e","e","e","e","e","e","e","e","c","c","i","i","i","i","i","i","i","i","u","u","u","u","u","u","u","u","y","n","n");
return str_replace(
......@@ -1152,11 +1163,22 @@ function isUseSelect2()
{
global $useSelect2;
if (!isset($_GET["useSelect2"])) {
return $useSelect2;
if (isRequestType('embedded-wayf.js')) {
if (isset($_GET["useSelect2"])) {
return $_GET["useSelect2"] == "true";
}
return false;
}
return $_GET["useSelect2"];
return $useSelect2;
}
function isUseSelect2Str()
{
if (isUseSelect2()) {
return "true";
}
return "false";
}
function getSelect2PageSize()
......
......@@ -7,25 +7,25 @@
$topLevelDir = dirname(__DIR__);
require_once($topLevelDir . '/lib/functions.php');
require('common.php');
require('idpApiObjects.php');
header('Content-Type: application/json');
global $allowedCORSDomain;
header('Access-Control-Allow-Origin: '.$allowedCORSDomain);
$repo = new IdpRepository($IDProviders, $IDPArray);
global $idpRepository;
if (array_key_exists("page", $_GET)) {
if (array_key_exists("search", $_GET)) {
//error_log("Search with request ".$_GET["search"]);
echo $repo->toJsonByQuery($_GET["search"], $_GET["page"], getSelect2PageSize());
echo $idpRepository->toJsonByQuery($_GET["search"], $_GET["page"], getSelect2PageSize());
} else {
//error_log("Search page ".$_GET["page"]);
echo $repo->toJsonByPage($_GET["page"], getSelect2PageSize());
echo $idpRepository->toJsonByPage($_GET["page"], getSelect2PageSize());
}
} elseif (array_key_exists("lastIdp", $_GET)) {
// Provide lastUsedIdp
echo $idpRepository->getLastUsedIdpJson();
} else {
echo $repo->toJson();
echo $idpRepository->toJson();
}
......@@ -115,12 +115,18 @@ final class IdpRepository
{
// The idps in the form of IdpObject
public $idpObjects = array();
public $lastIdps = array();
public $categories = array();
public function __construct(array $IDProviders = array(), array $previouslySelectedIdps = null)
{
global $showNumOfPreviouslyUsedIdPs;
$this->categories['last_used'] = array(
'Name' => getLocalString('last_used'),
);
if (isset($previouslySelectedIdps) && count($previouslySelectedIdps) > 0) {
$counter = (isset($showNumOfPreviouslyUsedIdPs)) ? $showNumOfPreviouslyUsedIdPs : 3;
for ($n = count($previouslySelectedIdps) - 1; $n >= 0; $n--) {
......@@ -128,13 +134,14 @@ final class IdpRepository
break;
}
$selIdp = $previouslySelectedIdps[$n];
$selIdp = $previouslySelectedIdps[$n];
if (isset($IDProviders[$selIdp])) {
$idp = new IdpObject($selIdp, $IDProviders[$selIdp]);
$idp->type = getLocalString('last_used');
$idp->type = 'last_used';
$this->idpObjects[] = $idp;
$this->lastIdps[] = $idp;
$counter--;
}
}
......@@ -143,7 +150,8 @@ final class IdpRepository
foreach ($IDProviders as $key => $value) {
// Skip categories
if ($value['Type'] == 'category') {
if (isset($value['Type']) && $value['Type'] == 'category') {
$this->categories[$key] = $value;
continue;
}
......@@ -152,6 +160,14 @@ final class IdpRepository
continue;
}
// Remove the following keys from $value:
// NameForSort
// IndexForSort
// TypeForSort
unset($value['NameForSort']);
unset($value['IndexForSort']);
unset($value['TypeForSort']);
$idp = new IdpObject($key, $value);
$this->idpObjects[] = $idp;
}
......@@ -177,7 +193,8 @@ final class IdpRepository
if (!isset($tmp[$type])) {
$group = new IdpGroup();
$group->text = $type;
// $group->text = $type;
$group->text = $this->categories[$type]['Name'];
$tmp[$type] = $group;
$group->hide = $hideFirstGroup && ($type == $firstGroupName);
}
......@@ -224,12 +241,10 @@ final class IdpRepository
$lastPageLastGroup = $this->idpObjects[$pageNumber * $pageSize - 1]->type;
$thisPageFirstGroup = $this->idpObjects[$pageNumber * $pageSize]->type;
$hideFirstGroup = ($lastPageLastGroup == $thisPageFirstGroup);
// logInfo(sprintf("lastPageLastGroup = %s / thisPageFirstGroup = %s", $lastPageLastGroup, $thisPageFirstGroup));
}
// logInfo(sprintf("hideFirstGroup = %s", $hideFirstGroup?"true":"false"));
$result{"results"} = $this->toGroups($idpPage, $hideFirstGroup);
$result{"pagination"}{"more"} = (($pageNumber + 1)*$pageSize <= sizeof($array));
$result{"pagination"}{"more"} = ($pageNumber * $pageSize < sizeof($array));
return json_encode($result, JSON_UNESCAPED_SLASHES);
}
......@@ -248,7 +263,6 @@ final class IdpRepository
array_filter(
$this->idpObjects,
function ($value) use ($query) {
// logDebug(sprintf("Data(%s) = %s", $value->id, $value->getDataForSearch()));
return (
fnmatch("*".removeAccents($query)."*", removeAccents($value->name), FNM_CASEFOLD)
|| fnmatch("*".removeAccents($query)."*", removeAccents($value->text), FNM_CASEFOLD)
......@@ -260,4 +274,17 @@ final class IdpRepository
$pageSize
);
}
public function getLastUsedIdpJson()
{
return json_encode($this->getLastUsedIdp());
}
public function getLastUsedIdp()
{
if (sizeof($this->lastIdps) > 0) {
return $this->lastIdps[0];
}
return "";
}
}
......@@ -26,11 +26,8 @@ function printHeader($bodyType)
global $federationURL, $organizationURL, $faqURL, $helpURL, $privacyURL;
global $customStrings;
global $developmentMode, $apiURL;
global $permanentUserIdP, $permanentUserIdPName, $permanentUserIdPLogo;
global $IDProviders;
$permanentUserIdP = getPermanentUserIdp();
include(get_template('header.php'));
}
......@@ -278,7 +275,6 @@ function getPermanentUserIdp()
function printFooter()
{
global $customStrings;
include(get_template('footer.php'));
}
......@@ -426,7 +422,7 @@ function printCSS($file)
{
global $imageURL;
if ($file != 'ImprovedDropDown.css' && $file != 'select2.css') {
if ($file != 'ImprovedDropDown.css' && $file != 'select2.css' && $file != 'select2.min.css') {
$file= 'styles.css';
}
......
This diff is collapsed.
<?php // Copyright (c) 2019 Geoffroy Arnoud, Guillaume Rousse, and SWITCHwayf contributors
use PHPUnit\Framework\TestCase;
require("../lib/idpApiObjects.php");
require("../lib/readMetadata.php");
function time_elapsed($message)
{
static $last = null;
$now = microtime(true);
if ($last != null) {
printf("%s => %f\n", $message, $now - $last);
}
$last = $now;
}
final class IdpApiTest extends TestCase
{
public function testSort()
{
$customStrings = array(
'federationName' => 'Fédération eduGAIN',
'providersIdPId' => 'https://dev-idp-fournisseurs.renater.fr/idp/shibboleth',
'supdataIdPId' => 'https://dev-idp-supdata.renater.fr/idp/shibboleth'
);
time_elapsed("[Sort] Init");
$IDProviders = array();
$IDProviders['unknown'] = array (
'Name' => $customStrings['federationName'],
'Type' => 'category'
);
$IDProviders['external'] = array (
'Name' => getLocalString('external'),
'Type' => 'category'
);
$language="fr";
require("edugain-IDProvider.metadata.php");
$IDProviders = mergeInfo($IDProviders, $metadataIDProviders, true, true);
time_elapsed("[Sort] doSort");
sortIdentityProviders($IDProviders);
time_elapsed("[Sort] endSort");
$repo = new IdpRepository($metadataIDProviders);
time_elapsed("[GetFirstPage] Creating repository");
}
// public function testGetFirstPage()
// {
// time_elapsed("[GetFirstPage] init");
//
// require("edugain-IDProvider.metadata.php");
//
// time_elapsed("[GetFirstPage] Loading eduGain IDP");
//
// $repo = new IdpRepository($metadataIDProviders);
//
// time_elapsed("[GetFirstPage] Creating repository");
//
// file_put_contents("/tmp/eduGainFirstPage.json", $repo->toJsonByPage(1, 100));
//
// time_elapsed("[GetFirstPage] Putting 1st page to a file");
// }
//
//
// public function testQuery()
// {
// time_elapsed("[Query] init");
// global $IDProviders;
//
//
// require("edugain-IDProvider.metadata.php");
//
// $IDProviders = $metadataIDProviders;
//
// time_elapsed("[Query] Loading eduGain IDP");
//
// $repo = new IdpRepository($metadataIDProviders);
//
// time_elapsed("[Query] Creating repository");
//
// file_put_contents(
// "/tmp/eduGainFirstPageQuery.json",
// $repo->toJsonByQuery("renater", 1, 100)
// );
//
// time_elapsed("[Query] Putting 1st page to a file");
// }
}
......@@ -365,16 +365,6 @@ if ($hintedCookieIdP != '-') {
$selectedIDP = '-';
}
// /*------------------------------------------------*/
// // Sort Identity Providers
// /*------------------------------------------------*/
//
// if ($useSAML2Metadata) {
// // Only automatically sort if list of Identity Provider is parsed
// // from metadata instead of being manualy managed
// sortIdentityProviders($IDProviders);
// }
/*------------------------------------------------*/
// Draw WAYF
/*------------------------------------------------*/
......@@ -469,6 +459,12 @@ if (
printCSS('select2.css');
exit;
} elseif (isRequestType('select2.min.css')) {
header('Content-Type: text/css');
printCSS('select2.min.css');
exit;
} elseif (isRequestType('snippet.html')) {
......
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
/*
* Styles for options appearance
*/
.select2-result-repository {
font-family: Verdana, sans-serif;
font-size: 10px;
/** text-align: left; */
padding-top: 0px;
padding-bottom: 0px
}
.select2-result-repository__logo {
float: left;
width: 16px;
margin-right: 5px
}
.select2-result-repository__logo img {
width: 100%;
height: auto;
border-radius: 0px
}
.select2-result-repository__title {
color: black;
/* font-weight:700;*/
word-wrap: break-word;
/* line-height:1.0; */
/* margin-bottom:4px */
}
This diff is collapsed.
/*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.