*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -64,11 +65,66 @@ class Proposals extends DolibarrApi
*/
public function get($id, $contact_list = 1)
{
+ return $this->_fetch($id, '', '', '', $contact_list);
+ }
+
+ /**
+ * Get properties of an proposal object by ref
+ *
+ * Return an array with proposal informations
+ *
+ * @param string $ref Ref of object
+ * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
+ * @return array|mixed data without useless information
+ *
+ * @url GET ref/{ref}
+ *
+ * @throws RestException
+ */
+ public function getByRef($ref, $contact_list = 1)
+ {
+ return $this->_fetch('', $ref, '', '', $contact_list);
+ }
+
+ /**
+ * Get properties of an proposal object by ref_ext
+ *
+ * Return an array with proposal informations
+ *
+ * @param string $ref_ext External reference of object
+ * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
+ * @return array|mixed data without useless information
+ *
+ * @url GET ref_ext/{ref_ext}
+ *
+ * @throws RestException
+ */
+ public function getByRefExt($ref_ext, $contact_list = 1)
+ {
+ return $this->_fetch('', '', $ref_ext, '', $contact_list);
+ }
+
+ /**
+ * Get properties of an proposal object
+ *
+ * Return an array with proposal informations
+ *
+ * @param int $id ID of order
+ * @param string $ref Ref of object
+ * @param string $ref_ext External reference of object
+ * @param string $ref_int Internal reference of other objec
+ * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
+ * @return array|mixed data without useless information
+ *
+ * @throws RestException
+ */
+ private function _fetch($id, $ref = '', $ref_ext = '', $ref_int = '', $contact_list = 1)
+ {
if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401);
}
- $result = $this->propal->fetch($id);
+ $result = $this->propal->fetch($id, $ref, $ref_ext, $ref_int);
if( ! $result ) {
throw new RestException(404, 'Commercial Proposal not found');
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 3fa163594a2..59ca77e002e 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -223,6 +223,90 @@ class Propal extends CommonObject
public $oldcopy;
+
+ /**
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
+ * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
+ * 'label' the translation key.
+ * 'enabled' is a condition when the field must be managed.
+ * 'position' is the sort order of field.
+ * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'noteditable' says if field is not editable (1 or 0)
+ * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
+ * 'index' if we want an index in database.
+ * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
+ * 'help' is a string visible as a tooltip on field
+ * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
+ * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
+ * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ *
+ * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
+ */
+
+ // BEGIN MODULEBUILDER PROPERTIES
+ /**
+ * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ */
+ public $fields=array(
+ 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
+ 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
+ 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
+ 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1),
+ 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>40),
+ 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
+ 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'Ref client', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
+ 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
+ 'datep' =>array('type'=>'date', 'label'=>'Datep', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
+ 'fin_validite' =>array('type'=>'datetime', 'label'=>'Fin validite', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
+ 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
+ 'date_cloture' =>array('type'=>'datetime', 'label'=>'Date cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
+ 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
+ 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>85),
+ 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
+ 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
+ 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
+ 'price' =>array('type'=>'double', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
+ 'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
+ 'remise_absolue' =>array('type'=>'double', 'label'=>'Remise absolue', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
+ 'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
+ 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
+ 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
+ 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
+ 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
+ 'total' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
+ 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
+ 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Fk currency', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
+ 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
+ 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>175),
+ 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>180),
+ 'date_livraison' =>array('type'=>'date', 'label'=>'Date livraison', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
+ 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
+ 'fk_availability' =>array('type'=>'integer', 'label'=>'Fk availability', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
+ 'fk_delivery_address' =>array('type'=>'integer', 'label'=>'Fk delivery address', 'enabled'=>1, 'visible'=>-1, 'position'=>200),
+ 'fk_input_reason' =>array('type'=>'integer', 'label'=>'Fk input reason', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
+ 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
+ 'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>220),
+ 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>225),
+ 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>230),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>235),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>240),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>245),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>250),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
+ 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>260),
+ );
+ // END MODULEBUILDER PROPERTIES
+
/**
* Draft status
*/
@@ -1803,7 +1887,7 @@ class Propal extends CommonObject
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET ref = '".$this->db->escape($num)."',";
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index af12c7cdce3..d4f85e62269 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -69,6 +69,11 @@ $search_societe = GETPOST('search_societe', 'alpha');
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_product_category = GETPOST('search_product_category', 'int');
$search_town = GETPOST('search_town', 'alpha');
@@ -162,8 +167,15 @@ $arrayfields = array(
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
- 'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
- 'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
+ 'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>! empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
+ 'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>! empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
+ 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>! empty($conf->multicurrency->enabled) && ! empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
+ 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>! empty($conf->multicurrency->enabled) && ! empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
@@ -209,6 +221,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_montant_ht = '';
$search_montant_vat = '';
$search_montant_ttc = '';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_login = '';
$search_product_category = '';
$search_town = '';
@@ -269,6 +286,7 @@ $sql .= " typent.code as typent_code,";
$sql .= " ava.rowid as availability,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
+$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql .= ' p.note_public, p.note_private,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
@@ -326,6 +344,11 @@ if ($search_login) $sql .= natural_search("u.login", $search_login);
if ($search_montant_ht != '') $sql .= natural_search("p.total_ht", $search_montant_ht, 1);
if ($search_montant_vat != '') $sql .= natural_search("p.tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql .= natural_search("p.total", $search_montant_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND p.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('p.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('p.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('p.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('p.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($sall) {
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
}
@@ -428,6 +451,11 @@ if ($resql)
if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale);
if ($search_montant_ht) $param .= '&search_montant_ht='.urlencode($search_montant_ht);
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_login) $param .= '&search_login='.urlencode($search_login);
if ($search_town) $param .= '&search_town='.urlencode($search_town);
if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
@@ -677,6 +705,53 @@ if ($resql)
print '';
print ' ';
}
+ if (!empty($arrayfields['p.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked']))
+ {
+ // Amount invoiced
+ print '';
+ print ' ';
+ }
+ if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked']))
+ {
+ // Amount invoiced
+ print '';
+ print ' ';
+ }
if (!empty($arrayfields['u.login']['checked']))
{
// Author
@@ -750,6 +825,13 @@ if ($resql)
if (!empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['p.total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'p.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.multicurrency_total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
if (!empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields
@@ -790,6 +872,29 @@ if ($resql)
$projectstatic->ref = $obj->project_ref;
$projectstatic->title = $obj->project_label;
+ $totalInvoicedHT = 0;
+ $totalInvoicedTTC = 0;
+ $multicurrency_totalInvoicedHT = 0;
+ $multicurrency_totalInvoicedTTC = 0;
+
+ $TInvoiceData = $objectstatic->InvoiceArrayList($obj->rowid);
+
+ if (!empty($TInvoiceData))
+ {
+ foreach ($TInvoiceData as $invoiceData)
+ {
+ $invoice = new Facture($db);
+ $invoice->fetch($invoiceData->facid);
+
+ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
+
+ $totalInvoicedHT += $invoice->total_ht;
+ $totalInvoicedTTC += $invoice->total_ttc;
+ $multicurrency_totalInvoicedHT += $invoice->multicurrency_total_ht;
+ $multicurrency_totalInvoicedTTC += $invoice->multicurrency_total_ttc;
+ }
+ }
+
print '';
if (!empty($arrayfields['p.ref']['checked']))
@@ -975,46 +1080,66 @@ if ($resql)
$totalarray['val']['p.total_ttc'] += $obj->total_ttc;
}
// Amount invoiced
- if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) {
- $totalInvoiced = 0;
- $p = new Propal($db);
- $TInvoiceData = $p->InvoiceArrayList($obj->rowid);
-
- if (!empty($TInvoiceData)) {
- foreach ($TInvoiceData as $invoiceData) {
- $invoice = new Facture($db);
- $invoice->fetch($invoiceData->facid);
-
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
- $totalInvoiced += $invoice->total_ht;
- }
- }
-
- print ''.price($totalInvoiced)." \n";
+ if (!empty($arrayfields['p.total_ht_invoiced']['checked']))
+ {
+ print ''.price($totalInvoicedHT)." \n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced';
- $totalarray['val']['p.total_ht_invoiced'] += $obj->total_ht_invoiced;
+ $totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT;
}
// Amount invoiced
- if (!empty($arrayfields['p.total_invoiced']['checked'])) {
- $totalInvoiced = 0;
- $p = new Propal($db);
- $TInvoiceData = $p->InvoiceArrayList($obj->rowid);
-
- if (!empty($TInvoiceData)) {
- foreach ($TInvoiceData as $invoiceData) {
- $invoice = new Facture($db);
- $invoice->fetch($invoiceData->facid);
-
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
- $totalInvoiced += $invoice->total_ttc;
- }
- }
-
- print ''.price($totalInvoiced)." \n";
+ if (!empty($arrayfields['p.total_invoiced']['checked']))
+ {
+ print ''.price($totalInvoicedTTC)." \n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced';
- $totalarray['val']['p.total_invoiced'] += $obj->total_invoiced;
+ $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC;
+ }
+
+ // Currency
+ if (!empty($arrayfields['p.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['p.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['p.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['p.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['p.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount invoiced
+ if (!empty($arrayfields['p.multicurrency_total_ht_invoiced']['checked']))
+ {
+ print ''.price($multicurrency_totalInvoicedHT)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount invoiced
+ if (!empty($arrayfields['p.multicurrency_total_invoiced']['checked']))
+ {
+ print ''.price($multicurrency_totalInvoicedTTC)." \n";
+ if (!$i) $totalarray['nbfield']++;
}
$userstatic->id = $obj->fk_user_author;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index b19210f894a..574581d2e35 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -232,6 +232,94 @@ class Commande extends CommonOrder
//! key of pos source ('0', '1', ...)
public $pos_source;
+
+ /**
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
+ * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
+ * 'label' the translation key.
+ * 'enabled' is a condition when the field must be managed.
+ * 'position' is the sort order of field.
+ * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'noteditable' says if field is not editable (1 or 0)
+ * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
+ * 'index' if we want an index in database.
+ * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
+ * 'help' is a string visible as a tooltip on field
+ * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
+ * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
+ * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ *
+ * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
+ */
+
+ // BEGIN MODULEBUILDER PROPERTIES
+ /**
+ * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ */
+ public $fields=array(
+ 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
+ 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
+ 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
+ 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1),
+ 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>40),
+ 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
+ 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'Ref client', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
+ 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
+ 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
+ 'date_cloture' =>array('type'=>'datetime', 'label'=>'Date cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
+ 'date_commande' =>array('type'=>'date', 'label'=>'Date commande', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
+ 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
+ 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
+ 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
+ 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
+ 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
+ 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
+ 'amount_ht' =>array('type'=>'double(24,8)', 'label'=>'Amount ht', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
+ 'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
+ 'remise_absolue' =>array('type'=>'double', 'label'=>'Remise absolue', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
+ 'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
+ 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
+ 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
+ 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
+ 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
+ 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>150),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>155),
+ 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>160),
+ 'facture' =>array('type'=>'tinyint(4)', 'label'=>'Facture', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
+ 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
+ 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Fk currency', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
+ 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
+ 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
+ 'date_livraison' =>array('type'=>'date', 'label'=>'Date livraison', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
+ 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
+ 'fk_warehouse' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Fk warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>200),
+ 'fk_availability' =>array('type'=>'integer', 'label'=>'Fk availability', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
+ 'fk_input_reason' =>array('type'=>'integer', 'label'=>'Fk input reason', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
+ 'fk_delivery_address' =>array('type'=>'integer', 'label'=>'Fk delivery address', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
+ 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225),
+ 'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>230),
+ 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>235),
+ 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>240),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>245),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>250),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>260),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>265),
+ 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
+ 'module_source' =>array('type'=>'varchar(32)', 'label'=>'Module source', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
+ 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'Pos source', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
+ );
+ // END MODULEBUILDER PROPERTIES
+
/**
* ERR Not enough stock
*/
@@ -384,7 +472,7 @@ class Commande extends CommonOrder
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
// Validate
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 845bc4603cd..5e2353110e7 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -74,7 +74,13 @@ $socid = GETPOST('socid', 'int');
$search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', 'int');
$search_total_ht = GETPOST('search_total_ht', 'alpha');
+$search_total_vat = GETPOST('search_total_vat', 'alpha');
$search_total_ttc = GETPOST('search_total_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$optioncss = GETPOST('optioncss', 'alpha');
@@ -141,6 +147,11 @@ $arrayfields = array(
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
+ 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
@@ -197,6 +208,11 @@ if (empty($reshook))
$search_total_ht = '';
$search_total_vat = '';
$search_total_ttc = '';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_login = '';
$search_dateorder_start = '';
$search_dateorder_end = '';
@@ -250,6 +266,7 @@ $sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author,';
+$sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,';
$sql .= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
@@ -314,25 +331,31 @@ if ($viewstatut <> '')
}
}
-if ($search_dateorder_start) $sql .= " AND c.date_commande >= '".$db->idate($search_dateorder_start)."'";
-if ($search_dateorder_end) $sql .= " AND c.date_commande <= '".$db->idate($search_dateorder_end)."'";
-if ($search_datedelivery_start) $sql .= " AND c.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
-if ($search_datedelivery_end) $sql .= " AND c.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
-if ($search_town) $sql .= natural_search('s.town', $search_town);
-if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
-if ($search_state) $sql .= natural_search("state.nom", $search_state);
-if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
-if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
-if ($search_company) $sql .= natural_search('s.nom', $search_company);
-if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
-if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
-if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
-if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
-if ($search_login) $sql .= natural_search("u.login", $search_login);
-if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref);
-if ($search_project != '') $sql .= natural_search("p.title", $search_project);
-if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
-if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
+if ($search_dateorder_start) $sql .= " AND c.date_commande >= '".$db->idate($search_dateorder_start)."'";
+if ($search_dateorder_end) $sql .= " AND c.date_commande <= '".$db->idate($search_dateorder_end)."'";
+if ($search_datedelivery_start) $sql .= " AND c.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
+if ($search_datedelivery_end) $sql .= " AND c.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
+if ($search_town) $sql .= natural_search('s.town', $search_town);
+if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
+if ($search_state) $sql .= natural_search("state.nom", $search_state);
+if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
+if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
+if ($search_company) $sql .= natural_search('s.nom', $search_company);
+if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
+if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
+if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
+if ($search_total_vat != '') $sql .= natural_search('c.tva', $search_total_vat, 1);
+if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND c.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('c.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('c.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('c.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('c.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
+if ($search_login) $sql .= natural_search("u.login", $search_login);
+if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref);
+if ($search_project != '') $sql .= natural_search("p.title", $search_project);
+if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
+if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@@ -424,6 +447,11 @@ if ($resql)
if ($search_total_ht != '') $param .= '&search_total_ht='.urlencode($search_total_ht);
if ($search_total_vat != '') $param .= '&search_total_vat='.urlencode($search_total_vat);
if ($search_total_ttc != '') $param .= '&search_total_ttc='.urlencode($search_total_ttc);
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_login) $param .= '&search_login='.urlencode($search_login);
if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref);
if ($search_town != '') $param .= '&search_town='.urlencode($search_town);
@@ -697,6 +725,41 @@ if ($resql)
print ' ';
print '';
}
+ if (!empty($arrayfields['c.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['c.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['c.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['c.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['c.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
if (!empty($arrayfields['u.login']['checked']))
{
// Author
@@ -775,6 +838,11 @@ if ($resql)
if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['c.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['c.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['c.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['c.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['c.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['c.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
// Extra fields
@@ -1097,6 +1165,40 @@ if ($resql)
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
}
+ // Currency
+ if (!empty($arrayfields['c.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['c.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['c.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['c.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['c.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
$userstatic->id = $obj->fk_user_author;
$userstatic->login = $obj->login;
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 139cd6c77ff..f4f9d1db16e 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -297,31 +297,32 @@ if (empty($reshook))
// Also negative lines should not be allowed on 'non Credit notes' invoices. A test is done when adding or updating lines but we must
// do it again in validation to avoid cases where invoice is created from another object that allow negative lines.
- // Note that we can accept the negative line if sum with other lines with same vat is positivie: Because all the lines will be merged together
+ // Note that we can accept the negative line if sum with other lines with same vat makes total positive: Because all the lines will be merged together
// when converted into 'available credit' and we will get a positive available credit line.
// Note: Other solution if you want to add a negative line on invoice, is to create a discount for customer and consumme it (but this is possible on standard invoice only).
- $array_of_pu_ht_per_vat_rate = array();
- $array_of_pu_ht_devise_per_vat_rate = array();
- foreach ($object->lines as $line) {
- if (empty($array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
- if (empty($array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
- $array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->subprice;
- $array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_subprice;
+ $array_of_total_ht_per_vat_rate = array();
+ $array_of_total_ht_devise_per_vat_rate = array();
+ foreach($object->lines as $line) {
+ if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
+ if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
+ $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->total_ht;
+ $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_subprice;
}
- //var_dump($array_of_pu_ht_per_vat_rate);exit;
- foreach ($array_of_pu_ht_per_vat_rate as $vatrate => $tmpvalue)
- {
- $pu_ht = $array_of_pu_ht_per_vat_rate[$vatrate];
- $pu_ht_devise = $array_of_pu_ht_devise_per_vat_rate[$vatrate];
- if (($pu_ht < 0 || $pu_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
+ //var_dump($array_of_total_ht_per_vat_rate);exit;
+ foreach($array_of_total_ht_per_vat_rate as $vatrate => $tmpvalue)
+ {
+ $tmp_total_ht = $array_of_total_ht_per_vat_rate[$vatrate];
+ $tmp_total_ht_devise = $array_of_total_ht_devise_per_vat_rate[$vatrate];
+
+ if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
if ($object->type == $object::TYPE_DEPOSIT) {
// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
} else {
- setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors');
+ setEventMessages($langs->trans("ErrorLinesCantBeNegativeForOneVATRate"), null, 'errors');
}
$error++;
$action = '';
@@ -5099,7 +5100,7 @@ elseif ($id > 0 || !empty($ref))
// Reverse back money or convert to reduction
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) {
// For credit note only
- if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercanissuepayment)
+ if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment)
{
if ($resteapayer == 0)
{
@@ -5112,13 +5113,13 @@ elseif ($id > 0 || !empty($ref))
}
// For standard invoice with excess received
- if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && empty($object->paye) && $resteapayer < 0 && $usercancreate && empty($discount->id))
+ if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && $object->statut == Facture::STATUS_VALIDATED && empty($object->paye) && $resteapayer < 0 && $usercancreate && empty($discount->id))
{
print 'id.'&action=converttoreduc">'.$langs->trans('ConvertExcessReceivedToReduc').' ';
}
// For credit note
- if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercancreate
- && (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) || $object->getSommePaiement() == 0)
+ if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercancreate
+ && (! empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) || $object->getSommePaiement() == 0)
) {
print 'id.'&action=converttoreduc" title="'.dol_escape_htmltag($langs->trans("ConfirmConvertToReduc2")).'">'.$langs->trans('ConvertToReduc').' ';
}
@@ -5130,7 +5131,7 @@ elseif ($id > 0 || !empty($ref))
}
// Classify paid
- if (($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)))
+ if (($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)))
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
)
{
@@ -5139,7 +5140,7 @@ elseif ($id > 0 || !empty($ref))
// Classify 'closed not completely paid' (possible si validee et pas encore classee payee)
- if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $usercanissuepayment)
+ if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && $usercanissuepayment)
{
if ($totalpaye > 0 || $totalcreditnotes > 0)
{
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index af69fd79008..dda35e4eafb 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -104,9 +104,9 @@ class Invoices extends DolibarrApi
}
/**
- * Get properties of an order object
+ * Get properties of an invoice object
*
- * Return an array with order informations
+ * Return an array with invoice informations
*
* @param int $id ID of order
* @param string $ref Ref of object
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 92268d69040..11ce0f8df1f 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -2530,7 +2530,7 @@ class Facture extends CommonInvoice
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
if ($num)
{
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index c8b27fa4744..b55f0c412b9 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -536,21 +536,21 @@ if ($resql)
}
if (!empty($arrayfields['f.total']['checked']))
{
- print ''.price($objp->total).' '."\n";
+ print ''.price($objp->total).' '."\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total';
$totalarray['val']['f.total'] += $objp->total;
}
if (!empty($arrayfields['f.tva']['checked']))
{
- print ''.price($objp->total_vat).' '."\n";
+ print ''.price($objp->total_vat).' '."\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.tva';
$totalarray['val']['f.tva'] += $objp->total_vat;
}
if (!empty($arrayfields['f.total_ttc']['checked']))
{
- print ''.price($objp->total_ttc).' '."\n";
+ print ''.price($objp->total_ttc).' '."\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc';
$totalarray['val']['f.total_ttc'] += $objp->total_ttc;
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 6da49bb1915..82f92085abf 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -87,6 +87,11 @@ $search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha');
$search_montant_localtax2 = GETPOST('search_montant_localtax2', 'alpha');
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_status = GETPOST('search_status', 'intcomma');
$search_paymentmode = GETPOST('search_paymentmode', 'int');
$search_paymentterms = GETPOST('search_paymentterms', 'int');
@@ -183,6 +188,13 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
+ 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>160),
+ 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170),
+ 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180),
+ 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>190),
+ 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200),
+ 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210),
+ 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
@@ -236,6 +248,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_montant_localtax1 = '';
$search_montant_localtax2 = '';
$search_montant_ttc = '';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_status = '';
$search_paymentmode = '';
$search_paymentterms = '';
@@ -383,6 +400,7 @@ $sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
$sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
+$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
$sql .= ' f.datef as df, f.date_lim_reglement as datelimite, f.module_source, f.pos_source,';
$sql .= ' f.paye as paye, f.fk_statut, f.close_code,';
$sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,';
@@ -394,7 +412,7 @@ $sql .= " country.code as country_code,";
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
-if (!$sall) $sql .= ', SUM(pf.amount) as dynamount_payed';
+if (!$sall) $sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed';
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
@@ -459,6 +477,11 @@ if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_v
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
if ($search_montant_localtax2 != '') $sql .= natural_search('f.localtax2', $search_montant_localtax2, 1);
if ($search_montant_ttc != '') $sql .= natural_search('f.total_ttc', $search_montant_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND f.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('f.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
if ($search_status != '-1' && $search_status != '')
@@ -591,6 +614,11 @@ if ($resql)
if ($search_montant_localtax1 != '') $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param .= '&search_paymentmode='.urlencode($search_paymentmode);
if ($search_paymentterms > 0) $param .= '&search_paymentterms='.urlencode($search_paymentterms);
@@ -878,13 +906,11 @@ if ($resql)
print ' ';
print '';
}
-
if (!empty($arrayfields['f.retained_warranty']['checked']))
{
print '';
print ' ';
}
-
if (!empty($arrayfields['dynamount_payed']['checked']))
{
print '';
@@ -895,6 +921,51 @@ if ($resql)
print ' ';
print ' ';
}
+ if (!empty($arrayfields['f.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked']))
+ {
+ print '';
+ print ' ';
+ }
+ if (!empty($arrayfields['multicurrency_rtp']['checked']))
+ {
+ print '';
+ print ' ';
+ }
if (!empty($arrayfields['f.date_closing']['checked']))
{
print '';
@@ -936,31 +1007,38 @@ if ($resql)
print " \n";
print '';
- if (!empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], 'f.ref_client', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
- if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER['PHP_SELF'], "p.title", '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
- if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
- if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder);
- if (!empty($arrayfields['f.module_source']['checked'])) print_liste_field_titre($arrayfields['f.module_source']['label'], $_SERVER["PHP_SELF"], "f.module_source", "", $param, "", $sortfield, $sortorder);
- if (!empty($arrayfields['f.pos_source']['checked'])) print_liste_field_titre($arrayfields['f.pos_source']['label'], $_SERVER["PHP_SELF"], "f.pos_source", "", $param, "", $sortfield, $sortorder);
- if (!empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['f.retained_warranty']['checked'])) print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
- if (!empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'], $_SERVER["PHP_SELF"], 'f.ref_client', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'], $_SERVER['PHP_SELF'], 'f.datef', '', $param, 'align="center"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, 'align="center"', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER['PHP_SELF'], "p.title", '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
+ if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
+ if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder);
+ if (!empty($arrayfields['f.module_source']['checked'])) print_liste_field_titre($arrayfields['f.module_source']['label'], $_SERVER["PHP_SELF"], "f.module_source", "", $param, "", $sortfield, $sortorder);
+ if (!empty($arrayfields['f.pos_source']['checked'])) print_liste_field_titre($arrayfields['f.pos_source']['label'], $_SERVER["PHP_SELF"], "f.pos_source", "", $param, "", $sortfield, $sortorder);
+ if (!empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.retained_warranty']['checked'])) print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['multicurrency_rtp']['checked'])) print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@@ -994,6 +1072,11 @@ if ($resql)
$facturestatic->total_ht = $obj->total_ht;
$facturestatic->total_tva = $obj->total_vat;
$facturestatic->total_ttc = $obj->total_ttc;
+ $facturestatic->multicurrency_code = $obj->multicurrency_code;
+ $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
+ $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
+ $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
+ $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
$facturestatic->statut = $obj->fk_statut;
$facturestatic->close_code = $obj->close_code;
$facturestatic->total_ttc = $obj->total_ttc;
@@ -1031,14 +1114,23 @@ if ($resql)
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facturestatic->total_ttc - $totalpay);
+ $multicurrency_paiement = $facturestatic->getSommePaiement(1);
+ $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
+ $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
+ $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
+ $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
if ($facturestatic->statut == Facture::STATUS_CLOSED && $facturestatic->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment
$remaintopay = 0;
+ $multicurrency_remaintopay = 0;
}
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consummed
- $remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
+ $remaincreditnote = $discount->getAvailableDiscounts($thirdpartystatic, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = price2num($facturestatic->total_ttc - $remaintopay);
+ $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdpartystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
+ $multicurrency_remaintopay = -$multicurrency_remaincreditnote;
+ $multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
}
$facturestatic->alreadypaid = $paiement;
@@ -1306,6 +1398,55 @@ if ($resql)
$totalarray['val']['rtp'] += $remaintopay;
}
+
+ // Currency
+ if (!empty($arrayfields['f.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['f.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked']))
+ {
+ print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').' '; // TODO Use a denormalized field
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Pending amount
+ if (!empty($arrayfields['multicurrency_rtp']['checked']))
+ {
+ print '';
+ print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ' ');
+ print ' '; // TODO Use a denormalized field
+ if (!$i) $totalarray['nbfield']++;
+ }
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 17a153a2dc4..37928f33147 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -517,7 +517,7 @@ class Contrat extends CommonObject
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
if ($num)
{
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index f6f18ab3d0c..c3707b18972 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -504,15 +504,16 @@ class DiscountAbsolute
* @param string $filter Filtre autre
* @param int $maxvalue Filter on max value for discount
* @param int $discount_type 0 => customer discount, 1 => supplier discount
+ * @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, amount otherwise
*/
- public function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0)
+ public function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0, $multicurrency = 0)
{
global $conf;
dol_syslog(get_class($this)."::getAvailableDiscounts discount_type=".$discount_type, LOG_DEBUG);
- $sql = "SELECT SUM(rc.amount_ttc) as amount";
+ $sql = "SELECT SUM(rc.amount_ttc) as amount, SUM(rc.multicurrency_amount_ttc) as multicurrency_amount";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc";
$sql .= " WHERE rc.entity = ".$conf->entity;
$sql .= " AND rc.discount_type=".intval($discount_type);
@@ -535,6 +536,11 @@ class DiscountAbsolute
//print 'zz'.$obj->amount;
//$obj = $this->db->fetch_object($resql);
//}
+ if ($multicurrency)
+ {
+ return $obj->amount_multicurrency;
+ }
+
return $obj->amount;
}
return -1;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 1197081100d..5e0ff117146 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6317,6 +6317,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $object->getLastMainDocLink($object->element);
}
else $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = '';
+
+ if (is_object($object) && $object->element == 'propal') $substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT . "/comm/propal/card.php?id=" . $object->id;
+ if (is_object($object) && $object->element == 'commande') $substitutionarray['__URL_ORDER__'] = DOL_MAIN_URL_ROOT . "/commande/card.php?id=" . $object->id;
+ if (is_object($object) && $object->element == 'facture') $substitutionarray['__URL_INVOICE__'] = DOL_MAIN_URL_ROOT . "/compta/facture/card.php?id=" . $object->id;
}
}
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index f66768b7ffb..298b19c7147 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -984,7 +984,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203);
- $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
+ $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->ficheinter->lire);
}
}
diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php
index 779f60e26da..b8bc72d423f 100644
--- a/htdocs/core/modules/modFournisseur.class.php
+++ b/htdocs/core/modules/modFournisseur.class.php
@@ -71,7 +71,7 @@ class modFournisseur extends DolibarrModules
// Dependencies
$this->depends = array("modSociete");
- $this->requiredby = array();
+ $this->requiredby = array("modSupplierProposal");
$this->langfiles = array('bills', 'companies', 'suppliers', 'orders', 'sendings');
// Config pages
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 954a6a8b089..ef40e0a7caf 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -636,11 +636,15 @@ if (!empty($usemargins) && $user->rights->margins->creer)
{
console.log("We are in a price per qty context, we do not call ajax/product");
} else {
+ global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { ?>
+ if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we are not yet able to get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); }
+
// Get the HT price for the product and display it
- console.log("Load price without tax and set it into #price_ht for id="+$(this).val()+" socid=socid; ?>");
+ console.log("Load unit price without tax and set it into #price_ht for product id="+$(this).val()+" socid=socid; ?>");
$.post('/product/ajax/products.php?action=fetch',
{ 'id': $(this).val(), 'socid': socid; ?> },
function(data) {
+ console.log("Load unit price end, we got value "+data.price_ht);
jQuery("#price_ht").val(data.price_ht);
},
'json'
@@ -658,95 +662,96 @@ if (!empty($usemargins) && $user->rights->margins->creer)
$("#fournprice_predef").find("option").remove();
$("#fournprice_predef").hide();
$("#buying_price").val("").show();
+
/* Call post to load content of combo list fournprice_predef */
$.post('/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', { 'idprod': $(this).val() }, function(data) {
- if (data && data.length > 0)
- {
- var options = ''; var defaultkey = ''; var defaultprice = ''; var bestpricefound = 0;
-
- var bestpriceid = 0; var bestpricevalue = 0;
- var pmppriceid = 0; var pmppricevalue = 0;
- var costpriceid = 0; var costpricevalue = 0;
-
- /* setup of margin calculation */
- var defaultbuyprice = 'global->MARGIN_TYPE))
- {
- if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice';
- if ($conf->global->MARGIN_TYPE == 'pmp') print 'pmp';
- if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice';
- } ?>';
- console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice);
-
- var i = 0;
- $(data).each(function() {
- /* Warning: Lines must be processed in order: best supplier price, then pmpprice line then costprice */
- if (this.id != 'pmpprice' && this.id != 'costprice')
+ if (data && data.length > 0)
{
- i++;
- this.price = parseFloat(this.price); // to fix when this.price >0
- // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0)
- //console.log("id="+this.id+"-price="+this.price+"-"+(this.price > 0));
- if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.price; bestpriceid = this.id; bestpricevalue = this.price; bestpricefound=1; } // bestpricefound is used to take the first price > 0
- }
- if (this.id == 'pmpprice')
- {
- // If margin is calculated on PMP, we set it by defaut (but only if value is not 0)
- console.log("id="+this.id+"-price="+this.price);
- if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice)
+ var options = ''; var defaultkey = ''; var defaultprice = ''; var bestpricefound = 0;
+
+ var bestpriceid = 0; var bestpricevalue = 0;
+ var pmppriceid = 0; var pmppricevalue = 0;
+ var costpriceid = 0; var costpricevalue = 0;
+
+ /* setup of margin calculation */
+ var defaultbuyprice = 'global->MARGIN_TYPE))
{
- if (this.price > 0) {
- defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price;
- //console.log("pmppricevalue="+pmppricevalue);
+ if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice';
+ if ($conf->global->MARGIN_TYPE == 'pmp') print 'pmp';
+ if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice';
+ } ?>';
+ console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice);
+
+ var i = 0;
+ $(data).each(function() {
+ /* Warning: Lines must be processed in order: best supplier price, then pmpprice line then costprice */
+ if (this.id != 'pmpprice' && this.id != 'costprice')
+ {
+ i++;
+ this.price = parseFloat(this.price); // to fix when this.price >0
+ // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0)
+ //console.log("id="+this.id+"-price="+this.price+"-"+(this.price > 0));
+ if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.price; bestpriceid = this.id; bestpricevalue = this.price; bestpricefound=1; } // bestpricefound is used to take the first price > 0
}
- }
- }
- if (this.id == 'costprice')
- {
- // If margin is calculated on Cost price, we set it by defaut (but only if value is not 0)
- console.log("id="+this.id+"-price="+this.price+"-pmppricevalue="+pmppricevalue);
- if ('costprice' == defaultbuyprice)
+ if (this.id == 'pmpprice')
+ {
+ // If margin is calculated on PMP, we set it by defaut (but only if value is not 0)
+ console.log("id="+this.id+"-price="+this.price);
+ if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice)
+ {
+ if (this.price > 0) {
+ defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price;
+ //console.log("pmppricevalue="+pmppricevalue);
+ }
+ }
+ }
+ if (this.id == 'costprice')
+ {
+ // If margin is calculated on Cost price, we set it by defaut (but only if value is not 0)
+ console.log("id="+this.id+"-price="+this.price+"-pmppricevalue="+pmppricevalue);
+ if ('costprice' == defaultbuyprice)
+ {
+ if (this.price > 0) { defaultkey = this.id; defaultprice = this.price; costpriceid = this.id; costpricevalue = this.price; }
+ else if (pmppricevalue > 0) { defaultkey = 'pmpprice'; defaultprice = pmppricevalue; }
+ }
+ }
+ options += ''+this.label+' ';
+ });
+ options += 'trans("InputPrice"); ?> ';
+
+ console.log("finally selected defaultkey="+defaultkey+" defaultprice for buying price="+defaultprice);
+
+ $("#fournprice_predef").html(options).show();
+ if (defaultkey != '')
{
- if (this.price > 0) { defaultkey = this.id; defaultprice = this.price; costpriceid = this.id; costpricevalue = this.price; }
- else if (pmppricevalue > 0) { defaultkey = 'pmpprice'; defaultprice = pmppricevalue; }
+ $("#fournprice_predef").val(defaultkey);
}
+
+ /* At loading, no product are yet selected, so we hide field of buying_price */
+ $("#buying_price").hide();
+
+ /* Define default price at loading */
+ var defaultprice = $("#fournprice_predef").find('option:selected').attr("price");
+ $("#buying_price").val(defaultprice);
+
+ $("#fournprice_predef").change(function() {
+ console.log("change on fournprice_predef");
+ /* Hide field buying_price according to choice into list (if 'inputprice' or not) */
+ var linevalue=$(this).find('option:selected').val();
+ var pricevalue = $(this).find('option:selected').attr("price");
+ if (linevalue != 'inputprice' && linevalue != 'pmpprice') {
+ $("#buying_price").val(pricevalue).hide(); /* We set value then hide field */
+ }
+ if (linevalue == 'inputprice') {
+ $('#buying_price').show();
+ }
+ if (linevalue == 'pmpprice') {
+ $("#buying_price").val(pricevalue);
+ $('#buying_price').hide();
+ }
+ });
}
- options += ''+this.label+' ';
- });
- options += 'trans("InputPrice"); ?> ';
-
- console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice);
-
- $("#fournprice_predef").html(options).show();
- if (defaultkey != '')
- {
- $("#fournprice_predef").val(defaultkey);
- }
-
- /* At loading, no product are yet selected, so we hide field of buying_price */
- $("#buying_price").hide();
-
- /* Define default price at loading */
- var defaultprice = $("#fournprice_predef").find('option:selected').attr("price");
- $("#buying_price").val(defaultprice);
-
- $("#fournprice_predef").change(function() {
- console.log("change on fournprice_predef");
- /* Hide field buying_price according to choice into list (if 'inputprice' or not) */
- var linevalue=$(this).find('option:selected').val();
- var pricevalue = $(this).find('option:selected').attr("price");
- if (linevalue != 'inputprice' && linevalue != 'pmpprice') {
- $("#buying_price").val(pricevalue).hide(); /* We set value then hide field */
- }
- if (linevalue == 'inputprice') {
- $('#buying_price').show();
- }
- if (linevalue == 'pmpprice') {
- $("#buying_price").val(pricevalue);
- $('#buying_price').hide();
- }
- });
- }
},
'json');
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index bf20ac42611..82d7c942a8d 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -697,7 +697,7 @@ class Expedition extends CommonObject
{
$numref = "EXP".$this->id;
}
- $this->newref = $numref;
+ $this->newref = dol_sanitizeFileName($numref);
$now = dol_now();
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index c98d8af18d2..88238506125 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1163,7 +1163,7 @@ class ExpenseReport extends CommonObject
}
if (empty($num) || $num < 0) return -1;
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$this->db->begin();
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index d857d6cf88c..f82f91986a0 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -544,7 +544,7 @@ class Fichinter extends CommonObject
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
$sql .= " SET fk_statut = 1";
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index bed02b94d55..ec1d2ca77c7 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -587,7 +587,7 @@ class CommandeFournisseur extends CommonOrder
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
$sql .= " SET ref='".$this->db->escape($num)."',";
@@ -971,7 +971,7 @@ class CommandeFournisseur extends CommonOrder
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
// Do we have to change status now ? (If double approval is required and first approval, we keep status to 1 = validated)
$movetoapprovestatus = true;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 6f5e3b6fc0a..d54e2da4eb1 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1413,7 +1413,7 @@ class FactureFournisseur extends CommonInvoice
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
$sql .= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'";
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 71881d34103..78cb4ecf7c7 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -80,6 +80,11 @@ $search_sale = GETPOST('search_sale', 'int');
$search_total_ht = GETPOST('search_total_ht', 'alpha');
$search_total_vat = GETPOST('search_total_vat', 'alpha');
$search_total_ttc = GETPOST('search_total_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$search_billed = GETPOST('search_billed', 'int');
$search_project_ref = GETPOST('search_project_ref', 'alpha');
@@ -146,6 +151,11 @@ $arrayfields = array(
'cf.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
'cf.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'cf.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
+ 'cf.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'cf.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'cf.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'cf.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'cf.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'cf.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'cf.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'cf.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@@ -201,6 +211,11 @@ if (empty($reshook))
$search_total_ht = '';
$search_total_vat = '';
$search_total_ttc = '';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_project_ref = '';
$search_status = -1;
$search_orderyear = '';
@@ -485,6 +500,7 @@ $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_delivery,";
+$sql .= ' cf.fk_multicurrency, cf.multicurrency_code, cf.multicurrency_tx, cf.multicurrency_total_ht, cf.multicurrency_total_tva as multicurrency_total_vat, cf.multicurrency_total_ttc,';
$sql .= ' cf.date_creation as date_creation, cf.tms as date_update,';
$sql .= ' cf.note_public, cf.note_private,';
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,";
@@ -543,6 +559,11 @@ if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.eleme
if ($search_total_ht != '') $sql .= natural_search('cf.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql .= natural_search('cf.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql .= natural_search('cf.total_ttc', $search_total_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND cf.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('cf.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('cf.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('cf.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('cf.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref);
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@@ -613,6 +634,11 @@ if ($resql)
if ($search_sale > 0) $param .= '&search_sale='.$search_sale;
if ($search_total_ht != '') $param .= '&search_total_ht='.$search_total_ht;
if ($search_total_ttc != '') $param .= "&search_total_ttc=".$search_total_ttc;
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_refsupp) $param .= "&search_refsupp=".$search_refsupp;
if ($search_status >= 0) $param .= "&search_status=".$search_status;
if ($search_project_ref >= 0) $param .= "&search_project_ref=".$search_project_ref;
@@ -844,6 +870,41 @@ if ($resql)
print ' ';
print '';
}
+ if (!empty($arrayfields['cf.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['cf.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['cf.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['cf.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@@ -902,6 +963,11 @@ if ($resql)
if (!empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'], $_SERVER["PHP_SELF"], "cf.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['cf.total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.total_vat']['label'], $_SERVER["PHP_SELF"], "cf.tva", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['cf.total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.total_ttc']['label'], $_SERVER["PHP_SELF"], "cf.total_ttc", "", $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['cf.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['cf.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'cf.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['cf.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['cf.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'cf.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['cf.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'cf.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['cf.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['cf.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'cf.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['cf.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'cf.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@@ -1086,6 +1152,40 @@ if ($resql)
$totalarray['val']['cf.total_ttc'] += $obj->total_ttc;
}
+ // Currency
+ if (!empty($arrayfields['cf.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['cf.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['cf.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['cf.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['cf.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 1fadd12b16d..48d56d8e502 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -84,6 +84,11 @@ $search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha');
$search_montant_localtax2 = GETPOST('search_montant_localtax2', 'alpha');
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_status = GETPOST('search_status', 'int');
$search_paymentmode = GETPOST('search_paymentmode', 'int');
$search_town = GETPOST('search_town', 'alpha');
@@ -167,6 +172,13 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'dynamount_payed'=>array('label'=>$langs->trans("Payed"), 'checked'=>0),
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
+ 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), // Not enabled by default because slow
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@@ -218,6 +230,11 @@ if (empty($reshook))
$search_montant_localtax1='';
$search_montant_localtax2='';
$search_montant_ttc='';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_status='';
$search_paymentmode='';
$search_town='';
@@ -269,6 +286,7 @@ if ($search_all || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement,";
$sql .= " f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,";
$sql .= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
+$sql .= ' f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva as multicurrency_total_vat, f.multicurrency_total_ttc,';
$sql .= " f.note_public, f.note_private,";
$sql .= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
$sql .= " typent.code as typent_code,";
@@ -336,6 +354,11 @@ if ($search_montant_vat != '') $sql .= natural_search('f.total_tva', $search_mon
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
if ($search_montant_localtax2 != '') $sql .= natural_search('f.localtax2', $search_montant_localtax2, 1);
if ($search_montant_ttc != '') $sql .= natural_search('f.total_ttc', $search_montant_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND f.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('f.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('f.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('f.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($search_status != '' && $search_status >= 0) $sql .= " AND f.fk_statut = ".$db->escape($search_status);
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode."";
$sql .= dolSqlDateFilter("f.datef", $day, $month, $year);
@@ -452,6 +475,11 @@ if ($resql)
if ($search_montant_localtax1 != '') $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_amount_no_tax) $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax);
if ($search_status >= 0) $param .= "&search_status=".urlencode($search_status);
@@ -741,6 +769,51 @@ if ($resql)
print '';
print ' ';
}
+ if (!empty($arrayfields['f.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked']))
+ {
+ print '';
+ print ' ';
+ }
+ if (!empty($arrayfields['multicurrency_rtp']['checked']))
+ {
+ print '';
+ print ' ';
+ }
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@@ -798,6 +871,13 @@ if ($resql)
if (!empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['f.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['multicurrency_rtp']['checked'])) print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@@ -831,6 +911,11 @@ if ($resql)
$facturestatic->statut = $obj->fk_statut;
$facturestatic->note_public = $obj->note_public;
$facturestatic->note_private = $obj->note_private;
+ $facturestatic->multicurrency_code = $obj->multicurrency_code;
+ $facturestatic->multicurrency_tx = $obj->multicurrency_tx;
+ $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
+ $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
+ $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
$thirdparty->id = $obj->socid;
$thirdparty->name = $obj->name;
@@ -848,6 +933,11 @@ if ($resql)
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
+ $multicurrency_paiement = $facturestatic->getSommePaiement(1);
+ $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
+ $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
+ $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
+ $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
$facturestatic->alreadypaid = ($paiement ? $paiement : 0);
@@ -1057,6 +1147,54 @@ if ($resql)
$totalarray['val']['rtp'] += $remaintopay;
}
+ // Currency
+ if (!empty($arrayfields['f.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['f.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['f.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['f.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['f.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ if (!empty($arrayfields['multicurrency_dynamount_payed']['checked']))
+ {
+ print ''.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : ' ').' '; // TODO Use a denormalized field
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Pending amount
+ if (!empty($arrayfields['multicurrency_rtp']['checked']))
+ {
+ print '';
+ print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ' ');
+ print ' '; // TODO Use a denormalized field
+ if (!$i) $totalarray['nbfield']++;
+ }
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index acd4be35b79..075ca5f5524 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -716,7 +716,7 @@ class Holiday extends CommonObject
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
// Update status
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET";
diff --git a/htdocs/includes/ace/ChangeLog.txt b/htdocs/includes/ace/ChangeLog.txt
index 237a2cdd66f..824f8750e12 100644
--- a/htdocs/includes/ace/ChangeLog.txt
+++ b/htdocs/includes/ace/ChangeLog.txt
@@ -1,3 +1,12 @@
+2020.01.14 Version 1.4.8
+* highlight both matched braces, and highlight unmatched brace in red
+* improve snippet manager
+* compatibility with webpack file-loader v5
+* improve vim mode
+
+2019.10.17 Version 1.4.7
+* add placeholder option
+
2019.09.08 Version 1.4.6
* restore native behavior of ctrl-p on mac (jumptomatching command is moved to cmd-\)
* improve snippet manager
diff --git a/htdocs/includes/ace/ace.d.ts b/htdocs/includes/ace/ace.d.ts
index 3d7ce109bb7..dd1a2952a06 100644
--- a/htdocs/includes/ace/ace.d.ts
+++ b/htdocs/includes/ace/ace.d.ts
@@ -214,6 +214,7 @@ export namespace Ace {
wrapBehavioursEnabled: boolean;
autoScrollEditorIntoView: boolean;
keyboardHandler: string;
+ placeholder: string;
value: string;
session: EditSession;
}
diff --git a/htdocs/includes/ace/kitchen-sink.html b/htdocs/includes/ace/kitchen-sink.html
index e4bab25a335..27014fa6004 100644
--- a/htdocs/includes/ace/kitchen-sink.html
+++ b/htdocs/includes/ace/kitchen-sink.html
@@ -8,7 +8,7 @@
diff --git a/htdocs/includes/ace/package.json b/htdocs/includes/ace/package.json
index 16587d65d90..a00dddeb40a 100644
--- a/htdocs/includes/ace/package.json
+++ b/htdocs/includes/ace/package.json
@@ -2,7 +2,7 @@
"name": "ace-builds",
"main": "./src-noconflict/ace.js",
"typings": "ace.d.ts",
- "version": "1.4.6",
+ "version": "1.4.8",
"description": "Ace (Ajax.org Cloud9 Editor)",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
diff --git a/htdocs/includes/ace/src/ace.js b/htdocs/includes/ace/src/ace.js
index 378ba7cf463..43d9931a3c4 100644
--- a/htdocs/includes/ace/src/ace.js
+++ b/htdocs/includes/ace/src/ace.js
@@ -880,10 +880,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
@@ -1404,26 +1404,30 @@ var useragent = require("./useragent");
var pressedKeys = null;
var ts = 0;
+var activeListenerOptions;
+function detectListenerOptionsSupport() {
+ activeListenerOptions = false;
+ try {
+ document.createComment("").addEventListener("test", function() {}, {
+ get passive() {
+ activeListenerOptions = {passive: false};
+ }
+ });
+ } catch(e) {}
+}
+
+function getListenerOptions() {
+ if (activeListenerOptions == undefined)
+ detectListenerOptionsSupport();
+ return activeListenerOptions;
+}
+
exports.addListener = function(elem, type, callback) {
- if (elem.addEventListener) {
- return elem.addEventListener(type, callback, false);
- }
- if (elem.attachEvent) {
- var wrapper = function() {
- callback.call(elem, window.event);
- };
- callback._wrapper = wrapper;
- elem.attachEvent("on" + type, wrapper);
- }
+ return elem.addEventListener(type, callback, getListenerOptions());
};
exports.removeListener = function(elem, type, callback) {
- if (elem.removeEventListener) {
- return elem.removeEventListener(type, callback, false);
- }
- if (elem.detachEvent) {
- elem.detachEvent("on" + type, callback._wrapper || callback);
- }
+ return elem.removeEventListener(type, callback, getListenerOptions());
};
exports.stopEvent = function(e) {
exports.stopPropagation(e);
@@ -1434,27 +1438,18 @@ exports.stopEvent = function(e) {
exports.stopPropagation = function(e) {
if (e.stopPropagation)
e.stopPropagation();
- else
- e.cancelBubble = true;
};
exports.preventDefault = function(e) {
if (e.preventDefault)
e.preventDefault();
- else
- e.returnValue = false;
};
exports.getButton = function(e) {
if (e.type == "dblclick")
return 0;
if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey)))
return 2;
- if (e.preventDefault) {
- return e.button;
- }
- else {
- return {1:0, 2:2, 4:1}[e.button];
- }
+ return e.button;
};
exports.capture = function(el, eventHandler, releaseCaptureHandler) {
@@ -1560,30 +1555,16 @@ exports.addMultiMouseDownListener = function(elements, timeouts, eventHandler, c
else if (clicks > 1)
return eventHandler[callbackName](eventNames[clicks], e);
}
- function onDblclick(e) {
- clicks = 2;
- if (timer)
- clearTimeout(timer);
- timer = setTimeout(function() {timer = null;}, timeouts[clicks - 1] || 600);
- eventHandler[callbackName]("mousedown", e);
- eventHandler[callbackName](eventNames[clicks], e);
- }
if (!Array.isArray(elements))
elements = [elements];
elements.forEach(function(el) {
exports.addListener(el, "mousedown", onMousedown);
- if (useragent.isOldIE)
- exports.addListener(el, "dblclick", onDblclick);
});
};
-var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window)
- ? function(e) {
- return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
- }
- : function(e) {
- return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
- };
+var getModifierHash = function(e) {
+ return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
+};
exports.getModifierString = function(e) {
return keys.KEY_MODS[getModifierHash(e)];
@@ -2228,6 +2209,7 @@ var TextInput = function(parentNode, host) {
var lastValue = "";
var lastSelectionStart = 0;
var lastSelectionEnd = 0;
+ var lastRestoreEnd = 0;
try { var isFocused = document.activeElement === text; } catch(e) {}
event.addListener(text, "blur", function(e) {
@@ -2447,9 +2429,8 @@ var TextInput = function(parentNode, host) {
endIndex = 0;
}
inserted = inserted.slice(0, endIndex);
- if (!fromInput && restoreStart == inserted.length && !extendLeft && !extendRight && !restoreEnd)
+ if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd)
return "";
-
sendingText = true;
if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) {
host.onTextInput(inserted);
@@ -2466,6 +2447,7 @@ var TextInput = function(parentNode, host) {
lastValue = value;
lastSelectionStart = selectionStart;
lastSelectionEnd = selectionEnd;
+ lastRestoreEnd = restoreEnd;
return inserted;
}
};
@@ -2628,7 +2610,7 @@ var TextInput = function(parentNode, host) {
= inComposition.context.compositionStartOffset;
}
inComposition.markerRange.end.column = inComposition.markerRange.start.column
- + lastSelectionEnd - inComposition.selectionStart;
+ + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd;
}
}
};
@@ -3786,10 +3768,11 @@ exports.DragdropHandler = DragdropHandler;
});
-define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"], function(require, exports, module) {
+define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"], function(require, exports, module) {
"use strict";
var MouseEvent = require("./mouse_event").MouseEvent;
+var event = require("../lib/event");
var dom = require("../lib/dom");
exports.addTouchListeners = function(el, editor) {
@@ -3916,12 +3899,12 @@ exports.addTouchListeners = function(el, editor) {
}
mode = "wait";
}
- el.addEventListener("contextmenu", function(e) {
+ event.addListener(el, "contextmenu", function(e) {
if (!pressed) return;
var textarea = editor.textInput.getElement();
textarea.focus();
});
- el.addEventListener("touchstart", function (e) {
+ event.addListener(el, "touchstart", function (e) {
var touches = e.touches;
if (longTouchTimer || touches.length > 1) {
clearTimeout(longTouchTimer);
@@ -3995,7 +3978,7 @@ exports.addTouchListeners = function(el, editor) {
touchStartT = t;
});
- el.addEventListener("touchend", function (e) {
+ event.addListener(el, "touchend", function (e) {
pressed = editor.$mouseHandler.isMousePressed = false;
if (animationTimer) clearInterval(animationTimer);
if (mode == "zoom") {
@@ -4015,7 +3998,7 @@ exports.addTouchListeners = function(el, editor) {
clearTimeout(longTouchTimer);
longTouchTimer = null;
});
- el.addEventListener("touchmove", function (e) {
+ event.addListener(el, "touchmove", function (e) {
if (longTouchTimer) {
clearTimeout(longTouchTimer);
longTouchTimer = null;
@@ -4577,7 +4560,7 @@ function deHyphenate(str) {
return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); });
}
-exports.version = "1.4.6";
+exports.version = "1.4.8";
});
@@ -5677,6 +5660,8 @@ var Selection = function(session) {
};
this.$setSelection = function(anchorRow, anchorColumn, cursorRow, cursorColumn) {
+ if (this.$silent)
+ return;
var wasEmpty = this.$isEmpty;
var wasMultiselect = this.inMultiSelectMode;
this.$silent = true;
@@ -6070,14 +6055,19 @@ var Selection = function(session) {
else
this.$desiredColumn = screenPos.column;
}
-
+
+ if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) {
+ var widget = this.session.lineWidgets[this.lead.row];
+ if (rows < 0)
+ rows -= widget.rowsAbove || 0;
+ else if (rows > 0)
+ rows += widget.rowCount - (widget.rowsAbove || 0);
+ }
+
var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX);
if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) {
- if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) {
- if (docPos.row > 0 || rows > 0)
- docPos.row++;
- }
+
}
this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);
};
@@ -9710,7 +9700,7 @@ function BracketMatch() {
var line = this.getLine(pos.row);
var before = true, range;
- var chr = line.charAt(pos.column-1);
+ var chr = line.charAt(pos.column - 1);
var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
if (!match) {
chr = line.charAt(pos.column);
@@ -9745,6 +9735,29 @@ function BracketMatch() {
return range;
};
+ this.getMatchingBracketRanges = function(pos) {
+ var line = this.getLine(pos.row);
+
+ var chr = line.charAt(pos.column - 1);
+ var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ if (!match) {
+ chr = line.charAt(pos.column);
+ pos = {row: pos.row, column: pos.column + 1};
+ match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ }
+
+ if (!match)
+ return null;
+
+ var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);
+ var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)
+ : this.$findOpeningBracket(match[2], pos);
+ if (!bracketPos)
+ return [startRange];
+ var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);
+
+ return [startRange, endRange];
+ };
this.$brackets = {
")": "(",
@@ -11147,15 +11160,14 @@ EditSession.$uid = 0;
this.lineWidgets = null;
this.getRowLength = function(row) {
+ var h = 1;
if (this.lineWidgets)
- var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
- else
- h = 0;
- if (!this.$useWrapMode || !this.$wrapData[row]) {
- return 1 + h;
- } else {
- return this.$wrapData[row].length + 1 + h;
- }
+ h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
+
+ if (!this.$useWrapMode || !this.$wrapData[row])
+ return h;
+ else
+ return this.$wrapData[row].length + h;
};
this.getRowLineCount = function(row) {
if (!this.$useWrapMode || !this.$wrapData[row]) {
@@ -11367,6 +11379,9 @@ EditSession.$uid = 0;
wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
}
}
+
+ if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)
+ screenRow += this.lineWidgets[row].rowsAbove;
return {
row: screenRow,
@@ -13034,6 +13049,26 @@ exports.commands = [{
},
readOnly: true,
scrollIntoView: "none"
+}, {
+ name: "addLineAfter",
+ exec: function(editor) {
+ editor.selection.clearSelection();
+ editor.navigateLineEnd();
+ editor.insert("\n");
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+}, {
+ name: "addLineBefore",
+ exec: function(editor) {
+ editor.selection.clearSelection();
+ var cursor = editor.getCursorPosition();
+ editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);
+ editor.insert("\n");
+ if (cursor.row === 0) editor.navigateUp();
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
}, {
name: "openCommandPallete",
description: "Open command pallete",
@@ -13419,28 +13454,46 @@ Editor.$uid = 0;
};
this.$highlightBrackets = function() {
- if (this.session.$bracketHighlight) {
- this.session.removeMarker(this.session.$bracketHighlight);
- this.session.$bracketHighlight = null;
- }
-
if (this.$highlightPending) {
return;
}
var self = this;
this.$highlightPending = true;
- setTimeout(function() {
+ setTimeout(function () {
self.$highlightPending = false;
var session = self.session;
if (!session || !session.bgTokenizer) return;
- var pos = session.findMatchingBracket(self.getCursorPosition());
- if (pos) {
- var range = new Range(pos.row, pos.column, pos.row, pos.column + 1);
- } else if (session.$mode.getMatching) {
- var range = session.$mode.getMatching(self.session);
+ if (session.$bracketHighlight) {
+ session.$bracketHighlight.markerIds.forEach(function(id) {
+ session.removeMarker(id);
+ });
+ session.$bracketHighlight = null;
}
- if (range)
- session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text");
+ var ranges = session.getMatchingBracketRanges(self.getCursorPosition());
+ if (!ranges && session.$mode.getMatching)
+ ranges = session.$mode.getMatching(self.session);
+ if (!ranges)
+ return;
+
+ var markerType = "ace_bracket";
+ if (!Array.isArray(ranges)) {
+ ranges = [ranges];
+ } else if (ranges.length == 1) {
+ markerType = "ace_error_bracket";
+ }
+ if (ranges.length == 2) {
+ if (Range.comparePoints(ranges[0].end, ranges[1].start) == 0)
+ ranges = [Range.fromPoints(ranges[0].start, ranges[1].end)];
+ else if (Range.comparePoints(ranges[0].start, ranges[1].end) == 0)
+ ranges = [Range.fromPoints(ranges[1].start, ranges[0].end)];
+ }
+
+ session.$bracketHighlight = {
+ ranges: ranges,
+ markerIds: ranges.map(function(range) {
+ return session.addMarker(range, markerType, "text");
+ })
+ };
}, 50);
};
this.$highlightTags = function() {
@@ -14263,6 +14316,7 @@ Editor.$uid = 0;
["up", "down"],
["before", "after"],
["even", "odd"],
+ ["in", "out"],
["inside", "outside"],
["next", "previous"],
["increase", "decrease"],
@@ -14870,9 +14924,11 @@ Editor.$uid = 0;
this.destroy = function() {
this.renderer.destroy();
this._signal("destroy", this);
- if (this.session) {
+ if (this.session)
this.session.destroy();
- }
+ if (this._$emitInputEvent)
+ this._$emitInputEvent.cancel();
+ this.session = null;
};
this.setAutoScrollEditorIntoView = function(enable) {
if (!enable)
@@ -15028,6 +15084,31 @@ config.defineOptions(Editor.prototype, "editor", {
relativeNumberRenderer.detach(this);
}
},
+ placeholder: {
+ set: function(message) {
+ if (!this.$updatePlaceholder) {
+ this.$updatePlaceholder = function() {
+ var value = this.renderer.$composition || this.getValue();
+ if (value && this.renderer.placeholderNode) {
+ this.renderer.off("afterRender", this.$updatePlaceholder);
+ dom.removeCssClass(this.container, "ace_hasPlaceholder");
+ this.renderer.placeholderNode.remove();
+ this.renderer.placeholderNode = null;
+ } else if (!value && !this.renderer.placeholderNode) {
+ this.renderer.on("afterRender", this.$updatePlaceholder);
+ dom.addCssClass(this.container, "ace_hasPlaceholder");
+ var el = dom.createElement("div");
+ el.className = "ace_placeholder";
+ el.textContent = this.$placeholder || "";
+ this.renderer.placeholderNode = el;
+ this.renderer.content.appendChild(this.renderer.placeholderNode);
+ }
+ }.bind(this);
+ this.on("input", this.$updatePlaceholder);
+ }
+ this.$updatePlaceholder();
+ }
+ },
hScrollBarAlwaysVisible: "renderer",
vScrollBarAlwaysVisible: "renderer",
@@ -15118,6 +15199,7 @@ var UndoManager = function() {
this.add = function(delta, allowMerge, session) {
if (this.$fromUndo) return;
if (delta == this.$lastDelta) return;
+ if (!this.$keepRedoStack) this.$redoStack.length = 0;
if (allowMerge === false || !this.lastDeltas) {
this.lastDeltas = [];
this.$undoStack.push(this.lastDeltas);
@@ -15194,6 +15276,25 @@ var UndoManager = function() {
if (to == null) to = this.$rev + 1;
};
+
+ this.validateDeltaBoundaries = function(deltaSet, docLength, invertAction) {
+ if (!deltaSet) {
+ return false;
+ }
+ return deltaSet.every(function(delta) {
+ var action = delta.action;
+ if (invertAction && delta.action === "insert") action = "remove";
+ if (invertAction && delta.action === "remove") action = "insert";
+ switch(action) {
+ case "insert":
+ return delta.start.row <= docLength;
+ case "remove":
+ return delta.start.row < docLength && delta.end.row < docLength;
+ default:
+ return true;
+ }
+ });
+ };
this.undo = function(session, dontSelect) {
this.lastDeltas = null;
var stack = this.$undoStack;
@@ -15211,7 +15312,7 @@ var UndoManager = function() {
var deltaSet = stack.pop();
var undoSelectionRange = null;
- if (deltaSet && deltaSet.length) {
+ if (this.validateDeltaBoundaries(deltaSet, session.getLength(), true)) {
undoSelectionRange = session.undoChanges(deltaSet, dontSelect);
this.$redoStack.push(deltaSet);
this.$syncRev();
@@ -15239,7 +15340,7 @@ var UndoManager = function() {
var deltaSet = this.$redoStack.pop();
var redoSelectionRange = null;
- if (deltaSet) {
+ if (this.validateDeltaBoundaries(deltaSet, session.getLength(), false)) {
redoSelectionRange = session.redoChanges(deltaSet, dontSelect);
this.$undoStack.push(deltaSet);
this.$syncRev();
@@ -15618,7 +15719,7 @@ var Lines = function(element, canvasHeight) {
};
this.computeLineHeight = function(row, config, session) {
- return config.lineHeight * session.getRowLength(row);
+ return config.lineHeight * session.getRowLineCount(row);
};
this.getLength = function() {
@@ -15645,10 +15746,10 @@ var Lines = function(element, canvasHeight) {
fragment.appendChild(cell[i].element);
}
this.element.appendChild(fragment);
- } else {
+ } else {
this.cells.push(cell);
this.element.appendChild(cell.element);
- }
+ }
};
this.unshift = function(cell) {
@@ -15662,10 +15763,10 @@ var Lines = function(element, canvasHeight) {
this.element.insertBefore(fragment, this.element.firstChild);
else
this.element.appendChild(fragment);
- } else {
+ } else {
this.cells.unshift(cell);
this.element.insertAdjacentElement("afterbegin", cell.element);
- }
+ }
};
this.last = function() {
@@ -17633,6 +17734,7 @@ position: absolute;\
box-sizing: border-box;\
min-width: 100%;\
contain: style size layout;\
+font-variant-ligatures: no-common-ligatures;\
}\
.ace_dragging .ace_scroller:before{\
position: absolute;\
@@ -17764,7 +17866,6 @@ margin-top: 1px;\
[ace_nocontext=true] {\
transform: none!important;\
filter: none!important;\
-perspective: none!important;\
clip-path: none!important;\
mask : none!important;\
contain: none!important;\
@@ -17843,6 +17944,9 @@ border-bottom: 1px solid;\
.ace_hidden-cursors .ace_cursor {\
opacity: 0.2;\
}\
+.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\
+opacity: 0;\
+}\
.ace_smooth-blinking .ace_cursor {\
transition: opacity 0.18s;\
}\
@@ -17879,6 +17983,11 @@ z-index: 5;\
position: absolute;\
z-index: 6;\
}\
+.ace_marker-layer .ace_error_bracket {\
+position: absolute;\
+border-bottom: 1px solid #DE5555;\
+border-radius: 0;\
+}\
.ace_marker-layer .ace_active-line {\
position: absolute;\
z-index: 2;\
@@ -18062,6 +18171,14 @@ opacity:1;\
}\
.ace_mobile-button:active {\
background-color: #ddd;\
+}\
+.ace_placeholder {\
+font-family: arial;\
+transform: scale(0.9);\
+transform-origin: left;\
+white-space: pre;\
+opacity: 0.7;\
+margin: 0 10px;\
}";
var useragent = require("./lib/useragent");
@@ -18522,7 +18639,6 @@ var VirtualRenderer = function(container, theme) {
if (composition.useTextareaForIME) {
var val = this.textarea.value;
w = this.characterWidth * (this.session.$getStringScreenWidth(val)[0]);
- h += 2;
}
else {
posTop += this.lineHeight + 2;
@@ -18649,7 +18765,7 @@ var VirtualRenderer = function(container, theme) {
this.$textLayer.checkForSizeChanges();
}
- this._signal("beforeRender");
+ this._signal("beforeRender", changes);
if (this.session && this.session.$bidiHandler)
this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);
@@ -18697,7 +18813,7 @@ var VirtualRenderer = function(container, theme) {
this.$markerFront.update(config);
this.$cursorLayer.update(config);
this.$moveTextAreaToCursor();
- this._signal("afterRender");
+ this._signal("afterRender", changes);
return;
}
if (changes & this.CHANGE_SCROLL) {
@@ -18717,7 +18833,7 @@ var VirtualRenderer = function(container, theme) {
this.$markerFront.update(config);
this.$cursorLayer.update(config);
this.$moveTextAreaToCursor();
- this._signal("afterRender");
+ this._signal("afterRender", changes);
return;
}
@@ -18753,7 +18869,7 @@ var VirtualRenderer = function(container, theme) {
this.$markerBack.update(config);
}
- this._signal("afterRender");
+ this._signal("afterRender", changes);
};
@@ -19185,7 +19301,7 @@ var VirtualRenderer = function(container, theme) {
this.$moveTextAreaToCursor();
this.$cursorLayer.element.style.display = "none";
}
- else {
+ else {
composition.markerId = this.session.addMarker(composition.markerRange, "ace_composition_marker", "text");
}
};
@@ -20079,10 +20195,20 @@ exports.defaultCommands = [{
scrollIntoView: "cursor",
readOnly: true
}, {
- name: "splitIntoLines",
+ name: "toggleSplitSelectionIntoLines",
+ description: "Split into lines",
+ exec: function(editor) {
+ if (editor.multiSelect.rangeCount > 1)
+ editor.multiSelect.joinSelections();
+ else
+ editor.multiSelect.splitIntoLines();
+ },
+ bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"},
+ readOnly: true
+}, {
+ name: "splitSelectionIntoLines",
description: "Split into lines",
exec: function(editor) { editor.multiSelect.splitIntoLines(); },
- bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"},
readOnly: true
}, {
name: "alignCursors",
@@ -20177,7 +20303,6 @@ var EditSession = require("./edit_session").EditSession;
return $blockChangeEvents || this.fromOrientedRange(range);
};
-
this.toSingleRange = function(range) {
range = range || this.ranges[0];
var removed = this.rangeList.removeAll();
@@ -20242,45 +20367,36 @@ var EditSession = require("./edit_session").EditSession;
this.getAllRanges = function() {
return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];
};
-
this.splitIntoLines = function () {
- if (this.rangeCount > 1) {
- var ranges = this.rangeList.ranges;
- var lastRange = ranges[ranges.length - 1];
- var range = Range.fromPoints(ranges[0].start, lastRange.end);
-
- this.toSingleRange();
- this.setSelectionRange(range, lastRange.cursor == lastRange.start);
- } else {
- var range = this.getRange();
- var isBackwards = this.isBackwards();
- var startRow = range.start.row;
+ var ranges = this.ranges.length ? this.ranges : [this.getRange()];
+ var newRanges = [];
+ for (var i = 0; i < ranges.length; i++) {
+ var range = ranges[i];
+ var row = range.start.row;
var endRow = range.end.row;
- if (startRow == endRow) {
- if (isBackwards)
- var start = range.end, end = range.start;
- else
- var start = range.start, end = range.end;
-
- this.addRange(Range.fromPoints(end, end));
- this.addRange(Range.fromPoints(start, start));
- return;
+ if (row === endRow) {
+ newRanges.push(range.clone());
+ } else {
+ newRanges.push(new Range(row, range.start.column, row, this.session.getLine(row).length));
+ while (++row < endRow)
+ newRanges.push(this.getLineRange(row, true));
+ newRanges.push(new Range(endRow, 0, endRow, range.end.column));
}
-
- var rectSel = [];
- var r = this.getLineRange(startRow, true);
- r.start.column = range.start.column;
- rectSel.push(r);
-
- for (var i = startRow + 1; i < endRow; i++)
- rectSel.push(this.getLineRange(i, true));
-
- r = this.getLineRange(endRow, true);
- r.end.column = range.end.column;
- rectSel.push(r);
-
- rectSel.forEach(this.addRange, this);
+ if (i == 0 && !this.isBackwards())
+ newRanges = newRanges.reverse();
}
+ this.toSingleRange();
+ for (var i = newRanges.length; i--;)
+ this.addRange(newRanges[i]);
+ };
+
+ this.joinSelections = function () {
+ var ranges = this.rangeList.ranges;
+ var lastRange = ranges[ranges.length - 1];
+ var range = Range.fromPoints(ranges[0].start, lastRange.end);
+
+ this.toSingleRange();
+ this.setSelectionRange(range, lastRange.cursor == lastRange.start);
};
this.toggleBlockSelection = function () {
if (this.rangeCount > 1) {
@@ -21146,13 +21262,10 @@ var dom = require("../lib/dom");
dom.importCssString(exports.cssText, exports.cssClass);
});
-define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"], function(require, exports, module) {
+define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
"use strict";
-var oop = require("./lib/oop");
var dom = require("./lib/dom");
-var Range = require("./range").Range;
-
function LineWidgets(session) {
this.session = session;
@@ -21266,14 +21379,21 @@ function LineWidgets(session) {
var len = delta.end.row - startRow;
if (len === 0) {
- } else if (delta.action == 'remove') {
+ } else if (delta.action == "remove") {
var removed = lineWidgets.splice(startRow + 1, len);
+ if (!lineWidgets[startRow] && removed[removed.length - 1]) {
+ lineWidgets[startRow] = removed.pop();
+ }
removed.forEach(function(w) {
w && this.removeLineWidget(w);
}, this);
this.$updateRows();
} else {
var args = new Array(len);
+ if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {
+ if (delta.start.column > lineWidgets[startRow].column)
+ startRow++;
+ }
args.unshift(startRow, 0);
lineWidgets.splice.apply(lineWidgets, args);
this.$updateRows();
@@ -21298,7 +21418,7 @@ function LineWidgets(session) {
this.session.lineWidgets = null;
};
- this.addLineWidget = function(w) {
+ this.$registerLineWidget = function(w) {
if (!this.session.lineWidgets)
this.session.lineWidgets = new Array(this.session.getLength());
@@ -21312,9 +21432,15 @@ function LineWidgets(session) {
}
this.session.lineWidgets[w.row] = w;
-
+ return w;
+ };
+
+ this.addLineWidget = function(w) {
+ this.$registerLineWidget(w);
w.session = this.session;
+ if (!this.editor) return w;
+
var renderer = this.editor.renderer;
if (w.html && !w.el) {
w.el = dom.createElement("div");
@@ -21326,13 +21452,13 @@ function LineWidgets(session) {
w.el.style.zIndex = 5;
renderer.container.appendChild(w.el);
w._inDocument = true;
- }
-
- if (!w.coverGutter) {
- w.el.style.zIndex = 3;
- }
- if (w.pixelHeight == null) {
- w.pixelHeight = w.el.offsetHeight;
+
+ if (!w.coverGutter) {
+ w.el.style.zIndex = 3;
+ }
+ if (w.pixelHeight == null) {
+ w.pixelHeight = w.el.offsetHeight;
+ }
}
if (w.rowCount == null) {
w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;
diff --git a/htdocs/includes/ace/src/ext-code_lens.js b/htdocs/includes/ace/src/ext-code_lens.js
new file mode 100644
index 00000000000..4b7e4340f22
--- /dev/null
+++ b/htdocs/includes/ace/src/ext-code_lens.js
@@ -0,0 +1,234 @@
+define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"], function(require, exports, module) {
+"use strict";
+var LineWidgets = require("../line_widgets").LineWidgets;
+var lang = require("../lib/lang");
+var dom = require("../lib/dom");
+
+function clearLensElements(renderer) {
+ var textLayer = renderer.$textLayer;
+ var lensElements = textLayer.$lenses;
+ if (lensElements)
+ lensElements.forEach(function(el) {el.remove(); });
+ textLayer.$lenses = null;
+}
+
+function renderWidgets(changes, renderer) {
+ var changed = changes & renderer.CHANGE_LINES
+ || changes & renderer.CHANGE_FULL
+ || changes & renderer.CHANGE_SCROLL
+ || changes & renderer.CHANGE_TEXT;
+ if (!changed)
+ return;
+
+ var session = renderer.session;
+ var lineWidgets = renderer.session.lineWidgets;
+ var textLayer = renderer.$textLayer;
+ var lensElements = textLayer.$lenses;
+ if (!lineWidgets) {
+ if (lensElements)
+ clearLensElements(renderer);
+ return;
+ }
+
+ var textCells = renderer.$textLayer.$lines.cells;
+ var config = renderer.layerConfig;
+ var padding = renderer.$padding;
+
+ if (!lensElements)
+ lensElements = textLayer.$lenses = [];
+
+
+ var index = 0;
+ for (var i = 0; i < textCells.length; i++) {
+ var row = textCells[i].row;
+ var widget = lineWidgets[row];
+ var lenses = widget && widget.lenses;
+
+ if (!lenses || !lenses.length) continue;
+
+ var lensContainer = lensElements[index];
+ if (!lensContainer) {
+ lensContainer = lensElements[index]
+ = dom.buildDom(["div", {class: "ace_codeLens"}], renderer.container);
+ }
+ lensContainer.style.height = config.lineHeight + "px";
+ index++;
+
+ for (var j = 0; j < lenses.length; j++) {
+ var el = lensContainer.childNodes[2 * j];
+ if (!el) {
+ if (j != 0) lensContainer.appendChild(dom.createTextNode("\xa0|\xa0"));
+ el = dom.buildDom(["a"], lensContainer);
+ }
+ el.textContent = lenses[j].title;
+ el.lensCommand = lenses[j];
+ }
+ while (lensContainer.childNodes.length > 2 * j - 1)
+ lensContainer.lastChild.remove();
+
+ var top = renderer.$cursorLayer.getPixelPosition({
+ row: row,
+ column: 0
+ }, true).top - config.lineHeight * widget.rowsAbove - config.offset;
+ lensContainer.style.top = top + "px";
+
+ var left = renderer.gutterWidth;
+ var indent = session.getLine(row).search(/\S|$/);
+ if (indent == -1)
+ indent = 0;
+ left += indent * config.characterWidth;
+ left -= renderer.scrollLeft;
+ lensContainer.style.paddingLeft = padding + left + "px";
+ }
+ while (index < lensElements.length)
+ lensElements.pop().remove();
+}
+
+function clearCodeLensWidgets(session) {
+ if (!session.lineWidgets) return;
+ var widgetManager = session.widgetManager;
+ session.lineWidgets.forEach(function(widget) {
+ if (widget && widget.lenses)
+ widgetManager.removeLineWidget(widget);
+ });
+}
+
+exports.setLenses = function(session, lenses) {
+ var firstRow = Number.MAX_VALUE;
+
+ clearCodeLensWidgets(session);
+ lenses && lenses.forEach(function(lens) {
+ var row = lens.start.row;
+ var column = lens.start.column;
+ var widget = session.lineWidgets && session.lineWidgets[row];
+ if (!widget || !widget.lenses) {
+ widget = session.widgetManager.$registerLineWidget({
+ rowCount: 1,
+ rowsAbove: 1,
+ row: row,
+ column: column,
+ lenses: []
+ });
+ }
+ widget.lenses.push(lens.command);
+ if (row < firstRow)
+ firstRow = row;
+ });
+ session._emit("changeFold", {data: {start: {row: firstRow}}});
+};
+
+function attachToEditor(editor) {
+ editor.codeLensProviders = [];
+ editor.renderer.on("afterRender", renderWidgets);
+ editor.$codeLensClickHandler = function(e) {
+ var command = e.target.lensCommand;
+ if (command)
+ editor.execCommand(command.id, command.arguments);
+ };
+ editor.container.addEventListener("click", editor.$codeLensClickHandler);
+ editor.$updateLenses = function() {
+ var session = editor.session;
+ if (!session) return;
+
+ if (!session.widgetManager) {
+ session.widgetManager = new LineWidgets(session);
+ session.widgetManager.attach(editor);
+ }
+
+ var providersToWaitNum = editor.codeLensProviders.length;
+ var lenses = [];
+ editor.codeLensProviders.forEach(function(provider) {
+ provider.provideCodeLenses(session, function(currentLenses) {
+ currentLenses.forEach(function(lens) {
+ lenses.push(lens);
+ });
+ providersToWaitNum--;
+ if (providersToWaitNum == 0) {
+ applyLenses();
+ }
+ });
+ });
+
+ function applyLenses() {
+ var cursor = session.selection.cursor;
+ var oldRow = session.documentToScreenRow(cursor);
+ exports.setLenses(session, lenses);
+
+ var lastDelta = session.$undoManager && session.$undoManager.$lastDelta;
+ if (lastDelta && lastDelta.action == "remove" && lastDelta.lines.length > 1)
+ return;
+ var row = session.documentToScreenRow(cursor);
+ var lineHeight = editor.renderer.layerConfig.lineHeight;
+ var top = session.getScrollTop() + (row - oldRow) * lineHeight;
+ session.setScrollTop(top);
+ }
+ };
+ var updateLenses = lang.delayedCall(editor.$updateLenses);
+ editor.$updateLensesOnInput = function() {
+ updateLenses.delay(250);
+ };
+ editor.on("input", editor.$updateLensesOnInput);
+}
+
+function detachFromEditor(editor) {
+ editor.off("input", editor.$updateLensesOnInput);
+ editor.renderer.off("afterRender", renderWidgets);
+ if (editor.$codeLensClickHandler)
+ editor.container.removeEventListener("click", editor.$codeLensClickHandler);
+}
+
+exports.registerCodeLensProvider = function(editor, codeLensProvider) {
+ editor.setOption("enableCodeLens", true);
+ editor.codeLensProviders.push(codeLensProvider);
+ editor.$updateLensesOnInput();
+};
+
+exports.clear = function(session) {
+ exports.setLenses(session, null);
+};
+
+var Editor = require("../editor").Editor;
+require("../config").defineOptions(Editor.prototype, "editor", {
+ enableCodeLens: {
+ set: function(val) {
+ if (val) {
+ attachToEditor(this);
+ } else {
+ detachFromEditor(this);
+ }
+ }
+ }
+});
+
+dom.importCssString("\
+.ace_codeLens {\
+ position: absolute;\
+ color: #aaa;\
+ font-size: 88%;\
+ background: inherit;\
+ width: 100%;\
+ display: flex;\
+ align-items: flex-end;\
+ pointer-events: none;\
+}\
+.ace_codeLens > a {\
+ cursor: pointer;\
+ pointer-events: auto;\
+}\
+.ace_codeLens > a:hover {\
+ color: #0000ff;\
+ text-decoration: underline;\
+}\
+.ace_dark > .ace_codeLens > a:hover {\
+ color: #4e94ce;\
+}\
+", "");
+
+}); (function() {
+ window.require(["ace/ext/code_lens"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/ext-emmet.js b/htdocs/includes/ace/src/ext-emmet.js
index 30425a69273..3cb3818d1b5 100644
--- a/htdocs/includes/ace/src/ext-emmet.js
+++ b/htdocs/includes/ace/src/ext-emmet.js
@@ -747,15 +747,16 @@ var TabstopManager = function(editor) {
this.onChange = function(delta) {
var isRemove = delta.action[0] == "r";
- var parents = this.selectedTabstop && this.selectedTabstop.parents || {};
+ var selectedTabstop = this.selectedTabstop || {};
+ var parents = selectedTabstop.parents || {};
var tabstops = (this.tabstops || []).slice();
for (var i = 0; i < tabstops.length; i++) {
var ts = tabstops[i];
- var active = ts == this.selectedTabstop || parents[ts.index];
+ var active = ts == selectedTabstop || parents[ts.index];
ts.rangeList.$bias = active ? 0 : 1;
- if (delta.action == "remove" && ts !== this.selectedTabstop) {
- var parentActive = ts.parents && ts.parents[this.selectedTabstop.index];
+ if (delta.action == "remove" && ts !== selectedTabstop) {
+ var parentActive = ts.parents && ts.parents[selectedTabstop.index];
var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
@@ -868,8 +869,6 @@ var TabstopManager = function(editor) {
var ranges = this.ranges;
tabstops.forEach(function(ts, index) {
var dest = this.$openTabstops[index] || ts;
- ts.rangeList = new RangeList();
- ts.rangeList.$bias = 0;
for (var i = 0; i < ts.length; i++) {
var p = ts[i];
@@ -879,7 +878,6 @@ var TabstopManager = function(editor) {
range.original = p;
range.tabstop = dest;
ranges.push(range);
- ts.rangeList.ranges.push(range);
if (dest != ts)
dest.unshift(range);
else
@@ -897,6 +895,9 @@ var TabstopManager = function(editor) {
this.$openTabstops[index] = dest;
}
this.addTabstopMarkers(dest);
+ dest.rangeList = dest.rangeList || new RangeList();
+ dest.rangeList.$bias = 0;
+ dest.rangeList.addList(dest);
}, this);
if (arg.length > 2) {
@@ -939,21 +940,18 @@ var TabstopManager = function(editor) {
this.keyboardHandler = new HashHandler();
this.keyboardHandler.bindKeys({
- "Tab": function(ed) {
- if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) {
+ "Tab": function(editor) {
+ if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
return;
- }
-
- ed.tabstopManager.tabNext(1);
+ editor.tabstopManager.tabNext(1);
+ editor.renderer.scrollCursorIntoView();
},
- "Shift-Tab": function(ed) {
- ed.tabstopManager.tabNext(-1);
+ "Shift-Tab": function(editor) {
+ editor.tabstopManager.tabNext(-1);
+ editor.renderer.scrollCursorIntoView();
},
- "Esc": function(ed) {
- ed.tabstopManager.detach();
- },
- "Return": function(ed) {
- return false;
+ "Esc": function(editor) {
+ editor.tabstopManager.detach();
}
});
}).call(TabstopManager.prototype);
diff --git a/htdocs/includes/ace/src/ext-keybinding_menu.js b/htdocs/includes/ace/src/ext-keybinding_menu.js
index 501c5f9ccad..4f980686e68 100644
--- a/htdocs/includes/ace/src/ext-keybinding_menu.js
+++ b/htdocs/includes/ace/src/ext-keybinding_menu.js
@@ -65,6 +65,7 @@ dom.importCssString(cssText);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
+ var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
@@ -76,17 +77,28 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
if (!closer) return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
- editor.focus();
+ if (editor) {
+ editor.focus();
+ }
closer = null;
callback && callback();
}
+ function setIgnoreFocusOut(ignore) {
+ ignoreFocusOut = ignore;
+ if (ignore) {
+ closer.style.pointerEvents = "none";
+ contentElement.style.pointerEvents = "auto";
+ }
+ }
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
- 'background-color: rgba(0, 0, 0, 0.3);';
- closer.addEventListener('click', function() {
- close();
+ (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
+ closer.addEventListener('click', function(e) {
+ if (!ignoreFocusOut) {
+ close();
+ }
});
document.addEventListener('keydown', documentEscListener);
@@ -96,9 +108,12 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
closer.appendChild(contentElement);
document.body.appendChild(closer);
- editor.blur();
+ if (editor) {
+ editor.blur();
+ }
return {
- close: close
+ close: close,
+ setIgnoreFocusOut: setIgnoreFocusOut
};
};
diff --git a/htdocs/includes/ace/src/ext-language_tools.js b/htdocs/includes/ace/src/ext-language_tools.js
index 80af02df566..7e6967e0d7a 100644
--- a/htdocs/includes/ace/src/ext-language_tools.js
+++ b/htdocs/includes/ace/src/ext-language_tools.js
@@ -747,15 +747,16 @@ var TabstopManager = function(editor) {
this.onChange = function(delta) {
var isRemove = delta.action[0] == "r";
- var parents = this.selectedTabstop && this.selectedTabstop.parents || {};
+ var selectedTabstop = this.selectedTabstop || {};
+ var parents = selectedTabstop.parents || {};
var tabstops = (this.tabstops || []).slice();
for (var i = 0; i < tabstops.length; i++) {
var ts = tabstops[i];
- var active = ts == this.selectedTabstop || parents[ts.index];
+ var active = ts == selectedTabstop || parents[ts.index];
ts.rangeList.$bias = active ? 0 : 1;
- if (delta.action == "remove" && ts !== this.selectedTabstop) {
- var parentActive = ts.parents && ts.parents[this.selectedTabstop.index];
+ if (delta.action == "remove" && ts !== selectedTabstop) {
+ var parentActive = ts.parents && ts.parents[selectedTabstop.index];
var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
@@ -868,8 +869,6 @@ var TabstopManager = function(editor) {
var ranges = this.ranges;
tabstops.forEach(function(ts, index) {
var dest = this.$openTabstops[index] || ts;
- ts.rangeList = new RangeList();
- ts.rangeList.$bias = 0;
for (var i = 0; i < ts.length; i++) {
var p = ts[i];
@@ -879,7 +878,6 @@ var TabstopManager = function(editor) {
range.original = p;
range.tabstop = dest;
ranges.push(range);
- ts.rangeList.ranges.push(range);
if (dest != ts)
dest.unshift(range);
else
@@ -897,6 +895,9 @@ var TabstopManager = function(editor) {
this.$openTabstops[index] = dest;
}
this.addTabstopMarkers(dest);
+ dest.rangeList = dest.rangeList || new RangeList();
+ dest.rangeList.$bias = 0;
+ dest.rangeList.addList(dest);
}, this);
if (arg.length > 2) {
@@ -939,21 +940,18 @@ var TabstopManager = function(editor) {
this.keyboardHandler = new HashHandler();
this.keyboardHandler.bindKeys({
- "Tab": function(ed) {
- if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) {
+ "Tab": function(editor) {
+ if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
return;
- }
-
- ed.tabstopManager.tabNext(1);
+ editor.tabstopManager.tabNext(1);
+ editor.renderer.scrollCursorIntoView();
},
- "Shift-Tab": function(ed) {
- ed.tabstopManager.tabNext(-1);
+ "Shift-Tab": function(editor) {
+ editor.tabstopManager.tabNext(-1);
+ editor.renderer.scrollCursorIntoView();
},
- "Esc": function(ed) {
- ed.tabstopManager.detach();
- },
- "Return": function(ed) {
- return false;
+ "Esc": function(editor) {
+ editor.tabstopManager.detach();
}
});
}).call(TabstopManager.prototype);
@@ -1355,7 +1353,7 @@ exports.parForEach = function(array, fn, callback) {
}
};
-var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;
+var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
regex = regex || ID_REGEX;
diff --git a/htdocs/includes/ace/src/ext-modelist.js b/htdocs/includes/ace/src/ext-modelist.js
index 0032ecd178f..8b771ffeb99 100644
--- a/htdocs/includes/ace/src/ext-modelist.js
+++ b/htdocs/includes/ace/src/ext-modelist.js
@@ -101,6 +101,7 @@ var supportedModes = {
Jade: ["jade|pug"],
Java: ["java"],
JavaScript: ["js|jsm|jsx"],
+ JSON5: ["json5"],
JSON: ["json"],
JSONiq: ["jq"],
JSP: ["jsp"],
@@ -131,6 +132,7 @@ var supportedModes = {
Nix: ["nix"],
Nim: ["nim"],
NSIS: ["nsi|nsh"],
+ Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
Pascal: ["pas|p"],
diff --git a/htdocs/includes/ace/src/ext-options.js b/htdocs/includes/ace/src/ext-options.js
index e01961df4ed..d1d01cefa05 100644
--- a/htdocs/includes/ace/src/ext-options.js
+++ b/htdocs/includes/ace/src/ext-options.js
@@ -65,6 +65,7 @@ dom.importCssString(cssText);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
+ var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
@@ -76,17 +77,28 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
if (!closer) return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
- editor.focus();
+ if (editor) {
+ editor.focus();
+ }
closer = null;
callback && callback();
}
+ function setIgnoreFocusOut(ignore) {
+ ignoreFocusOut = ignore;
+ if (ignore) {
+ closer.style.pointerEvents = "none";
+ contentElement.style.pointerEvents = "auto";
+ }
+ }
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
- 'background-color: rgba(0, 0, 0, 0.3);';
- closer.addEventListener('click', function() {
- close();
+ (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
+ closer.addEventListener('click', function(e) {
+ if (!ignoreFocusOut) {
+ close();
+ }
});
document.addEventListener('keydown', documentEscListener);
@@ -96,9 +108,12 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
closer.appendChild(contentElement);
document.body.appendChild(closer);
- editor.blur();
+ if (editor) {
+ editor.blur();
+ }
return {
- close: close
+ close: close,
+ setIgnoreFocusOut: setIgnoreFocusOut
};
};
@@ -207,6 +222,7 @@ var supportedModes = {
Jade: ["jade|pug"],
Java: ["java"],
JavaScript: ["js|jsm|jsx"],
+ JSON5: ["json5"],
JSON: ["json"],
JSONiq: ["jq"],
JSP: ["jsp"],
@@ -237,6 +253,7 @@ var supportedModes = {
Nix: ["nix"],
Nim: ["nim"],
NSIS: ["nsi|nsh"],
+ Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
Pascal: ["pas|p"],
@@ -396,9 +413,9 @@ exports.themes = themeData.map(function(data) {
define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
"use strict";
-var overlayPage = require('./menu_tools/overlay_page').overlayPage;
-
+require("./menu_tools/overlay_page");
+
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var config = require("../config");
@@ -437,7 +454,8 @@ var optionGroups = {
{ caption : "Ace", value : null },
{ caption : "Vim", value : "ace/keyboard/vim" },
{ caption : "Emacs", value : "ace/keyboard/emacs" },
- { caption : "Sublime", value : "ace/keyboard/sublime" }
+ { caption : "Sublime", value : "ace/keyboard/sublime" },
+ { caption : "VSCode", value : "ace/keyboard/vscode" }
]
},
"Font Size": {
diff --git a/htdocs/includes/ace/src/ext-prompt.js b/htdocs/includes/ace/src/ext-prompt.js
index 815c7cda214..bcc99f70806 100644
--- a/htdocs/includes/ace/src/ext-prompt.js
+++ b/htdocs/includes/ace/src/ext-prompt.js
@@ -387,7 +387,7 @@ exports.parForEach = function(array, fn, callback) {
}
};
-var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;
+var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
regex = regex || ID_REGEX;
@@ -1179,15 +1179,16 @@ var TabstopManager = function(editor) {
this.onChange = function(delta) {
var isRemove = delta.action[0] == "r";
- var parents = this.selectedTabstop && this.selectedTabstop.parents || {};
+ var selectedTabstop = this.selectedTabstop || {};
+ var parents = selectedTabstop.parents || {};
var tabstops = (this.tabstops || []).slice();
for (var i = 0; i < tabstops.length; i++) {
var ts = tabstops[i];
- var active = ts == this.selectedTabstop || parents[ts.index];
+ var active = ts == selectedTabstop || parents[ts.index];
ts.rangeList.$bias = active ? 0 : 1;
- if (delta.action == "remove" && ts !== this.selectedTabstop) {
- var parentActive = ts.parents && ts.parents[this.selectedTabstop.index];
+ if (delta.action == "remove" && ts !== selectedTabstop) {
+ var parentActive = ts.parents && ts.parents[selectedTabstop.index];
var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
@@ -1300,8 +1301,6 @@ var TabstopManager = function(editor) {
var ranges = this.ranges;
tabstops.forEach(function(ts, index) {
var dest = this.$openTabstops[index] || ts;
- ts.rangeList = new RangeList();
- ts.rangeList.$bias = 0;
for (var i = 0; i < ts.length; i++) {
var p = ts[i];
@@ -1311,7 +1310,6 @@ var TabstopManager = function(editor) {
range.original = p;
range.tabstop = dest;
ranges.push(range);
- ts.rangeList.ranges.push(range);
if (dest != ts)
dest.unshift(range);
else
@@ -1329,6 +1327,9 @@ var TabstopManager = function(editor) {
this.$openTabstops[index] = dest;
}
this.addTabstopMarkers(dest);
+ dest.rangeList = dest.rangeList || new RangeList();
+ dest.rangeList.$bias = 0;
+ dest.rangeList.addList(dest);
}, this);
if (arg.length > 2) {
@@ -1371,21 +1372,18 @@ var TabstopManager = function(editor) {
this.keyboardHandler = new HashHandler();
this.keyboardHandler.bindKeys({
- "Tab": function(ed) {
- if (exports.snippetManager && exports.snippetManager.expandWithTab(ed)) {
+ "Tab": function(editor) {
+ if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
return;
- }
-
- ed.tabstopManager.tabNext(1);
+ editor.tabstopManager.tabNext(1);
+ editor.renderer.scrollCursorIntoView();
},
- "Shift-Tab": function(ed) {
- ed.tabstopManager.tabNext(-1);
+ "Shift-Tab": function(editor) {
+ editor.tabstopManager.tabNext(-1);
+ editor.renderer.scrollCursorIntoView();
},
- "Esc": function(ed) {
- ed.tabstopManager.detach();
- },
- "Return": function(ed) {
- return false;
+ "Esc": function(editor) {
+ editor.tabstopManager.detach();
}
});
}).call(TabstopManager.prototype);
@@ -2004,6 +2002,7 @@ dom.importCssString(cssText);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
+ var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
@@ -2015,17 +2014,28 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
if (!closer) return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
- editor.focus();
+ if (editor) {
+ editor.focus();
+ }
closer = null;
callback && callback();
}
+ function setIgnoreFocusOut(ignore) {
+ ignoreFocusOut = ignore;
+ if (ignore) {
+ closer.style.pointerEvents = "none";
+ contentElement.style.pointerEvents = "auto";
+ }
+ }
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
- 'background-color: rgba(0, 0, 0, 0.3);';
- closer.addEventListener('click', function() {
- close();
+ (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
+ closer.addEventListener('click', function(e) {
+ if (!ignoreFocusOut) {
+ close();
+ }
});
document.addEventListener('keydown', documentEscListener);
@@ -2035,9 +2045,12 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
closer.appendChild(contentElement);
document.body.appendChild(closer);
- editor.blur();
+ if (editor) {
+ editor.blur();
+ }
return {
- close: close
+ close: close,
+ setIgnoreFocusOut: setIgnoreFocusOut
};
};
@@ -2146,6 +2159,7 @@ var supportedModes = {
Jade: ["jade|pug"],
Java: ["java"],
JavaScript: ["js|jsm|jsx"],
+ JSON5: ["json5"],
JSON: ["json"],
JSONiq: ["jq"],
JSP: ["jsp"],
@@ -2176,6 +2190,7 @@ var supportedModes = {
Nix: ["nix"],
Nim: ["nim"],
NSIS: ["nsi|nsh"],
+ Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
Pascal: ["pas|p"],
@@ -2305,14 +2320,18 @@ function prompt(editor, message, options, callback) {
var cmdLine = $singleLineEditor();
cmdLine.session.setUndoManager(new UndoManager());
- cmdLine.setOption("fontSize", editor.getOption("fontSize"));
- var el = dom.buildDom(["div", {class: "ace_prompt_container"}]);
+ var el = dom.buildDom(["div", {class: "ace_prompt_container" + (options.hasDescription ? " input-box-with-description" : "")}]);
var overlay = overlayPage(editor, el, done);
el.appendChild(cmdLine.container);
- editor.cmdLine = cmdLine;
- cmdLine.setValue(message, 1);
+ if (editor) {
+ editor.cmdLine = cmdLine;
+ cmdLine.setOption("fontSize", editor.getOption("fontSize"));
+ }
+ if (message) {
+ cmdLine.setValue(message, 1);
+ }
if (options.selection) {
cmdLine.selection.setRange({
start: cmdLine.session.doc.indexToPosition(options.selection[0]),
@@ -2348,14 +2367,26 @@ function prompt(editor, message, options, callback) {
cmdLine.session.bgTokenizer.setTokenizer(tokenizer);
}
+ if (options.placeholder) {
+ cmdLine.setOption("placeholder", options.placeholder);
+ }
+
+ if (options.hasDescription) {
+ var promptTextContainer = dom.buildDom(["div", {class: "ace_prompt_text_container"}]);
+ dom.buildDom(options.prompt || "Press 'Enter' to confirm or 'Escape' to cancel", promptTextContainer);
+ el.appendChild(promptTextContainer);
+ }
+
+ overlay.setIgnoreFocusOut(options.ignoreFocusOut);
+
function accept() {
var val;
- if (popup.getCursorPosition().row > 0) {
+ if (popup && popup.getCursorPosition().row > 0) {
val = valueFromRecentList();
} else {
val = cmdLine.getValue();
}
- var curData = popup.getData(popup.getRow());
+ var curData = popup ? popup.getData(popup.getRow()) : val;
if (curData && !curData.error) {
done();
options.onAccept && options.onAccept({
@@ -2365,22 +2396,29 @@ function prompt(editor, message, options, callback) {
}
}
- cmdLine.commands.bindKeys({
+ var keys = {
"Enter": accept,
"Esc|Shift-Esc": function() {
options.onCancel && options.onCancel(cmdLine.getValue(), cmdLine);
done();
- },
- "Up": function(editor) { popup.goTo("up"); valueFromRecentList();},
- "Down": function(editor) { popup.goTo("down"); valueFromRecentList();},
- "Ctrl-Up|Ctrl-Home": function(editor) { popup.goTo("start"); valueFromRecentList();},
- "Ctrl-Down|Ctrl-End": function(editor) { popup.goTo("end"); valueFromRecentList();},
- "Tab": function(editor) {
- popup.goTo("down"); valueFromRecentList();
- },
- "PageUp": function(editor) { popup.gotoPageUp(); valueFromRecentList();},
- "PageDown": function(editor) { popup.gotoPageDown(); valueFromRecentList();}
- });
+ }
+ };
+
+ if (popup) {
+ Object.assign(keys, {
+ "Up": function(editor) { popup.goTo("up"); valueFromRecentList();},
+ "Down": function(editor) { popup.goTo("down"); valueFromRecentList();},
+ "Ctrl-Up|Ctrl-Home": function(editor) { popup.goTo("start"); valueFromRecentList();},
+ "Ctrl-Down|Ctrl-End": function(editor) { popup.goTo("end"); valueFromRecentList();},
+ "Tab": function(editor) {
+ popup.goTo("down"); valueFromRecentList();
+ },
+ "PageUp": function(editor) { popup.gotoPageUp(); valueFromRecentList();},
+ "PageDown": function(editor) { popup.gotoPageDown(); valueFromRecentList();}
+ });
+ }
+
+ cmdLine.commands.bindKeys(keys);
function done() {
overlay.close();
@@ -2413,7 +2451,9 @@ function prompt(editor, message, options, callback) {
}
cmdLine.resize(true);
- popup.resize(true);
+ if (popup) {
+ popup.resize(true);
+ }
cmdLine.focus();
openPrompt = {
diff --git a/htdocs/includes/ace/src/ext-settings_menu.js b/htdocs/includes/ace/src/ext-settings_menu.js
index d10afac8f34..ebfa4108519 100644
--- a/htdocs/includes/ace/src/ext-settings_menu.js
+++ b/htdocs/includes/ace/src/ext-settings_menu.js
@@ -65,6 +65,7 @@ dom.importCssString(cssText);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
+ var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
@@ -76,17 +77,28 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
if (!closer) return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
- editor.focus();
+ if (editor) {
+ editor.focus();
+ }
closer = null;
callback && callback();
}
+ function setIgnoreFocusOut(ignore) {
+ ignoreFocusOut = ignore;
+ if (ignore) {
+ closer.style.pointerEvents = "none";
+ contentElement.style.pointerEvents = "auto";
+ }
+ }
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
- 'background-color: rgba(0, 0, 0, 0.3);';
- closer.addEventListener('click', function() {
- close();
+ (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
+ closer.addEventListener('click', function(e) {
+ if (!ignoreFocusOut) {
+ close();
+ }
});
document.addEventListener('keydown', documentEscListener);
@@ -96,9 +108,12 @@ module.exports.overlayPage = function overlayPage(editor, contentElement, callba
closer.appendChild(contentElement);
document.body.appendChild(closer);
- editor.blur();
+ if (editor) {
+ editor.blur();
+ }
return {
- close: close
+ close: close,
+ setIgnoreFocusOut: setIgnoreFocusOut
};
};
@@ -207,6 +222,7 @@ var supportedModes = {
Jade: ["jade|pug"],
Java: ["java"],
JavaScript: ["js|jsm|jsx"],
+ JSON5: ["json5"],
JSON: ["json"],
JSONiq: ["jq"],
JSP: ["jsp"],
@@ -237,6 +253,7 @@ var supportedModes = {
Nix: ["nix"],
Nim: ["nim"],
NSIS: ["nsi|nsh"],
+ Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
Pascal: ["pas|p"],
@@ -396,9 +413,9 @@ exports.themes = themeData.map(function(data) {
define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
"use strict";
-var overlayPage = require('./menu_tools/overlay_page').overlayPage;
-
+require("./menu_tools/overlay_page");
+
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var config = require("../config");
@@ -437,7 +454,8 @@ var optionGroups = {
{ caption : "Ace", value : null },
{ caption : "Vim", value : "ace/keyboard/vim" },
{ caption : "Emacs", value : "ace/keyboard/emacs" },
- { caption : "Sublime", value : "ace/keyboard/sublime" }
+ { caption : "Sublime", value : "ace/keyboard/sublime" },
+ { caption : "VSCode", value : "ace/keyboard/vscode" }
]
},
"Font Size": {
diff --git a/htdocs/includes/ace/src/ext-spellcheck.js b/htdocs/includes/ace/src/ext-spellcheck.js
index 6f5af5049d7..10d3901f49f 100644
--- a/htdocs/includes/ace/src/ext-spellcheck.js
+++ b/htdocs/includes/ace/src/ext-spellcheck.js
@@ -28,7 +28,6 @@ exports.contextMenuHandler = function(e){
});
host.textInput.setInputHandler(function(newVal) {
- console.log(newVal , value, text.selectionStart, text.selectionEnd);
if (newVal == value)
return '';
if (newVal.lastIndexOf(value, 0) === 0)
diff --git a/htdocs/includes/ace/src/keybinding-emacs.js b/htdocs/includes/ace/src/keybinding-emacs.js
index 960ff734b3d..58e79cd44fc 100644
--- a/htdocs/includes/ace/src/keybinding-emacs.js
+++ b/htdocs/includes/ace/src/keybinding-emacs.js
@@ -548,8 +548,6 @@ function objectToRegExp(obj) {
if (this.$editor.showCommandLine) {
this.$editor.showCommandLine(msg);
this.$editor.focus();
- } else {
- console.log(msg);
}
};
diff --git a/htdocs/includes/ace/src/keybinding-sublime.js b/htdocs/includes/ace/src/keybinding-sublime.js
index e34735b2ae0..21fcb3803c6 100644
--- a/htdocs/includes/ace/src/keybinding-sublime.js
+++ b/htdocs/includes/ace/src/keybinding-sublime.js
@@ -1,9 +1,6 @@
-define("ace/keyboard/sublime",["require","exports","module","ace/lib/keys","ace/lib/oop","ace/lib/useragent","ace/keyboard/hash_handler"], function(require, exports, module) {
+define("ace/keyboard/sublime",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module) {
"use strict";
-var keyUtil = require("../lib/keys");
-var oop = require("../lib/oop");
-var useragent = require("../lib/useragent");
var HashHandler = require("../keyboard/hash_handler").HashHandler;
function moveBySubWords(editor, direction, extend) {
@@ -373,7 +370,7 @@ exports.handler.addCommands([{
},
{
bindKey: { mac: "cmd-shift-l", win: "ctrl-shift-l" },
- name: "splitIntoLines"
+ name: "splitSelectionIntoLines"
}, {
bindKey: { mac: "ctrl-cmd-down", win: "ctrl-shift-down" },
name: "movelinesdown"
diff --git a/htdocs/includes/ace/src/keybinding-vim.js b/htdocs/includes/ace/src/keybinding-vim.js
index 889c2269ac7..79761280e93 100644
--- a/htdocs/includes/ace/src/keybinding-vim.js
+++ b/htdocs/includes/ace/src/keybinding-vim.js
@@ -435,6 +435,7 @@ define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/eve
if (!e) e = s;
return this.ace.session.replace(new Range(s.line, s.ch, e.line, e.ch), text);
};
+ this.replaceSelection =
this.replaceSelections = function(p) {
var sel = this.ace.selection;
if (this.ace.inVirtualSelectionMode) {
@@ -846,6 +847,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
{ keys: '', type: 'keyToKey', toKeys: '' },
{ keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },
{ keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },
+ { keys: '', type: 'keyToKey', toKeys: '' }, // ace_patch ipad keyboard sends C-Esc instead of C-[
+ { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },
{ keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
{ keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},
{ keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
@@ -940,7 +943,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },
{ keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },
+ { keys: 'gi', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'lastEdit' }, context: 'normal' },
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' },
+ { keys: 'gI', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'bol'}, context: 'normal' },
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },
{ keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },
{ keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },
@@ -950,6 +955,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
{ keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
{ keys: 'gv', type: 'action', action: 'reselectLastSelection' },
{ keys: 'J', type: 'action', action: 'joinLines', isEdit: true },
+ { keys: 'gJ', type: 'action', action: 'joinLines', actionArgs: { keepSpaces: true }, isEdit: true },
{ keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }},
{ keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }},
{ keys: 'r', type: 'action', action: 'replace', isEdit: true },
@@ -1026,7 +1032,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
cm.state.vim = null;
}
-
function detachVimMap(cm, next) {
if (this == CodeMirror.keyMap.vim)
CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
@@ -1296,9 +1301,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
}
return mark;
}
+ function find(cm, offset) {
+ var oldPointer = pointer;
+ var mark = move(cm, offset);
+ pointer = oldPointer;
+ return mark && mark.find();
+ }
return {
cachedCursor: undefined, //used for # and * jumps
add: add,
+ find: find,
move: move
};
};
@@ -1943,6 +1955,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
});
}
function onPromptClose(query) {
+ cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
handleQuery(query, true /** ignoreCase */, true /** smartCase */);
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isRecording) {
@@ -2514,7 +2527,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
}
}
if (ch < lineText.length) {
- var re = /[<>]/.test(lineText[ch]) ? /[(){}[\]<>]/ : /[(){}[\]]/;
+ var re = /[<>]/.test(lineText[ch]) ? /[(){}[\]<>]/ : /[(){}[\]]/; //ace_patch?
var matched = cm.findMatchingBracket(Pos(line, ch+1), {bracketRegex: re});
return matched.to;
} else {
@@ -2643,8 +2656,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
head.line--;
cm.setSelection(anchor, head)
text = cm.getSelection();
- cm.replaceSelections("");
- finalHead = anchor
+ cm.replaceSelection("");
+ finalHead = anchor;
} else {
text = cm.getSelection();
var replacement = fillArray('', ranges.length);
@@ -2864,6 +2877,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
var height = cm.listSelections().length;
if (insertAt == 'eol') {
head = Pos(head.line, lineLength(cm, head.line));
+ } else if (insertAt == 'bol') {
+ head = Pos(head.line, 0);
} else if (insertAt == 'charAfter') {
head = offsetCursor(head, 0, 1);
} else if (insertAt == 'firstNonBlank') {
@@ -2902,6 +2917,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
if (vim.visualMode){
return;
}
+ } else if (insertAt == 'lastEdit') {
+ head = getLastEditPos(cm) || head;
}
cm.setOption('disableInput', false);
if (actionArgs && actionArgs.replace) {
@@ -3001,7 +3018,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
var tmp = Pos(curStart.line + 1,
lineLength(cm, curStart.line + 1));
var text = cm.getRange(curStart, tmp);
- text = text.replace(/\n\s*/g, ' ');
+ text = actionArgs.keepSpaces
+ ? text.replace(/\n\r?/g, '')
+ : text.replace(/\n\s*/g, ' ');
cm.replaceRange(text, curStart, tmp);
}
var curFinalPos = Pos(curStart.line, finalCh);
@@ -4583,11 +4602,22 @@ dom.importCssString(".normal-mode .ace_cursor{\
}
function getMarkPos(cm, vim, markName) {
+ if (markName == '\'' || markName == '`') {
+ return vimGlobalState.jumpList.find(cm, -1) || Pos(0, 0);
+ } else if (markName == '.') {
+ return getLastEditPos(cm);
+ }
var mark = vim.marks[markName];
return mark && mark.find();
}
+ function getLastEditPos(cm) {
+ var undoManager = cm.ace.session.$undoManager;
+ if (undoManager && undoManager.$lastDelta)
+ return toCmPos(undoManager.$lastDelta.end);
+ }
+
var ExCommandDispatcher = function() {
this.buildCommandMap_();
};
@@ -5068,6 +5098,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
var global = false; // True to replace all instances on a line, false to replace only 1.
if (tokens.length) {
regexPart = tokens[0];
+ if (getOption('pcre') && regexPart !== '') {
+ regexPart = new RegExp(regexPart).source; //normalize not escaped characters
+ }
replacePart = tokens[1];
if (regexPart && regexPart[regexPart.length - 1] === '$') {
regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
@@ -5075,7 +5108,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
}
if (replacePart !== undefined) {
if (getOption('pcre')) {
- replacePart = unescapeRegexReplace(replacePart);
+ replacePart = unescapeRegexReplace(replacePart.replace(/([^\\])&/g,"$1$$&"));
} else {
replacePart = translateRegexReplace(replacePart);
}
@@ -5101,7 +5134,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
global = true;
flagsPart.replace('g', '');
}
- regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
+ if (getOption('pcre')) {
+ regexPart = regexPart + '/' + flagsPart;
+ } else {
+ regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
+ }
}
}
if (regexPart) {
diff --git a/htdocs/includes/ace/src/keybinding-vscode.js b/htdocs/includes/ace/src/keybinding-vscode.js
new file mode 100644
index 00000000000..45ac5cf03ff
--- /dev/null
+++ b/htdocs/includes/ace/src/keybinding-vscode.js
@@ -0,0 +1,262 @@
+define("ace/keyboard/vscode",["require","exports","module","ace/keyboard/hash_handler","ace/config"], function(require, exports, module) {
+"use strict";
+
+var HashHandler = require("../keyboard/hash_handler").HashHandler;
+var config = require("../config");
+
+exports.handler = new HashHandler();
+exports.handler.$id = "ace/keyboard/vscode";
+
+exports.handler.addCommands([{
+ name: "toggleWordWrap",
+ exec: function(editor) {
+ var wrapUsed = editor.session.getUseWrapMode();
+ editor.session.setUseWrapMode(!wrapUsed);
+ },
+ readOnly: true
+}, {
+ name: "navigateToLastEditLocation",
+ exec: function(editor) {
+ var lastDelta = editor.session.getUndoManager().$lastDelta;
+ var range = (lastDelta.action == "remove")? lastDelta.start: lastDelta.end;
+ editor.moveCursorTo(range.row, range.column);
+ editor.clearSelection();
+ }
+}, {
+ name: "replaceAll",
+ exec: function (editor) {
+ if (!editor.searchBox) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, true);
+ });
+ } else {
+ if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
+ editor.searchBox.replaceAll();
+ }
+ }
+ }
+}, {
+ name: "replaceOne",
+ exec: function (editor) {
+ if (!editor.searchBox) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, true);
+ });
+ } else {
+ if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
+ editor.searchBox.replace();
+ }
+ }
+ }
+}, {
+ name: "selectAllMatches",
+ exec: function (editor) {
+ if (!editor.searchBox) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, false);
+ });
+ } else {
+ if (editor.searchBox.active === true) {
+ editor.searchBox.findAll();
+ }
+ }
+ }
+}, {
+ name: "toggleFindCaseSensitive",
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, false);
+ var sb = editor.searchBox;
+ sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
+ sb.$syncOptions();
+ });
+
+ }
+}, {
+ name: "toggleFindInSelection",
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, false);
+ var sb = editor.searchBox;
+ sb.searchOption.checked = !sb.searchRange;
+ sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
+ sb.$syncOptions();
+ });
+ }
+}, {
+ name: "toggleFindRegex",
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, false);
+ var sb = editor.searchBox;
+ sb.regExpOption.checked = !sb.regExpOption.checked;
+ sb.$syncOptions();
+ });
+ }
+}, {
+ name: "toggleFindWholeWord",
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function(e) {
+ e.Search(editor, false);
+ var sb = editor.searchBox;
+ sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
+ sb.$syncOptions();
+ });
+ }
+}, {
+ name: "removeSecondaryCursors",
+ exec: function (editor) {
+ var ranges = editor.selection.ranges;
+ if (ranges && ranges.length > 1)
+ editor.selection.toSingleRange(ranges[ranges.length - 1]);
+ else
+ editor.selection.clearSelection();
+ }
+}]);
+
+
+[{
+ bindKey: {mac: "Control-G", win: "Ctrl-G"},
+ name: "gotoline"
+}, {
+ bindKey: {mac: "Command-Shift-L|Command-F2", win: "Ctrl-Shift-L|Ctrl-F2"},
+ name: "findAll"
+}, {
+ bindKey: {mac: "Shift-F8|Shift-Option-F8", win: "Shift-F8|Shift-Alt-F8"},
+ name: "goToPreviousError"
+}, {
+ bindKey: {mac: "F8|Option-F8", win: "F8|Alt-F8"},
+ name: "goToNextError"
+}, {
+ bindKey: {mac: "Command-Shift-P|F1", win: "Ctrl-Shift-P|F1"},
+ name: "openCommandPallete"
+}, {
+ bindKey: {mac: "Command-K|Command-S", win: "Ctrl-K|Ctrl-S"},
+ name: "showKeyboardShortcuts"
+}, {
+ bindKey: {mac: "Shift-Option-Up", win: "Alt-Shift-Up"},
+ name: "copylinesup"
+}, {
+ bindKey: {mac: "Shift-Option-Down", win: "Alt-Shift-Down"},
+ name: "copylinesdown"
+}, {
+ bindKey: {mac: "Command-Shift-K", win: "Ctrl-Shift-K"},
+ name: "removeline"
+}, {
+ bindKey: {mac: "Command-Enter", win: "Ctrl-Enter"},
+ name: "addLineAfter"
+}, {
+ bindKey: {mac: "Command-Shift-Enter", win: "Ctrl-Shift-Enter"},
+ name: "addLineBefore"
+}, {
+ bindKey: {mac: "Command-Shift-\\", win: "Ctrl-Shift-\\"},
+ name: "jumptomatching"
+}, {
+ bindKey: {mac: "Command-]", win: "Ctrl-]"},
+ name: "blockindent"
+}, {
+ bindKey: {mac: "Command-[", win: "Ctrl-["},
+ name: "blockoutdent"
+}, {
+ bindKey: {mac: "Control-PageDown", win: "Alt-PageDown"},
+ name: "pagedown"
+}, {
+ bindKey: {mac: "Control-PageUp", win: "Alt-PageUp"},
+ name: "pageup"
+}, {
+ bindKey: {mac: "Shift-Option-A", win: "Shift-Alt-A"},
+ name: "toggleBlockComment"
+}, {
+ bindKey: {mac: "Option-Z", win: "Alt-Z"},
+ name: "toggleWordWrap"
+}, {
+ bindKey: {mac: "Command-G", win: "F3|Ctrl-K Ctrl-D"},
+ name: "findnext"
+}, {
+ bindKey: {mac: "Command-Shift-G", win: "Shift-F3"},
+ name: "findprevious"
+}, {
+ bindKey: {mac: "Option-Enter", win: "Alt-Enter"},
+ name: "selectAllMatches"
+}, {
+ bindKey: {mac: "Command-D", win: "Ctrl-D"},
+ name: "selectMoreAfter"
+}, {
+ bindKey: {mac: "Command-K Command-D", win: "Ctrl-K Ctrl-D"},
+ name: "selectOrFindNext"
+}, {
+ bindKey: {mac: "Shift-Option-I", win: "Shift-Alt-I"},
+ name: "splitSelectionIntoLines"
+}, {
+ bindKey: {mac: "Command-K M", win: "Ctrl-K M"},
+ name: "modeSelect"
+}, {
+ bindKey: {mac: "Command-Option-[", win: "Ctrl-Shift-["},
+ name: "toggleFoldWidget"
+}, {
+ bindKey: {mac: "Command-Option-]", win: "Ctrl-Shift-]"},
+ name: "toggleFoldWidget"
+}, {
+ bindKey: {mac: "Command-K Command-0", win: "Ctrl-K Ctrl-0"},
+ name: "foldall"
+}, {
+ bindKey: {mac: "Command-K Command-J", win: "Ctrl-K Ctrl-J"},
+ name: "unfoldall"
+}, {
+ bindKey: { mac: "Command-K Command-1", win: "Ctrl-K Ctrl-1" },
+ name: "foldOther"
+}, {
+ bindKey: { mac: "Command-K Command-Q", win: "Ctrl-K Ctrl-Q" },
+ name: "navigateToLastEditLocation"
+}, {
+ bindKey: { mac: "Command-K Command-R|Command-K Command-S", win: "Ctrl-K Ctrl-R|Ctrl-K Ctrl-S" },
+ name: "showKeyboardShortcuts"
+}, {
+ bindKey: { mac: "Command-K Command-X", win: "Ctrl-K Ctrl-X" },
+ name: "trimTrailingSpace"
+}, {
+ bindKey: {mac: "Shift-Down|Command-Shift-Down", win: "Shift-Down|Ctrl-Shift-Down"},
+ name: "selectdown"
+}, {
+ bindKey: {mac: "Shift-Up|Command-Shift-Up", win: "Shift-Up|Ctrl-Shift-Up"},
+ name: "selectup"
+}, {
+ bindKey: {mac: "Command-Alt-Enter", win: "Ctrl-Alt-Enter"},
+ name: "replaceAll"
+}, {
+ bindKey: {mac: "Command-Shift-1", win: "Ctrl-Shift-1"},
+ name: "replaceOne"
+}, {
+ bindKey: {mac: "Option-C", win: "Alt-C"},
+ name: "toggleFindCaseSensitive"
+}, {
+ bindKey: {mac: "Option-L", win: "Alt-L"},
+ name: "toggleFindInSelection"
+}, {
+ bindKey: {mac: "Option-R", win: "Alt-R"},
+ name: "toggleFindRegex"
+}, {
+ bindKey: {mac: "Option-W", win: "Alt-W"},
+ name: "toggleFindWholeWord"
+}, {
+ bindKey: {mac: "Command-L", win: "Ctrl-L"},
+ name: "expandtoline"
+}, {
+ bindKey: {mac: "Shift-Esc", win: "Shift-Esc"},
+ name: "removeSecondaryCursors"
+}
+].forEach(function(binding) {
+ var command = exports.handler.commands[binding.name];
+ if (command)
+ command.bindKey = binding.bindKey;
+ exports.handler.bindKey(binding.bindKey, command || binding.name);
+});
+
+}); (function() {
+ window.require(["ace/keyboard/vscode"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/mode-csound_document.js b/htdocs/includes/ace/src/mode-csound_document.js
index b4495c6892f..ae92fce17e1 100644
--- a/htdocs/includes/ace/src/mode-csound_document.js
+++ b/htdocs/includes/ace/src/mode-csound_document.js
@@ -1146,6 +1146,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ampdb",
"ampdbfs",
"ampmidi",
+ "ampmidicurve",
"ampmidid",
"areson",
"aresonk",
@@ -1194,7 +1195,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ceps",
"cepsinv",
"chanctrl",
- "changed",
"changed2",
"chani",
"chano",
@@ -1363,6 +1363,17 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"flooper",
"flooper2",
"floor",
+ "fluidAllOut",
+ "fluidCCi",
+ "fluidCCk",
+ "fluidControl",
+ "fluidEngine",
+ "fluidInfo",
+ "fluidLoad",
+ "fluidNote",
+ "fluidOut",
+ "fluidProgramSelect",
+ "fluidSetInterpMethod",
"fmanal",
"fmax",
"fmb3",
@@ -1437,6 +1448,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"grain2",
"grain3",
"granule",
+ "gtf",
"guiro",
"harmon",
"harmon2",
@@ -1845,6 +1857,8 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"nsamp",
"nstance",
"nstrnum",
+ "nstrstr",
+ "ntof",
"ntom",
"ntrpol",
"nxtpow2",
@@ -1975,7 +1989,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ptable",
"ptable3",
"ptablei",
- "ptableiw",
"ptablew",
"ptrack",
"puts",
@@ -2282,6 +2295,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"strget",
"strindex",
"strindexk",
+ "string2array",
"strlen",
"strlenk",
"strlower",
@@ -2325,7 +2339,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"tableigpw",
"tableikt",
"tableimix",
- "tableiw",
"tablekt",
"tablemix",
"tableng",
@@ -2533,6 +2546,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"array",
"bformdec",
"bformenc",
+ "changed",
"copy2ftab",
"copy2ttab",
"hrtfer",
@@ -2542,6 +2556,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"mintab",
"pop",
"pop_f",
+ "ptableiw",
"push",
"push_f",
"scalet",
@@ -2560,6 +2575,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"stack",
"sumtab",
"tabgen",
+ "tableiw",
"tabmap",
"tabmap_i",
"tabslice",
diff --git a/htdocs/includes/ace/src/mode-csound_orchestra.js b/htdocs/includes/ace/src/mode-csound_orchestra.js
index 7f1a60442aa..7cb3917c9f4 100644
--- a/htdocs/includes/ace/src/mode-csound_orchestra.js
+++ b/htdocs/includes/ace/src/mode-csound_orchestra.js
@@ -1146,6 +1146,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ampdb",
"ampdbfs",
"ampmidi",
+ "ampmidicurve",
"ampmidid",
"areson",
"aresonk",
@@ -1194,7 +1195,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ceps",
"cepsinv",
"chanctrl",
- "changed",
"changed2",
"chani",
"chano",
@@ -1363,6 +1363,17 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"flooper",
"flooper2",
"floor",
+ "fluidAllOut",
+ "fluidCCi",
+ "fluidCCk",
+ "fluidControl",
+ "fluidEngine",
+ "fluidInfo",
+ "fluidLoad",
+ "fluidNote",
+ "fluidOut",
+ "fluidProgramSelect",
+ "fluidSetInterpMethod",
"fmanal",
"fmax",
"fmb3",
@@ -1437,6 +1448,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"grain2",
"grain3",
"granule",
+ "gtf",
"guiro",
"harmon",
"harmon2",
@@ -1845,6 +1857,8 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"nsamp",
"nstance",
"nstrnum",
+ "nstrstr",
+ "ntof",
"ntom",
"ntrpol",
"nxtpow2",
@@ -1975,7 +1989,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"ptable",
"ptable3",
"ptablei",
- "ptableiw",
"ptablew",
"ptrack",
"puts",
@@ -2282,6 +2295,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"strget",
"strindex",
"strindexk",
+ "string2array",
"strlen",
"strlenk",
"strlower",
@@ -2325,7 +2339,6 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"tableigpw",
"tableikt",
"tableimix",
- "tableiw",
"tablekt",
"tablemix",
"tableng",
@@ -2533,6 +2546,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"array",
"bformdec",
"bformenc",
+ "changed",
"copy2ftab",
"copy2ttab",
"hrtfer",
@@ -2542,6 +2556,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"mintab",
"pop",
"pop_f",
+ "ptableiw",
"push",
"push_f",
"scalet",
@@ -2560,6 +2575,7 @@ var CsoundOrchestraHighlightRules = function(embeddedRulePrefix) {
"stack",
"sumtab",
"tabgen",
+ "tableiw",
"tabmap",
"tabmap_i",
"tabslice",
diff --git a/htdocs/includes/ace/src/mode-jade.js b/htdocs/includes/ace/src/mode-jade.js
index 51c796d73f2..5c3488944ce 100644
--- a/htdocs/includes/ace/src/mode-jade.js
+++ b/htdocs/includes/ace/src/mode-jade.js
@@ -1083,7 +1083,7 @@ var MarkdownHighlightRules = function() {
next : "blockquote"
}, { // HR * - _
token : "constant",
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
next: "allowBlock"
}, { // list
token : "markup.list",
diff --git a/htdocs/includes/ace/src/mode-json5.js b/htdocs/includes/ace/src/mode-json5.js
new file mode 100644
index 00000000000..539fd2f2160
--- /dev/null
+++ b/htdocs/includes/ace/src/mode-json5.js
@@ -0,0 +1,360 @@
+define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JsonHighlightRules = function() {
+ this.$rules = {
+ "start" : [
+ {
+ token : "variable", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
+ }, {
+ token : "string", // single line
+ regex : '"',
+ next : "string"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0[xX][0-9a-fA-F]+\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "constant.language.boolean",
+ regex : "(?:true|false)\\b"
+ }, {
+ token : "text", // single quoted strings are not allowed
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "comment", // comments are not allowed, but who cares?
+ regex : "\\/\\/.*$"
+ }, {
+ token : "comment.start", // comments are not allowed, but who cares?
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "string" : [
+ {
+ token : "constant.language.escape",
+ regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start"
+ }, {
+ defaultToken : "string"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment.end", // comments are not allowed, but who cares?
+ regex : "\\*\\/",
+ next : "start"
+ }, {
+ defaultToken: "comment"
+ }
+ ]
+ };
+
+};
+
+oop.inherits(JsonHighlightRules, TextHighlightRules);
+
+exports.JsonHighlightRules = JsonHighlightRules;
+});
+
+define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules;
+
+var Json5HighlightRules = function() {
+ JsonHighlightRules.call(this);
+
+ var startRules = [{
+ token : "variable",
+ regex : /[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/
+ }, {
+ token : "variable",
+ regex : /['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:null)\b/
+ }, {
+ token : "string",
+ regex : /'/,
+ next : [{
+ token : "constant.language.escape",
+ regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
+ consumeLineEnd : true
+ }, {
+ token : "string",
+ regex : /'|$/,
+ next : "start"
+ }, {
+ defaultToken : "string"
+ }]
+ }, {
+ token : "string",
+ regex : /"(?![^"]*":)/,
+ next : [{
+ token : "constant.language.escape",
+ regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
+ consumeLineEnd : true
+ }, {
+ token : "string",
+ regex : /"|$/,
+ next : "start"
+ }, {
+ defaultToken : "string"
+ }]
+ }, {
+ token : "constant.numeric",
+ regex : /[+-]?(?:Infinity|NaN)\b/
+ }];
+
+ for (var key in this.$rules)
+ this.$rules[key].unshift.apply(this.$rules[key], startRules);
+
+ this.normalizeRules();
+};
+
+oop.inherits(Json5HighlightRules, JsonHighlightRules);
+
+exports.Json5HighlightRules = Json5HighlightRules;
+});
+
+define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
+var Range = require("../range").Range;
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+ this.checkOutdent = function(line, input) {
+ if (! /^\s+$/.test(line))
+ return false;
+
+ return /^\s*\}/.test(input);
+ };
+
+ this.autoOutdent = function(doc, row) {
+ var line = doc.getLine(row);
+ var match = line.match(/^(\s*\})/);
+
+ if (!match) return 0;
+
+ var column = match[1].length;
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+ if (!openBracePos || openBracePos.row == row) return 0;
+
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
+ doc.replace(new Range(row, 0, row, column-1), indent);
+ };
+
+ this.$getIndent = function(line) {
+ return line.match(/^\s*/)[0];
+ };
+
+}).call(MatchingBraceOutdent.prototype);
+
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
+});
+
+define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+ );
+ this.foldingStopMarker = new RegExp(
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+ );
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function(session, foldStyle, row) {
+ var line = session.getLine(row);
+
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+
+ return fw;
+ };
+
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ } else if (foldStyle != "all")
+ range = null;
+ }
+
+ return range;
+ }
+
+ if (foldStyle === "markbegin")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+
+ this.getSectionRange = function(session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ } else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ } else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function(session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m) continue;
+ if (m[1]) depth--;
+ else depth++;
+
+ if (!depth) break;
+ }
+
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var HighlightRules = require("./json5_highlight_rules").Json5HighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = HighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.lineCommentStart = "//";
+ this.blockComment = {start: "/*", end: "*/"};
+
+ this.checkOutdent = function(state, line, input) {
+ return this.$outdent.checkOutdent(line, input);
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
+ };
+
+ this.$id = "ace/mode/json5";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+}); (function() {
+ window.require(["ace/mode/json5"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/mode-markdown.js b/htdocs/includes/ace/src/mode-markdown.js
index 380fab69915..ac4072175ec 100644
--- a/htdocs/includes/ace/src/mode-markdown.js
+++ b/htdocs/includes/ace/src/mode-markdown.js
@@ -2625,7 +2625,7 @@ var MarkdownHighlightRules = function() {
next : "blockquote"
}, { // HR * - _
token : "constant",
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
next: "allowBlock"
}, { // list
token : "markup.list",
diff --git a/htdocs/includes/ace/src/mode-mask.js b/htdocs/includes/ace/src/mode-mask.js
index 83cc5fe70b3..7a60ff04e9a 100644
--- a/htdocs/includes/ace/src/mode-mask.js
+++ b/htdocs/includes/ace/src/mode-mask.js
@@ -1083,7 +1083,7 @@ var MarkdownHighlightRules = function() {
next : "blockquote"
}, { // HR * - _
token : "constant",
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
next: "allowBlock"
}, { // list
token : "markup.list",
diff --git a/htdocs/includes/ace/src/mode-nsis.js b/htdocs/includes/ace/src/mode-nsis.js
index 2b8b5061a6d..67c2abec063 100644
--- a/htdocs/includes/ace/src/mode-nsis.js
+++ b/htdocs/includes/ace/src/mode-nsis.js
@@ -13,7 +13,7 @@ var NSISHighlightRules = function() {
caseInsensitive: true
}, {
token: "keyword.command.nsis",
- regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEDllCharacteristics|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/,
+ regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/,
caseInsensitive: true
}, {
token: "keyword.control.nsis",
diff --git a/htdocs/includes/ace/src/mode-nunjucks.js b/htdocs/includes/ace/src/mode-nunjucks.js
new file mode 100644
index 00000000000..57f1e9f32bb
--- /dev/null
+++ b/htdocs/includes/ace/src/mode-nunjucks.js
@@ -0,0 +1,2695 @@
+define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var DocCommentHighlightRules = function() {
+ this.$rules = {
+ "start" : [ {
+ token : "comment.doc.tag",
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
+ },
+ DocCommentHighlightRules.getTagRule(),
+ {
+ defaultToken : "comment.doc",
+ caseInsensitive: true
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getTagRule = function(start) {
+ return {
+ token : "comment.doc.tag.storage.type",
+ regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
+ };
+};
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
+
+var JavaScriptHighlightRules = function(options) {
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language":
+ "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
+ "Namespace|QName|XML|XMLList|" + // E4X
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
+ "SyntaxError|TypeError|URIError|" +
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
+ "isNaN|parseFloat|parseInt|" +
+ "JSON|Math|" + // Other
+ "this|arguments|prototype|window|document" , // Pseudo
+ "keyword":
+ "const|yield|import|get|set|async|await|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
+ "__parent__|__count__|escape|unescape|with|__proto__|" +
+ "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
+ "storage.type":
+ "const|let|var|function",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ "support.function":
+ "alert",
+ "constant.language.boolean": "true|false"
+ }, "identifier");
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
+
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
+ "u[0-9a-fA-F]{4}|" + // unicode
+ "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
+ "[0-2][0-7]{0,2}|" + // oct
+ "3[0-7][0-7]?|" + // oct
+ "[4-7][0-7]?|" + //oct
+ ".)";
+
+ this.$rules = {
+ "no_regex" : [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ comments("no_regex"),
+ {
+ token : "string",
+ regex : "'(?=.)",
+ next : "qstring"
+ }, {
+ token : "string",
+ regex : '"(?=.)',
+ next : "qqstring"
+ }, {
+ token : "constant.numeric", // hexadecimal, octal and binary
+ regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
+ }, {
+ token : "constant.numeric", // decimal integers and floats
+ regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
+ }, {
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ token : [
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
+ "keyword.operator", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : [
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
+ "keyword.operator", "text",
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "keyword",
+ regex : "from(?=\\s*('|\"))"
+ }, {
+ token : "keyword",
+ regex : "(?:" + kwBeforeRe + ")\\b",
+ next : "start"
+ }, {
+ token : ["support.constant"],
+ regex : /that\b/
+ }, {
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
+ regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
+ }, {
+ token : keywordMapper,
+ regex : identifierRe
+ }, {
+ token : "punctuation.operator",
+ regex : /[.](?![.])/,
+ next : "property"
+ }, {
+ token : "storage.type",
+ regex : /=>/,
+ next : "start"
+ }, {
+ token : "keyword.operator",
+ regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
+ next : "start"
+ }, {
+ token : "punctuation.operator",
+ regex : /[?:,;.]/,
+ next : "start"
+ }, {
+ token : "paren.lparen",
+ regex : /[\[({]/,
+ next : "start"
+ }, {
+ token : "paren.rparen",
+ regex : /[\])}]/
+ }, {
+ token: "comment",
+ regex: /^#!.*$/
+ }
+ ],
+ property: [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : [
+ "storage.type", "punctuation.operator", "entity.name.function", "text",
+ "keyword.operator", "text",
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "punctuation.operator",
+ regex : /[.](?![.])/
+ }, {
+ token : "support.function",
+ regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
+ }, {
+ token : "support.function.dom",
+ regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
+ }, {
+ token : "support.constant",
+ regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
+ }, {
+ token : "identifier",
+ regex : identifierRe
+ }, {
+ regex: "",
+ token: "empty",
+ next: "no_regex"
+ }
+ ],
+ "start": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ comments("start"),
+ {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex"
+ }, {
+ token : "text",
+ regex : "\\s+|^$",
+ next : "start"
+ }, {
+ token: "empty",
+ regex: "",
+ next: "no_regex"
+ }
+ ],
+ "regex": [
+ {
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ token: "string.regexp",
+ regex: "/[sxngimy]*",
+ next: "no_regex"
+ }, {
+ token : "invalid",
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
+ }, {
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
+ }, {
+ token : "constant.language.delimiter",
+ regex: /\|/
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class"
+ }, {
+ token: "empty",
+ regex: "$",
+ next: "no_regex"
+ }, {
+ defaultToken: "string.regexp"
+ }
+ ],
+ "regex_character_class": [
+ {
+ token: "regexp.charclass.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ token: "constant.language.escape",
+ regex: "]",
+ next: "regex"
+ }, {
+ token: "constant.language.escape",
+ regex: "-"
+ }, {
+ token: "empty",
+ regex: "$",
+ next: "no_regex"
+ }, {
+ defaultToken: "string.regexp.charachterclass"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+"
+ }, {
+ token: "punctuation.operator",
+ regex: "$"
+ }, {
+ token: "empty",
+ regex: "",
+ next: "no_regex"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ consumeLineEnd : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "no_regex"
+ }, {
+ defaultToken: "string"
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ consumeLineEnd : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "no_regex"
+ }, {
+ defaultToken: "string"
+ }
+ ]
+ };
+
+
+ if (!options || !options.noES6) {
+ this.$rules.no_regex.unshift({
+ regex: "[{}]", onMatch: function(val, state, stack) {
+ this.next = val == "{" ? this.nextState : "";
+ if (val == "{" && stack.length) {
+ stack.unshift("start", state);
+ }
+ else if (val == "}" && stack.length) {
+ stack.shift();
+ this.next = stack.shift();
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
+ return "paren.quasi.end";
+ }
+ return val == "{" ? "paren.lparen" : "paren.rparen";
+ },
+ nextState: "start"
+ }, {
+ token : "string.quasi.start",
+ regex : /`/,
+ push : [{
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "paren.quasi.start",
+ regex : /\${/,
+ push : "start"
+ }, {
+ token : "string.quasi.end",
+ regex : /`/,
+ next : "pop"
+ }, {
+ defaultToken: "string.quasi"
+ }]
+ });
+
+ if (!options || options.jsx != false)
+ JSX.call(this);
+ }
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("no_regex") ]);
+
+ this.normalizeRules();
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+function JSX() {
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
+ var jsxTag = {
+ onMatch : function(val, state, stack) {
+ var offset = val.charAt(1) == "/" ? 2 : 1;
+ if (offset == 1) {
+ if (state != this.nextState)
+ stack.unshift(this.next, this.nextState, 0);
+ else
+ stack.unshift(this.next);
+ stack[2]++;
+ } else if (offset == 2) {
+ if (state == this.nextState) {
+ stack[1]--;
+ if (!stack[1] || stack[1] < 0) {
+ stack.shift();
+ stack.shift();
+ }
+ }
+ }
+ return [{
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
+ value: val.slice(0, offset)
+ }, {
+ type: "meta.tag.tag-name.xml",
+ value: val.substr(offset)
+ }];
+ },
+ regex : "?" + tagRegex + "",
+ next: "jsxAttributes",
+ nextState: "jsx"
+ };
+ this.$rules.start.unshift(jsxTag);
+ var jsxJsRule = {
+ regex: "{",
+ token: "paren.quasi.start",
+ push: "start"
+ };
+ this.$rules.jsx = [
+ jsxJsRule,
+ jsxTag,
+ {include : "reference"},
+ {defaultToken: "string"}
+ ];
+ this.$rules.jsxAttributes = [{
+ token : "meta.tag.punctuation.tag-close.xml",
+ regex : "/?>",
+ onMatch : function(value, currentState, stack) {
+ if (currentState == stack[0])
+ stack.shift();
+ if (value.length == 2) {
+ if (stack[0] == this.nextState)
+ stack[1]--;
+ if (!stack[1] || stack[1] < 0) {
+ stack.splice(0, 2);
+ }
+ }
+ this.next = stack[0] || "start";
+ return [{type: this.token, value: value}];
+ },
+ nextState: "jsx"
+ },
+ jsxJsRule,
+ comments("jsxAttributes"),
+ {
+ token : "entity.other.attribute-name.xml",
+ regex : tagRegex
+ }, {
+ token : "keyword.operator.attribute-equals.xml",
+ regex : "="
+ }, {
+ token : "text.tag-whitespace.xml",
+ regex : "\\s+"
+ }, {
+ token : "string.attribute-value.xml",
+ regex : "'",
+ stateName : "jsx_attr_q",
+ push : [
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
+ {include : "reference"},
+ {defaultToken : "string.attribute-value.xml"}
+ ]
+ }, {
+ token : "string.attribute-value.xml",
+ regex : '"',
+ stateName : "jsx_attr_qq",
+ push : [
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
+ {include : "reference"},
+ {defaultToken : "string.attribute-value.xml"}
+ ]
+ },
+ jsxTag
+ ];
+ this.$rules.reference = [{
+ token : "constant.language.escape.reference.xml",
+ regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }];
+}
+
+function comments(next) {
+ return [
+ {
+ token : "comment", // multi line comment
+ regex : /\/\*/,
+ next: [
+ DocCommentHighlightRules.getTagRule(),
+ {token : "comment", regex : "\\*\\/", next : next || "pop"},
+ {defaultToken : "comment", caseInsensitive: true}
+ ]
+ }, {
+ token : "comment",
+ regex : "\\/\\/",
+ next: [
+ DocCommentHighlightRules.getTagRule(),
+ {token : "comment", regex : "$|^", next : next || "pop"},
+ {defaultToken : "comment", caseInsensitive: true}
+ ]
+ }
+ ];
+}
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
+var Range = require("../range").Range;
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+ this.checkOutdent = function(line, input) {
+ if (! /^\s+$/.test(line))
+ return false;
+
+ return /^\s*\}/.test(input);
+ };
+
+ this.autoOutdent = function(doc, row) {
+ var line = doc.getLine(row);
+ var match = line.match(/^(\s*\})/);
+
+ if (!match) return 0;
+
+ var column = match[1].length;
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+ if (!openBracePos || openBracePos.row == row) return 0;
+
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
+ doc.replace(new Range(row, 0, row, column-1), indent);
+ };
+
+ this.$getIndent = function(line) {
+ return line.match(/^\s*/)[0];
+ };
+
+}).call(MatchingBraceOutdent.prototype);
+
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
+});
+
+define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(
+ this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+ );
+ this.foldingStopMarker = new RegExp(
+ this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+ );
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function(session, foldStyle, row) {
+ var line = session.getLine(row);
+
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+
+ return fw;
+ };
+
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ } else if (foldStyle != "all")
+ range = null;
+ }
+
+ return range;
+ }
+
+ if (foldStyle === "markbegin")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+
+ this.getSectionRange = function(session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ } else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ } else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function(session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m) continue;
+ if (m[1]) depth--;
+ else depth++;
+
+ if (!depth) break;
+ }
+
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = JavaScriptHighlightRules;
+
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.lineCommentStart = "//";
+ this.blockComment = {start: "/*", end: "*/"};
+ this.$quotes = {'"': '"', "'": "'", "`": "`"};
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+ var endState = tokenizedLine.state;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start" || state == "no_regex") {
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ } else if (state == "doc-start") {
+ if (endState == "start" || endState == "no_regex") {
+ return "";
+ }
+ var match = line.match(/^\s*(\/?)\*/);
+ if (match) {
+ if (match[1]) {
+ indent += " ";
+ }
+ indent += "* ";
+ }
+ }
+
+ return indent;
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ return this.$outdent.checkOutdent(line, input);
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
+ };
+
+ this.createWorker = function(session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("annotate", function(results) {
+ session.setAnnotations(results.data);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+ this.$id = "ace/mode/javascript";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
+var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
+var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
+var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
+var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
+
+var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
+var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
+
+var CssHighlightRules = function() {
+
+ var keywordMapper = this.createKeywordMapper({
+ "support.function": supportFunction,
+ "support.constant": supportConstant,
+ "support.type": supportType,
+ "support.constant.color": supportConstantColor,
+ "support.constant.fonts": supportConstantFonts
+ }, "text", true);
+
+ this.$rules = {
+ "start" : [{
+ include : ["strings", "url", "comments"]
+ }, {
+ token: "paren.lparen",
+ regex: "\\{",
+ next: "ruleset"
+ }, {
+ token: "paren.rparen",
+ regex: "\\}"
+ }, {
+ token: "string",
+ regex: "@(?!viewport)",
+ next: "media"
+ }, {
+ token: "keyword",
+ regex: "#[a-z0-9-_]+"
+ }, {
+ token: "keyword",
+ regex: "%"
+ }, {
+ token: "variable",
+ regex: "\\.[a-z0-9-_]+"
+ }, {
+ token: "string",
+ regex: ":[a-z0-9-_]+"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token: "constant",
+ regex: "[a-z0-9-_]+"
+ }, {
+ caseInsensitive: true
+ }],
+
+ "media": [{
+ include : ["strings", "url", "comments"]
+ }, {
+ token: "paren.lparen",
+ regex: "\\{",
+ next: "start"
+ }, {
+ token: "paren.rparen",
+ regex: "\\}",
+ next: "start"
+ }, {
+ token: "string",
+ regex: ";",
+ next: "start"
+ }, {
+ token: "keyword",
+ regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
+ + "|page|font|keyframes|viewport|counter-style|font-feature-values"
+ + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
+ }],
+
+ "comments" : [{
+ token: "comment", // multi line comment
+ regex: "\\/\\*",
+ push: [{
+ token : "comment",
+ regex : "\\*\\/",
+ next : "pop"
+ }, {
+ defaultToken : "comment"
+ }]
+ }],
+
+ "ruleset" : [{
+ regex : "-(webkit|ms|moz|o)-",
+ token : "text"
+ }, {
+ token : "punctuation.operator",
+ regex : "[:;]"
+ }, {
+ token : "paren.rparen",
+ regex : "\\}",
+ next : "start"
+ }, {
+ include : ["strings", "url", "comments"]
+ }, {
+ token : ["constant.numeric", "keyword"],
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token : "constant.numeric", // hex6 color
+ regex : "#[a-f0-9]{6}"
+ }, {
+ token : "constant.numeric", // hex3 color
+ regex : "#[a-f0-9]{3}"
+ }, {
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
+ regex : pseudoElements
+ }, {
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
+ regex : pseudoClasses
+ }, {
+ include: "url"
+ }, {
+ token : keywordMapper,
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ caseInsensitive: true
+ }],
+
+ url: [{
+ token : "support.function",
+ regex : "(?:url(:?-prefix)?|domain|regexp)\\(",
+ push: [{
+ token : "support.function",
+ regex : "\\)",
+ next : "pop"
+ }, {
+ defaultToken: "string"
+ }]
+ }],
+
+ strings: [{
+ token : "string.start",
+ regex : "'",
+ push : [{
+ token : "string.end",
+ regex : "'|$",
+ next: "pop"
+ }, {
+ include : "escapes"
+ }, {
+ token : "constant.language.escape",
+ regex : /\\$/,
+ consumeLineEnd: true
+ }, {
+ defaultToken: "string"
+ }]
+ }, {
+ token : "string.start",
+ regex : '"',
+ push : [{
+ token : "string.end",
+ regex : '"|$',
+ next: "pop"
+ }, {
+ include : "escapes"
+ }, {
+ token : "constant.language.escape",
+ regex : /\\$/,
+ consumeLineEnd: true
+ }, {
+ defaultToken: "string"
+ }]
+ }],
+ escapes: [{
+ token : "constant.language.escape",
+ regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
+ }]
+
+ };
+
+ this.normalizeRules();
+};
+
+oop.inherits(CssHighlightRules, TextHighlightRules);
+
+exports.CssHighlightRules = CssHighlightRules;
+
+});
+
+define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+var propertyMap = {
+ "background": {"#$0": 1},
+ "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
+ "background-image": {"url('/$0')": 1},
+ "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
+ "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
+ "background-attachment": {"scroll": 1, "fixed": 1},
+ "background-size": {"cover": 1, "contain": 1},
+ "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
+ "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
+ "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
+ "border-color": {"#$0": 1},
+ "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
+ "border-collapse": {"collapse": 1, "separate": 1},
+ "bottom": {"px": 1, "em": 1, "%": 1},
+ "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
+ "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
+ "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
+ "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
+ "empty-cells": {"show": 1, "hide": 1},
+ "float": {"left": 1, "right": 1, "none": 1},
+ "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
+ "font-size": {"px": 1, "em": 1, "%": 1},
+ "font-weight": {"bold": 1, "normal": 1},
+ "font-style": {"italic": 1, "normal": 1},
+ "font-variant": {"normal": 1, "small-caps": 1},
+ "height": {"px": 1, "em": 1, "%": 1},
+ "left": {"px": 1, "em": 1, "%": 1},
+ "letter-spacing": {"normal": 1},
+ "line-height": {"normal": 1},
+ "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
+ "margin": {"px": 1, "em": 1, "%": 1},
+ "margin-right": {"px": 1, "em": 1, "%": 1},
+ "margin-left": {"px": 1, "em": 1, "%": 1},
+ "margin-top": {"px": 1, "em": 1, "%": 1},
+ "margin-bottom": {"px": 1, "em": 1, "%": 1},
+ "max-height": {"px": 1, "em": 1, "%": 1},
+ "max-width": {"px": 1, "em": 1, "%": 1},
+ "min-height": {"px": 1, "em": 1, "%": 1},
+ "min-width": {"px": 1, "em": 1, "%": 1},
+ "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
+ "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
+ "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
+ "padding": {"px": 1, "em": 1, "%": 1},
+ "padding-top": {"px": 1, "em": 1, "%": 1},
+ "padding-right": {"px": 1, "em": 1, "%": 1},
+ "padding-bottom": {"px": 1, "em": 1, "%": 1},
+ "padding-left": {"px": 1, "em": 1, "%": 1},
+ "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
+ "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
+ "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
+ "right": {"px": 1, "em": 1, "%": 1},
+ "table-layout": {"fixed": 1, "auto": 1},
+ "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
+ "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
+ "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
+ "top": {"px": 1, "em": 1, "%": 1},
+ "vertical-align": {"top": 1, "bottom": 1},
+ "visibility": {"hidden": 1, "visible": 1},
+ "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
+ "width": {"px": 1, "em": 1, "%": 1},
+ "word-spacing": {"normal": 1},
+ "filter": {"alpha(opacity=$0100)": 1},
+
+ "text-shadow": {"$02px 2px 2px #777": 1},
+ "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
+ "-moz-border-radius": 1,
+ "-moz-border-radius-topright": 1,
+ "-moz-border-radius-bottomright": 1,
+ "-moz-border-radius-topleft": 1,
+ "-moz-border-radius-bottomleft": 1,
+ "-webkit-border-radius": 1,
+ "-webkit-border-top-right-radius": 1,
+ "-webkit-border-top-left-radius": 1,
+ "-webkit-border-bottom-right-radius": 1,
+ "-webkit-border-bottom-left-radius": 1,
+ "-moz-box-shadow": 1,
+ "-webkit-box-shadow": 1,
+ "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
+ "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
+ "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
+};
+
+var CssCompletions = function() {
+
+};
+
+(function() {
+
+ this.completionsDefined = false;
+
+ this.defineCompletions = function() {
+ if (document) {
+ var style = document.createElement('c').style;
+
+ for (var i in style) {
+ if (typeof style[i] !== 'string')
+ continue;
+
+ var name = i.replace(/[A-Z]/g, function(x) {
+ return '-' + x.toLowerCase();
+ });
+
+ if (!propertyMap.hasOwnProperty(name))
+ propertyMap[name] = 1;
+ }
+ }
+
+ this.completionsDefined = true;
+ };
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ if (!this.completionsDefined) {
+ this.defineCompletions();
+ }
+
+ if (state==='ruleset' || session.$mode.$id == "ace/mode/scss") {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ if (/:[^;]+$/.test(line)) {
+ /([\w\-]+):[^:]*$/.test(line);
+
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
+ } else {
+ return this.getPropertyCompletions(state, session, pos, prefix);
+ }
+ }
+
+ return [];
+ };
+
+ this.getPropertyCompletions = function(state, session, pos, prefix) {
+ var properties = Object.keys(propertyMap);
+ return properties.map(function(property){
+ return {
+ caption: property,
+ snippet: property + ': $0;',
+ meta: "property",
+ score: 1000000
+ };
+ });
+ };
+
+ this.getPropertyValueCompletions = function(state, session, pos, prefix) {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
+
+ if (!property)
+ return [];
+ var values = [];
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
+ values = Object.keys(propertyMap[property]);
+ }
+ return values.map(function(value){
+ return {
+ caption: value,
+ snippet: value,
+ meta: "property value",
+ score: 1000000
+ };
+ });
+ };
+
+}).call(CssCompletions.prototype);
+
+exports.CssCompletions = CssCompletions;
+});
+
+define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+
+var CssBehaviour = function () {
+
+ this.inherit(CstyleBehaviour);
+
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
+ if (text === ':' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ':') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
+ return {
+ text: ':;',
+ selection: [1, 1]
+ };
+ }
+ }
+ }
+ });
+
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && selected === ':') {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
+ if (rightChar === ';') {
+ range.end.column ++;
+ return range;
+ }
+ }
+ }
+ });
+
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
+ if (text === ';' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ';') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+
+ this.add("!important", "insertion", function (state, action, editor, session, text) {
+ if (text === '!' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+
+ if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
+ return {
+ text: '!important',
+ selection: [10, 10]
+ };
+ }
+ }
+ });
+
+};
+oop.inherits(CssBehaviour, CstyleBehaviour);
+
+exports.CssBehaviour = CssBehaviour;
+});
+
+define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var CssCompletions = require("./css_completions").CssCompletions;
+var CssBehaviour = require("./behaviour/css").CssBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.HighlightRules = CssHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CssBehaviour();
+ this.$completer = new CssCompletions();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+ this.blockComment = {start: "/*", end: "*/"};
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ var match = line.match(/^.*\{\s*$/);
+ if (match) {
+ indent += tab;
+ }
+
+ return indent;
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ return this.$outdent.checkOutdent(line, input);
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
+ };
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ return this.$completer.getCompletions(state, session, pos, prefix);
+ };
+
+ this.createWorker = function(session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("annotate", function(e) {
+ session.setAnnotations(e.data);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+ this.$id = "ace/mode/css";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var XmlHighlightRules = function(normalize) {
+ var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
+
+ this.$rules = {
+ start : [
+ {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
+ {
+ token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
+ regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
+ },
+ {token : "comment.start.xml", regex : "<\\!--", next : "comment"},
+ {
+ token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
+ regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
+ },
+ {include : "tag"},
+ {token : "text.end-tag-open.xml", regex: ""},
+ {token : "text.tag-open.xml", regex: "<"},
+ {include : "reference"},
+ {defaultToken : "text.xml"}
+ ],
+
+ processing_instruction : [{
+ token : "entity.other.attribute-name.decl-attribute-name.xml",
+ regex : tagRegex
+ }, {
+ token : "keyword.operator.decl-attribute-equals.xml",
+ regex : "="
+ }, {
+ include: "whitespace"
+ }, {
+ include: "string"
+ }, {
+ token : "punctuation.xml-decl.xml",
+ regex : "\\?>",
+ next : "start"
+ }],
+
+ doctype : [
+ {include : "whitespace"},
+ {include : "string"},
+ {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
+ {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
+ {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
+ ],
+
+ int_subset : [{
+ token : "text.xml",
+ regex : "\\s+"
+ }, {
+ token: "punctuation.int-subset.xml",
+ regex: "]",
+ next: "pop"
+ }, {
+ token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
+ regex : "(<\\!)(" + tagRegex + ")",
+ push : [{
+ token : "text",
+ regex : "\\s+"
+ },
+ {
+ token : "punctuation.markup-decl.xml",
+ regex : ">",
+ next : "pop"
+ },
+ {include : "string"}]
+ }],
+
+ cdata : [
+ {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
+ {token : "text.xml", regex : "\\s+"},
+ {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
+ ],
+
+ comment : [
+ {token : "comment.end.xml", regex : "-->", next : "start"},
+ {defaultToken : "comment.xml"}
+ ],
+
+ reference : [{
+ token : "constant.language.escape.reference.xml",
+ regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }],
+
+ attr_reference : [{
+ token : "constant.language.escape.reference.attribute-value.xml",
+ regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }],
+
+ tag : [{
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
+ regex : "(?:(<)|())((?:" + tagRegex + ":)?" + tagRegex + ")",
+ next: [
+ {include : "attributes"},
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
+ ]
+ }],
+
+ tag_whitespace : [
+ {token : "text.tag-whitespace.xml", regex : "\\s+"}
+ ],
+ whitespace : [
+ {token : "text.whitespace.xml", regex : "\\s+"}
+ ],
+ string: [{
+ token : "string.xml",
+ regex : "'",
+ push : [
+ {token : "string.xml", regex: "'", next: "pop"},
+ {defaultToken : "string.xml"}
+ ]
+ }, {
+ token : "string.xml",
+ regex : '"',
+ push : [
+ {token : "string.xml", regex: '"', next: "pop"},
+ {defaultToken : "string.xml"}
+ ]
+ }],
+
+ attributes: [{
+ token : "entity.other.attribute-name.xml",
+ regex : tagRegex
+ }, {
+ token : "keyword.operator.attribute-equals.xml",
+ regex : "="
+ }, {
+ include: "tag_whitespace"
+ }, {
+ include: "attribute_value"
+ }],
+
+ attribute_value: [{
+ token : "string.attribute-value.xml",
+ regex : "'",
+ push : [
+ {token : "string.attribute-value.xml", regex: "'", next: "pop"},
+ {include : "attr_reference"},
+ {defaultToken : "string.attribute-value.xml"}
+ ]
+ }, {
+ token : "string.attribute-value.xml",
+ regex : '"',
+ push : [
+ {token : "string.attribute-value.xml", regex: '"', next: "pop"},
+ {include : "attr_reference"},
+ {defaultToken : "string.attribute-value.xml"}
+ ]
+ }]
+ };
+
+ if (this.constructor === XmlHighlightRules)
+ this.normalizeRules();
+};
+
+
+(function() {
+
+ this.embedTagRules = function(HighlightRules, prefix, tag){
+ this.$rules.tag.unshift({
+ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
+ regex : "(<)(" + tag + "(?=\\s|>|$))",
+ next: [
+ {include : "attributes"},
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
+ ]
+ });
+
+ this.$rules[tag + "-end"] = [
+ {include : "attributes"},
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
+ onMatch : function(value, currentState, stack) {
+ stack.splice(0);
+ return this.token;
+ }}
+ ];
+
+ this.embedRules(HighlightRules, prefix, [{
+ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
+ regex : "()(" + tag + "(?=\\s|>|$))",
+ next: tag + "-end"
+ }, {
+ token: "string.cdata.xml",
+ regex : "<\\!\\[CDATA\\["
+ }, {
+ token: "string.cdata.xml",
+ regex : "\\]\\]>"
+ }]);
+ };
+
+}).call(TextHighlightRules.prototype);
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
+
+var tagMap = lang.createMap({
+ a : 'anchor',
+ button : 'form',
+ form : 'form',
+ img : 'image',
+ input : 'form',
+ label : 'form',
+ option : 'form',
+ script : 'script',
+ select : 'form',
+ textarea : 'form',
+ style : 'style',
+ table : 'table',
+ tbody : 'table',
+ td : 'table',
+ tfoot : 'table',
+ th : 'table',
+ tr : 'table'
+});
+
+var HtmlHighlightRules = function() {
+ XmlHighlightRules.call(this);
+
+ this.addRules({
+ attributes: [{
+ include : "tag_whitespace"
+ }, {
+ token : "entity.other.attribute-name.xml",
+ regex : "[-_a-zA-Z0-9:.]+"
+ }, {
+ token : "keyword.operator.attribute-equals.xml",
+ regex : "=",
+ push : [{
+ include: "tag_whitespace"
+ }, {
+ token : "string.unquoted.attribute-value.html",
+ regex : "[^<>='\"`\\s]+",
+ next : "pop"
+ }, {
+ token : "empty",
+ regex : "",
+ next : "pop"
+ }]
+ }, {
+ include : "attribute_value"
+ }],
+ tag: [{
+ token : function(start, tag) {
+ var group = tagMap[tag];
+ return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
+ "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
+ },
+ regex : "(?)([-_a-zA-Z0-9:.]+)",
+ next: "tag_stuff"
+ }],
+ tag_stuff: [
+ {include : "attributes"},
+ {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
+ ]
+ });
+
+ this.embedTagRules(CssHighlightRules, "css-", "style");
+ this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
+
+ if (this.constructor === HtmlHighlightRules)
+ this.normalizeRules();
+};
+
+oop.inherits(HtmlHighlightRules, XmlHighlightRules);
+
+exports.HtmlHighlightRules = HtmlHighlightRules;
+});
+
+define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var lang = require("../../lib/lang");
+
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+
+var XmlBehaviour = function () {
+
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+
+ if (!token)
+ token = iterator.stepBackward();
+
+ if (!token)
+ return;
+
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+
+ if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+
+ if (token && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+
+ if (!token) {
+ return;
+ }
+
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+
+ if (this.voidElements && !this.voidElements[tag]) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ } else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+
+};
+
+oop.inherits(XmlBehaviour, Behaviour);
+
+exports.XmlBehaviour = XmlBehaviour;
+});
+
+define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
+ this.defaultMode = defaultMode;
+ this.subModes = subModes;
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+
+
+ this.$getMode = function(state) {
+ if (typeof state != "string")
+ state = state[0];
+ for (var key in this.subModes) {
+ if (state.indexOf(key) === 0)
+ return this.subModes[key];
+ }
+ return null;
+ };
+
+ this.$tryMode = function(state, session, foldStyle, row) {
+ var mode = this.$getMode(state);
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
+ };
+
+ this.getFoldWidget = function(session, foldStyle, row) {
+ return (
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
+ );
+ };
+
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
+ var mode = this.$getMode(session.getState(row-1));
+
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.$getMode(session.getState(row));
+
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.defaultMode;
+
+ return mode.getFoldWidgetRange(session, foldStyle, row);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var lang = require("../../lib/lang");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+
+var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+var Tag = function() {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = {row: 0, column: 0};
+ this.end = {row: 0, column: 0};
+};
+
+function is(token, type) {
+ return token.type.lastIndexOf(type + ".xml") > -1;
+}
+
+(function() {
+
+ this.getFoldWidget = function(session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle == "markbeginend" ? "end" : "";
+
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+
+ return "start";
+ };
+
+ this.getCommentFoldWidget = function(session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ } else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+
+ return null;
+ };
+
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this._readTagForward = function(iterator) {
+ var token = iterator.getCurrentToken();
+ if (!token)
+ return null;
+
+ var tag = new Tag();
+ do {
+ if (is(token, "tag-open")) {
+ tag.closing = is(token, "end-tag-open");
+ tag.start.row = iterator.getCurrentTokenRow();
+ tag.start.column = iterator.getCurrentTokenColumn();
+ } else if (is(token, "tag-name")) {
+ tag.tagName = token.value;
+ } else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == "/>";
+ tag.end.row = iterator.getCurrentTokenRow();
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
+ iterator.stepForward();
+ return tag;
+ }
+ } while(token = iterator.stepForward());
+
+ return null;
+ };
+
+ this._readTagBackward = function(iterator) {
+ var token = iterator.getCurrentToken();
+ if (!token)
+ return null;
+
+ var tag = new Tag();
+ do {
+ if (is(token, "tag-open")) {
+ tag.closing = is(token, "end-tag-open");
+ tag.start.row = iterator.getCurrentTokenRow();
+ tag.start.column = iterator.getCurrentTokenColumn();
+ iterator.stepBackward();
+ return tag;
+ } else if (is(token, "tag-name")) {
+ tag.tagName = token.value;
+ } else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == "/>";
+ tag.end.row = iterator.getCurrentTokenRow();
+ tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
+ }
+ } while(token = iterator.stepBackward());
+
+ return null;
+ };
+
+ this._pop = function(stack, tag) {
+ while (stack.length) {
+
+ var top = stack[stack.length-1];
+ if (!tag || top.tagName == tag.tagName) {
+ return stack.pop();
+ }
+ else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
+ stack.pop();
+ continue;
+ } else {
+ return null;
+ }
+ }
+ };
+
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row)
+ && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+
+ var isBackward = firstTag.closing || firstTag.selfClosing;
+ var stack = [];
+ var tag;
+
+ if (!isBackward) {
+ var iterator = new TokenIterator(session, row, firstTag.start.column);
+ var start = {
+ row: row,
+ column: firstTag.start.column + firstTag.tagName.length + 2
+ };
+ if (firstTag.start.row == firstTag.end.row)
+ start.column = firstTag.end.column;
+ while (tag = this._readTagForward(iterator)) {
+ if (tag.selfClosing) {
+ if (!stack.length) {
+ tag.start.column += tag.tagName.length + 2;
+ tag.end.column -= 2;
+ return Range.fromPoints(tag.start, tag.end);
+ } else
+ continue;
+ }
+
+ if (tag.closing) {
+ this._pop(stack, tag);
+ if (stack.length == 0)
+ return Range.fromPoints(start, tag.start);
+ }
+ else {
+ stack.push(tag);
+ }
+ }
+ }
+ else {
+ var iterator = new TokenIterator(session, row, firstTag.end.column);
+ var end = {
+ row: row,
+ column: firstTag.start.column
+ };
+
+ while (tag = this._readTagBackward(iterator)) {
+ if (tag.selfClosing) {
+ if (!stack.length) {
+ tag.start.column += tag.tagName.length + 2;
+ tag.end.column -= 2;
+ return Range.fromPoints(tag.start, tag.end);
+ } else
+ continue;
+ }
+
+ if (!tag.closing) {
+ this._pop(stack, tag);
+ if (stack.length == 0) {
+ tag.start.column += tag.tagName.length + 2;
+ if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
+ tag.start.column = tag.end.column;
+ return Range.fromPoints(tag.start, end);
+ }
+ }
+ else {
+ stack.push(tag);
+ }
+ }
+ }
+
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var MixedFoldMode = require("./mixed").FoldMode;
+var XmlFoldMode = require("./xml").FoldMode;
+var CStyleFoldMode = require("./cstyle").FoldMode;
+
+var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
+ "js-": new CStyleFoldMode(),
+ "css-": new CStyleFoldMode()
+ });
+};
+
+oop.inherits(FoldMode, MixedFoldMode);
+
+});
+
+define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
+"use strict";
+
+var TokenIterator = require("../token_iterator").TokenIterator;
+
+var commonAttributes = [
+ "accesskey",
+ "class",
+ "contenteditable",
+ "contextmenu",
+ "dir",
+ "draggable",
+ "dropzone",
+ "hidden",
+ "id",
+ "inert",
+ "itemid",
+ "itemprop",
+ "itemref",
+ "itemscope",
+ "itemtype",
+ "lang",
+ "spellcheck",
+ "style",
+ "tabindex",
+ "title",
+ "translate"
+];
+
+var eventAttributes = [
+ "onabort",
+ "onblur",
+ "oncancel",
+ "oncanplay",
+ "oncanplaythrough",
+ "onchange",
+ "onclick",
+ "onclose",
+ "oncontextmenu",
+ "oncuechange",
+ "ondblclick",
+ "ondrag",
+ "ondragend",
+ "ondragenter",
+ "ondragleave",
+ "ondragover",
+ "ondragstart",
+ "ondrop",
+ "ondurationchange",
+ "onemptied",
+ "onended",
+ "onerror",
+ "onfocus",
+ "oninput",
+ "oninvalid",
+ "onkeydown",
+ "onkeypress",
+ "onkeyup",
+ "onload",
+ "onloadeddata",
+ "onloadedmetadata",
+ "onloadstart",
+ "onmousedown",
+ "onmousemove",
+ "onmouseout",
+ "onmouseover",
+ "onmouseup",
+ "onmousewheel",
+ "onpause",
+ "onplay",
+ "onplaying",
+ "onprogress",
+ "onratechange",
+ "onreset",
+ "onscroll",
+ "onseeked",
+ "onseeking",
+ "onselect",
+ "onshow",
+ "onstalled",
+ "onsubmit",
+ "onsuspend",
+ "ontimeupdate",
+ "onvolumechange",
+ "onwaiting"
+];
+
+var globalAttributes = commonAttributes.concat(eventAttributes);
+
+var attributeMap = {
+ "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
+ "abbr": {},
+ "address": {},
+ "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
+ "article": {"pubdate": 1},
+ "aside": {},
+ "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
+ "b": {},
+ "base": {"href": 1, "target": 1},
+ "bdi": {},
+ "bdo": {},
+ "blockquote": {"cite": 1},
+ "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
+ "br": {},
+ "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
+ "canvas": {"width": 1, "height": 1},
+ "caption": {},
+ "cite": {},
+ "code": {},
+ "col": {"span": 1},
+ "colgroup": {"span": 1},
+ "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
+ "data": {},
+ "datalist": {},
+ "dd": {},
+ "del": {"cite": 1, "datetime": 1},
+ "details": {"open": 1},
+ "dfn": {},
+ "dialog": {"open": 1},
+ "div": {},
+ "dl": {},
+ "dt": {},
+ "em": {},
+ "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
+ "fieldset": {"disabled": 1, "form": 1, "name": 1},
+ "figcaption": {},
+ "figure": {},
+ "footer": {},
+ "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
+ "h1": {},
+ "h2": {},
+ "h3": {},
+ "h4": {},
+ "h5": {},
+ "h6": {},
+ "head": {},
+ "header": {},
+ "hr": {},
+ "html": {"manifest": 1},
+ "i": {},
+ "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
+ "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
+ "input": {
+ "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
+ "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
+ "ins": {"cite": 1, "datetime": 1},
+ "kbd": {},
+ "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
+ "label": {"form": 1, "for": 1},
+ "legend": {},
+ "li": {"value": 1},
+ "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
+ "main": {},
+ "map": {"name": 1},
+ "mark": {},
+ "math": {},
+ "menu": {"type": 1, "label": 1},
+ "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
+ "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
+ "nav": {},
+ "noscript": {"href": 1},
+ "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
+ "ol": {"start": 1, "reversed": 1},
+ "optgroup": {"disabled": 1, "label": 1},
+ "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
+ "output": {"for": 1, "form": 1, "name": 1},
+ "p": {},
+ "param": {"name": 1, "value": 1},
+ "pre": {},
+ "progress": {"value": 1, "max": 1},
+ "q": {"cite": 1},
+ "rp": {},
+ "rt": {},
+ "ruby": {},
+ "s": {},
+ "samp": {},
+ "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
+ "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
+ "small": {},
+ "source": {"src": 1, "type": 1, "media": 1},
+ "span": {},
+ "strong": {},
+ "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
+ "sub": {},
+ "sup": {},
+ "svg": {},
+ "table": {"summary": 1},
+ "tbody": {},
+ "td": {"headers": 1, "rowspan": 1, "colspan": 1},
+ "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
+ "tfoot": {},
+ "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
+ "thead": {},
+ "time": {"datetime": 1},
+ "title": {},
+ "tr": {},
+ "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
+ "section": {},
+ "summary": {},
+ "u": {},
+ "ul": {},
+ "var": {},
+ "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
+ "wbr": {}
+};
+
+var elements = Object.keys(attributeMap);
+
+function is(token, type) {
+ return token.type.lastIndexOf(type + ".xml") > -1;
+}
+
+function findTagName(session, pos) {
+ var iterator = new TokenIterator(session, pos.row, pos.column);
+ var token = iterator.getCurrentToken();
+ while (token && !is(token, "tag-name")){
+ token = iterator.stepBackward();
+ }
+ if (token)
+ return token.value;
+}
+
+function findAttributeName(session, pos) {
+ var iterator = new TokenIterator(session, pos.row, pos.column);
+ var token = iterator.getCurrentToken();
+ while (token && !is(token, "attribute-name")){
+ token = iterator.stepBackward();
+ }
+ if (token)
+ return token.value;
+}
+
+var HtmlCompletions = function() {
+
+};
+
+(function() {
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ var token = session.getTokenAt(pos.row, pos.column);
+
+ if (!token)
+ return [];
+ if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
+ return this.getTagCompletions(state, session, pos, prefix);
+ if (is(token, "tag-whitespace") || is(token, "attribute-name"))
+ return this.getAttributeCompletions(state, session, pos, prefix);
+ if (is(token, "attribute-value"))
+ return this.getAttributeValueCompletions(state, session, pos, prefix);
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ if (/&[a-z]*$/i.test(line))
+ return this.getHTMLEntityCompletions(state, session, pos, prefix);
+
+ return [];
+ };
+
+ this.getTagCompletions = function(state, session, pos, prefix) {
+ return elements.map(function(element){
+ return {
+ value: element,
+ meta: "tag",
+ score: 1000000
+ };
+ });
+ };
+
+ this.getAttributeCompletions = function(state, session, pos, prefix) {
+ var tagName = findTagName(session, pos);
+ if (!tagName)
+ return [];
+ var attributes = globalAttributes;
+ if (tagName in attributeMap) {
+ attributes = attributes.concat(Object.keys(attributeMap[tagName]));
+ }
+ return attributes.map(function(attribute){
+ return {
+ caption: attribute,
+ snippet: attribute + '="$0"',
+ meta: "attribute",
+ score: 1000000
+ };
+ });
+ };
+
+ this.getAttributeValueCompletions = function(state, session, pos, prefix) {
+ var tagName = findTagName(session, pos);
+ var attributeName = findAttributeName(session, pos);
+
+ if (!tagName)
+ return [];
+ var values = [];
+ if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
+ values = Object.keys(attributeMap[tagName][attributeName]);
+ }
+ return values.map(function(value){
+ return {
+ caption: value,
+ snippet: value,
+ meta: "attribute value",
+ score: 1000000
+ };
+ });
+ };
+
+ this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
+ var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
+
+ return values.map(function(value){
+ return {
+ caption: value,
+ snippet: value,
+ meta: "html entity",
+ score: 1000000
+ };
+ });
+ };
+
+}).call(HtmlCompletions.prototype);
+
+exports.HtmlCompletions = HtmlCompletions;
+});
+
+define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var TextMode = require("./text").Mode;
+var JavaScriptMode = require("./javascript").Mode;
+var CssMode = require("./css").Mode;
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+var HtmlCompletions = require("./html_completions").HtmlCompletions;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
+var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
+
+var Mode = function(options) {
+ this.fragmentContext = options && options.fragmentContext;
+ this.HighlightRules = HtmlHighlightRules;
+ this.$behaviour = new XmlBehaviour();
+ this.$completer = new HtmlCompletions();
+
+ this.createModeDelegates({
+ "js-": JavaScriptMode,
+ "css-": CssMode
+ });
+
+ this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.blockComment = {start: ""};
+
+ this.voidElements = lang.arrayToMap(voidElements);
+
+ this.getNextLineIndent = function(state, line, tab) {
+ return this.$getIndent(line);
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ return false;
+ };
+
+ this.getCompletions = function(state, session, pos, prefix) {
+ return this.$completer.getCompletions(state, session, pos, prefix);
+ };
+
+ this.createWorker = function(session) {
+ if (this.constructor != Mode)
+ return;
+ var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+
+ if (this.fragmentContext)
+ worker.call("setOptions", [{context: this.fragmentContext}]);
+
+ worker.on("error", function(e) {
+ session.setAnnotations(e.data);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+ this.$id = "ace/mode/html";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+define("ace/mode/nunjucks_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+
+var NunjucksHighlightRules = function() {
+ HtmlHighlightRules.call(this);
+ this.$rules["start"].unshift({
+ token: "punctuation.begin",
+ regex: /{{-?/,
+ push: [{
+ token: "punctuation.end",
+ regex: /-?}}/,
+ next: "pop"
+ },
+ {include: "expression"}
+ ]
+ }, {
+ token: "punctuation.begin",
+ regex: /{%-?/,
+ push: [{
+ token: "punctuation.end",
+ regex: /-?%}/,
+ next: "pop"
+ }, {
+ token: "constant.language.escape",
+ regex: /\b(r\/.*\/[gimy]?)\b/
+ },
+ {include: "statement"}
+ ]
+ }, {
+ token: "comment.begin",
+ regex: /{#/,
+ push: [{
+ token: "comment.end",
+ regex: /#}/,
+ next: "pop"
+ },
+ {defaultToken: "comment"}
+ ]
+ });
+ this.addRules({
+ attribute_value: [{
+ token: "string.attribute-value.xml",
+ regex: "'",
+ push: [
+ {token: "string.attribute-value.xml", regex: "'", next: "pop"},
+ {
+ token: "punctuation.begin",
+ regex: /{{-?/,
+ push: [{
+ token: "punctuation.end",
+ regex: /-?}}/,
+ next: "pop"
+ },
+ {include: "expression"}
+ ]
+ },
+ {include: "attr_reference"},
+ {defaultToken: "string.attribute-value.xml"}
+ ]
+ }, {
+ token: "string.attribute-value.xml",
+ regex: '"',
+ push: [
+ {token: "string.attribute-value.xml", regex: '"', next: "pop"},
+ {
+ token: "punctuation.begin",
+ regex: /{{-?/,
+ push: [{
+ token: "punctuation.end",
+ regex: /-?}}/,
+ next: "pop"
+ },
+ {include: "expression"}
+ ]
+ },
+ {include: "attr_reference"},
+ {defaultToken: "string.attribute-value.xml"}
+ ]
+ }],
+ "statement": [{
+ token: "keyword.control",
+ regex: /\b(block|endblock|extends|endif|elif|for|endfor|asyncEach|endeach|include|asyncAll|endall|macro|endmacro|set|endset|ignore missing|as|from|raw|verbatim|filter|endfilter)\b/
+ },
+ {include: "expression"}
+ ],
+ "expression": [{
+ token: "constant.language",
+ regex: /\b(true|false|none)\b/
+ }, {
+ token: "string",
+ regex: /"/,
+ push: [{
+ token: "string",
+ regex: /"/,
+ next: "pop"
+ },
+ {include: "escapeStrings"},
+ {defaultToken: "string"}
+ ]
+ }, {
+ token: "string",
+ regex: /'/,
+ push: [{
+ token: "string",
+ regex: /'/,
+ next: "pop"
+ },
+ {include: "escapeStrings"},
+ {defaultToken: "string"}
+ ]
+ }, {
+ token: "constant.numeric", // hexadecimal, octal and binary
+ regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
+ }, {
+ token: "constant.numeric", // decimal integers and floats
+ regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
+ }, {
+ token: "keyword.operator",
+ regex: /\+|-|\/\/|\/|%|\*\*|\*|===|==|!==|!=|>=|>|<=|
+ }, {
+ token: "keyword.control",
+ regex: /\b(and|else|if|in|import|not|or)\b/
+ }, {
+ token: "support.function",
+ regex: /[a-zA-Z_]+(?=\()/
+ }, {
+ token: "paren.lpar",
+ regex: /[(\[{]/
+ }, {
+ token: "paren.rpar",
+ regex: /[)\]}]/
+ }, {
+ token: "punctuation",
+ regex: /[,]/
+ }, {
+ token: ["punctuation", "support.function"],
+ regex: /(\.)([a-zA-Z_][a-zA-Z0-9_]*)(?=\()/
+ }, {
+ token: ["punctuation", "variable.parameter"],
+ regex: /(\.)([a-zA-Z_][a-zA-Z0-9_]*)/
+ }, {
+ token: ["punctuation", "text", "support.other"],
+ regex: /(\|)(\s)*([a-zA-Z_][a-zA-Z0-9_]*)/
+ }, {
+ token: "variable",
+ regex: /[a-zA-Z_][a-zA-Z0-9_]*/
+ }
+ ],
+ "escapeStrings": [{
+ token: "constant.language.escape",
+ regex: /(\\\\n)|(\\\\)|(\\")|(\\')|(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)/
+ }, {
+ token: "constant.language.escape",
+ regex: /\\(?:x[0-9A-F]{2}|(?:U[0-9A-Fa-f]{8})|(?:u[0-9A-Fa-f]{4})|(?:N{[a-zA-Z ]+}))/
+ }]
+ });
+
+ this.normalizeRules();
+};
+
+oop.inherits(NunjucksHighlightRules, TextHighlightRules);
+
+exports.NunjucksHighlightRules = NunjucksHighlightRules;
+});
+
+define("ace/mode/nunjucks",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/nunjucks_highlight_rules"], function(require, exports, module) {
+ "use strict";
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var NunjucksHighlightRules = require("./nunjucks_highlight_rules").NunjucksHighlightRules;
+
+var Mode = function() {
+ this.HighlightRules = NunjucksHighlightRules;
+};
+
+oop.inherits(Mode, HtmlMode);
+
+(function() {
+ this.$id = "ace/mode/nunjucks";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+}); (function() {
+ window.require(["ace/mode/nunjucks"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/mode-rust.js b/htdocs/includes/ace/src/mode-rust.js
index d10bdfce408..e24ed47a680 100644
--- a/htdocs/includes/ace/src/mode-rust.js
+++ b/htdocs/includes/ace/src/mode-rust.js
@@ -56,7 +56,7 @@ var RustHighlightRules = function() {
regex: '\\b(fn)(\\s+)((?:r#)?[a-zA-Z_][a-zA-Z0-9_]*)' },
{ token: 'support.constant', regex: '\\b[a-zA-Z_][\\w\\d]*::' },
{ token: 'keyword.source.rust',
- regex: '\\b(?:abstract|alignof|as|become|box|break|catch|continue|const|crate|default|do|dyn|else|enum|extern|for|final|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\\b' },
+ regex: '\\b(?:abstract|alignof|as|async|await|become|box|break|catch|continue|const|crate|default|do|dyn|else|enum|extern|for|final|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\\b' },
{ token: 'storage.type.source.rust',
regex: '\\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|u128|f16|f32|f64|i8|i16|i32|i64|i128|str|option|either|c_float|c_double|c_void|FILE|fpos_t|DIR|dirent|c_char|c_schar|c_uchar|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|size_t|ptrdiff_t|clock_t|time_t|c_longlong|c_ulonglong|intptr_t|uintptr_t|off_t|dev_t|ino_t|pid_t|mode_t|ssize_t)\\b' },
{ token: 'variable.language.source.rust', regex: '\\bself\\b' },
diff --git a/htdocs/includes/ace/src/mode-slim.js b/htdocs/includes/ace/src/mode-slim.js
index 320e6a75b92..7f243bde705 100644
--- a/htdocs/includes/ace/src/mode-slim.js
+++ b/htdocs/includes/ace/src/mode-slim.js
@@ -2831,7 +2831,7 @@ var MarkdownHighlightRules = function() {
next : "blockquote"
}, { // HR * - _
token : "constant",
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
+ regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
next: "allowBlock"
}, { // list
token : "markup.list",
diff --git a/htdocs/includes/ace/src/mode-vhdl.js b/htdocs/includes/ace/src/mode-vhdl.js
index e6222383e60..75f22a1f512 100644
--- a/htdocs/includes/ace/src/mode-vhdl.js
+++ b/htdocs/includes/ace/src/mode-vhdl.js
@@ -12,15 +12,14 @@ var VHDLHighlightRules = function() {
"begin|block|buffer|bus|case|component|configuration|"+
"disconnect|downto|else|elsif|end|entity|file|for|function|"+
"generate|generic|guarded|if|impure|in|inertial|inout|is|"+
- "label|linkage|literal|loop|mapnew|next|of|on|open|"+
- "others|out|port|process|pure|range|record|reject|"+
- "report|return|select|shared|subtype|then|to|transport|"+
+ "label|linkage|literal|loop|mapnew|next|of|on|open|others|"+
+ "out|port|process|pure|range|record|reject|report|return|"+
+ "select|severity|shared|signal|subtype|then|to|transport|"+
"type|unaffected|united|until|wait|when|while|with";
var storageType = "bit|bit_vector|boolean|character|integer|line|natural|"+
- "positive|real|register|severity|signal|signed|"+
- "std_logic|std_logic_vector|string||text|time|unsigned|"+
- "variable";
+ "positive|real|register|signed|std_logic|"+
+ "std_logic_vector|string||text|time|unsigned|variable";
var storageModifiers = "array|constant";
diff --git a/htdocs/includes/ace/src/snippets/json5.js b/htdocs/includes/ace/src/snippets/json5.js
new file mode 100644
index 00000000000..8afbead737d
--- /dev/null
+++ b/htdocs/includes/ace/src/snippets/json5.js
@@ -0,0 +1,14 @@
+define("ace/snippets/json5",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText =undefined;
+exports.scope = "json5";
+
+}); (function() {
+ window.require(["ace/snippets/json5"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/snippets/nunjucks.js b/htdocs/includes/ace/src/snippets/nunjucks.js
new file mode 100644
index 00000000000..961adec5778
--- /dev/null
+++ b/htdocs/includes/ace/src/snippets/nunjucks.js
@@ -0,0 +1,14 @@
+define("ace/snippets/nunjucks",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText =undefined;
+exports.scope = "nunjucks";
+
+}); (function() {
+ window.require(["ace/snippets/nunjucks"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/htdocs/includes/ace/src/worker-coffee.js b/htdocs/includes/ace/src/worker-coffee.js
index 38a3b4a12c6..e924c0c88a4 100644
--- a/htdocs/includes/ace/src/worker-coffee.js
+++ b/htdocs/includes/ace/src/worker-coffee.js
@@ -2092,10 +2092,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-css.js b/htdocs/includes/ace/src/worker-css.js
index 78d75c18028..a7d914e3397 100644
--- a/htdocs/includes/ace/src/worker-css.js
+++ b/htdocs/includes/ace/src/worker-css.js
@@ -8709,10 +8709,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-html.js b/htdocs/includes/ace/src/worker-html.js
index 6d60761b9a1..f52f5eeb204 100644
--- a/htdocs/includes/ace/src/worker-html.js
+++ b/htdocs/includes/ace/src/worker-html.js
@@ -11544,10 +11544,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-javascript.js b/htdocs/includes/ace/src/worker-javascript.js
index 19f5058d5c1..4d3d2a85e99 100644
--- a/htdocs/includes/ace/src/worker-javascript.js
+++ b/htdocs/includes/ace/src/worker-javascript.js
@@ -12467,10 +12467,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-json.js b/htdocs/includes/ace/src/worker-json.js
index 3f5abb5c5fe..0f7fa308c6f 100644
--- a/htdocs/includes/ace/src/worker-json.js
+++ b/htdocs/includes/ace/src/worker-json.js
@@ -2337,10 +2337,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-lua.js b/htdocs/includes/ace/src/worker-lua.js
index 6e1ebb68275..9884d2a8759 100644
--- a/htdocs/includes/ace/src/worker-lua.js
+++ b/htdocs/includes/ace/src/worker-lua.js
@@ -3572,10 +3572,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-php.js b/htdocs/includes/ace/src/worker-php.js
index 7d41f37cb50..9be61099005 100644
--- a/htdocs/includes/ace/src/worker-php.js
+++ b/htdocs/includes/ace/src/worker-php.js
@@ -2394,7 +2394,7 @@ PHP.Lexer = function(src, ini) {
};
-PHP.Parser = function ( preprocessedTokens, eval ) {
+PHP.Parser = function ( preprocessedTokens, evaluate ) {
var yybase = this.yybase,
yydefault = this.yydefault,
@@ -2516,7 +2516,7 @@ PHP.Parser = function ( preprocessedTokens, eval ) {
this.yyastk[ this.stackPos ] = this.yyval;
attributeStack[ this.stackPos ] = this.startAttributes;
} else {
- if (eval !== true) {
+ if (evaluate !== true) {
var expected = [];
@@ -4241,10 +4241,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-xml.js b/htdocs/includes/ace/src/worker-xml.js
index f6ea2cbf148..d661272a9d2 100644
--- a/htdocs/includes/ace/src/worker-xml.js
+++ b/htdocs/includes/ace/src/worker-xml.js
@@ -1824,10 +1824,15 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '',start+9);
- domBuilder.startCDATA();
- domBuilder.characters(source,start+9,end-start-9);
- domBuilder.endCDATA()
- return end+3;
+ if (end > start) {
+ domBuilder.startCDATA();
+ domBuilder.characters(source,start+9,end-start-9);
+ domBuilder.endCDATA()
+ return end+3;
+ } else {
+ errorHandler.error("Unclosed CDATA");
+ return -1;
+ }
}
var matchs = split(source,start);
var len = matchs.length;
@@ -3825,10 +3830,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/src/worker-xquery.js b/htdocs/includes/ace/src/worker-xquery.js
index a20b76c2c28..6f0f68123d2 100644
--- a/htdocs/includes/ace/src/worker-xquery.js
+++ b/htdocs/includes/ace/src/worker-xquery.js
@@ -58290,10 +58290,10 @@ if (!Date.now) {
return new Date().getTime();
};
}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
"\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
+if (!String.prototype.trim) {
ws = "[" + ws + "]";
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
trimEndRegexp = new RegExp(ws + ws + "*$");
diff --git a/htdocs/includes/ace/webpack-resolver.js b/htdocs/includes/ace/webpack-resolver.js
index 1d5de60d98a..6205871f242 100644
--- a/htdocs/includes/ace/webpack-resolver.js
+++ b/htdocs/includes/ace/webpack-resolver.js
@@ -1,403 +1,403 @@
-ace.config.setModuleUrl('ace/ext/beautify', require('file-loader!./src-noconflict/ext-beautify.js'))
-ace.config.setModuleUrl('ace/ext/elastic_tabstops_lite', require('file-loader!./src-noconflict/ext-elastic_tabstops_lite.js'))
-ace.config.setModuleUrl('ace/ext/emmet', require('file-loader!./src-noconflict/ext-emmet.js'))
-ace.config.setModuleUrl('ace/ext/error_marker', require('file-loader!./src-noconflict/ext-error_marker.js'))
-ace.config.setModuleUrl('ace/ext/keyboard_menu', require('file-loader!./src-noconflict/ext-keybinding_menu.js'))
-ace.config.setModuleUrl('ace/ext/language_tools', require('file-loader!./src-noconflict/ext-language_tools.js'))
-ace.config.setModuleUrl('ace/ext/linking', require('file-loader!./src-noconflict/ext-linking.js'))
-ace.config.setModuleUrl('ace/ext/modelist', require('file-loader!./src-noconflict/ext-modelist.js'))
-ace.config.setModuleUrl('ace/ext/options', require('file-loader!./src-noconflict/ext-options.js'))
-ace.config.setModuleUrl('ace/ext/prompt', require('file-loader!./src-noconflict/ext-prompt.js'))
-ace.config.setModuleUrl('ace/ext/rtl', require('file-loader!./src-noconflict/ext-rtl.js'))
-ace.config.setModuleUrl('ace/ext/searchbox', require('file-loader!./src-noconflict/ext-searchbox.js'))
-ace.config.setModuleUrl('ace/ext/settings_menu', require('file-loader!./src-noconflict/ext-settings_menu.js'))
-ace.config.setModuleUrl('ace/ext/spellcheck', require('file-loader!./src-noconflict/ext-spellcheck.js'))
-ace.config.setModuleUrl('ace/ext/split', require('file-loader!./src-noconflict/ext-split.js'))
-ace.config.setModuleUrl('ace/ext/static_highlight', require('file-loader!./src-noconflict/ext-static_highlight.js'))
-ace.config.setModuleUrl('ace/ext/statusbar', require('file-loader!./src-noconflict/ext-statusbar.js'))
-ace.config.setModuleUrl('ace/ext/textarea', require('file-loader!./src-noconflict/ext-textarea.js'))
-ace.config.setModuleUrl('ace/ext/themelist', require('file-loader!./src-noconflict/ext-themelist.js'))
-ace.config.setModuleUrl('ace/ext/whitespace', require('file-loader!./src-noconflict/ext-whitespace.js'))
-ace.config.setModuleUrl('ace/keyboard/emacs', require('file-loader!./src-noconflict/keybinding-emacs.js'))
-ace.config.setModuleUrl('ace/keyboard/sublime', require('file-loader!./src-noconflict/keybinding-sublime.js'))
-ace.config.setModuleUrl('ace/keyboard/vim', require('file-loader!./src-noconflict/keybinding-vim.js'))
-ace.config.setModuleUrl('ace/mode/abap', require('file-loader!./src-noconflict/mode-abap.js'))
-ace.config.setModuleUrl('ace/mode/abc', require('file-loader!./src-noconflict/mode-abc.js'))
-ace.config.setModuleUrl('ace/mode/actionscript', require('file-loader!./src-noconflict/mode-actionscript.js'))
-ace.config.setModuleUrl('ace/mode/ada', require('file-loader!./src-noconflict/mode-ada.js'))
-ace.config.setModuleUrl('ace/mode/apache_conf', require('file-loader!./src-noconflict/mode-apache_conf.js'))
-ace.config.setModuleUrl('ace/mode/apex', require('file-loader!./src-noconflict/mode-apex.js'))
-ace.config.setModuleUrl('ace/mode/applescript', require('file-loader!./src-noconflict/mode-applescript.js'))
-ace.config.setModuleUrl('ace/mode/aql', require('file-loader!./src-noconflict/mode-aql.js'))
-ace.config.setModuleUrl('ace/mode/asciidoc', require('file-loader!./src-noconflict/mode-asciidoc.js'))
-ace.config.setModuleUrl('ace/mode/asl', require('file-loader!./src-noconflict/mode-asl.js'))
-ace.config.setModuleUrl('ace/mode/assembly_x86', require('file-loader!./src-noconflict/mode-assembly_x86.js'))
-ace.config.setModuleUrl('ace/mode/autohotkey', require('file-loader!./src-noconflict/mode-autohotkey.js'))
-ace.config.setModuleUrl('ace/mode/batchfile', require('file-loader!./src-noconflict/mode-batchfile.js'))
-ace.config.setModuleUrl('ace/mode/bro', require('file-loader!./src-noconflict/mode-bro.js'))
-ace.config.setModuleUrl('ace/mode/c9search', require('file-loader!./src-noconflict/mode-c9search.js'))
-ace.config.setModuleUrl('ace/mode/cirru', require('file-loader!./src-noconflict/mode-cirru.js'))
-ace.config.setModuleUrl('ace/mode/clojure', require('file-loader!./src-noconflict/mode-clojure.js'))
-ace.config.setModuleUrl('ace/mode/cobol', require('file-loader!./src-noconflict/mode-cobol.js'))
-ace.config.setModuleUrl('ace/mode/coffee', require('file-loader!./src-noconflict/mode-coffee.js'))
-ace.config.setModuleUrl('ace/mode/coldfusion', require('file-loader!./src-noconflict/mode-coldfusion.js'))
-ace.config.setModuleUrl('ace/mode/crystal', require('file-loader!./src-noconflict/mode-crystal.js'))
-ace.config.setModuleUrl('ace/mode/csharp', require('file-loader!./src-noconflict/mode-csharp.js'))
-ace.config.setModuleUrl('ace/mode/csound_document', require('file-loader!./src-noconflict/mode-csound_document.js'))
-ace.config.setModuleUrl('ace/mode/csound_orchestra', require('file-loader!./src-noconflict/mode-csound_orchestra.js'))
-ace.config.setModuleUrl('ace/mode/csound_score', require('file-loader!./src-noconflict/mode-csound_score.js'))
-ace.config.setModuleUrl('ace/mode/csp', require('file-loader!./src-noconflict/mode-csp.js'))
-ace.config.setModuleUrl('ace/mode/css', require('file-loader!./src-noconflict/mode-css.js'))
-ace.config.setModuleUrl('ace/mode/curly', require('file-loader!./src-noconflict/mode-curly.js'))
-ace.config.setModuleUrl('ace/mode/c_cpp', require('file-loader!./src-noconflict/mode-c_cpp.js'))
-ace.config.setModuleUrl('ace/mode/d', require('file-loader!./src-noconflict/mode-d.js'))
-ace.config.setModuleUrl('ace/mode/dart', require('file-loader!./src-noconflict/mode-dart.js'))
-ace.config.setModuleUrl('ace/mode/diff', require('file-loader!./src-noconflict/mode-diff.js'))
-ace.config.setModuleUrl('ace/mode/django', require('file-loader!./src-noconflict/mode-django.js'))
-ace.config.setModuleUrl('ace/mode/dockerfile', require('file-loader!./src-noconflict/mode-dockerfile.js'))
-ace.config.setModuleUrl('ace/mode/dot', require('file-loader!./src-noconflict/mode-dot.js'))
-ace.config.setModuleUrl('ace/mode/drools', require('file-loader!./src-noconflict/mode-drools.js'))
-ace.config.setModuleUrl('ace/mode/edifact', require('file-loader!./src-noconflict/mode-edifact.js'))
-ace.config.setModuleUrl('ace/mode/eiffel', require('file-loader!./src-noconflict/mode-eiffel.js'))
-ace.config.setModuleUrl('ace/mode/ejs', require('file-loader!./src-noconflict/mode-ejs.js'))
-ace.config.setModuleUrl('ace/mode/elixir', require('file-loader!./src-noconflict/mode-elixir.js'))
-ace.config.setModuleUrl('ace/mode/elm', require('file-loader!./src-noconflict/mode-elm.js'))
-ace.config.setModuleUrl('ace/mode/erlang', require('file-loader!./src-noconflict/mode-erlang.js'))
-ace.config.setModuleUrl('ace/mode/forth', require('file-loader!./src-noconflict/mode-forth.js'))
-ace.config.setModuleUrl('ace/mode/fortran', require('file-loader!./src-noconflict/mode-fortran.js'))
-ace.config.setModuleUrl('ace/mode/fsharp', require('file-loader!./src-noconflict/mode-fsharp.js'))
-ace.config.setModuleUrl('ace/mode/fsl', require('file-loader!./src-noconflict/mode-fsl.js'))
-ace.config.setModuleUrl('ace/mode/ftl', require('file-loader!./src-noconflict/mode-ftl.js'))
-ace.config.setModuleUrl('ace/mode/gcode', require('file-loader!./src-noconflict/mode-gcode.js'))
-ace.config.setModuleUrl('ace/mode/gherkin', require('file-loader!./src-noconflict/mode-gherkin.js'))
-ace.config.setModuleUrl('ace/mode/gitignore', require('file-loader!./src-noconflict/mode-gitignore.js'))
-ace.config.setModuleUrl('ace/mode/glsl', require('file-loader!./src-noconflict/mode-glsl.js'))
-ace.config.setModuleUrl('ace/mode/gobstones', require('file-loader!./src-noconflict/mode-gobstones.js'))
-ace.config.setModuleUrl('ace/mode/golang', require('file-loader!./src-noconflict/mode-golang.js'))
-ace.config.setModuleUrl('ace/mode/graphqlschema', require('file-loader!./src-noconflict/mode-graphqlschema.js'))
-ace.config.setModuleUrl('ace/mode/groovy', require('file-loader!./src-noconflict/mode-groovy.js'))
-ace.config.setModuleUrl('ace/mode/haml', require('file-loader!./src-noconflict/mode-haml.js'))
-ace.config.setModuleUrl('ace/mode/handlebars', require('file-loader!./src-noconflict/mode-handlebars.js'))
-ace.config.setModuleUrl('ace/mode/haskell', require('file-loader!./src-noconflict/mode-haskell.js'))
-ace.config.setModuleUrl('ace/mode/haskell_cabal', require('file-loader!./src-noconflict/mode-haskell_cabal.js'))
-ace.config.setModuleUrl('ace/mode/haxe', require('file-loader!./src-noconflict/mode-haxe.js'))
-ace.config.setModuleUrl('ace/mode/hjson', require('file-loader!./src-noconflict/mode-hjson.js'))
-ace.config.setModuleUrl('ace/mode/html', require('file-loader!./src-noconflict/mode-html.js'))
-ace.config.setModuleUrl('ace/mode/html_elixir', require('file-loader!./src-noconflict/mode-html_elixir.js'))
-ace.config.setModuleUrl('ace/mode/html_ruby', require('file-loader!./src-noconflict/mode-html_ruby.js'))
-ace.config.setModuleUrl('ace/mode/ini', require('file-loader!./src-noconflict/mode-ini.js'))
-ace.config.setModuleUrl('ace/mode/io', require('file-loader!./src-noconflict/mode-io.js'))
-ace.config.setModuleUrl('ace/mode/jack', require('file-loader!./src-noconflict/mode-jack.js'))
-ace.config.setModuleUrl('ace/mode/jade', require('file-loader!./src-noconflict/mode-jade.js'))
-ace.config.setModuleUrl('ace/mode/java', require('file-loader!./src-noconflict/mode-java.js'))
-ace.config.setModuleUrl('ace/mode/javascript', require('file-loader!./src-noconflict/mode-javascript.js'))
-ace.config.setModuleUrl('ace/mode/json', require('file-loader!./src-noconflict/mode-json.js'))
-ace.config.setModuleUrl('ace/mode/jsoniq', require('file-loader!./src-noconflict/mode-jsoniq.js'))
-ace.config.setModuleUrl('ace/mode/jsp', require('file-loader!./src-noconflict/mode-jsp.js'))
-ace.config.setModuleUrl('ace/mode/jssm', require('file-loader!./src-noconflict/mode-jssm.js'))
-ace.config.setModuleUrl('ace/mode/jsx', require('file-loader!./src-noconflict/mode-jsx.js'))
-ace.config.setModuleUrl('ace/mode/julia', require('file-loader!./src-noconflict/mode-julia.js'))
-ace.config.setModuleUrl('ace/mode/kotlin', require('file-loader!./src-noconflict/mode-kotlin.js'))
-ace.config.setModuleUrl('ace/mode/latex', require('file-loader!./src-noconflict/mode-latex.js'))
-ace.config.setModuleUrl('ace/mode/less', require('file-loader!./src-noconflict/mode-less.js'))
-ace.config.setModuleUrl('ace/mode/liquid', require('file-loader!./src-noconflict/mode-liquid.js'))
-ace.config.setModuleUrl('ace/mode/lisp', require('file-loader!./src-noconflict/mode-lisp.js'))
-ace.config.setModuleUrl('ace/mode/livescript', require('file-loader!./src-noconflict/mode-livescript.js'))
-ace.config.setModuleUrl('ace/mode/logiql', require('file-loader!./src-noconflict/mode-logiql.js'))
-ace.config.setModuleUrl('ace/mode/logtalk', require('file-loader!./src-noconflict/mode-logtalk.js'))
-ace.config.setModuleUrl('ace/mode/lsl', require('file-loader!./src-noconflict/mode-lsl.js'))
-ace.config.setModuleUrl('ace/mode/lua', require('file-loader!./src-noconflict/mode-lua.js'))
-ace.config.setModuleUrl('ace/mode/luapage', require('file-loader!./src-noconflict/mode-luapage.js'))
-ace.config.setModuleUrl('ace/mode/lucene', require('file-loader!./src-noconflict/mode-lucene.js'))
-ace.config.setModuleUrl('ace/mode/makefile', require('file-loader!./src-noconflict/mode-makefile.js'))
-ace.config.setModuleUrl('ace/mode/markdown', require('file-loader!./src-noconflict/mode-markdown.js'))
-ace.config.setModuleUrl('ace/mode/mask', require('file-loader!./src-noconflict/mode-mask.js'))
-ace.config.setModuleUrl('ace/mode/matlab', require('file-loader!./src-noconflict/mode-matlab.js'))
-ace.config.setModuleUrl('ace/mode/maze', require('file-loader!./src-noconflict/mode-maze.js'))
-ace.config.setModuleUrl('ace/mode/mel', require('file-loader!./src-noconflict/mode-mel.js'))
-ace.config.setModuleUrl('ace/mode/mixal', require('file-loader!./src-noconflict/mode-mixal.js'))
-ace.config.setModuleUrl('ace/mode/mushcode', require('file-loader!./src-noconflict/mode-mushcode.js'))
-ace.config.setModuleUrl('ace/mode/mysql', require('file-loader!./src-noconflict/mode-mysql.js'))
-ace.config.setModuleUrl('ace/mode/nginx', require('file-loader!./src-noconflict/mode-nginx.js'))
-ace.config.setModuleUrl('ace/mode/nim', require('file-loader!./src-noconflict/mode-nim.js'))
-ace.config.setModuleUrl('ace/mode/nix', require('file-loader!./src-noconflict/mode-nix.js'))
-ace.config.setModuleUrl('ace/mode/nsis', require('file-loader!./src-noconflict/mode-nsis.js'))
-ace.config.setModuleUrl('ace/mode/objectivec', require('file-loader!./src-noconflict/mode-objectivec.js'))
-ace.config.setModuleUrl('ace/mode/ocaml', require('file-loader!./src-noconflict/mode-ocaml.js'))
-ace.config.setModuleUrl('ace/mode/pascal', require('file-loader!./src-noconflict/mode-pascal.js'))
-ace.config.setModuleUrl('ace/mode/perl', require('file-loader!./src-noconflict/mode-perl.js'))
-ace.config.setModuleUrl('ace/mode/perl6', require('file-loader!./src-noconflict/mode-perl6.js'))
-ace.config.setModuleUrl('ace/mode/pgsql', require('file-loader!./src-noconflict/mode-pgsql.js'))
-ace.config.setModuleUrl('ace/mode/php', require('file-loader!./src-noconflict/mode-php.js'))
-ace.config.setModuleUrl('ace/mode/php_laravel_blade', require('file-loader!./src-noconflict/mode-php_laravel_blade.js'))
-ace.config.setModuleUrl('ace/mode/pig', require('file-loader!./src-noconflict/mode-pig.js'))
-ace.config.setModuleUrl('ace/mode/plain_text', require('file-loader!./src-noconflict/mode-plain_text.js'))
-ace.config.setModuleUrl('ace/mode/powershell', require('file-loader!./src-noconflict/mode-powershell.js'))
-ace.config.setModuleUrl('ace/mode/praat', require('file-loader!./src-noconflict/mode-praat.js'))
-ace.config.setModuleUrl('ace/mode/prolog', require('file-loader!./src-noconflict/mode-prolog.js'))
-ace.config.setModuleUrl('ace/mode/properties', require('file-loader!./src-noconflict/mode-properties.js'))
-ace.config.setModuleUrl('ace/mode/protobuf', require('file-loader!./src-noconflict/mode-protobuf.js'))
-ace.config.setModuleUrl('ace/mode/puppet', require('file-loader!./src-noconflict/mode-puppet.js'))
-ace.config.setModuleUrl('ace/mode/python', require('file-loader!./src-noconflict/mode-python.js'))
-ace.config.setModuleUrl('ace/mode/r', require('file-loader!./src-noconflict/mode-r.js'))
-ace.config.setModuleUrl('ace/mode/razor', require('file-loader!./src-noconflict/mode-razor.js'))
-ace.config.setModuleUrl('ace/mode/rdoc', require('file-loader!./src-noconflict/mode-rdoc.js'))
-ace.config.setModuleUrl('ace/mode/red', require('file-loader!./src-noconflict/mode-red.js'))
-ace.config.setModuleUrl('ace/mode/redshift', require('file-loader!./src-noconflict/mode-redshift.js'))
-ace.config.setModuleUrl('ace/mode/rhtml', require('file-loader!./src-noconflict/mode-rhtml.js'))
-ace.config.setModuleUrl('ace/mode/rst', require('file-loader!./src-noconflict/mode-rst.js'))
-ace.config.setModuleUrl('ace/mode/ruby', require('file-loader!./src-noconflict/mode-ruby.js'))
-ace.config.setModuleUrl('ace/mode/rust', require('file-loader!./src-noconflict/mode-rust.js'))
-ace.config.setModuleUrl('ace/mode/sass', require('file-loader!./src-noconflict/mode-sass.js'))
-ace.config.setModuleUrl('ace/mode/scad', require('file-loader!./src-noconflict/mode-scad.js'))
-ace.config.setModuleUrl('ace/mode/scala', require('file-loader!./src-noconflict/mode-scala.js'))
-ace.config.setModuleUrl('ace/mode/scheme', require('file-loader!./src-noconflict/mode-scheme.js'))
-ace.config.setModuleUrl('ace/mode/scss', require('file-loader!./src-noconflict/mode-scss.js'))
-ace.config.setModuleUrl('ace/mode/sh', require('file-loader!./src-noconflict/mode-sh.js'))
-ace.config.setModuleUrl('ace/mode/sjs', require('file-loader!./src-noconflict/mode-sjs.js'))
-ace.config.setModuleUrl('ace/mode/slim', require('file-loader!./src-noconflict/mode-slim.js'))
-ace.config.setModuleUrl('ace/mode/smarty', require('file-loader!./src-noconflict/mode-smarty.js'))
-ace.config.setModuleUrl('ace/mode/snippets', require('file-loader!./src-noconflict/mode-snippets.js'))
-ace.config.setModuleUrl('ace/mode/soy_template', require('file-loader!./src-noconflict/mode-soy_template.js'))
-ace.config.setModuleUrl('ace/mode/space', require('file-loader!./src-noconflict/mode-space.js'))
-ace.config.setModuleUrl('ace/mode/sparql', require('file-loader!./src-noconflict/mode-sparql.js'))
-ace.config.setModuleUrl('ace/mode/sql', require('file-loader!./src-noconflict/mode-sql.js'))
-ace.config.setModuleUrl('ace/mode/sqlserver', require('file-loader!./src-noconflict/mode-sqlserver.js'))
-ace.config.setModuleUrl('ace/mode/stylus', require('file-loader!./src-noconflict/mode-stylus.js'))
-ace.config.setModuleUrl('ace/mode/svg', require('file-loader!./src-noconflict/mode-svg.js'))
-ace.config.setModuleUrl('ace/mode/swift', require('file-loader!./src-noconflict/mode-swift.js'))
-ace.config.setModuleUrl('ace/mode/tcl', require('file-loader!./src-noconflict/mode-tcl.js'))
-ace.config.setModuleUrl('ace/mode/terraform', require('file-loader!./src-noconflict/mode-terraform.js'))
-ace.config.setModuleUrl('ace/mode/tex', require('file-loader!./src-noconflict/mode-tex.js'))
-ace.config.setModuleUrl('ace/mode/text', require('file-loader!./src-noconflict/mode-text.js'))
-ace.config.setModuleUrl('ace/mode/textile', require('file-loader!./src-noconflict/mode-textile.js'))
-ace.config.setModuleUrl('ace/mode/toml', require('file-loader!./src-noconflict/mode-toml.js'))
-ace.config.setModuleUrl('ace/mode/tsx', require('file-loader!./src-noconflict/mode-tsx.js'))
-ace.config.setModuleUrl('ace/mode/turtle', require('file-loader!./src-noconflict/mode-turtle.js'))
-ace.config.setModuleUrl('ace/mode/twig', require('file-loader!./src-noconflict/mode-twig.js'))
-ace.config.setModuleUrl('ace/mode/typescript', require('file-loader!./src-noconflict/mode-typescript.js'))
-ace.config.setModuleUrl('ace/mode/vala', require('file-loader!./src-noconflict/mode-vala.js'))
-ace.config.setModuleUrl('ace/mode/vbscript', require('file-loader!./src-noconflict/mode-vbscript.js'))
-ace.config.setModuleUrl('ace/mode/velocity', require('file-loader!./src-noconflict/mode-velocity.js'))
-ace.config.setModuleUrl('ace/mode/verilog', require('file-loader!./src-noconflict/mode-verilog.js'))
-ace.config.setModuleUrl('ace/mode/vhdl', require('file-loader!./src-noconflict/mode-vhdl.js'))
-ace.config.setModuleUrl('ace/mode/visualforce', require('file-loader!./src-noconflict/mode-visualforce.js'))
-ace.config.setModuleUrl('ace/mode/wollok', require('file-loader!./src-noconflict/mode-wollok.js'))
-ace.config.setModuleUrl('ace/mode/xml', require('file-loader!./src-noconflict/mode-xml.js'))
-ace.config.setModuleUrl('ace/mode/xquery', require('file-loader!./src-noconflict/mode-xquery.js'))
-ace.config.setModuleUrl('ace/mode/yaml', require('file-loader!./src-noconflict/mode-yaml.js'))
-ace.config.setModuleUrl('ace/mode/zeek', require('file-loader!./src-noconflict/mode-zeek.js'))
+ace.config.setModuleUrl('ace/ext/beautify', require('file-loader?esModule=false!./src-noconflict/ext-beautify.js'))
+ace.config.setModuleUrl('ace/ext/elastic_tabstops_lite', require('file-loader?esModule=false!./src-noconflict/ext-elastic_tabstops_lite.js'))
+ace.config.setModuleUrl('ace/ext/emmet', require('file-loader?esModule=false!./src-noconflict/ext-emmet.js'))
+ace.config.setModuleUrl('ace/ext/error_marker', require('file-loader?esModule=false!./src-noconflict/ext-error_marker.js'))
+ace.config.setModuleUrl('ace/ext/keyboard_menu', require('file-loader?esModule=false!./src-noconflict/ext-keybinding_menu.js'))
+ace.config.setModuleUrl('ace/ext/language_tools', require('file-loader?esModule=false!./src-noconflict/ext-language_tools.js'))
+ace.config.setModuleUrl('ace/ext/linking', require('file-loader?esModule=false!./src-noconflict/ext-linking.js'))
+ace.config.setModuleUrl('ace/ext/modelist', require('file-loader?esModule=false!./src-noconflict/ext-modelist.js'))
+ace.config.setModuleUrl('ace/ext/options', require('file-loader?esModule=false!./src-noconflict/ext-options.js'))
+ace.config.setModuleUrl('ace/ext/prompt', require('file-loader?esModule=false!./src-noconflict/ext-prompt.js'))
+ace.config.setModuleUrl('ace/ext/rtl', require('file-loader?esModule=false!./src-noconflict/ext-rtl.js'))
+ace.config.setModuleUrl('ace/ext/searchbox', require('file-loader?esModule=false!./src-noconflict/ext-searchbox.js'))
+ace.config.setModuleUrl('ace/ext/settings_menu', require('file-loader?esModule=false!./src-noconflict/ext-settings_menu.js'))
+ace.config.setModuleUrl('ace/ext/spellcheck', require('file-loader?esModule=false!./src-noconflict/ext-spellcheck.js'))
+ace.config.setModuleUrl('ace/ext/split', require('file-loader?esModule=false!./src-noconflict/ext-split.js'))
+ace.config.setModuleUrl('ace/ext/static_highlight', require('file-loader?esModule=false!./src-noconflict/ext-static_highlight.js'))
+ace.config.setModuleUrl('ace/ext/statusbar', require('file-loader?esModule=false!./src-noconflict/ext-statusbar.js'))
+ace.config.setModuleUrl('ace/ext/textarea', require('file-loader?esModule=false!./src-noconflict/ext-textarea.js'))
+ace.config.setModuleUrl('ace/ext/themelist', require('file-loader?esModule=false!./src-noconflict/ext-themelist.js'))
+ace.config.setModuleUrl('ace/ext/whitespace', require('file-loader?esModule=false!./src-noconflict/ext-whitespace.js'))
+ace.config.setModuleUrl('ace/keyboard/emacs', require('file-loader?esModule=false!./src-noconflict/keybinding-emacs.js'))
+ace.config.setModuleUrl('ace/keyboard/sublime', require('file-loader?esModule=false!./src-noconflict/keybinding-sublime.js'))
+ace.config.setModuleUrl('ace/keyboard/vim', require('file-loader?esModule=false!./src-noconflict/keybinding-vim.js'))
+ace.config.setModuleUrl('ace/mode/abap', require('file-loader?esModule=false!./src-noconflict/mode-abap.js'))
+ace.config.setModuleUrl('ace/mode/abc', require('file-loader?esModule=false!./src-noconflict/mode-abc.js'))
+ace.config.setModuleUrl('ace/mode/actionscript', require('file-loader?esModule=false!./src-noconflict/mode-actionscript.js'))
+ace.config.setModuleUrl('ace/mode/ada', require('file-loader?esModule=false!./src-noconflict/mode-ada.js'))
+ace.config.setModuleUrl('ace/mode/apache_conf', require('file-loader?esModule=false!./src-noconflict/mode-apache_conf.js'))
+ace.config.setModuleUrl('ace/mode/apex', require('file-loader?esModule=false!./src-noconflict/mode-apex.js'))
+ace.config.setModuleUrl('ace/mode/applescript', require('file-loader?esModule=false!./src-noconflict/mode-applescript.js'))
+ace.config.setModuleUrl('ace/mode/aql', require('file-loader?esModule=false!./src-noconflict/mode-aql.js'))
+ace.config.setModuleUrl('ace/mode/asciidoc', require('file-loader?esModule=false!./src-noconflict/mode-asciidoc.js'))
+ace.config.setModuleUrl('ace/mode/asl', require('file-loader?esModule=false!./src-noconflict/mode-asl.js'))
+ace.config.setModuleUrl('ace/mode/assembly_x86', require('file-loader?esModule=false!./src-noconflict/mode-assembly_x86.js'))
+ace.config.setModuleUrl('ace/mode/autohotkey', require('file-loader?esModule=false!./src-noconflict/mode-autohotkey.js'))
+ace.config.setModuleUrl('ace/mode/batchfile', require('file-loader?esModule=false!./src-noconflict/mode-batchfile.js'))
+ace.config.setModuleUrl('ace/mode/bro', require('file-loader?esModule=false!./src-noconflict/mode-bro.js'))
+ace.config.setModuleUrl('ace/mode/c9search', require('file-loader?esModule=false!./src-noconflict/mode-c9search.js'))
+ace.config.setModuleUrl('ace/mode/cirru', require('file-loader?esModule=false!./src-noconflict/mode-cirru.js'))
+ace.config.setModuleUrl('ace/mode/clojure', require('file-loader?esModule=false!./src-noconflict/mode-clojure.js'))
+ace.config.setModuleUrl('ace/mode/cobol', require('file-loader?esModule=false!./src-noconflict/mode-cobol.js'))
+ace.config.setModuleUrl('ace/mode/coffee', require('file-loader?esModule=false!./src-noconflict/mode-coffee.js'))
+ace.config.setModuleUrl('ace/mode/coldfusion', require('file-loader?esModule=false!./src-noconflict/mode-coldfusion.js'))
+ace.config.setModuleUrl('ace/mode/crystal', require('file-loader?esModule=false!./src-noconflict/mode-crystal.js'))
+ace.config.setModuleUrl('ace/mode/csharp', require('file-loader?esModule=false!./src-noconflict/mode-csharp.js'))
+ace.config.setModuleUrl('ace/mode/csound_document', require('file-loader?esModule=false!./src-noconflict/mode-csound_document.js'))
+ace.config.setModuleUrl('ace/mode/csound_orchestra', require('file-loader?esModule=false!./src-noconflict/mode-csound_orchestra.js'))
+ace.config.setModuleUrl('ace/mode/csound_score', require('file-loader?esModule=false!./src-noconflict/mode-csound_score.js'))
+ace.config.setModuleUrl('ace/mode/csp', require('file-loader?esModule=false!./src-noconflict/mode-csp.js'))
+ace.config.setModuleUrl('ace/mode/css', require('file-loader?esModule=false!./src-noconflict/mode-css.js'))
+ace.config.setModuleUrl('ace/mode/curly', require('file-loader?esModule=false!./src-noconflict/mode-curly.js'))
+ace.config.setModuleUrl('ace/mode/c_cpp', require('file-loader?esModule=false!./src-noconflict/mode-c_cpp.js'))
+ace.config.setModuleUrl('ace/mode/d', require('file-loader?esModule=false!./src-noconflict/mode-d.js'))
+ace.config.setModuleUrl('ace/mode/dart', require('file-loader?esModule=false!./src-noconflict/mode-dart.js'))
+ace.config.setModuleUrl('ace/mode/diff', require('file-loader?esModule=false!./src-noconflict/mode-diff.js'))
+ace.config.setModuleUrl('ace/mode/django', require('file-loader?esModule=false!./src-noconflict/mode-django.js'))
+ace.config.setModuleUrl('ace/mode/dockerfile', require('file-loader?esModule=false!./src-noconflict/mode-dockerfile.js'))
+ace.config.setModuleUrl('ace/mode/dot', require('file-loader?esModule=false!./src-noconflict/mode-dot.js'))
+ace.config.setModuleUrl('ace/mode/drools', require('file-loader?esModule=false!./src-noconflict/mode-drools.js'))
+ace.config.setModuleUrl('ace/mode/edifact', require('file-loader?esModule=false!./src-noconflict/mode-edifact.js'))
+ace.config.setModuleUrl('ace/mode/eiffel', require('file-loader?esModule=false!./src-noconflict/mode-eiffel.js'))
+ace.config.setModuleUrl('ace/mode/ejs', require('file-loader?esModule=false!./src-noconflict/mode-ejs.js'))
+ace.config.setModuleUrl('ace/mode/elixir', require('file-loader?esModule=false!./src-noconflict/mode-elixir.js'))
+ace.config.setModuleUrl('ace/mode/elm', require('file-loader?esModule=false!./src-noconflict/mode-elm.js'))
+ace.config.setModuleUrl('ace/mode/erlang', require('file-loader?esModule=false!./src-noconflict/mode-erlang.js'))
+ace.config.setModuleUrl('ace/mode/forth', require('file-loader?esModule=false!./src-noconflict/mode-forth.js'))
+ace.config.setModuleUrl('ace/mode/fortran', require('file-loader?esModule=false!./src-noconflict/mode-fortran.js'))
+ace.config.setModuleUrl('ace/mode/fsharp', require('file-loader?esModule=false!./src-noconflict/mode-fsharp.js'))
+ace.config.setModuleUrl('ace/mode/fsl', require('file-loader?esModule=false!./src-noconflict/mode-fsl.js'))
+ace.config.setModuleUrl('ace/mode/ftl', require('file-loader?esModule=false!./src-noconflict/mode-ftl.js'))
+ace.config.setModuleUrl('ace/mode/gcode', require('file-loader?esModule=false!./src-noconflict/mode-gcode.js'))
+ace.config.setModuleUrl('ace/mode/gherkin', require('file-loader?esModule=false!./src-noconflict/mode-gherkin.js'))
+ace.config.setModuleUrl('ace/mode/gitignore', require('file-loader?esModule=false!./src-noconflict/mode-gitignore.js'))
+ace.config.setModuleUrl('ace/mode/glsl', require('file-loader?esModule=false!./src-noconflict/mode-glsl.js'))
+ace.config.setModuleUrl('ace/mode/gobstones', require('file-loader?esModule=false!./src-noconflict/mode-gobstones.js'))
+ace.config.setModuleUrl('ace/mode/golang', require('file-loader?esModule=false!./src-noconflict/mode-golang.js'))
+ace.config.setModuleUrl('ace/mode/graphqlschema', require('file-loader?esModule=false!./src-noconflict/mode-graphqlschema.js'))
+ace.config.setModuleUrl('ace/mode/groovy', require('file-loader?esModule=false!./src-noconflict/mode-groovy.js'))
+ace.config.setModuleUrl('ace/mode/haml', require('file-loader?esModule=false!./src-noconflict/mode-haml.js'))
+ace.config.setModuleUrl('ace/mode/handlebars', require('file-loader?esModule=false!./src-noconflict/mode-handlebars.js'))
+ace.config.setModuleUrl('ace/mode/haskell', require('file-loader?esModule=false!./src-noconflict/mode-haskell.js'))
+ace.config.setModuleUrl('ace/mode/haskell_cabal', require('file-loader?esModule=false!./src-noconflict/mode-haskell_cabal.js'))
+ace.config.setModuleUrl('ace/mode/haxe', require('file-loader?esModule=false!./src-noconflict/mode-haxe.js'))
+ace.config.setModuleUrl('ace/mode/hjson', require('file-loader?esModule=false!./src-noconflict/mode-hjson.js'))
+ace.config.setModuleUrl('ace/mode/html', require('file-loader?esModule=false!./src-noconflict/mode-html.js'))
+ace.config.setModuleUrl('ace/mode/html_elixir', require('file-loader?esModule=false!./src-noconflict/mode-html_elixir.js'))
+ace.config.setModuleUrl('ace/mode/html_ruby', require('file-loader?esModule=false!./src-noconflict/mode-html_ruby.js'))
+ace.config.setModuleUrl('ace/mode/ini', require('file-loader?esModule=false!./src-noconflict/mode-ini.js'))
+ace.config.setModuleUrl('ace/mode/io', require('file-loader?esModule=false!./src-noconflict/mode-io.js'))
+ace.config.setModuleUrl('ace/mode/jack', require('file-loader?esModule=false!./src-noconflict/mode-jack.js'))
+ace.config.setModuleUrl('ace/mode/jade', require('file-loader?esModule=false!./src-noconflict/mode-jade.js'))
+ace.config.setModuleUrl('ace/mode/java', require('file-loader?esModule=false!./src-noconflict/mode-java.js'))
+ace.config.setModuleUrl('ace/mode/javascript', require('file-loader?esModule=false!./src-noconflict/mode-javascript.js'))
+ace.config.setModuleUrl('ace/mode/json', require('file-loader?esModule=false!./src-noconflict/mode-json.js'))
+ace.config.setModuleUrl('ace/mode/jsoniq', require('file-loader?esModule=false!./src-noconflict/mode-jsoniq.js'))
+ace.config.setModuleUrl('ace/mode/jsp', require('file-loader?esModule=false!./src-noconflict/mode-jsp.js'))
+ace.config.setModuleUrl('ace/mode/jssm', require('file-loader?esModule=false!./src-noconflict/mode-jssm.js'))
+ace.config.setModuleUrl('ace/mode/jsx', require('file-loader?esModule=false!./src-noconflict/mode-jsx.js'))
+ace.config.setModuleUrl('ace/mode/julia', require('file-loader?esModule=false!./src-noconflict/mode-julia.js'))
+ace.config.setModuleUrl('ace/mode/kotlin', require('file-loader?esModule=false!./src-noconflict/mode-kotlin.js'))
+ace.config.setModuleUrl('ace/mode/latex', require('file-loader?esModule=false!./src-noconflict/mode-latex.js'))
+ace.config.setModuleUrl('ace/mode/less', require('file-loader?esModule=false!./src-noconflict/mode-less.js'))
+ace.config.setModuleUrl('ace/mode/liquid', require('file-loader?esModule=false!./src-noconflict/mode-liquid.js'))
+ace.config.setModuleUrl('ace/mode/lisp', require('file-loader?esModule=false!./src-noconflict/mode-lisp.js'))
+ace.config.setModuleUrl('ace/mode/livescript', require('file-loader?esModule=false!./src-noconflict/mode-livescript.js'))
+ace.config.setModuleUrl('ace/mode/logiql', require('file-loader?esModule=false!./src-noconflict/mode-logiql.js'))
+ace.config.setModuleUrl('ace/mode/logtalk', require('file-loader?esModule=false!./src-noconflict/mode-logtalk.js'))
+ace.config.setModuleUrl('ace/mode/lsl', require('file-loader?esModule=false!./src-noconflict/mode-lsl.js'))
+ace.config.setModuleUrl('ace/mode/lua', require('file-loader?esModule=false!./src-noconflict/mode-lua.js'))
+ace.config.setModuleUrl('ace/mode/luapage', require('file-loader?esModule=false!./src-noconflict/mode-luapage.js'))
+ace.config.setModuleUrl('ace/mode/lucene', require('file-loader?esModule=false!./src-noconflict/mode-lucene.js'))
+ace.config.setModuleUrl('ace/mode/makefile', require('file-loader?esModule=false!./src-noconflict/mode-makefile.js'))
+ace.config.setModuleUrl('ace/mode/markdown', require('file-loader?esModule=false!./src-noconflict/mode-markdown.js'))
+ace.config.setModuleUrl('ace/mode/mask', require('file-loader?esModule=false!./src-noconflict/mode-mask.js'))
+ace.config.setModuleUrl('ace/mode/matlab', require('file-loader?esModule=false!./src-noconflict/mode-matlab.js'))
+ace.config.setModuleUrl('ace/mode/maze', require('file-loader?esModule=false!./src-noconflict/mode-maze.js'))
+ace.config.setModuleUrl('ace/mode/mel', require('file-loader?esModule=false!./src-noconflict/mode-mel.js'))
+ace.config.setModuleUrl('ace/mode/mixal', require('file-loader?esModule=false!./src-noconflict/mode-mixal.js'))
+ace.config.setModuleUrl('ace/mode/mushcode', require('file-loader?esModule=false!./src-noconflict/mode-mushcode.js'))
+ace.config.setModuleUrl('ace/mode/mysql', require('file-loader?esModule=false!./src-noconflict/mode-mysql.js'))
+ace.config.setModuleUrl('ace/mode/nginx', require('file-loader?esModule=false!./src-noconflict/mode-nginx.js'))
+ace.config.setModuleUrl('ace/mode/nim', require('file-loader?esModule=false!./src-noconflict/mode-nim.js'))
+ace.config.setModuleUrl('ace/mode/nix', require('file-loader?esModule=false!./src-noconflict/mode-nix.js'))
+ace.config.setModuleUrl('ace/mode/nsis', require('file-loader?esModule=false!./src-noconflict/mode-nsis.js'))
+ace.config.setModuleUrl('ace/mode/objectivec', require('file-loader?esModule=false!./src-noconflict/mode-objectivec.js'))
+ace.config.setModuleUrl('ace/mode/ocaml', require('file-loader?esModule=false!./src-noconflict/mode-ocaml.js'))
+ace.config.setModuleUrl('ace/mode/pascal', require('file-loader?esModule=false!./src-noconflict/mode-pascal.js'))
+ace.config.setModuleUrl('ace/mode/perl', require('file-loader?esModule=false!./src-noconflict/mode-perl.js'))
+ace.config.setModuleUrl('ace/mode/perl6', require('file-loader?esModule=false!./src-noconflict/mode-perl6.js'))
+ace.config.setModuleUrl('ace/mode/pgsql', require('file-loader?esModule=false!./src-noconflict/mode-pgsql.js'))
+ace.config.setModuleUrl('ace/mode/php', require('file-loader?esModule=false!./src-noconflict/mode-php.js'))
+ace.config.setModuleUrl('ace/mode/php_laravel_blade', require('file-loader?esModule=false!./src-noconflict/mode-php_laravel_blade.js'))
+ace.config.setModuleUrl('ace/mode/pig', require('file-loader?esModule=false!./src-noconflict/mode-pig.js'))
+ace.config.setModuleUrl('ace/mode/plain_text', require('file-loader?esModule=false!./src-noconflict/mode-plain_text.js'))
+ace.config.setModuleUrl('ace/mode/powershell', require('file-loader?esModule=false!./src-noconflict/mode-powershell.js'))
+ace.config.setModuleUrl('ace/mode/praat', require('file-loader?esModule=false!./src-noconflict/mode-praat.js'))
+ace.config.setModuleUrl('ace/mode/prolog', require('file-loader?esModule=false!./src-noconflict/mode-prolog.js'))
+ace.config.setModuleUrl('ace/mode/properties', require('file-loader?esModule=false!./src-noconflict/mode-properties.js'))
+ace.config.setModuleUrl('ace/mode/protobuf', require('file-loader?esModule=false!./src-noconflict/mode-protobuf.js'))
+ace.config.setModuleUrl('ace/mode/puppet', require('file-loader?esModule=false!./src-noconflict/mode-puppet.js'))
+ace.config.setModuleUrl('ace/mode/python', require('file-loader?esModule=false!./src-noconflict/mode-python.js'))
+ace.config.setModuleUrl('ace/mode/r', require('file-loader?esModule=false!./src-noconflict/mode-r.js'))
+ace.config.setModuleUrl('ace/mode/razor', require('file-loader?esModule=false!./src-noconflict/mode-razor.js'))
+ace.config.setModuleUrl('ace/mode/rdoc', require('file-loader?esModule=false!./src-noconflict/mode-rdoc.js'))
+ace.config.setModuleUrl('ace/mode/red', require('file-loader?esModule=false!./src-noconflict/mode-red.js'))
+ace.config.setModuleUrl('ace/mode/redshift', require('file-loader?esModule=false!./src-noconflict/mode-redshift.js'))
+ace.config.setModuleUrl('ace/mode/rhtml', require('file-loader?esModule=false!./src-noconflict/mode-rhtml.js'))
+ace.config.setModuleUrl('ace/mode/rst', require('file-loader?esModule=false!./src-noconflict/mode-rst.js'))
+ace.config.setModuleUrl('ace/mode/ruby', require('file-loader?esModule=false!./src-noconflict/mode-ruby.js'))
+ace.config.setModuleUrl('ace/mode/rust', require('file-loader?esModule=false!./src-noconflict/mode-rust.js'))
+ace.config.setModuleUrl('ace/mode/sass', require('file-loader?esModule=false!./src-noconflict/mode-sass.js'))
+ace.config.setModuleUrl('ace/mode/scad', require('file-loader?esModule=false!./src-noconflict/mode-scad.js'))
+ace.config.setModuleUrl('ace/mode/scala', require('file-loader?esModule=false!./src-noconflict/mode-scala.js'))
+ace.config.setModuleUrl('ace/mode/scheme', require('file-loader?esModule=false!./src-noconflict/mode-scheme.js'))
+ace.config.setModuleUrl('ace/mode/scss', require('file-loader?esModule=false!./src-noconflict/mode-scss.js'))
+ace.config.setModuleUrl('ace/mode/sh', require('file-loader?esModule=false!./src-noconflict/mode-sh.js'))
+ace.config.setModuleUrl('ace/mode/sjs', require('file-loader?esModule=false!./src-noconflict/mode-sjs.js'))
+ace.config.setModuleUrl('ace/mode/slim', require('file-loader?esModule=false!./src-noconflict/mode-slim.js'))
+ace.config.setModuleUrl('ace/mode/smarty', require('file-loader?esModule=false!./src-noconflict/mode-smarty.js'))
+ace.config.setModuleUrl('ace/mode/snippets', require('file-loader?esModule=false!./src-noconflict/mode-snippets.js'))
+ace.config.setModuleUrl('ace/mode/soy_template', require('file-loader?esModule=false!./src-noconflict/mode-soy_template.js'))
+ace.config.setModuleUrl('ace/mode/space', require('file-loader?esModule=false!./src-noconflict/mode-space.js'))
+ace.config.setModuleUrl('ace/mode/sparql', require('file-loader?esModule=false!./src-noconflict/mode-sparql.js'))
+ace.config.setModuleUrl('ace/mode/sql', require('file-loader?esModule=false!./src-noconflict/mode-sql.js'))
+ace.config.setModuleUrl('ace/mode/sqlserver', require('file-loader?esModule=false!./src-noconflict/mode-sqlserver.js'))
+ace.config.setModuleUrl('ace/mode/stylus', require('file-loader?esModule=false!./src-noconflict/mode-stylus.js'))
+ace.config.setModuleUrl('ace/mode/svg', require('file-loader?esModule=false!./src-noconflict/mode-svg.js'))
+ace.config.setModuleUrl('ace/mode/swift', require('file-loader?esModule=false!./src-noconflict/mode-swift.js'))
+ace.config.setModuleUrl('ace/mode/tcl', require('file-loader?esModule=false!./src-noconflict/mode-tcl.js'))
+ace.config.setModuleUrl('ace/mode/terraform', require('file-loader?esModule=false!./src-noconflict/mode-terraform.js'))
+ace.config.setModuleUrl('ace/mode/tex', require('file-loader?esModule=false!./src-noconflict/mode-tex.js'))
+ace.config.setModuleUrl('ace/mode/text', require('file-loader?esModule=false!./src-noconflict/mode-text.js'))
+ace.config.setModuleUrl('ace/mode/textile', require('file-loader?esModule=false!./src-noconflict/mode-textile.js'))
+ace.config.setModuleUrl('ace/mode/toml', require('file-loader?esModule=false!./src-noconflict/mode-toml.js'))
+ace.config.setModuleUrl('ace/mode/tsx', require('file-loader?esModule=false!./src-noconflict/mode-tsx.js'))
+ace.config.setModuleUrl('ace/mode/turtle', require('file-loader?esModule=false!./src-noconflict/mode-turtle.js'))
+ace.config.setModuleUrl('ace/mode/twig', require('file-loader?esModule=false!./src-noconflict/mode-twig.js'))
+ace.config.setModuleUrl('ace/mode/typescript', require('file-loader?esModule=false!./src-noconflict/mode-typescript.js'))
+ace.config.setModuleUrl('ace/mode/vala', require('file-loader?esModule=false!./src-noconflict/mode-vala.js'))
+ace.config.setModuleUrl('ace/mode/vbscript', require('file-loader?esModule=false!./src-noconflict/mode-vbscript.js'))
+ace.config.setModuleUrl('ace/mode/velocity', require('file-loader?esModule=false!./src-noconflict/mode-velocity.js'))
+ace.config.setModuleUrl('ace/mode/verilog', require('file-loader?esModule=false!./src-noconflict/mode-verilog.js'))
+ace.config.setModuleUrl('ace/mode/vhdl', require('file-loader?esModule=false!./src-noconflict/mode-vhdl.js'))
+ace.config.setModuleUrl('ace/mode/visualforce', require('file-loader?esModule=false!./src-noconflict/mode-visualforce.js'))
+ace.config.setModuleUrl('ace/mode/wollok', require('file-loader?esModule=false!./src-noconflict/mode-wollok.js'))
+ace.config.setModuleUrl('ace/mode/xml', require('file-loader?esModule=false!./src-noconflict/mode-xml.js'))
+ace.config.setModuleUrl('ace/mode/xquery', require('file-loader?esModule=false!./src-noconflict/mode-xquery.js'))
+ace.config.setModuleUrl('ace/mode/yaml', require('file-loader?esModule=false!./src-noconflict/mode-yaml.js'))
+ace.config.setModuleUrl('ace/mode/zeek', require('file-loader?esModule=false!./src-noconflict/mode-zeek.js'))
-ace.config.setModuleUrl('ace/theme/ambiance', require('file-loader!./src-noconflict/theme-ambiance.js'))
-ace.config.setModuleUrl('ace/theme/chaos', require('file-loader!./src-noconflict/theme-chaos.js'))
-ace.config.setModuleUrl('ace/theme/chrome', require('file-loader!./src-noconflict/theme-chrome.js'))
-ace.config.setModuleUrl('ace/theme/clouds', require('file-loader!./src-noconflict/theme-clouds.js'))
-ace.config.setModuleUrl('ace/theme/clouds_midnight', require('file-loader!./src-noconflict/theme-clouds_midnight.js'))
-ace.config.setModuleUrl('ace/theme/cobalt', require('file-loader!./src-noconflict/theme-cobalt.js'))
-ace.config.setModuleUrl('ace/theme/crimson_editor', require('file-loader!./src-noconflict/theme-crimson_editor.js'))
-ace.config.setModuleUrl('ace/theme/dawn', require('file-loader!./src-noconflict/theme-dawn.js'))
-ace.config.setModuleUrl('ace/theme/dracula', require('file-loader!./src-noconflict/theme-dracula.js'))
-ace.config.setModuleUrl('ace/theme/dreamweaver', require('file-loader!./src-noconflict/theme-dreamweaver.js'))
-ace.config.setModuleUrl('ace/theme/eclipse', require('file-loader!./src-noconflict/theme-eclipse.js'))
-ace.config.setModuleUrl('ace/theme/github', require('file-loader!./src-noconflict/theme-github.js'))
-ace.config.setModuleUrl('ace/theme/gob', require('file-loader!./src-noconflict/theme-gob.js'))
-ace.config.setModuleUrl('ace/theme/gruvbox', require('file-loader!./src-noconflict/theme-gruvbox.js'))
-ace.config.setModuleUrl('ace/theme/idle_fingers', require('file-loader!./src-noconflict/theme-idle_fingers.js'))
-ace.config.setModuleUrl('ace/theme/iplastic', require('file-loader!./src-noconflict/theme-iplastic.js'))
-ace.config.setModuleUrl('ace/theme/katzenmilch', require('file-loader!./src-noconflict/theme-katzenmilch.js'))
-ace.config.setModuleUrl('ace/theme/kr_theme', require('file-loader!./src-noconflict/theme-kr_theme.js'))
-ace.config.setModuleUrl('ace/theme/kuroir', require('file-loader!./src-noconflict/theme-kuroir.js'))
-ace.config.setModuleUrl('ace/theme/merbivore', require('file-loader!./src-noconflict/theme-merbivore.js'))
-ace.config.setModuleUrl('ace/theme/merbivore_soft', require('file-loader!./src-noconflict/theme-merbivore_soft.js'))
-ace.config.setModuleUrl('ace/theme/monokai', require('file-loader!./src-noconflict/theme-monokai.js'))
-ace.config.setModuleUrl('ace/theme/mono_industrial', require('file-loader!./src-noconflict/theme-mono_industrial.js'))
-ace.config.setModuleUrl('ace/theme/pastel_on_dark', require('file-loader!./src-noconflict/theme-pastel_on_dark.js'))
-ace.config.setModuleUrl('ace/theme/solarized_dark', require('file-loader!./src-noconflict/theme-solarized_dark.js'))
-ace.config.setModuleUrl('ace/theme/solarized_light', require('file-loader!./src-noconflict/theme-solarized_light.js'))
-ace.config.setModuleUrl('ace/theme/sqlserver', require('file-loader!./src-noconflict/theme-sqlserver.js'))
-ace.config.setModuleUrl('ace/theme/terminal', require('file-loader!./src-noconflict/theme-terminal.js'))
-ace.config.setModuleUrl('ace/theme/textmate', require('file-loader!./src-noconflict/theme-textmate.js'))
-ace.config.setModuleUrl('ace/theme/tomorrow', require('file-loader!./src-noconflict/theme-tomorrow.js'))
-ace.config.setModuleUrl('ace/theme/tomorrow_night', require('file-loader!./src-noconflict/theme-tomorrow_night.js'))
-ace.config.setModuleUrl('ace/theme/tomorrow_night_blue', require('file-loader!./src-noconflict/theme-tomorrow_night_blue.js'))
-ace.config.setModuleUrl('ace/theme/tomorrow_night_bright', require('file-loader!./src-noconflict/theme-tomorrow_night_bright.js'))
-ace.config.setModuleUrl('ace/theme/tomorrow_night_eighties', require('file-loader!./src-noconflict/theme-tomorrow_night_eighties.js'))
-ace.config.setModuleUrl('ace/theme/twilight', require('file-loader!./src-noconflict/theme-twilight.js'))
-ace.config.setModuleUrl('ace/theme/vibrant_ink', require('file-loader!./src-noconflict/theme-vibrant_ink.js'))
-ace.config.setModuleUrl('ace/theme/xcode', require('file-loader!./src-noconflict/theme-xcode.js'))
-ace.config.setModuleUrl('ace/mode/coffee_worker', require('file-loader!./src-noconflict/worker-coffee.js'))
-ace.config.setModuleUrl('ace/mode/css_worker', require('file-loader!./src-noconflict/worker-css.js'))
-ace.config.setModuleUrl('ace/mode/html_worker', require('file-loader!./src-noconflict/worker-html.js'))
-ace.config.setModuleUrl('ace/mode/javascript_worker', require('file-loader!./src-noconflict/worker-javascript.js'))
-ace.config.setModuleUrl('ace/mode/json_worker', require('file-loader!./src-noconflict/worker-json.js'))
-ace.config.setModuleUrl('ace/mode/lua_worker', require('file-loader!./src-noconflict/worker-lua.js'))
-ace.config.setModuleUrl('ace/mode/php_worker', require('file-loader!./src-noconflict/worker-php.js'))
-ace.config.setModuleUrl('ace/mode/xml_worker', require('file-loader!./src-noconflict/worker-xml.js'))
-ace.config.setModuleUrl('ace/mode/xquery_worker', require('file-loader!./src-noconflict/worker-xquery.js'))
-ace.config.setModuleUrl('ace/snippets/abap', require('file-loader!./src-noconflict/snippets/abap.js'))
-ace.config.setModuleUrl('ace/snippets/abc', require('file-loader!./src-noconflict/snippets/abc.js'))
-ace.config.setModuleUrl('ace/snippets/actionscript', require('file-loader!./src-noconflict/snippets/actionscript.js'))
-ace.config.setModuleUrl('ace/snippets/ada', require('file-loader!./src-noconflict/snippets/ada.js'))
-ace.config.setModuleUrl('ace/snippets/apache_conf', require('file-loader!./src-noconflict/snippets/apache_conf.js'))
-ace.config.setModuleUrl('ace/snippets/apex', require('file-loader!./src-noconflict/snippets/apex.js'))
-ace.config.setModuleUrl('ace/snippets/applescript', require('file-loader!./src-noconflict/snippets/applescript.js'))
-ace.config.setModuleUrl('ace/snippets/aql', require('file-loader!./src-noconflict/snippets/aql.js'))
-ace.config.setModuleUrl('ace/snippets/asciidoc', require('file-loader!./src-noconflict/snippets/asciidoc.js'))
-ace.config.setModuleUrl('ace/snippets/asl', require('file-loader!./src-noconflict/snippets/asl.js'))
-ace.config.setModuleUrl('ace/snippets/assembly_x86', require('file-loader!./src-noconflict/snippets/assembly_x86.js'))
-ace.config.setModuleUrl('ace/snippets/autohotkey', require('file-loader!./src-noconflict/snippets/autohotkey.js'))
-ace.config.setModuleUrl('ace/snippets/batchfile', require('file-loader!./src-noconflict/snippets/batchfile.js'))
-ace.config.setModuleUrl('ace/snippets/bro', require('file-loader!./src-noconflict/snippets/bro.js'))
-ace.config.setModuleUrl('ace/snippets/c9search', require('file-loader!./src-noconflict/snippets/c9search.js'))
-ace.config.setModuleUrl('ace/snippets/cirru', require('file-loader!./src-noconflict/snippets/cirru.js'))
-ace.config.setModuleUrl('ace/snippets/clojure', require('file-loader!./src-noconflict/snippets/clojure.js'))
-ace.config.setModuleUrl('ace/snippets/cobol', require('file-loader!./src-noconflict/snippets/cobol.js'))
-ace.config.setModuleUrl('ace/snippets/coffee', require('file-loader!./src-noconflict/snippets/coffee.js'))
-ace.config.setModuleUrl('ace/snippets/coldfusion', require('file-loader!./src-noconflict/snippets/coldfusion.js'))
-ace.config.setModuleUrl('ace/snippets/crystal', require('file-loader!./src-noconflict/snippets/crystal.js'))
-ace.config.setModuleUrl('ace/snippets/csharp', require('file-loader!./src-noconflict/snippets/csharp.js'))
-ace.config.setModuleUrl('ace/snippets/csound_document', require('file-loader!./src-noconflict/snippets/csound_document.js'))
-ace.config.setModuleUrl('ace/snippets/csound_orchestra', require('file-loader!./src-noconflict/snippets/csound_orchestra.js'))
-ace.config.setModuleUrl('ace/snippets/csound_score', require('file-loader!./src-noconflict/snippets/csound_score.js'))
-ace.config.setModuleUrl('ace/snippets/csp', require('file-loader!./src-noconflict/snippets/csp.js'))
-ace.config.setModuleUrl('ace/snippets/css', require('file-loader!./src-noconflict/snippets/css.js'))
-ace.config.setModuleUrl('ace/snippets/curly', require('file-loader!./src-noconflict/snippets/curly.js'))
-ace.config.setModuleUrl('ace/snippets/c_cpp', require('file-loader!./src-noconflict/snippets/c_cpp.js'))
-ace.config.setModuleUrl('ace/snippets/d', require('file-loader!./src-noconflict/snippets/d.js'))
-ace.config.setModuleUrl('ace/snippets/dart', require('file-loader!./src-noconflict/snippets/dart.js'))
-ace.config.setModuleUrl('ace/snippets/diff', require('file-loader!./src-noconflict/snippets/diff.js'))
-ace.config.setModuleUrl('ace/snippets/django', require('file-loader!./src-noconflict/snippets/django.js'))
-ace.config.setModuleUrl('ace/snippets/dockerfile', require('file-loader!./src-noconflict/snippets/dockerfile.js'))
-ace.config.setModuleUrl('ace/snippets/dot', require('file-loader!./src-noconflict/snippets/dot.js'))
-ace.config.setModuleUrl('ace/snippets/drools', require('file-loader!./src-noconflict/snippets/drools.js'))
-ace.config.setModuleUrl('ace/snippets/edifact', require('file-loader!./src-noconflict/snippets/edifact.js'))
-ace.config.setModuleUrl('ace/snippets/eiffel', require('file-loader!./src-noconflict/snippets/eiffel.js'))
-ace.config.setModuleUrl('ace/snippets/ejs', require('file-loader!./src-noconflict/snippets/ejs.js'))
-ace.config.setModuleUrl('ace/snippets/elixir', require('file-loader!./src-noconflict/snippets/elixir.js'))
-ace.config.setModuleUrl('ace/snippets/elm', require('file-loader!./src-noconflict/snippets/elm.js'))
-ace.config.setModuleUrl('ace/snippets/erlang', require('file-loader!./src-noconflict/snippets/erlang.js'))
-ace.config.setModuleUrl('ace/snippets/forth', require('file-loader!./src-noconflict/snippets/forth.js'))
-ace.config.setModuleUrl('ace/snippets/fortran', require('file-loader!./src-noconflict/snippets/fortran.js'))
-ace.config.setModuleUrl('ace/snippets/fsharp', require('file-loader!./src-noconflict/snippets/fsharp.js'))
-ace.config.setModuleUrl('ace/snippets/fsl', require('file-loader!./src-noconflict/snippets/fsl.js'))
-ace.config.setModuleUrl('ace/snippets/ftl', require('file-loader!./src-noconflict/snippets/ftl.js'))
-ace.config.setModuleUrl('ace/snippets/gcode', require('file-loader!./src-noconflict/snippets/gcode.js'))
-ace.config.setModuleUrl('ace/snippets/gherkin', require('file-loader!./src-noconflict/snippets/gherkin.js'))
-ace.config.setModuleUrl('ace/snippets/gitignore', require('file-loader!./src-noconflict/snippets/gitignore.js'))
-ace.config.setModuleUrl('ace/snippets/glsl', require('file-loader!./src-noconflict/snippets/glsl.js'))
-ace.config.setModuleUrl('ace/snippets/gobstones', require('file-loader!./src-noconflict/snippets/gobstones.js'))
-ace.config.setModuleUrl('ace/snippets/golang', require('file-loader!./src-noconflict/snippets/golang.js'))
-ace.config.setModuleUrl('ace/snippets/graphqlschema', require('file-loader!./src-noconflict/snippets/graphqlschema.js'))
-ace.config.setModuleUrl('ace/snippets/groovy', require('file-loader!./src-noconflict/snippets/groovy.js'))
-ace.config.setModuleUrl('ace/snippets/haml', require('file-loader!./src-noconflict/snippets/haml.js'))
-ace.config.setModuleUrl('ace/snippets/handlebars', require('file-loader!./src-noconflict/snippets/handlebars.js'))
-ace.config.setModuleUrl('ace/snippets/haskell', require('file-loader!./src-noconflict/snippets/haskell.js'))
-ace.config.setModuleUrl('ace/snippets/haskell_cabal', require('file-loader!./src-noconflict/snippets/haskell_cabal.js'))
-ace.config.setModuleUrl('ace/snippets/haxe', require('file-loader!./src-noconflict/snippets/haxe.js'))
-ace.config.setModuleUrl('ace/snippets/hjson', require('file-loader!./src-noconflict/snippets/hjson.js'))
-ace.config.setModuleUrl('ace/snippets/html', require('file-loader!./src-noconflict/snippets/html.js'))
-ace.config.setModuleUrl('ace/snippets/html_elixir', require('file-loader!./src-noconflict/snippets/html_elixir.js'))
-ace.config.setModuleUrl('ace/snippets/html_ruby', require('file-loader!./src-noconflict/snippets/html_ruby.js'))
-ace.config.setModuleUrl('ace/snippets/ini', require('file-loader!./src-noconflict/snippets/ini.js'))
-ace.config.setModuleUrl('ace/snippets/io', require('file-loader!./src-noconflict/snippets/io.js'))
-ace.config.setModuleUrl('ace/snippets/jack', require('file-loader!./src-noconflict/snippets/jack.js'))
-ace.config.setModuleUrl('ace/snippets/jade', require('file-loader!./src-noconflict/snippets/jade.js'))
-ace.config.setModuleUrl('ace/snippets/java', require('file-loader!./src-noconflict/snippets/java.js'))
-ace.config.setModuleUrl('ace/snippets/javascript', require('file-loader!./src-noconflict/snippets/javascript.js'))
-ace.config.setModuleUrl('ace/snippets/json', require('file-loader!./src-noconflict/snippets/json.js'))
-ace.config.setModuleUrl('ace/snippets/jsoniq', require('file-loader!./src-noconflict/snippets/jsoniq.js'))
-ace.config.setModuleUrl('ace/snippets/jsp', require('file-loader!./src-noconflict/snippets/jsp.js'))
-ace.config.setModuleUrl('ace/snippets/jssm', require('file-loader!./src-noconflict/snippets/jssm.js'))
-ace.config.setModuleUrl('ace/snippets/jsx', require('file-loader!./src-noconflict/snippets/jsx.js'))
-ace.config.setModuleUrl('ace/snippets/julia', require('file-loader!./src-noconflict/snippets/julia.js'))
-ace.config.setModuleUrl('ace/snippets/kotlin', require('file-loader!./src-noconflict/snippets/kotlin.js'))
-ace.config.setModuleUrl('ace/snippets/latex', require('file-loader!./src-noconflict/snippets/latex.js'))
-ace.config.setModuleUrl('ace/snippets/less', require('file-loader!./src-noconflict/snippets/less.js'))
-ace.config.setModuleUrl('ace/snippets/liquid', require('file-loader!./src-noconflict/snippets/liquid.js'))
-ace.config.setModuleUrl('ace/snippets/lisp', require('file-loader!./src-noconflict/snippets/lisp.js'))
-ace.config.setModuleUrl('ace/snippets/livescript', require('file-loader!./src-noconflict/snippets/livescript.js'))
-ace.config.setModuleUrl('ace/snippets/logiql', require('file-loader!./src-noconflict/snippets/logiql.js'))
-ace.config.setModuleUrl('ace/snippets/logtalk', require('file-loader!./src-noconflict/snippets/logtalk.js'))
-ace.config.setModuleUrl('ace/snippets/lsl', require('file-loader!./src-noconflict/snippets/lsl.js'))
-ace.config.setModuleUrl('ace/snippets/lua', require('file-loader!./src-noconflict/snippets/lua.js'))
-ace.config.setModuleUrl('ace/snippets/luapage', require('file-loader!./src-noconflict/snippets/luapage.js'))
-ace.config.setModuleUrl('ace/snippets/lucene', require('file-loader!./src-noconflict/snippets/lucene.js'))
-ace.config.setModuleUrl('ace/snippets/makefile', require('file-loader!./src-noconflict/snippets/makefile.js'))
-ace.config.setModuleUrl('ace/snippets/markdown', require('file-loader!./src-noconflict/snippets/markdown.js'))
-ace.config.setModuleUrl('ace/snippets/mask', require('file-loader!./src-noconflict/snippets/mask.js'))
-ace.config.setModuleUrl('ace/snippets/matlab', require('file-loader!./src-noconflict/snippets/matlab.js'))
-ace.config.setModuleUrl('ace/snippets/maze', require('file-loader!./src-noconflict/snippets/maze.js'))
-ace.config.setModuleUrl('ace/snippets/mel', require('file-loader!./src-noconflict/snippets/mel.js'))
-ace.config.setModuleUrl('ace/snippets/mixal', require('file-loader!./src-noconflict/snippets/mixal.js'))
-ace.config.setModuleUrl('ace/snippets/mushcode', require('file-loader!./src-noconflict/snippets/mushcode.js'))
-ace.config.setModuleUrl('ace/snippets/mysql', require('file-loader!./src-noconflict/snippets/mysql.js'))
-ace.config.setModuleUrl('ace/snippets/nginx', require('file-loader!./src-noconflict/snippets/nginx.js'))
-ace.config.setModuleUrl('ace/snippets/nim', require('file-loader!./src-noconflict/snippets/nim.js'))
-ace.config.setModuleUrl('ace/snippets/nix', require('file-loader!./src-noconflict/snippets/nix.js'))
-ace.config.setModuleUrl('ace/snippets/nsis', require('file-loader!./src-noconflict/snippets/nsis.js'))
-ace.config.setModuleUrl('ace/snippets/objectivec', require('file-loader!./src-noconflict/snippets/objectivec.js'))
-ace.config.setModuleUrl('ace/snippets/ocaml', require('file-loader!./src-noconflict/snippets/ocaml.js'))
-ace.config.setModuleUrl('ace/snippets/pascal', require('file-loader!./src-noconflict/snippets/pascal.js'))
-ace.config.setModuleUrl('ace/snippets/perl', require('file-loader!./src-noconflict/snippets/perl.js'))
-ace.config.setModuleUrl('ace/snippets/perl6', require('file-loader!./src-noconflict/snippets/perl6.js'))
-ace.config.setModuleUrl('ace/snippets/pgsql', require('file-loader!./src-noconflict/snippets/pgsql.js'))
-ace.config.setModuleUrl('ace/snippets/php', require('file-loader!./src-noconflict/snippets/php.js'))
-ace.config.setModuleUrl('ace/snippets/php_laravel_blade', require('file-loader!./src-noconflict/snippets/php_laravel_blade.js'))
-ace.config.setModuleUrl('ace/snippets/pig', require('file-loader!./src-noconflict/snippets/pig.js'))
-ace.config.setModuleUrl('ace/snippets/plain_text', require('file-loader!./src-noconflict/snippets/plain_text.js'))
-ace.config.setModuleUrl('ace/snippets/powershell', require('file-loader!./src-noconflict/snippets/powershell.js'))
-ace.config.setModuleUrl('ace/snippets/praat', require('file-loader!./src-noconflict/snippets/praat.js'))
-ace.config.setModuleUrl('ace/snippets/prolog', require('file-loader!./src-noconflict/snippets/prolog.js'))
-ace.config.setModuleUrl('ace/snippets/properties', require('file-loader!./src-noconflict/snippets/properties.js'))
-ace.config.setModuleUrl('ace/snippets/protobuf', require('file-loader!./src-noconflict/snippets/protobuf.js'))
-ace.config.setModuleUrl('ace/snippets/puppet', require('file-loader!./src-noconflict/snippets/puppet.js'))
-ace.config.setModuleUrl('ace/snippets/python', require('file-loader!./src-noconflict/snippets/python.js'))
-ace.config.setModuleUrl('ace/snippets/r', require('file-loader!./src-noconflict/snippets/r.js'))
-ace.config.setModuleUrl('ace/snippets/razor', require('file-loader!./src-noconflict/snippets/razor.js'))
-ace.config.setModuleUrl('ace/snippets/rdoc', require('file-loader!./src-noconflict/snippets/rdoc.js'))
-ace.config.setModuleUrl('ace/snippets/red', require('file-loader!./src-noconflict/snippets/red.js'))
-ace.config.setModuleUrl('ace/snippets/redshift', require('file-loader!./src-noconflict/snippets/redshift.js'))
-ace.config.setModuleUrl('ace/snippets/rhtml', require('file-loader!./src-noconflict/snippets/rhtml.js'))
-ace.config.setModuleUrl('ace/snippets/rst', require('file-loader!./src-noconflict/snippets/rst.js'))
-ace.config.setModuleUrl('ace/snippets/ruby', require('file-loader!./src-noconflict/snippets/ruby.js'))
-ace.config.setModuleUrl('ace/snippets/rust', require('file-loader!./src-noconflict/snippets/rust.js'))
-ace.config.setModuleUrl('ace/snippets/sass', require('file-loader!./src-noconflict/snippets/sass.js'))
-ace.config.setModuleUrl('ace/snippets/scad', require('file-loader!./src-noconflict/snippets/scad.js'))
-ace.config.setModuleUrl('ace/snippets/scala', require('file-loader!./src-noconflict/snippets/scala.js'))
-ace.config.setModuleUrl('ace/snippets/scheme', require('file-loader!./src-noconflict/snippets/scheme.js'))
-ace.config.setModuleUrl('ace/snippets/scss', require('file-loader!./src-noconflict/snippets/scss.js'))
-ace.config.setModuleUrl('ace/snippets/sh', require('file-loader!./src-noconflict/snippets/sh.js'))
-ace.config.setModuleUrl('ace/snippets/sjs', require('file-loader!./src-noconflict/snippets/sjs.js'))
-ace.config.setModuleUrl('ace/snippets/slim', require('file-loader!./src-noconflict/snippets/slim.js'))
-ace.config.setModuleUrl('ace/snippets/smarty', require('file-loader!./src-noconflict/snippets/smarty.js'))
-ace.config.setModuleUrl('ace/snippets/snippets', require('file-loader!./src-noconflict/snippets/snippets.js'))
-ace.config.setModuleUrl('ace/snippets/soy_template', require('file-loader!./src-noconflict/snippets/soy_template.js'))
-ace.config.setModuleUrl('ace/snippets/space', require('file-loader!./src-noconflict/snippets/space.js'))
-ace.config.setModuleUrl('ace/snippets/sparql', require('file-loader!./src-noconflict/snippets/sparql.js'))
-ace.config.setModuleUrl('ace/snippets/sql', require('file-loader!./src-noconflict/snippets/sql.js'))
-ace.config.setModuleUrl('ace/snippets/sqlserver', require('file-loader!./src-noconflict/snippets/sqlserver.js'))
-ace.config.setModuleUrl('ace/snippets/stylus', require('file-loader!./src-noconflict/snippets/stylus.js'))
-ace.config.setModuleUrl('ace/snippets/svg', require('file-loader!./src-noconflict/snippets/svg.js'))
-ace.config.setModuleUrl('ace/snippets/swift', require('file-loader!./src-noconflict/snippets/swift.js'))
-ace.config.setModuleUrl('ace/snippets/tcl', require('file-loader!./src-noconflict/snippets/tcl.js'))
-ace.config.setModuleUrl('ace/snippets/terraform', require('file-loader!./src-noconflict/snippets/terraform.js'))
-ace.config.setModuleUrl('ace/snippets/tex', require('file-loader!./src-noconflict/snippets/tex.js'))
-ace.config.setModuleUrl('ace/snippets/text', require('file-loader!./src-noconflict/snippets/text.js'))
-ace.config.setModuleUrl('ace/snippets/textile', require('file-loader!./src-noconflict/snippets/textile.js'))
-ace.config.setModuleUrl('ace/snippets/toml', require('file-loader!./src-noconflict/snippets/toml.js'))
-ace.config.setModuleUrl('ace/snippets/tsx', require('file-loader!./src-noconflict/snippets/tsx.js'))
-ace.config.setModuleUrl('ace/snippets/turtle', require('file-loader!./src-noconflict/snippets/turtle.js'))
-ace.config.setModuleUrl('ace/snippets/twig', require('file-loader!./src-noconflict/snippets/twig.js'))
-ace.config.setModuleUrl('ace/snippets/typescript', require('file-loader!./src-noconflict/snippets/typescript.js'))
-ace.config.setModuleUrl('ace/snippets/vala', require('file-loader!./src-noconflict/snippets/vala.js'))
-ace.config.setModuleUrl('ace/snippets/vbscript', require('file-loader!./src-noconflict/snippets/vbscript.js'))
-ace.config.setModuleUrl('ace/snippets/velocity', require('file-loader!./src-noconflict/snippets/velocity.js'))
-ace.config.setModuleUrl('ace/snippets/verilog', require('file-loader!./src-noconflict/snippets/verilog.js'))
-ace.config.setModuleUrl('ace/snippets/vhdl', require('file-loader!./src-noconflict/snippets/vhdl.js'))
-ace.config.setModuleUrl('ace/snippets/visualforce', require('file-loader!./src-noconflict/snippets/visualforce.js'))
-ace.config.setModuleUrl('ace/snippets/wollok', require('file-loader!./src-noconflict/snippets/wollok.js'))
-ace.config.setModuleUrl('ace/snippets/xml', require('file-loader!./src-noconflict/snippets/xml.js'))
-ace.config.setModuleUrl('ace/snippets/xquery', require('file-loader!./src-noconflict/snippets/xquery.js'))
-ace.config.setModuleUrl('ace/snippets/yaml', require('file-loader!./src-noconflict/snippets/yaml.js'))
-ace.config.setModuleUrl('ace/snippets/zeek', require('file-loader!./src-noconflict/snippets/zeek.js'))
\ No newline at end of file
+ace.config.setModuleUrl('ace/theme/ambiance', require('file-loader?esModule=false!./src-noconflict/theme-ambiance.js'))
+ace.config.setModuleUrl('ace/theme/chaos', require('file-loader?esModule=false!./src-noconflict/theme-chaos.js'))
+ace.config.setModuleUrl('ace/theme/chrome', require('file-loader?esModule=false!./src-noconflict/theme-chrome.js'))
+ace.config.setModuleUrl('ace/theme/clouds', require('file-loader?esModule=false!./src-noconflict/theme-clouds.js'))
+ace.config.setModuleUrl('ace/theme/clouds_midnight', require('file-loader?esModule=false!./src-noconflict/theme-clouds_midnight.js'))
+ace.config.setModuleUrl('ace/theme/cobalt', require('file-loader?esModule=false!./src-noconflict/theme-cobalt.js'))
+ace.config.setModuleUrl('ace/theme/crimson_editor', require('file-loader?esModule=false!./src-noconflict/theme-crimson_editor.js'))
+ace.config.setModuleUrl('ace/theme/dawn', require('file-loader?esModule=false!./src-noconflict/theme-dawn.js'))
+ace.config.setModuleUrl('ace/theme/dracula', require('file-loader?esModule=false!./src-noconflict/theme-dracula.js'))
+ace.config.setModuleUrl('ace/theme/dreamweaver', require('file-loader?esModule=false!./src-noconflict/theme-dreamweaver.js'))
+ace.config.setModuleUrl('ace/theme/eclipse', require('file-loader?esModule=false!./src-noconflict/theme-eclipse.js'))
+ace.config.setModuleUrl('ace/theme/github', require('file-loader?esModule=false!./src-noconflict/theme-github.js'))
+ace.config.setModuleUrl('ace/theme/gob', require('file-loader?esModule=false!./src-noconflict/theme-gob.js'))
+ace.config.setModuleUrl('ace/theme/gruvbox', require('file-loader?esModule=false!./src-noconflict/theme-gruvbox.js'))
+ace.config.setModuleUrl('ace/theme/idle_fingers', require('file-loader?esModule=false!./src-noconflict/theme-idle_fingers.js'))
+ace.config.setModuleUrl('ace/theme/iplastic', require('file-loader?esModule=false!./src-noconflict/theme-iplastic.js'))
+ace.config.setModuleUrl('ace/theme/katzenmilch', require('file-loader?esModule=false!./src-noconflict/theme-katzenmilch.js'))
+ace.config.setModuleUrl('ace/theme/kr_theme', require('file-loader?esModule=false!./src-noconflict/theme-kr_theme.js'))
+ace.config.setModuleUrl('ace/theme/kuroir', require('file-loader?esModule=false!./src-noconflict/theme-kuroir.js'))
+ace.config.setModuleUrl('ace/theme/merbivore', require('file-loader?esModule=false!./src-noconflict/theme-merbivore.js'))
+ace.config.setModuleUrl('ace/theme/merbivore_soft', require('file-loader?esModule=false!./src-noconflict/theme-merbivore_soft.js'))
+ace.config.setModuleUrl('ace/theme/monokai', require('file-loader?esModule=false!./src-noconflict/theme-monokai.js'))
+ace.config.setModuleUrl('ace/theme/mono_industrial', require('file-loader?esModule=false!./src-noconflict/theme-mono_industrial.js'))
+ace.config.setModuleUrl('ace/theme/pastel_on_dark', require('file-loader?esModule=false!./src-noconflict/theme-pastel_on_dark.js'))
+ace.config.setModuleUrl('ace/theme/solarized_dark', require('file-loader?esModule=false!./src-noconflict/theme-solarized_dark.js'))
+ace.config.setModuleUrl('ace/theme/solarized_light', require('file-loader?esModule=false!./src-noconflict/theme-solarized_light.js'))
+ace.config.setModuleUrl('ace/theme/sqlserver', require('file-loader?esModule=false!./src-noconflict/theme-sqlserver.js'))
+ace.config.setModuleUrl('ace/theme/terminal', require('file-loader?esModule=false!./src-noconflict/theme-terminal.js'))
+ace.config.setModuleUrl('ace/theme/textmate', require('file-loader?esModule=false!./src-noconflict/theme-textmate.js'))
+ace.config.setModuleUrl('ace/theme/tomorrow', require('file-loader?esModule=false!./src-noconflict/theme-tomorrow.js'))
+ace.config.setModuleUrl('ace/theme/tomorrow_night', require('file-loader?esModule=false!./src-noconflict/theme-tomorrow_night.js'))
+ace.config.setModuleUrl('ace/theme/tomorrow_night_blue', require('file-loader?esModule=false!./src-noconflict/theme-tomorrow_night_blue.js'))
+ace.config.setModuleUrl('ace/theme/tomorrow_night_bright', require('file-loader?esModule=false!./src-noconflict/theme-tomorrow_night_bright.js'))
+ace.config.setModuleUrl('ace/theme/tomorrow_night_eighties', require('file-loader?esModule=false!./src-noconflict/theme-tomorrow_night_eighties.js'))
+ace.config.setModuleUrl('ace/theme/twilight', require('file-loader?esModule=false!./src-noconflict/theme-twilight.js'))
+ace.config.setModuleUrl('ace/theme/vibrant_ink', require('file-loader?esModule=false!./src-noconflict/theme-vibrant_ink.js'))
+ace.config.setModuleUrl('ace/theme/xcode', require('file-loader?esModule=false!./src-noconflict/theme-xcode.js'))
+ace.config.setModuleUrl('ace/mode/coffee_worker', require('file-loader?esModule=false!./src-noconflict/worker-coffee.js'))
+ace.config.setModuleUrl('ace/mode/css_worker', require('file-loader?esModule=false!./src-noconflict/worker-css.js'))
+ace.config.setModuleUrl('ace/mode/html_worker', require('file-loader?esModule=false!./src-noconflict/worker-html.js'))
+ace.config.setModuleUrl('ace/mode/javascript_worker', require('file-loader?esModule=false!./src-noconflict/worker-javascript.js'))
+ace.config.setModuleUrl('ace/mode/json_worker', require('file-loader?esModule=false!./src-noconflict/worker-json.js'))
+ace.config.setModuleUrl('ace/mode/lua_worker', require('file-loader?esModule=false!./src-noconflict/worker-lua.js'))
+ace.config.setModuleUrl('ace/mode/php_worker', require('file-loader?esModule=false!./src-noconflict/worker-php.js'))
+ace.config.setModuleUrl('ace/mode/xml_worker', require('file-loader?esModule=false!./src-noconflict/worker-xml.js'))
+ace.config.setModuleUrl('ace/mode/xquery_worker', require('file-loader?esModule=false!./src-noconflict/worker-xquery.js'))
+ace.config.setModuleUrl('ace/snippets/abap', require('file-loader?esModule=false!./src-noconflict/snippets/abap.js'))
+ace.config.setModuleUrl('ace/snippets/abc', require('file-loader?esModule=false!./src-noconflict/snippets/abc.js'))
+ace.config.setModuleUrl('ace/snippets/actionscript', require('file-loader?esModule=false!./src-noconflict/snippets/actionscript.js'))
+ace.config.setModuleUrl('ace/snippets/ada', require('file-loader?esModule=false!./src-noconflict/snippets/ada.js'))
+ace.config.setModuleUrl('ace/snippets/apache_conf', require('file-loader?esModule=false!./src-noconflict/snippets/apache_conf.js'))
+ace.config.setModuleUrl('ace/snippets/apex', require('file-loader?esModule=false!./src-noconflict/snippets/apex.js'))
+ace.config.setModuleUrl('ace/snippets/applescript', require('file-loader?esModule=false!./src-noconflict/snippets/applescript.js'))
+ace.config.setModuleUrl('ace/snippets/aql', require('file-loader?esModule=false!./src-noconflict/snippets/aql.js'))
+ace.config.setModuleUrl('ace/snippets/asciidoc', require('file-loader?esModule=false!./src-noconflict/snippets/asciidoc.js'))
+ace.config.setModuleUrl('ace/snippets/asl', require('file-loader?esModule=false!./src-noconflict/snippets/asl.js'))
+ace.config.setModuleUrl('ace/snippets/assembly_x86', require('file-loader?esModule=false!./src-noconflict/snippets/assembly_x86.js'))
+ace.config.setModuleUrl('ace/snippets/autohotkey', require('file-loader?esModule=false!./src-noconflict/snippets/autohotkey.js'))
+ace.config.setModuleUrl('ace/snippets/batchfile', require('file-loader?esModule=false!./src-noconflict/snippets/batchfile.js'))
+ace.config.setModuleUrl('ace/snippets/bro', require('file-loader?esModule=false!./src-noconflict/snippets/bro.js'))
+ace.config.setModuleUrl('ace/snippets/c9search', require('file-loader?esModule=false!./src-noconflict/snippets/c9search.js'))
+ace.config.setModuleUrl('ace/snippets/cirru', require('file-loader?esModule=false!./src-noconflict/snippets/cirru.js'))
+ace.config.setModuleUrl('ace/snippets/clojure', require('file-loader?esModule=false!./src-noconflict/snippets/clojure.js'))
+ace.config.setModuleUrl('ace/snippets/cobol', require('file-loader?esModule=false!./src-noconflict/snippets/cobol.js'))
+ace.config.setModuleUrl('ace/snippets/coffee', require('file-loader?esModule=false!./src-noconflict/snippets/coffee.js'))
+ace.config.setModuleUrl('ace/snippets/coldfusion', require('file-loader?esModule=false!./src-noconflict/snippets/coldfusion.js'))
+ace.config.setModuleUrl('ace/snippets/crystal', require('file-loader?esModule=false!./src-noconflict/snippets/crystal.js'))
+ace.config.setModuleUrl('ace/snippets/csharp', require('file-loader?esModule=false!./src-noconflict/snippets/csharp.js'))
+ace.config.setModuleUrl('ace/snippets/csound_document', require('file-loader?esModule=false!./src-noconflict/snippets/csound_document.js'))
+ace.config.setModuleUrl('ace/snippets/csound_orchestra', require('file-loader?esModule=false!./src-noconflict/snippets/csound_orchestra.js'))
+ace.config.setModuleUrl('ace/snippets/csound_score', require('file-loader?esModule=false!./src-noconflict/snippets/csound_score.js'))
+ace.config.setModuleUrl('ace/snippets/csp', require('file-loader?esModule=false!./src-noconflict/snippets/csp.js'))
+ace.config.setModuleUrl('ace/snippets/css', require('file-loader?esModule=false!./src-noconflict/snippets/css.js'))
+ace.config.setModuleUrl('ace/snippets/curly', require('file-loader?esModule=false!./src-noconflict/snippets/curly.js'))
+ace.config.setModuleUrl('ace/snippets/c_cpp', require('file-loader?esModule=false!./src-noconflict/snippets/c_cpp.js'))
+ace.config.setModuleUrl('ace/snippets/d', require('file-loader?esModule=false!./src-noconflict/snippets/d.js'))
+ace.config.setModuleUrl('ace/snippets/dart', require('file-loader?esModule=false!./src-noconflict/snippets/dart.js'))
+ace.config.setModuleUrl('ace/snippets/diff', require('file-loader?esModule=false!./src-noconflict/snippets/diff.js'))
+ace.config.setModuleUrl('ace/snippets/django', require('file-loader?esModule=false!./src-noconflict/snippets/django.js'))
+ace.config.setModuleUrl('ace/snippets/dockerfile', require('file-loader?esModule=false!./src-noconflict/snippets/dockerfile.js'))
+ace.config.setModuleUrl('ace/snippets/dot', require('file-loader?esModule=false!./src-noconflict/snippets/dot.js'))
+ace.config.setModuleUrl('ace/snippets/drools', require('file-loader?esModule=false!./src-noconflict/snippets/drools.js'))
+ace.config.setModuleUrl('ace/snippets/edifact', require('file-loader?esModule=false!./src-noconflict/snippets/edifact.js'))
+ace.config.setModuleUrl('ace/snippets/eiffel', require('file-loader?esModule=false!./src-noconflict/snippets/eiffel.js'))
+ace.config.setModuleUrl('ace/snippets/ejs', require('file-loader?esModule=false!./src-noconflict/snippets/ejs.js'))
+ace.config.setModuleUrl('ace/snippets/elixir', require('file-loader?esModule=false!./src-noconflict/snippets/elixir.js'))
+ace.config.setModuleUrl('ace/snippets/elm', require('file-loader?esModule=false!./src-noconflict/snippets/elm.js'))
+ace.config.setModuleUrl('ace/snippets/erlang', require('file-loader?esModule=false!./src-noconflict/snippets/erlang.js'))
+ace.config.setModuleUrl('ace/snippets/forth', require('file-loader?esModule=false!./src-noconflict/snippets/forth.js'))
+ace.config.setModuleUrl('ace/snippets/fortran', require('file-loader?esModule=false!./src-noconflict/snippets/fortran.js'))
+ace.config.setModuleUrl('ace/snippets/fsharp', require('file-loader?esModule=false!./src-noconflict/snippets/fsharp.js'))
+ace.config.setModuleUrl('ace/snippets/fsl', require('file-loader?esModule=false!./src-noconflict/snippets/fsl.js'))
+ace.config.setModuleUrl('ace/snippets/ftl', require('file-loader?esModule=false!./src-noconflict/snippets/ftl.js'))
+ace.config.setModuleUrl('ace/snippets/gcode', require('file-loader?esModule=false!./src-noconflict/snippets/gcode.js'))
+ace.config.setModuleUrl('ace/snippets/gherkin', require('file-loader?esModule=false!./src-noconflict/snippets/gherkin.js'))
+ace.config.setModuleUrl('ace/snippets/gitignore', require('file-loader?esModule=false!./src-noconflict/snippets/gitignore.js'))
+ace.config.setModuleUrl('ace/snippets/glsl', require('file-loader?esModule=false!./src-noconflict/snippets/glsl.js'))
+ace.config.setModuleUrl('ace/snippets/gobstones', require('file-loader?esModule=false!./src-noconflict/snippets/gobstones.js'))
+ace.config.setModuleUrl('ace/snippets/golang', require('file-loader?esModule=false!./src-noconflict/snippets/golang.js'))
+ace.config.setModuleUrl('ace/snippets/graphqlschema', require('file-loader?esModule=false!./src-noconflict/snippets/graphqlschema.js'))
+ace.config.setModuleUrl('ace/snippets/groovy', require('file-loader?esModule=false!./src-noconflict/snippets/groovy.js'))
+ace.config.setModuleUrl('ace/snippets/haml', require('file-loader?esModule=false!./src-noconflict/snippets/haml.js'))
+ace.config.setModuleUrl('ace/snippets/handlebars', require('file-loader?esModule=false!./src-noconflict/snippets/handlebars.js'))
+ace.config.setModuleUrl('ace/snippets/haskell', require('file-loader?esModule=false!./src-noconflict/snippets/haskell.js'))
+ace.config.setModuleUrl('ace/snippets/haskell_cabal', require('file-loader?esModule=false!./src-noconflict/snippets/haskell_cabal.js'))
+ace.config.setModuleUrl('ace/snippets/haxe', require('file-loader?esModule=false!./src-noconflict/snippets/haxe.js'))
+ace.config.setModuleUrl('ace/snippets/hjson', require('file-loader?esModule=false!./src-noconflict/snippets/hjson.js'))
+ace.config.setModuleUrl('ace/snippets/html', require('file-loader?esModule=false!./src-noconflict/snippets/html.js'))
+ace.config.setModuleUrl('ace/snippets/html_elixir', require('file-loader?esModule=false!./src-noconflict/snippets/html_elixir.js'))
+ace.config.setModuleUrl('ace/snippets/html_ruby', require('file-loader?esModule=false!./src-noconflict/snippets/html_ruby.js'))
+ace.config.setModuleUrl('ace/snippets/ini', require('file-loader?esModule=false!./src-noconflict/snippets/ini.js'))
+ace.config.setModuleUrl('ace/snippets/io', require('file-loader?esModule=false!./src-noconflict/snippets/io.js'))
+ace.config.setModuleUrl('ace/snippets/jack', require('file-loader?esModule=false!./src-noconflict/snippets/jack.js'))
+ace.config.setModuleUrl('ace/snippets/jade', require('file-loader?esModule=false!./src-noconflict/snippets/jade.js'))
+ace.config.setModuleUrl('ace/snippets/java', require('file-loader?esModule=false!./src-noconflict/snippets/java.js'))
+ace.config.setModuleUrl('ace/snippets/javascript', require('file-loader?esModule=false!./src-noconflict/snippets/javascript.js'))
+ace.config.setModuleUrl('ace/snippets/json', require('file-loader?esModule=false!./src-noconflict/snippets/json.js'))
+ace.config.setModuleUrl('ace/snippets/jsoniq', require('file-loader?esModule=false!./src-noconflict/snippets/jsoniq.js'))
+ace.config.setModuleUrl('ace/snippets/jsp', require('file-loader?esModule=false!./src-noconflict/snippets/jsp.js'))
+ace.config.setModuleUrl('ace/snippets/jssm', require('file-loader?esModule=false!./src-noconflict/snippets/jssm.js'))
+ace.config.setModuleUrl('ace/snippets/jsx', require('file-loader?esModule=false!./src-noconflict/snippets/jsx.js'))
+ace.config.setModuleUrl('ace/snippets/julia', require('file-loader?esModule=false!./src-noconflict/snippets/julia.js'))
+ace.config.setModuleUrl('ace/snippets/kotlin', require('file-loader?esModule=false!./src-noconflict/snippets/kotlin.js'))
+ace.config.setModuleUrl('ace/snippets/latex', require('file-loader?esModule=false!./src-noconflict/snippets/latex.js'))
+ace.config.setModuleUrl('ace/snippets/less', require('file-loader?esModule=false!./src-noconflict/snippets/less.js'))
+ace.config.setModuleUrl('ace/snippets/liquid', require('file-loader?esModule=false!./src-noconflict/snippets/liquid.js'))
+ace.config.setModuleUrl('ace/snippets/lisp', require('file-loader?esModule=false!./src-noconflict/snippets/lisp.js'))
+ace.config.setModuleUrl('ace/snippets/livescript', require('file-loader?esModule=false!./src-noconflict/snippets/livescript.js'))
+ace.config.setModuleUrl('ace/snippets/logiql', require('file-loader?esModule=false!./src-noconflict/snippets/logiql.js'))
+ace.config.setModuleUrl('ace/snippets/logtalk', require('file-loader?esModule=false!./src-noconflict/snippets/logtalk.js'))
+ace.config.setModuleUrl('ace/snippets/lsl', require('file-loader?esModule=false!./src-noconflict/snippets/lsl.js'))
+ace.config.setModuleUrl('ace/snippets/lua', require('file-loader?esModule=false!./src-noconflict/snippets/lua.js'))
+ace.config.setModuleUrl('ace/snippets/luapage', require('file-loader?esModule=false!./src-noconflict/snippets/luapage.js'))
+ace.config.setModuleUrl('ace/snippets/lucene', require('file-loader?esModule=false!./src-noconflict/snippets/lucene.js'))
+ace.config.setModuleUrl('ace/snippets/makefile', require('file-loader?esModule=false!./src-noconflict/snippets/makefile.js'))
+ace.config.setModuleUrl('ace/snippets/markdown', require('file-loader?esModule=false!./src-noconflict/snippets/markdown.js'))
+ace.config.setModuleUrl('ace/snippets/mask', require('file-loader?esModule=false!./src-noconflict/snippets/mask.js'))
+ace.config.setModuleUrl('ace/snippets/matlab', require('file-loader?esModule=false!./src-noconflict/snippets/matlab.js'))
+ace.config.setModuleUrl('ace/snippets/maze', require('file-loader?esModule=false!./src-noconflict/snippets/maze.js'))
+ace.config.setModuleUrl('ace/snippets/mel', require('file-loader?esModule=false!./src-noconflict/snippets/mel.js'))
+ace.config.setModuleUrl('ace/snippets/mixal', require('file-loader?esModule=false!./src-noconflict/snippets/mixal.js'))
+ace.config.setModuleUrl('ace/snippets/mushcode', require('file-loader?esModule=false!./src-noconflict/snippets/mushcode.js'))
+ace.config.setModuleUrl('ace/snippets/mysql', require('file-loader?esModule=false!./src-noconflict/snippets/mysql.js'))
+ace.config.setModuleUrl('ace/snippets/nginx', require('file-loader?esModule=false!./src-noconflict/snippets/nginx.js'))
+ace.config.setModuleUrl('ace/snippets/nim', require('file-loader?esModule=false!./src-noconflict/snippets/nim.js'))
+ace.config.setModuleUrl('ace/snippets/nix', require('file-loader?esModule=false!./src-noconflict/snippets/nix.js'))
+ace.config.setModuleUrl('ace/snippets/nsis', require('file-loader?esModule=false!./src-noconflict/snippets/nsis.js'))
+ace.config.setModuleUrl('ace/snippets/objectivec', require('file-loader?esModule=false!./src-noconflict/snippets/objectivec.js'))
+ace.config.setModuleUrl('ace/snippets/ocaml', require('file-loader?esModule=false!./src-noconflict/snippets/ocaml.js'))
+ace.config.setModuleUrl('ace/snippets/pascal', require('file-loader?esModule=false!./src-noconflict/snippets/pascal.js'))
+ace.config.setModuleUrl('ace/snippets/perl', require('file-loader?esModule=false!./src-noconflict/snippets/perl.js'))
+ace.config.setModuleUrl('ace/snippets/perl6', require('file-loader?esModule=false!./src-noconflict/snippets/perl6.js'))
+ace.config.setModuleUrl('ace/snippets/pgsql', require('file-loader?esModule=false!./src-noconflict/snippets/pgsql.js'))
+ace.config.setModuleUrl('ace/snippets/php', require('file-loader?esModule=false!./src-noconflict/snippets/php.js'))
+ace.config.setModuleUrl('ace/snippets/php_laravel_blade', require('file-loader?esModule=false!./src-noconflict/snippets/php_laravel_blade.js'))
+ace.config.setModuleUrl('ace/snippets/pig', require('file-loader?esModule=false!./src-noconflict/snippets/pig.js'))
+ace.config.setModuleUrl('ace/snippets/plain_text', require('file-loader?esModule=false!./src-noconflict/snippets/plain_text.js'))
+ace.config.setModuleUrl('ace/snippets/powershell', require('file-loader?esModule=false!./src-noconflict/snippets/powershell.js'))
+ace.config.setModuleUrl('ace/snippets/praat', require('file-loader?esModule=false!./src-noconflict/snippets/praat.js'))
+ace.config.setModuleUrl('ace/snippets/prolog', require('file-loader?esModule=false!./src-noconflict/snippets/prolog.js'))
+ace.config.setModuleUrl('ace/snippets/properties', require('file-loader?esModule=false!./src-noconflict/snippets/properties.js'))
+ace.config.setModuleUrl('ace/snippets/protobuf', require('file-loader?esModule=false!./src-noconflict/snippets/protobuf.js'))
+ace.config.setModuleUrl('ace/snippets/puppet', require('file-loader?esModule=false!./src-noconflict/snippets/puppet.js'))
+ace.config.setModuleUrl('ace/snippets/python', require('file-loader?esModule=false!./src-noconflict/snippets/python.js'))
+ace.config.setModuleUrl('ace/snippets/r', require('file-loader?esModule=false!./src-noconflict/snippets/r.js'))
+ace.config.setModuleUrl('ace/snippets/razor', require('file-loader?esModule=false!./src-noconflict/snippets/razor.js'))
+ace.config.setModuleUrl('ace/snippets/rdoc', require('file-loader?esModule=false!./src-noconflict/snippets/rdoc.js'))
+ace.config.setModuleUrl('ace/snippets/red', require('file-loader?esModule=false!./src-noconflict/snippets/red.js'))
+ace.config.setModuleUrl('ace/snippets/redshift', require('file-loader?esModule=false!./src-noconflict/snippets/redshift.js'))
+ace.config.setModuleUrl('ace/snippets/rhtml', require('file-loader?esModule=false!./src-noconflict/snippets/rhtml.js'))
+ace.config.setModuleUrl('ace/snippets/rst', require('file-loader?esModule=false!./src-noconflict/snippets/rst.js'))
+ace.config.setModuleUrl('ace/snippets/ruby', require('file-loader?esModule=false!./src-noconflict/snippets/ruby.js'))
+ace.config.setModuleUrl('ace/snippets/rust', require('file-loader?esModule=false!./src-noconflict/snippets/rust.js'))
+ace.config.setModuleUrl('ace/snippets/sass', require('file-loader?esModule=false!./src-noconflict/snippets/sass.js'))
+ace.config.setModuleUrl('ace/snippets/scad', require('file-loader?esModule=false!./src-noconflict/snippets/scad.js'))
+ace.config.setModuleUrl('ace/snippets/scala', require('file-loader?esModule=false!./src-noconflict/snippets/scala.js'))
+ace.config.setModuleUrl('ace/snippets/scheme', require('file-loader?esModule=false!./src-noconflict/snippets/scheme.js'))
+ace.config.setModuleUrl('ace/snippets/scss', require('file-loader?esModule=false!./src-noconflict/snippets/scss.js'))
+ace.config.setModuleUrl('ace/snippets/sh', require('file-loader?esModule=false!./src-noconflict/snippets/sh.js'))
+ace.config.setModuleUrl('ace/snippets/sjs', require('file-loader?esModule=false!./src-noconflict/snippets/sjs.js'))
+ace.config.setModuleUrl('ace/snippets/slim', require('file-loader?esModule=false!./src-noconflict/snippets/slim.js'))
+ace.config.setModuleUrl('ace/snippets/smarty', require('file-loader?esModule=false!./src-noconflict/snippets/smarty.js'))
+ace.config.setModuleUrl('ace/snippets/snippets', require('file-loader?esModule=false!./src-noconflict/snippets/snippets.js'))
+ace.config.setModuleUrl('ace/snippets/soy_template', require('file-loader?esModule=false!./src-noconflict/snippets/soy_template.js'))
+ace.config.setModuleUrl('ace/snippets/space', require('file-loader?esModule=false!./src-noconflict/snippets/space.js'))
+ace.config.setModuleUrl('ace/snippets/sparql', require('file-loader?esModule=false!./src-noconflict/snippets/sparql.js'))
+ace.config.setModuleUrl('ace/snippets/sql', require('file-loader?esModule=false!./src-noconflict/snippets/sql.js'))
+ace.config.setModuleUrl('ace/snippets/sqlserver', require('file-loader?esModule=false!./src-noconflict/snippets/sqlserver.js'))
+ace.config.setModuleUrl('ace/snippets/stylus', require('file-loader?esModule=false!./src-noconflict/snippets/stylus.js'))
+ace.config.setModuleUrl('ace/snippets/svg', require('file-loader?esModule=false!./src-noconflict/snippets/svg.js'))
+ace.config.setModuleUrl('ace/snippets/swift', require('file-loader?esModule=false!./src-noconflict/snippets/swift.js'))
+ace.config.setModuleUrl('ace/snippets/tcl', require('file-loader?esModule=false!./src-noconflict/snippets/tcl.js'))
+ace.config.setModuleUrl('ace/snippets/terraform', require('file-loader?esModule=false!./src-noconflict/snippets/terraform.js'))
+ace.config.setModuleUrl('ace/snippets/tex', require('file-loader?esModule=false!./src-noconflict/snippets/tex.js'))
+ace.config.setModuleUrl('ace/snippets/text', require('file-loader?esModule=false!./src-noconflict/snippets/text.js'))
+ace.config.setModuleUrl('ace/snippets/textile', require('file-loader?esModule=false!./src-noconflict/snippets/textile.js'))
+ace.config.setModuleUrl('ace/snippets/toml', require('file-loader?esModule=false!./src-noconflict/snippets/toml.js'))
+ace.config.setModuleUrl('ace/snippets/tsx', require('file-loader?esModule=false!./src-noconflict/snippets/tsx.js'))
+ace.config.setModuleUrl('ace/snippets/turtle', require('file-loader?esModule=false!./src-noconflict/snippets/turtle.js'))
+ace.config.setModuleUrl('ace/snippets/twig', require('file-loader?esModule=false!./src-noconflict/snippets/twig.js'))
+ace.config.setModuleUrl('ace/snippets/typescript', require('file-loader?esModule=false!./src-noconflict/snippets/typescript.js'))
+ace.config.setModuleUrl('ace/snippets/vala', require('file-loader?esModule=false!./src-noconflict/snippets/vala.js'))
+ace.config.setModuleUrl('ace/snippets/vbscript', require('file-loader?esModule=false!./src-noconflict/snippets/vbscript.js'))
+ace.config.setModuleUrl('ace/snippets/velocity', require('file-loader?esModule=false!./src-noconflict/snippets/velocity.js'))
+ace.config.setModuleUrl('ace/snippets/verilog', require('file-loader?esModule=false!./src-noconflict/snippets/verilog.js'))
+ace.config.setModuleUrl('ace/snippets/vhdl', require('file-loader?esModule=false!./src-noconflict/snippets/vhdl.js'))
+ace.config.setModuleUrl('ace/snippets/visualforce', require('file-loader?esModule=false!./src-noconflict/snippets/visualforce.js'))
+ace.config.setModuleUrl('ace/snippets/wollok', require('file-loader?esModule=false!./src-noconflict/snippets/wollok.js'))
+ace.config.setModuleUrl('ace/snippets/xml', require('file-loader?esModule=false!./src-noconflict/snippets/xml.js'))
+ace.config.setModuleUrl('ace/snippets/xquery', require('file-loader?esModule=false!./src-noconflict/snippets/xquery.js'))
+ace.config.setModuleUrl('ace/snippets/yaml', require('file-loader?esModule=false!./src-noconflict/snippets/yaml.js'))
+ace.config.setModuleUrl('ace/snippets/zeek', require('file-loader?esModule=false!./src-noconflict/snippets/zeek.js'))
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/.editorconfig b/htdocs/includes/jquery/plugins/select2/.editorconfig
new file mode 100644
index 00000000000..54f4d3beedb
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/.editorconfig
@@ -0,0 +1,6 @@
+[*]
+indent_style = space
+end_of_line = lf
+
+[*.js]
+indent_size = 2
diff --git a/htdocs/includes/jquery/plugins/select2/.gitignore b/htdocs/includes/jquery/plugins/select2/.gitignore
new file mode 100644
index 00000000000..aa970da6518
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/.gitignore
@@ -0,0 +1,3 @@
+node_modules
+dist/js/i18n/build.txt
+.sass-cache
diff --git a/htdocs/includes/jquery/plugins/select2/.jshintignore b/htdocs/includes/jquery/plugins/select2/.jshintignore
new file mode 100644
index 00000000000..ba5a30f8c38
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/.jshintignore
@@ -0,0 +1,4 @@
+src/js/banner.*.js
+src/js/wrapper.*.js
+tests/vendor/*.js
+tests/helpers.js
diff --git a/htdocs/includes/jquery/plugins/select2/.jshintrc b/htdocs/includes/jquery/plugins/select2/.jshintrc
new file mode 100644
index 00000000000..94299268771
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/.jshintrc
@@ -0,0 +1,25 @@
+{
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "es3": true,
+ "eqnull": true,
+ "freeze": true,
+ "globals": {
+ "console": false,
+ "define": false,
+ "document": false,
+ "MockContainer": false,
+ "module": false,
+ "QUnit": false,
+ "require": false,
+ "test": false,
+ "window": false
+ },
+ "indent": 2,
+ "maxlen": 80,
+ "noarg": true,
+ "nonew": true,
+ "quotmark": "single",
+ "undef": true
+}
diff --git a/htdocs/includes/jquery/plugins/select2/CHANGELOG.md b/htdocs/includes/jquery/plugins/select2/CHANGELOG.md
index 3ae60aff255..d6b2a7587dd 100644
--- a/htdocs/includes/jquery/plugins/select2/CHANGELOG.md
+++ b/htdocs/includes/jquery/plugins/select2/CHANGELOG.md
@@ -1,5 +1,178 @@
# Change Log
+## 4.0.13
+
+### New features / improvements
+
+* Trigger `input` event before `change` events (#4649)
+* Feed back the keypress code that was responsible for the 'close' event (#5513)
+* Only trigger `selection:update` once on DOM change events (#5734)
+
+### Bug fixes
+
+* Prevent opening of disabled elements (#5751)
+
+### Documentation
+
+* Fix "edit this page" links in docs (#5689)
+
+### Miscellaneous
+
+* Registered Select2 on Open Collective (#5700, #5721, #5741)
+
+## 4.0.12
+
+### Bug fixes
+
+* Fixes incorrect offset when using the Shadow DOM and styling the `` element (#5682)
+
+### Miscellaneous
+
+* Replace cdnjs with jsDelivr in the documentation (#5687)
+* Fix incorrect provider for the automated NPM deployment (#5686)
+
+## 4.0.11
+
+### Bug fixes
+
+* Fixes jQuery migrate error when getting offset when dropdownParent not in document (#5584)
+
+### Miscellaneous
+
+* Enable GitHub actions for CI (#5591)
+* Documentation has been moved into and is deployed from the code repository (#5638)
+* Remove Travis CI integration (#5665)
+
+## 4.0.10
+
+### New features / improvements
+
+* Support passing in a selector for `dropdownParent` option (#5622)
+
+### Bug fixes
+
+* Fix bug where dropdowns pointing upwards were incorrectly positioned (#5621)
+
+## 4.0.9
+
+### New features / improvements
+
+* Mirror disabled state through aria-disabled on selection (#5579)
+* Select2 now clears the internal ID when it is destroyed (#5587)
+* Set the main ARIA 1.1 roles and properties for comboboxes (#5582)
+* The `language` option now has a clearly defined fallback chain (#5602)
+
+### Bug fixes
+
+* Do not propagate click when search box is not empty (#5580)
+* Fix `maximumSelectionLength` being ignored by `closeOnSelect` (#5581)
+* Fix generated options not receiving result IDs (#5586)
+* Remove selection title attribute if text is empty (#5589)
+* Reposition dropdown whenever items are selected (#5590)
+* Fix dropdown positioning when displayed above with messages (#5592)
+* Fix search box expanding width of container (#5595)
+* `allowClear` no longer shifts selections to a new line (#5603)
+
+### Translations
+
+* Fix error in German translations (#5604)
+
+### Miscellaneous
+
+* Updated development grunt version so it no longer shows as vulnerable (#5597)
+* Remove unused variables (#5554)
+
+## 4.0.8
+
+### New features / improvements
+
+* Test against and fix compatibility with jQuery 3.4.1 (#5531)
+* Results respect disabled state of `` (#5560)
+* Add `computedstyle` option for calculating the width (#5559)
+
+### Bug fixes
+
+* Fix tag creation being broken in 4.0.7 (#5558)
+* Fix infinite scroll when the scrollbar is not visible (#5575)
+* Revert change to focusing behaviour in 4.0.6 (#5576)
+
+### Translations
+
+* Fix wording in French translations (#5521)
+
+### Miscellaneous
+
+* Update grunt-contrib-qunit to latest version (#5530)
+* Removed unused `.select2-selection__placeholder` CSS definitions for multiple selects (#5508)
+* Remove deprecated jQuery shorthand (#5564)
+
+## 4.0.7
+
+### New features/improvements
+- Do not close on select if Ctrl or Meta (Cmd) keys being held (#5222)
+
+### Bug fixes
+- Fixed issue where single select boxes would automatically reopen when they were closed (#5490, #5492)
+
+### Miscellaneous
+- Move almost and jquery-mousewheel to devDependencies (#5489)
+
+## 4.0.6
+
+### New features/improvements
+- Add style property to package.json (#5019)
+- Implement `clear` and `clearing` events (#5058)
+- Add `scrollAfterSelect` option (#5150)
+- Add missing diacritics (#4118, #4337, #5464)
+
+### Bug fixes
+- Fix up arrow error when there are no options in dropdown (#5127)
+- Add `;` before beginning of factory wrapper (#5089)
+- Fix IE11 issue with select losing focus after selecting an item (#4860)
+- Clear tooltip from `select2-selection__rendered` when selection is cleared (#4640, #4746)
+- Fix keyboard not closing when closing dropdown on iOS 10 (#4680)
+- User-defined types not normalized properly when passed in as data (#4632)
+- Perform deep merge for `Defaults.set()` (#4364)
+- Fix "the results could not be loaded" displaying during AJAX request (#4356)
+- Cache objects in `Utils.__cache` instead of using `$.data` (#4346, #5486)
+- Removing the double event binding registration of `selection:update` (#4306)
+
+#### Accessibility
+- Improve `.select2-hidden-accessible` (#4908)
+- Add role and aria-readonly attributes to single selection dropdown value (#4881)
+
+### Translations
+- Add Turkmen translations (`tk`) (#5125)
+- Fix error in French translations (#5122)
+- Add Albanian translation (`sq`) (#5199)
+- Add Georgian translation (`ka`) (#5179)
+- Add Nepali translation (`ne`) (#5295)
+- Add Bangla translation (`bn`) (#5248)
+- Add `removeAllItems` translation for clear "x" title (#5291)
+- Fix wording in Vietnamese translations (#5387)
+- Fix error in Russian translation (#5401)
+
+### Miscellaneous
+- Remove duplicate CSS selector in classic theme (#5115)
+
+## 4.0.5
+
+### Bug fixes
+- Replace `autocapitalize=off` with `autocapitalize=none` (#4994)
+
+### Translations
+- Vietnamese: remove an unnecessary quote mark (#5059)
+- Czech: Add missing commas and periods (#5052)
+- Spanish: Update the 'errorLoading' message (#5032)
+- Fix typo in Romanian (#5005)
+- Improve French translation (#4988)
+- Add Pashto translation (`ps`) (#4960)
+- Add translations for lower and upper Sorbian (`dsb` and `hsb`) (#4949)
+- Updates to Slovak (#4915)
+- Fixed Norwegian `inputTooShort` message (#4817, 4896)
+- Add Afrikaans translation (`af`) (#4850)
+- Add Bosnian translation (`bs`) (#4504)
+
## 4.0.4
### New features / Improvements
diff --git a/htdocs/includes/jquery/plugins/select2/Gruntfile.js b/htdocs/includes/jquery/plugins/select2/Gruntfile.js
index bf0f38d4303..23ef3d9cf50 100644
--- a/htdocs/includes/jquery/plugins/select2/Gruntfile.js
+++ b/htdocs/includes/jquery/plugins/select2/Gruntfile.js
@@ -1,3 +1,5 @@
+const sass = require('node-sass');
+
module.exports = function (grunt) {
// Full list of files that must be included by RequireJS
includes = [
@@ -62,10 +64,6 @@ module.exports = function (grunt) {
grunt.initConfig({
package: grunt.file.readJSON('package.json'),
- clean: {
- docs: ['docs/_site']
- },
-
concat: {
'dist': {
options: {
@@ -124,81 +122,10 @@ module.exports = function (grunt) {
}
},
- 'saucelabs-qunit': {
- all: {
- options: {
- build: testBuildNumber,
- tags: ['tests', 'qunit'],
- urls: testUrls,
- testname: 'QUnit test for Select2',
- browsers: [
- {
- browserName: 'internet explorer',
- version: '8'
- },
- {
- browserName: 'internet explorer',
- version: '9'
- },
- {
- browserName: 'internet explorer',
- version: '10'
- },
- {
- browserName: 'internet explorer',
- version: '11'
- },
-
- {
- browserName: 'firefox',
- platform: 'linux'
- },
-
- {
- browserName: 'chrome'
- },
-
- {
- browserName: 'opera',
- version: '12',
- platform: 'linux'
- }
- ]
- }
- }
- },
-
- 'gh-pages': {
- options: {
- base: 'docs',
- branch: 'master',
- clone: 'node_modules/grunt-gh-pages/repo',
- message: 'Updated docs with master',
- push: true,
- repo: 'git@github.com:select2/select2.github.io.git'
- },
- src: '**'
- },
-
- jekyll: {
- options: {
- src: 'docs',
- dest: 'docs/_site'
- },
- build: {
- d: null
- },
- serve: {
- options: {
- serve: true,
- watch: true
- }
- }
- },
-
jshint: {
options: {
- jshintrc: true
+ jshintrc: true,
+ reporterOutput: ''
},
code: {
src: ['src/js/**/*.js']
@@ -211,6 +138,7 @@ module.exports = function (grunt) {
sass: {
dist: {
options: {
+ implementation: sass,
outputStyle: 'compressed'
},
files: {
@@ -222,6 +150,7 @@ module.exports = function (grunt) {
},
dev: {
options: {
+ implementation: sass,
outputStyle: 'nested'
},
files: {
@@ -233,19 +162,6 @@ module.exports = function (grunt) {
}
},
- symlink: {
- docs: {
- cwd: 'dist',
- expand: true,
- overwrite: false,
- src: [
- '*'
- ],
- dest: 'docs/dist',
- filter: 'isDirectory'
- }
- },
-
requirejs: {
'dist': {
options: {
@@ -324,22 +240,17 @@ module.exports = function (grunt) {
}
});
- grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-requirejs');
- grunt.loadNpmTasks('grunt-contrib-symlink');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-gh-pages');
- grunt.loadNpmTasks('grunt-jekyll');
- grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-sass');
- grunt.registerTask('default', ['compile', 'test', 'minify']);
+ grunt.registerTask('default', ['compile', 'test', 'lint', 'minify']);
grunt.registerTask('compile', [
'requirejs:dist', 'requirejs:dist.full', 'requirejs:i18n',
@@ -347,24 +258,6 @@ module.exports = function (grunt) {
'sass:dev'
]);
grunt.registerTask('minify', ['uglify', 'sass:dist']);
- grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']);
-
- var ciTasks = [];
-
- ciTasks.push('compile');
- ciTasks.push('connect:tests');
-
- // Can't run Sauce Labs tests in pull requests
- if (process.env.TRAVIS_PULL_REQUEST == 'false') {
- ciTasks.push('saucelabs-qunit');
- }
-
- ciTasks.push('qunit');
- ciTasks.push('jshint');
-
- grunt.registerTask('ci', ciTasks);
-
- grunt.registerTask('docs', ['symlink:docs', 'jekyll:serve']);
-
- grunt.registerTask('docs-release', ['default', 'clean:docs', 'gh-pages']);
+ grunt.registerTask('lint', ['jshint']);
+ grunt.registerTask('test', ['connect:tests', 'qunit']);
};
diff --git a/htdocs/includes/jquery/plugins/select2/README.md b/htdocs/includes/jquery/plugins/select2/README.md
index 6ee975d6ee0..a27484fa40c 100644
--- a/htdocs/includes/jquery/plugins/select2/README.md
+++ b/htdocs/includes/jquery/plugins/select2/README.md
@@ -1,6 +1,8 @@
Select2
=======
-[![Build Status][travis-ci-image]][travis-ci-status]
+![Build Status][github-actions-image]
+[](https://opencollective.com/select2) [][cdnjs]
+[][jsdelivr]
Select2 is a jQuery-based replacement for select boxes. It supports searching,
remote data sets, and pagination of results.
@@ -31,14 +33,10 @@ Browser compatibility
* Safari 3+
* Opera 10.6+
-Select2 is automatically tested on the following browsers.
-
-[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status]
-
Usage
-----
-You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or
-[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of
+You can source Select2 directly from a CDN like [jsDelivr][jsdelivr] or
+[cdnjs][cdnjs], [download it from this GitHub repo][releases], or use one of
the integrations below.
Integrations
@@ -51,14 +49,17 @@ Plugins
- [django-autocomplete-light]
- [django-easy-select2]
- [django-select2]
+* [Drupal] - [drupal-select2]
* [Meteor] - [meteor-select2]
* [Ruby on Rails][ruby-on-rails] - [select2-rails]
* [Wicket] - [wicketstuff-select2]
* [Yii 2][yii2] - [yii2-widget-select2]
+* [Angularjs][angularjs] - [mdr-angular-select2]
Themes
- [Bootstrap 3][bootstrap3] - [select2-bootstrap-theme]
+- [Bootstrap 4][bootstrap4] - [select2-bootstrap4-theme]
- [Flat UI][flat-ui] - [select2-flat-theme]
- [Metro UI][metro-ui] - [select2-metro]
@@ -76,8 +77,8 @@ make a pull request back to Select2 here on GitHub.
Documentation
-------------
The documentation for Select2 is available
-[through GitHub Pages][documentation] and is located within this repository
-in the [`docs` folder][documentation-folder].
+[online at the documentation website][documentation] and is located within the
+[`docs` directory of this repository][documentation-directory].
Community
---------
@@ -91,28 +92,31 @@ The license is available within the repository in the [LICENSE][license] file.
[cdnjs]: http://www.cdnjs.com/libraries/select2
[community]: https://select2.org/getting-help
[documentation]: https://select2.org
-[documentation-folder]: https://github.com/select2/select2/tree/master/docs
+[documentation-directory]: https://github.com/select2/select2/tree/develop/docs
[freenode]: https://freenode.net/
-[jsdelivr]: http://www.jsdelivr.com/#!select2
+[github-actions-image]: https://github.com/select2/select2/workflows/CI/badge.svg
+[jsdelivr]: https://www.jsdelivr.com/package/npm/select2
[license]: LICENSE.md
[releases]: https://github.com/select2/select2/releases
-[saucelabs-matrix]: https://saucelabs.com/browser-matrix/select2.svg
-[saucelabs-status]: https://saucelabs.com/u/select2
-[travis-ci-image]: https://img.shields.io/travis/select2/select2/master.svg
-[travis-ci-status]: https://travis-ci.org/select2/select2
+[angularjs]: https://angularjs.org/
[bootstrap3]: https://getbootstrap.com/
+[bootstrap4]: https://getbootstrap.com/
[django]: https://www.djangoproject.com/
[django-autocomplete-light]: https://github.com/yourlabs/django-autocomplete-light
[django-easy-select2]: https://github.com/asyncee/django-easy-select2
[django-select2]: https://github.com/applegrew/django-select2
+[drupal]: https://www.drupal.org/
+[drupal-select2]: https://www.drupal.org/project/select2
[flat-ui]: http://designmodo.github.io/Flat-UI/
+[mdr-angular-select2]: https://github.com/modulr/mdr-angular-select2
[meteor]: https://www.meteor.com/
[meteor-select2]: https://github.com/nate-strauser/meteor-select2
[metro-ui]: http://metroui.org.ua/
[select2-metro]: http://metroui.org.ua/select2.html
[ruby-on-rails]: http://rubyonrails.org/
[select2-bootstrap-theme]: https://github.com/select2/select2-bootstrap-theme
+[select2-bootstrap4-theme]: https://github.com/ttskch/select2-bootstrap4-theme
[select2-flat-theme]: https://github.com/techhysahil/select2-Flat_Theme
[select2-rails]: https://github.com/argerim/select2-rails
[vue.js]: http://vuejs.org/
@@ -121,3 +125,33 @@ The license is available within the repository in the [LICENSE][license] file.
[wicketstuff-select2]: https://github.com/wicketstuff/core/tree/master/select2-parent
[yii2]: http://www.yiiframework.com/
[yii2-widget-select2]: https://github.com/kartik-v/yii2-widget-select2
+
+## Contributors
+
+### Code Contributors
+
+This project exists thanks to all the people who contribute. [[Contribute](.github/CONTRIBUTING.md)].
+
+
+### Financial Contributors
+
+Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/select2/contribute)]
+
+#### Individuals
+
+
+
+#### Organizations
+
+Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/select2/contribute)]
+
+
+
+
+
+
+
+
+
+
+
diff --git a/htdocs/includes/jquery/plugins/select2/component.json b/htdocs/includes/jquery/plugins/select2/component.json
index 078338b59d3..a8e74c52499 100644
--- a/htdocs/includes/jquery/plugins/select2/component.json
+++ b/htdocs/includes/jquery/plugins/select2/component.json
@@ -2,7 +2,7 @@
"name": "select2",
"repo": "select/select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
- "version": "4.0.4",
+ "version": "4.0.13",
"demo": "https://select2.org/",
"keywords": [
"jquery"
diff --git a/htdocs/includes/jquery/plugins/select2/composer.json b/htdocs/includes/jquery/plugins/select2/composer.json
index 141f4e14155..5ef2db2b1db 100644
--- a/htdocs/includes/jquery/plugins/select2/composer.json
+++ b/htdocs/includes/jquery/plugins/select2/composer.json
@@ -4,9 +4,6 @@
"type": "component",
"homepage": "https://select2.org/",
"license": "MIT",
- "require": {
- "robloach/component-installer": "*"
- },
"extra": {
"component": {
"scripts": [
diff --git a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
index 447b2b86cc0..750b3207aeb 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
+++ b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
@@ -118,12 +118,14 @@
.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;
- margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
- width: 1px !important; }
+ width: 1px !important;
+ white-space: nowrap !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
@@ -186,16 +188,13 @@
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
- .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
- color: #999;
- margin-top: 5px;
- float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
- margin-right: 10px; }
+ margin-right: 10px;
+ padding: 1px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
@@ -214,7 +213,7 @@
.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-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
+.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 {
@@ -420,9 +419,7 @@
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
- float: right; }
-
-.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ float: right;
margin-left: 5px;
margin-right: auto; }
diff --git a/htdocs/includes/jquery/plugins/select2/dist/css/select2.min.css b/htdocs/includes/jquery/plugins/select2/dist/css/select2.min.css
index 76de04d9233..7c18ad59dfc 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/css/select2.min.css
+++ b/htdocs/includes/jquery/plugins/select2/dist/css/select2.min.css
@@ -1 +1 @@
-.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;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !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__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.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-selection__placeholder,.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}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{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}
+.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}
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/af.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/af.js
new file mode 100644
index 00000000000..32e5ac7de89
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/af.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Verwyders asseblief "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Voer asseblief "+(e.minimum-e.input.length)+" of meer karakters"},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var n="Kies asseblief net "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"},removeAllItems:function(){return"Verwyder alle items"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ar.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ar.js
new file mode 100644
index 00000000000..64e1caad34d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ar.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(n){return"الرجاء حذف "+(n.input.length-n.maximum)+" عناصر"},inputTooShort:function(n){return"الرجاء إضافة "+(n.minimum-n.input.length)+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(n){return"تستطيع إختيار "+n.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"},removeAllItems:function(){return"قم بإزالة كل العناصر"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/az.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/az.js
new file mode 100644
index 00000000000..1d52c260f29
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/az.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/az",[],function(){return{inputTooLong:function(n){return n.input.length-n.maximum+" simvol silin"},inputTooShort:function(n){return n.minimum-n.input.length+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(n){return"Sadəcə "+n.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"},removeAllItems:function(){return"Bütün elementləri sil"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bg.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bg.js
new file mode 100644
index 00000000000..73b730a705a
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bg.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/bg",[],function(){return{inputTooLong:function(n){var e=n.input.length-n.maximum,u="Моля въведете с "+e+" по-малко символ";return e>1&&(u+="a"),u},inputTooShort:function(n){var e=n.minimum-n.input.length,u="Моля въведете още "+e+" символ";return e>1&&(u+="a"),u},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(n){var e="Можете да направите до "+n.maximum+" ";return n.maximum>1?e+="избора":e+="избор",e},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"},removeAllItems:function(){return"Премахнете всички елементи"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bn.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bn.js
new file mode 100644
index 00000000000..2d17b9d8e05
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bn.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।";return 1!=e&&(u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।"),u},inputTooShort:function(n){return n.minimum-n.input.length+" টি অক্ষর অথবা অধিক অক্ষর লিখুন।"},loadingMore:function(){return"আরো ফলাফল লোড হচ্ছে ..."},maximumSelected:function(n){var e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।";return 1!=n.maximum&&(e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।"),e},noResults:function(){return"কোন ফলাফল পাওয়া যায়নি।"},searching:function(){return"অনুসন্ধান করা হচ্ছে ..."}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bs.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bs.js
new file mode 100644
index 00000000000..46b084d7583
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/bs.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/bs",[],function(){function e(e,n,r,t){return e%10==1&&e%100!=11?n:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(n){var r=n.input.length-n.maximum,t="Obrišite "+r+" simbol";return t+=e(r,"","a","a")},inputTooShort:function(n){var r=n.minimum-n.input.length,t="Ukucajte bar još "+r+" simbol";return t+=e(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(n){var r="Možete izabrati samo "+n.maximum+" stavk";return r+=e(n.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Uklonite sve stavke"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ca.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ca.js
new file mode 100644
index 00000000000..82dbbb7a212
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ca.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Si us plau, elimina "+n+" car";return r+=1==n?"àcter":"àcters"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Si us plau, introdueix "+n+" car";return r+=1==n?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var n="Només es pot seleccionar "+e.maximum+" element";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/cs.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/cs.js
new file mode 100644
index 00000000000..7116d6c1dfd
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/cs.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/cs",[],function(){function e(e,n){switch(e){case 2:return n?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadejte o jeden znak méně.":t<=4?"Prosím, zadejte o "+e(t,!0)+" znaky méně.":"Prosím, zadejte o "+t+" znaků méně."},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadejte ještě jeden znak.":t<=4?"Prosím, zadejte ještě další "+e(t,!0)+" znaky.":"Prosím, zadejte ještě dalších "+t+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(n){var t=n.maximum;return 1==t?"Můžete zvolit jen jednu položku.":t<=4?"Můžete zvolit maximálně "+e(t,!1)+" položky.":"Můžete zvolit maximálně "+t+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"},removeAllItems:function(){return"Odstraňte všechny položky"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/da.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/da.js
new file mode 100644
index 00000000000..cda32c34aaa
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/da.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){return"Angiv venligst "+(e.input.length-e.maximum)+" tegn mindre"},inputTooShort:function(e){return"Angiv venligst "+(e.minimum-e.input.length)+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var n="Du kan kun vælge "+e.maximum+" emne";return 1!=e.maximum&&(n+="r"),n},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/de.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/de.js
new file mode 100644
index 00000000000..c2e61e5800b
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/de.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){return"Bitte "+(e.input.length-e.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(e){return"Bitte "+(e.minimum-e.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var n="Sie können nur "+e.maximum+" Element";return 1!=e.maximum&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/dsb.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/dsb.js
new file mode 100644
index 00000000000..02f283abada
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/dsb.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/dsb",[],function(){var n=["znamuško","znamušce","znamuška","znamuškow"],e=["zapisk","zapiska","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Pšosym lašuj "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Pšosym zapódaj nanejmjenjej "+a+" "+u(a,n)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(n){return"Móžoš jano "+n.maximum+" "+u(n.maximum,e)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/el.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/el.js
new file mode 100644
index 00000000000..d4922a1df5b
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/el.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(n){var e=n.input.length-n.maximum,u="Παρακαλώ διαγράψτε "+e+" χαρακτήρ";return 1==e&&(u+="α"),1!=e&&(u+="ες"),u},inputTooShort:function(n){return"Παρακαλώ συμπληρώστε "+(n.minimum-n.input.length)+" ή περισσότερους χαρακτήρες"},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(n){var e="Μπορείτε να επιλέξετε μόνο "+n.maximum+" επιλογ";return 1==n.maximum&&(e+="ή"),1!=n.maximum&&(e+="ές"),e},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"},removeAllItems:function(){return"Καταργήστε όλα τα στοιχεία"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/en.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/en.js
new file mode 100644
index 00000000000..3b192857342
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/en.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Please delete "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var n="You can only select "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/es.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/es.js
new file mode 100644
index 00000000000..68afd6d2592
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/es.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Por favor, elimine "+n+" car";return r+=1==n?"ácter":"acteres"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Por favor, introduzca "+n+" car";return r+=1==n?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var n="Sólo puede seleccionar "+e.maximum+" elemento";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/et.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/et.js
new file mode 100644
index 00000000000..070b61a26dd
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/et.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var n=e.input.length-e.maximum,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" vähem"},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" rohkem"},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var n="Saad vaid "+e.maximum+" tulemus";return 1==e.maximum?n+="e":n+="t",n+=" valida"},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"},removeAllItems:function(){return"Eemalda kõik esemed"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/eu.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/eu.js
new file mode 100644
index 00000000000..90d5e73f8a8
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/eu.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gutxiago"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gehiago"},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return 1===e.maximum?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"},removeAllItems:function(){return"Kendu elementu guztiak"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fa.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fa.js
new file mode 100644
index 00000000000..e1ffdbed0d8
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fa.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(n){return"لطفاً "+(n.input.length-n.maximum)+" کاراکتر را حذف نمایید"},inputTooShort:function(n){return"لطفاً تعداد "+(n.minimum-n.input.length)+" کاراکتر یا بیشتر وارد نمایید"},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(n){return"شما تنها میتوانید "+n.maximum+" آیتم را انتخاب نمایید"},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."},removeAllItems:function(){return"همه موارد را حذف کنید"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fi.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fi.js
new file mode 100644
index 00000000000..ffed1247dd0
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fi.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(n){return"Ole hyvä ja anna "+(n.input.length-n.maximum)+" merkkiä vähemmän"},inputTooShort:function(n){return"Ole hyvä ja anna "+(n.minimum-n.input.length)+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(n){return"Voit valita ainoastaan "+n.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"},removeAllItems:function(){return"Poista kaikki kohteet"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fr.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fr.js
new file mode 100644
index 00000000000..dd02f973ffa
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/fr.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var n=e.input.length-e.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(e){var n=e.minimum-e.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/gl.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/gl.js
new file mode 100644
index 00000000000..208a0057057
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/gl.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var n=e.input.length-e.maximum;return 1===n?"Elimine un carácter":"Elimine "+n+" caracteres"},inputTooShort:function(e){var n=e.minimum-e.input.length;return 1===n?"Engada un carácter":"Engada "+n+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return 1===e.maximum?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Elimina todos os elementos"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/he.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/he.js
new file mode 100644
index 00000000000..25a8805aa02
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/he.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="נא למחוק ";return r+=1===e?"תו אחד":e+" תווים"},inputTooShort:function(n){var e=n.minimum-n.input.length,r="נא להכניס ";return r+=1===e?"תו אחד":e+" תווים",r+=" או יותר"},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(n){var e="באפשרותך לבחור עד ";return 1===n.maximum?e+="פריט אחד":e+=n.maximum+" פריטים",e},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"},removeAllItems:function(){return"הסר את כל הפריטים"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hi.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hi.js
new file mode 100644
index 00000000000..f3ed798434b
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hi.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(n){var e=n.input.length-n.maximum,r=e+" अक्षर को हटा दें";return e>1&&(r=e+" अक्षरों को हटा दें "),r},inputTooShort:function(n){return"कृपया "+(n.minimum-n.input.length)+" या अधिक अक्षर दर्ज करें"},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(n){return"आप केवल "+n.maximum+" आइटम का चयन कर सकते हैं"},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."},removeAllItems:function(){return"सभी वस्तुओं को हटा दें"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hr.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hr.js
new file mode 100644
index 00000000000..cb3268db161
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hr.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/hr",[],function(){function n(n){var e=" "+n+" znak";return n%10<5&&n%10>0&&(n%100<5||n%100>19)?n%10>1&&(e+="a"):e+="ova",e}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(e){return"Unesite "+n(e.input.length-e.maximum)},inputTooShort:function(e){return"Unesite još "+n(e.minimum-e.input.length)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(n){return"Maksimalan broj odabranih stavki je "+n.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Ukloni sve stavke"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hsb.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hsb.js
new file mode 100644
index 00000000000..3d5bf09dbd5
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hsb.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/hsb",[],function(){var n=["znamješko","znamješce","znamješka","znamješkow"],e=["zapisk","zapiskaj","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Prošu zhašej "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Prošu zapodaj znajmjeńša "+a+" "+u(a,n)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(n){return"Móžeš jenož "+n.maximum+" "+u(n.maximum,e)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hu.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hu.js
new file mode 100644
index 00000000000..4893aa2f70d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hu.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){return"Túl hosszú. "+(e.input.length-e.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(e){return"Túl rövid. Még "+(e.minimum-e.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hy.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hy.js
new file mode 100644
index 00000000000..8230007141a
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/hy.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(n){return"Խնդրում ենք հեռացնել "+(n.input.length-n.maximum)+" նշան"},inputTooShort:function(n){return"Խնդրում ենք մուտքագրել "+(n.minimum-n.input.length)+" կամ ավել նշաններ"},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(n){return"Դուք կարող եք ընտրել առավելագույնը "+n.maximum+" կետ"},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"},removeAllItems:function(){return"Հեռացնել բոլոր տարրերը"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/id.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/id.js
new file mode 100644
index 00000000000..4a0b3bf009d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/id.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(n){return"Hapuskan "+(n.input.length-n.maximum)+" huruf"},inputTooShort:function(n){return"Masukkan "+(n.minimum-n.input.length)+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(n){return"Anda hanya dapat memilih "+n.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Hapus semua item"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/is.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/is.js
new file mode 100644
index 00000000000..cca5bbecf02
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/is.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/is",[],function(){return{inputTooLong:function(n){var t=n.input.length-n.maximum,e="Vinsamlegast styttið texta um "+t+" staf";return t<=1?e:e+"i"},inputTooShort:function(n){var t=n.minimum-n.input.length,e="Vinsamlegast skrifið "+t+" staf";return t>1&&(e+="i"),e+=" í viðbót"},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(n){return"Þú getur aðeins valið "+n.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"},removeAllItems:function(){return"Fjarlægðu öll atriði"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/it.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/it.js
new file mode 100644
index 00000000000..507c7d9f293
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/it.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Per favore cancella "+n+" caratter";return t+=1!==n?"i":"e"},inputTooShort:function(e){return"Per favore inserisci "+(e.minimum-e.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var n="Puoi selezionare solo "+e.maximum+" element";return 1!==e.maximum?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ja.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ja.js
new file mode 100644
index 00000000000..451025e2c7d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ja.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(n){return n.input.length-n.maximum+" 文字を削除してください"},inputTooShort:function(n){return"少なくとも "+(n.minimum-n.input.length)+" 文字を入力してください"},loadingMore:function(){return"読み込み中…"},maximumSelected:function(n){return n.maximum+" 件しか選択できません"},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"},removeAllItems:function(){return"すべてのアイテムを削除"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ka.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ka.js
new file mode 100644
index 00000000000..60c593b705d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ka.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:function(n){return"გთხოვთ აკრიფეთ "+(n.input.length-n.maximum)+" სიმბოლოთი ნაკლები"},inputTooShort:function(n){return"გთხოვთ აკრიფეთ "+(n.minimum-n.input.length)+" სიმბოლო ან მეტი"},loadingMore:function(){return"მონაცემების ჩატვირთვა…"},maximumSelected:function(n){return"თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს "+n.maximum+" ელემენტი"},noResults:function(){return"რეზულტატი არ მოიძებნა"},searching:function(){return"ძიება…"},removeAllItems:function(){return"ამოიღე ყველა ელემენტი"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/km.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/km.js
new file mode 100644
index 00000000000..4dca94f414e
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/km.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(n){return"សូមលុបចេញ "+(n.input.length-n.maximum)+" អក្សរ"},inputTooShort:function(n){return"សូមបញ្ចូល"+(n.minimum-n.input.length)+" អក្សរ រឺ ច្រើនជាងនេះ"},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(n){return"អ្នកអាចជ្រើសរើសបានតែ "+n.maximum+" ជម្រើសប៉ុណ្ណោះ"},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."},removeAllItems:function(){return"លុបធាតុទាំងអស់"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ko.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ko.js
new file mode 100644
index 00000000000..f2880fb0043
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ko.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니다. "+(n.input.length-n.maximum)+" 글자 지워주세요."},inputTooShort:function(n){return"너무 짧습니다. "+(n.minimum-n.input.length)+" 글자 더 입력해주세요."},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(n){return"최대 "+n.maximum+"개까지만 선택 가능합니다."},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lt.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lt.js
new file mode 100644
index 00000000000..f6a42155ad8
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lt.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/lt",[],function(){function n(n,e,i,t){return n%10==1&&(n%100<11||n%100>19)?e:n%10>=2&&n%10<=9&&(n%100<11||n%100>19)?i:t}return{inputTooLong:function(e){var i=e.input.length-e.maximum,t="Pašalinkite "+i+" simbol";return t+=n(i,"į","ius","ių")},inputTooShort:function(e){var i=e.minimum-e.input.length,t="Įrašykite dar "+i+" simbol";return t+=n(i,"į","ius","ių")},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(e){var i="Jūs galite pasirinkti tik "+e.maximum+" element";return i+=n(e.maximum,"ą","us","ų")},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"},removeAllItems:function(){return"Pašalinti visus elementus"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lv.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lv.js
new file mode 100644
index 00000000000..806dc5c4339
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/lv.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/lv",[],function(){function e(e,n,u,i){return 11===e?n:e%10==1?u:i}return{inputTooLong:function(n){var u=n.input.length-n.maximum,i="Lūdzu ievadiet par "+u;return(i+=" simbol"+e(u,"iem","u","iem"))+" mazāk"},inputTooShort:function(n){var u=n.minimum-n.input.length,i="Lūdzu ievadiet vēl "+u;return i+=" simbol"+e(u,"us","u","us")},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(n){var u="Jūs varat izvēlēties ne vairāk kā "+n.maximum;return u+=" element"+e(n.maximum,"us","u","us")},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"},removeAllItems:function(){return"Noņemt visus vienumus"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/mk.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/mk.js
new file mode 100644
index 00000000000..cb7b84a2634
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/mk.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/mk",[],function(){return{inputTooLong:function(n){var e=(n.input.length,n.maximum,"Ве молиме внесете "+n.maximum+" помалку карактер");return 1!==n.maximum&&(e+="и"),e},inputTooShort:function(n){var e=(n.minimum,n.input.length,"Ве молиме внесете уште "+n.maximum+" карактер");return 1!==n.maximum&&(e+="и"),e},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(n){var e="Можете да изберете само "+n.maximum+" ставк";return 1===n.maximum?e+="а":e+="и",e},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"},removeAllItems:function(){return"Отстрани ги сите предмети"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ms.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ms.js
new file mode 100644
index 00000000000..6bd7eaa3e02
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ms.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(n){return"Sila hapuskan "+(n.input.length-n.maximum)+" aksara"},inputTooShort:function(n){return"Sila masukkan "+(n.minimum-n.input.length)+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(n){return"Anda hanya boleh memilih "+n.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Keluarkan semua item"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nb.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nb.js
new file mode 100644
index 00000000000..25d89c68704
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nb.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){return"Vennligst fjern "+(e.input.length-e.maximum)+" tegn"},inputTooShort:function(e){return"Vennligst skriv inn "+(e.minimum-e.input.length)+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ne.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ne.js
new file mode 100644
index 00000000000..1c39f672103
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ne.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="कृपया "+e+" अक्षर मेटाउनुहोस्।";return 1!=e&&(u+="कृपया "+e+" अक्षरहरु मेटाउनुहोस्।"),u},inputTooShort:function(n){return"कृपया बाँकी रहेका "+(n.minimum-n.input.length)+" वा अरु धेरै अक्षरहरु भर्नुहोस्।"},loadingMore:function(){return"अरु नतिजाहरु भरिँदैछन् …"},maximumSelected:function(n){var e="तँपाई "+n.maximum+" वस्तु मात्र छान्न पाउँनुहुन्छ।";return 1!=n.maximum&&(e="तँपाई "+n.maximum+" वस्तुहरु मात्र छान्न पाउँनुहुन्छ।"),e},noResults:function(){return"कुनै पनि नतिजा भेटिएन।"},searching:function(){return"खोजि हुँदैछ…"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nl.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nl.js
new file mode 100644
index 00000000000..2b74058d237
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/nl.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){return"Gelieve "+(e.input.length-e.maximum)+" karakters te verwijderen"},inputTooShort:function(e){return"Gelieve "+(e.minimum-e.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var n=1==e.maximum?"kan":"kunnen",r="Er "+n+" maar "+e.maximum+" item";return 1!=e.maximum&&(r+="s"),r+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pl.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pl.js
new file mode 100644
index 00000000000..4ca5748c386
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pl.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/pl",[],function(){var n=["znak","znaki","znaków"],e=["element","elementy","elementów"],r=function(n,e){return 1===n?e[0]:n>1&&n<=4?e[1]:n>=5?e[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Usuń "+t+" "+r(t,n)},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Podaj przynajmniej "+t+" "+r(t,n)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(n){return"Możesz zaznaczyć tylko "+n.maximum+" "+r(n.maximum,e)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ps.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ps.js
new file mode 100644
index 00000000000..9b008e4c145
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ps.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="د مهربانۍ لمخي "+e+" توری ړنګ کړئ";return 1!=e&&(r=r.replace("توری","توري")),r},inputTooShort:function(n){return"لږ تر لږه "+(n.minimum-n.input.length)+" يا ډېر توري وليکئ"},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(n){var e="تاسو يوازي "+n.maximum+" قلم په نښه کولای سی";return 1!=n.maximum&&(e=e.replace("قلم","قلمونه")),e},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."},removeAllItems:function(){return"ټول توکي لرې کړئ"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt-BR.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt-BR.js
new file mode 100644
index 00000000000..c991e2550ae
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt-BR.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Apague "+n+" caracter";return 1!=n&&(r+="es"),r},inputTooShort:function(e){return"Digite "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var n="Você só pode selecionar "+e.maximum+" ite";return 1==e.maximum?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt.js
new file mode 100644
index 00000000000..b5da1a6b496
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/pt.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var r=e.input.length-e.maximum,n="Por favor apague "+r+" ";return n+=1!=r?"caracteres":"caractere"},inputTooShort:function(e){return"Introduza "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var r="Apenas pode seleccionar "+e.maximum+" ";return r+=1!=e.maximum?"itens":"item"},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ro.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ro.js
new file mode 100644
index 00000000000..1ba7b40bef7
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ro.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return 1!==t&&(n+="e"),n},inputTooShort:function(e){return"Vă rugăm să introduceți "+(e.minimum-e.input.length)+" sau mai multe caractere"},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",1!==e.maximum&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"},removeAllItems:function(){return"Eliminați toate elementele"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ru.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ru.js
new file mode 100644
index 00000000000..63a7d66c3b4
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/ru.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/ru",[],function(){function n(n,e,r,u){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?r:e:u}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Пожалуйста, введите на "+r+" символ";return u+=n(r,"","a","ов"),u+=" меньше"},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Пожалуйста, введите ещё хотя бы "+r+" символ";return u+=n(r,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(e){var r="Вы можете выбрать не более "+e.maximum+" элемент";return r+=n(e.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sk.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sk.js
new file mode 100644
index 00000000000..5049528ad0d
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sk.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadajte o jeden znak menej":t>=2&&t<=4?"Prosím, zadajte o "+e[t](!0)+" znaky menej":"Prosím, zadajte o "+t+" znakov menej"},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadajte ešte jeden znak":t<=4?"Prosím, zadajte ešte ďalšie "+e[t](!0)+" znaky":"Prosím, zadajte ešte ďalších "+t+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return 1==n.maximum?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+e[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sl.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sl.js
new file mode 100644
index 00000000000..4d0b7d3e345
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sl.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Prosim zbrišite "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Prosim vpišite še "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var n="Označite lahko največ "+e.maximum+" predmet";return 2==e.maximum?n+="a":1!=e.maximum&&(n+="e"),n},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"},removeAllItems:function(){return"Odstranite vse elemente"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sq.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sq.js
new file mode 100644
index 00000000000..59162024ed3
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sq.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Të lutem fshi "+n+" karakter";return 1!=n&&(t+="e"),t},inputTooShort:function(e){return"Të lutem shkruaj "+(e.minimum-e.input.length)+" ose më shumë karaktere"},loadingMore:function(){return"Duke ngarkuar më shumë rezultate…"},maximumSelected:function(e){var n="Mund të zgjedhësh vetëm "+e.maximum+" element";return 1!=e.maximum&&(n+="e"),n},noResults:function(){return"Nuk u gjet asnjë rezultat"},searching:function(){return"Duke kërkuar…"},removeAllItems:function(){return"Hiq të gjitha sendet"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr-Cyrl.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr-Cyrl.js
new file mode 100644
index 00000000000..ce13ce8f9a1
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr-Cyrl.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/sr-Cyrl",[],function(){function n(n,e,r,u){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:u}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Обришите "+r+" симбол";return u+=n(r,"","а","а")},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Укуцајте бар још "+r+" симбол";return u+=n(r,"","а","а")},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(e){var r="Можете изабрати само "+e.maximum+" ставк";return r+=n(e.maximum,"у","е","и")},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr.js
new file mode 100644
index 00000000000..dd407a06dc4
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sr.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/sr",[],function(){function n(n,e,r,t){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(e){var r=e.input.length-e.maximum,t="Obrišite "+r+" simbol";return t+=n(r,"","a","a")},inputTooShort:function(e){var r=e.minimum-e.input.length,t="Ukucajte bar još "+r+" simbol";return t+=n(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(e){var r="Možete izabrati samo "+e.maximum+" stavk";return r+=n(e.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sv.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sv.js
new file mode 100644
index 00000000000..1bc8724a79a
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/sv.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){return"Vänligen sudda ut "+(n.input.length-n.maximum)+" tecken"},inputTooShort:function(n){return"Vänligen skriv in "+(n.minimum-n.input.length)+" eller fler tecken"},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(n){return"Du kan max välja "+n.maximum+" element"},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/th.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/th.js
new file mode 100644
index 00000000000..63eab7114b0
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/th.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(n){return"โปรดลบออก "+(n.input.length-n.maximum)+" ตัวอักษร"},inputTooShort:function(n){return"โปรดพิมพ์เพิ่มอีก "+(n.minimum-n.input.length)+" ตัวอักษร"},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(n){return"คุณสามารถเลือกได้ไม่เกิน "+n.maximum+" รายการ"},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"},removeAllItems:function(){return"ลบรายการทั้งหมด"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tk.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tk.js
new file mode 100644
index 00000000000..30255ff3777
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tk.js
@@ -0,0 +1,3 @@
+/*! 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;e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){return e.input.length-e.maximum+" harp bozuň."},inputTooShort:function(e){return"Ýene-de iň az "+(e.minimum-e.input.length)+" harp ýazyň."},loadingMore:function(){return"Köpräk netije görkezilýär…"},maximumSelected:function(e){return"Diňe "+e.maximum+" sanysyny saýlaň."},noResults:function(){return"Netije tapylmady."},searching:function(){return"Gözlenýär…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tr.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tr.js
new file mode 100644
index 00000000000..fc4c0bf0512
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/tr.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(n){return n.input.length-n.maximum+" karakter daha girmelisiniz"},inputTooShort:function(n){return"En az "+(n.minimum-n.input.length)+" karakter daha girmelisiniz"},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(n){return"Sadece "+n.maximum+" seçim yapabilirsiniz"},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"},removeAllItems:function(){return"Tüm öğeleri kaldır"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/uk.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/uk.js
new file mode 100644
index 00000000000..63697e38849
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/uk.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/uk",[],function(){function n(n,e,u,r){return n%100>10&&n%100<15?r:n%10==1?e:n%10>1&&n%10<5?u:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(e){return"Будь ласка, видаліть "+(e.input.length-e.maximum)+" "+n(e.maximum,"літеру","літери","літер")},inputTooShort:function(n){return"Будь ласка, введіть "+(n.minimum-n.input.length)+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(e){return"Ви можете вибрати лише "+e.maximum+" "+n(e.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"},removeAllItems:function(){return"Видалити всі елементи"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/vi.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/vi.js
new file mode 100644
index 00000000000..24f3bc2d61a
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/vi.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/vi",[],function(){return{inputTooLong:function(n){return"Vui lòng xóa bớt "+(n.input.length-n.maximum)+" ký tự"},inputTooShort:function(n){return"Vui lòng nhập thêm từ "+(n.minimum-n.input.length)+" ký tự trở lên"},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(n){return"Chỉ có thể chọn được "+n.maximum+" lựa chọn"},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"},removeAllItems:function(){return"Xóa tất cả các mục"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-CN.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-CN.js
new file mode 100644
index 00000000000..2c5649d3108
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-CN.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-TW.js b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-TW.js
new file mode 100644
index 00000000000..570a5669374
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/i18n/zh-TW.js
@@ -0,0 +1,3 @@
+/*! 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 n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(n){return"請刪掉"+(n.input.length-n.maximum)+"個字元"},inputTooShort:function(n){return"請再輸入"+(n.minimum-n.input.length)+"個字元"},loadingMore:function(){return"載入中…"},maximumSelected:function(n){return"你只能選擇最多"+n.maximum+"項"},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"},removeAllItems:function(){return"刪除所有項目"}}}),n.define,n.require}();
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.js b/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.js
index 608642bf64e..358572a6576 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.js
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.js
@@ -1,11 +1,11 @@
/*!
- * Select2 4.0.5
+ * Select2 4.0.13
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
-(function (factory) {
+;(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
@@ -574,10 +574,10 @@ S2.define('select2/utils',[
DecoratedClass.prototype = new ctr();
for (var m = 0; m < superMethods.length; m++) {
- var superMethod = superMethods[m];
+ var superMethod = superMethods[m];
- DecoratedClass.prototype[superMethod] =
- SuperClass.prototype[superMethod];
+ DecoratedClass.prototype[superMethod] =
+ SuperClass.prototype[superMethod];
}
var calledMethod = function (methodName) {
@@ -772,6 +772,70 @@ S2.define('select2/utils',[
$element.append($nodes);
};
+ // Cache objects in Utils.__cache instead of $.data (see #4346)
+ Utils.__cache = {};
+
+ var id = 0;
+ Utils.GetUniqueElementId = function (element) {
+ // Get a unique element Id. If element has no id,
+ // creates a new unique number, stores it in the id
+ // attribute and returns the new id.
+ // If an id already exists, it simply returns it.
+
+ var select2Id = element.getAttribute('data-select2-id');
+ if (select2Id == null) {
+ // If element has id, use it.
+ if (element.id) {
+ select2Id = element.id;
+ element.setAttribute('data-select2-id', select2Id);
+ } else {
+ element.setAttribute('data-select2-id', ++id);
+ select2Id = id.toString();
+ }
+ }
+ return select2Id;
+ };
+
+ Utils.StoreData = function (element, name, value) {
+ // Stores an item in the cache for a specified element.
+ // name is the cache key.
+ var id = Utils.GetUniqueElementId(element);
+ if (!Utils.__cache[id]) {
+ Utils.__cache[id] = {};
+ }
+
+ Utils.__cache[id][name] = value;
+ };
+
+ Utils.GetData = function (element, name) {
+ // Retrieves a value from the cache by its key (name)
+ // name is optional. If no name specified, return
+ // all cache items for the specified element.
+ // and for a specified element.
+ var id = Utils.GetUniqueElementId(element);
+ if (name) {
+ if (Utils.__cache[id]) {
+ if (Utils.__cache[id][name] != null) {
+ return Utils.__cache[id][name];
+ }
+ return $(element).data(name); // Fallback to HTML5 data attribs.
+ }
+ return $(element).data(name); // Fallback to HTML5 data attribs.
+ } else {
+ return Utils.__cache[id];
+ }
+ };
+
+ Utils.RemoveData = function (element) {
+ // Removes all cached items for a specified element.
+ var id = Utils.GetUniqueElementId(element);
+ if (Utils.__cache[id] != null) {
+ delete Utils.__cache[id];
+ }
+
+ element.removeAttribute('data-select2-id');
+ };
+
return Utils;
});
@@ -791,7 +855,7 @@ S2.define('select2/results',[
Results.prototype.render = function () {
var $results = $(
- ''
+ ''
);
if (this.options.get('multiple')) {
@@ -814,7 +878,7 @@ S2.define('select2/results',[
this.hideLoading();
var $message = $(
- ' '
);
@@ -907,7 +971,7 @@ S2.define('select2/results',[
$options.each(function () {
var $option = $(this);
- var item = $.data(this, 'data');
+ var item = Utils.GetData(this, 'data');
// id needs to be converted to a string when comparing
var id = '' + item.id;
@@ -948,11 +1012,16 @@ S2.define('select2/results',[
option.className = 'select2-results__option';
var attrs = {
- 'role': 'treeitem',
+ 'role': 'option',
'aria-selected': 'false'
};
- if (data.disabled) {
+ var matches = window.Element.prototype.matches ||
+ window.Element.prototype.msMatchesSelector ||
+ window.Element.prototype.webkitMatchesSelector;
+
+ if ((data.element != null && matches.call(data.element, ':disabled')) ||
+ (data.element == null && data.disabled)) {
delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true';
}
@@ -1012,7 +1081,7 @@ S2.define('select2/results',[
this.template(data, option);
}
- $.data(option, 'data', data);
+ Utils.StoreData(option, 'data', data);
return option;
};
@@ -1053,7 +1122,10 @@ S2.define('select2/results',[
}
self.setClasses();
- self.highlightFirstItem();
+
+ if (self.options.get('scrollAfterSelect')) {
+ self.highlightFirstItem();
+ }
});
container.on('unselect', function () {
@@ -1062,7 +1134,10 @@ S2.define('select2/results',[
}
self.setClasses();
- self.highlightFirstItem();
+
+ if (self.options.get('scrollAfterSelect')) {
+ self.highlightFirstItem();
+ }
});
container.on('open', function () {
@@ -1098,7 +1173,7 @@ S2.define('select2/results',[
return;
}
- var data = $highlighted.data('data');
+ var data = Utils.GetData($highlighted[0], 'data');
if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {});
@@ -1116,8 +1191,9 @@ S2.define('select2/results',[
var currentIndex = $options.index($highlighted);
- // If we are already at te top, don't move further
- if (currentIndex === 0) {
+ // If we are already at the top, don't move further
+ // If no options, currentIndex will be -1
+ if (currentIndex <= 0) {
return;
}
@@ -1210,7 +1286,7 @@ S2.define('select2/results',[
function (evt) {
var $this = $(this);
- var data = $this.data('data');
+ var data = Utils.GetData(this, 'data');
if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) {
@@ -1233,7 +1309,7 @@ S2.define('select2/results',[
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) {
- var data = $(this).data('data');
+ var data = Utils.GetData(this, 'data');
self.getHighlightedResults()
.removeClass('select2-results__option--highlighted');
@@ -1348,14 +1424,15 @@ S2.define('select2/selection/base',[
this._tabindex = 0;
- if (this.$element.data('old-tabindex') != null) {
- this._tabindex = this.$element.data('old-tabindex');
+ if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
+ this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
} else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex');
}
$selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex);
+ $selection.attr('aria-disabled', 'false');
this.$selection = $selection;
@@ -1365,7 +1442,6 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.bind = function (container, $container) {
var self = this;
- var id = container.id + '-container';
var resultsId = container.id + '-results';
this.container = container;
@@ -1408,17 +1484,19 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');
- self.$selection.focus();
+ self.$selection.trigger('focus');
self._detachCloseHandler(container);
});
container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex);
+ self.$selection.attr('aria-disabled', 'false');
});
container.on('disable', function () {
self.$selection.attr('tabindex', '-1');
+ self.$selection.attr('aria-disabled', 'true');
});
};
@@ -1441,7 +1519,6 @@ S2.define('select2/selection/base',[
};
BaseSelection.prototype._attachCloseHandler = function (container) {
- var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target);
@@ -1451,13 +1528,11 @@ S2.define('select2/selection/base',[
var $all = $('.select2.select2-container--open');
$all.each(function () {
- var $this = $(this);
-
if (this == $select[0]) {
return;
}
- var $element = $this.data('element');
+ var $element = Utils.GetData(this, 'element');
$element.select2('close');
});
@@ -1481,6 +1556,27 @@ S2.define('select2/selection/base',[
throw new Error('The `update` method must be defined in child classes.');
};
+ /**
+ * Helper method to abstract the "enabled" (not "disabled") state of this
+ * object.
+ *
+ * @return {true} if the instance is not disabled.
+ * @return {false} if the instance is disabled.
+ */
+ BaseSelection.prototype.isEnabled = function () {
+ return !this.isDisabled();
+ };
+
+ /**
+ * Helper method to abstract the "disabled" state of this object.
+ *
+ * @return {true} if the disabled option is true.
+ * @return {false} if the disabled option is false.
+ */
+ BaseSelection.prototype.isDisabled = function () {
+ return this.options.get('disabled');
+ };
+
return BaseSelection;
});
@@ -1518,7 +1614,10 @@ S2.define('select2/selection/single',[
var id = container.id + '-container';
- this.$selection.find('.select2-selection__rendered').attr('id', id);
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) {
@@ -1542,17 +1641,15 @@ S2.define('select2/selection/single',[
container.on('focus', function (evt) {
if (!container.isOpen()) {
- self.$selection.focus();
+ self.$selection.trigger('focus');
}
});
-
- container.on('selection:update', function (params) {
- self.update(params.data);
- });
};
SingleSelection.prototype.clear = function () {
- this.$selection.find('.select2-selection__rendered').empty();
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ $rendered.empty();
+ $rendered.removeAttr('title'); // clear tooltip on empty
};
SingleSelection.prototype.display = function (data, container) {
@@ -1578,7 +1675,14 @@ S2.define('select2/selection/single',[
var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted);
- $rendered.prop('title', selection.title || selection.text);
+
+ var title = selection.title || selection.text;
+
+ if (title) {
+ $rendered.attr('title', title);
+ } else {
+ $rendered.removeAttr('title');
+ }
};
return SingleSelection;
@@ -1623,14 +1727,14 @@ S2.define('select2/selection/multiple',[
'.select2-selection__choice__remove',
function (evt) {
// Ignore the event if it is disabled
- if (self.options.get('disabled')) {
+ if (self.isDisabled()) {
return;
}
var $remove = $(this);
var $selection = $remove.parent();
- var data = $selection.data('data');
+ var data = Utils.GetData($selection[0], 'data');
self.trigger('unselect', {
originalEvent: evt,
@@ -1641,7 +1745,9 @@ S2.define('select2/selection/multiple',[
};
MultipleSelection.prototype.clear = function () {
- this.$selection.find('.select2-selection__rendered').empty();
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ $rendered.empty();
+ $rendered.removeAttr('title');
};
MultipleSelection.prototype.display = function (data, container) {
@@ -1679,9 +1785,14 @@ S2.define('select2/selection/multiple',[
var formatted = this.display(selection, $selection);
$selection.append(formatted);
- $selection.prop('title', selection.title || selection.text);
- $selection.data('data', selection);
+ var title = selection.title || selection.text;
+
+ if (title) {
+ $selection.attr('title', title);
+ }
+
+ Utils.StoreData($selection[0], 'data', selection);
$selections.push($selection);
}
@@ -1746,8 +1857,9 @@ S2.define('select2/selection/placeholder',[
S2.define('select2/selection/allowClear',[
'jquery',
- '../keys'
-], function ($, KEYS) {
+ '../keys',
+ '../utils'
+], function ($, KEYS, Utils) {
function AllowClear () { }
AllowClear.prototype.bind = function (decorated, container, $container) {
@@ -1776,7 +1888,7 @@ S2.define('select2/selection/allowClear',[
AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
return;
}
@@ -1789,10 +1901,22 @@ S2.define('select2/selection/allowClear',[
evt.stopPropagation();
- var data = $clear.data('data');
+ var data = Utils.GetData($clear[0], 'data');
+
+ var previousVal = this.$element.val();
+ this.$element.val(this.placeholder.id);
+
+ var unselectData = {
+ data: data
+ };
+ this.trigger('clear', unselectData);
+ if (unselectData.prevented) {
+ this.$element.val(previousVal);
+ return;
+ }
for (var d = 0; d < data.length; d++) {
- var unselectData = {
+ unselectData = {
data: data[d]
};
@@ -1802,11 +1926,12 @@ S2.define('select2/selection/allowClear',[
// If the event was prevented, don't clear it out.
if (unselectData.prevented) {
+ this.$element.val(previousVal);
return;
}
}
- this.$element.val(this.placeholder.id).trigger('change');
+ this.$element.trigger('input').trigger('change');
this.trigger('toggle', {});
};
@@ -1829,12 +1954,14 @@ S2.define('select2/selection/allowClear',[
return;
}
+ var removeAll = this.options.get('translations').get('removeAllItems');
+
var $remove = $(
- '' +
+ '' +
'×' +
' '
);
- $remove.data('data', data);
+ Utils.StoreData($remove[0], 'data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove);
};
@@ -1856,7 +1983,7 @@ S2.define('select2/selection/search',[
'' +
' ' +
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
' '
);
@@ -1873,14 +2000,18 @@ S2.define('select2/selection/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
+ var resultsId = container.id + '-results';
+
decorated.call(this, container, $container);
container.on('open', function () {
+ self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus');
});
container.on('close', function () {
self.$search.val('');
+ self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus');
});
@@ -1900,7 +2031,11 @@ S2.define('select2/selection/search',[
});
container.on('results:focus', function (params) {
- self.$search.attr('aria-activedescendant', params.id);
+ if (params.data._resultId) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ } else {
+ self.$search.removeAttr('aria-activedescendant');
+ }
});
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
@@ -1925,7 +2060,7 @@ S2.define('select2/selection/search',[
.prev('.select2-selection__choice');
if ($previousChoice.length > 0) {
- var item = $previousChoice.data('data');
+ var item = Utils.GetData($previousChoice[0], 'data');
self.searchRemoveChoice(item);
@@ -1934,6 +2069,12 @@ S2.define('select2/selection/search',[
}
});
+ this.$selection.on('click', '.select2-search--inline', function (evt) {
+ if (self.$search.val()) {
+ evt.stopPropagation();
+ }
+ });
+
// Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check.
@@ -2019,7 +2160,7 @@ S2.define('select2/selection/search',[
this.resizeSearch();
if (searchHadFocus) {
- this.$search.focus();
+ this.$search.trigger('focus');
}
};
@@ -2052,7 +2193,7 @@ S2.define('select2/selection/search',[
var width = '';
if (this.$search.attr('placeholder') !== '') {
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ width = this.$selection.find('.select2-selection__rendered').width();
} else {
var minimumWidth = this.$search.val().length + 1;
@@ -2076,10 +2217,13 @@ S2.define('select2/selection/eventRelay',[
'open', 'opening',
'close', 'closing',
'select', 'selecting',
- 'unselect', 'unselecting'
+ 'unselect', 'unselecting',
+ 'clear', 'clearing'
];
- var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+ var preventableEvents = [
+ 'opening', 'closing', 'selecting', 'unselecting', 'clearing'
+ ];
decorated.call(this, container, $container);
@@ -2412,6 +2556,7 @@ S2.define('select2/diacritics',[
'\u019F': 'O',
'\uA74A': 'O',
'\uA74C': 'O',
+ '\u0152': 'OE',
'\u01A2': 'OI',
'\uA74E': 'OO',
'\u0222': 'OU',
@@ -2821,6 +2966,7 @@ S2.define('select2/diacritics',[
'\uA74B': 'o',
'\uA74D': 'o',
'\u0275': 'o',
+ '\u0153': 'oe',
'\u01A3': 'oi',
'\u0223': 'ou',
'\uA74F': 'oo',
@@ -2989,8 +3135,9 @@ S2.define('select2/diacritics',[
'\u03CD': '\u03C5',
'\u03CB': '\u03C5',
'\u03B0': '\u03C5',
- '\u03C9': '\u03C9',
- '\u03C2': '\u03C3'
+ '\u03CE': '\u03C9',
+ '\u03C2': '\u03C3',
+ '\u2019': '\''
};
return diacritics;
@@ -3075,7 +3222,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) {
data.element.selected = true;
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
return;
}
@@ -3096,13 +3243,13 @@ S2.define('select2/data/select',[
}
self.$element.val(val);
- self.$element.trigger('change');
+ self.$element.trigger('input').trigger('change');
});
} else {
var val = data.id;
this.$element.val(val);
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
}
};
@@ -3118,7 +3265,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) {
data.element.selected = false;
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
return;
}
@@ -3136,7 +3283,7 @@ S2.define('select2/data/select',[
self.$element.val(val);
- self.$element.trigger('change');
+ self.$element.trigger('input').trigger('change');
});
};
@@ -3158,7 +3305,7 @@ S2.define('select2/data/select',[
// Remove anything added to child elements
this.$element.find('*').each(function () {
// Remove any custom data set by Select2
- $.removeData(this, 'data');
+ Utils.RemoveData(this);
});
};
@@ -3231,7 +3378,7 @@ S2.define('select2/data/select',[
normalizedData.element = option;
// Override the option's data with the combined data
- $.data(option, 'data', normalizedData);
+ Utils.StoreData(option, 'data', normalizedData);
return $option;
};
@@ -3239,7 +3386,7 @@ S2.define('select2/data/select',[
SelectAdapter.prototype.item = function ($option) {
var data = {};
- data = $.data($option[0], 'data');
+ data = Utils.GetData($option[0], 'data');
if (data != null) {
return data;
@@ -3277,13 +3424,13 @@ S2.define('select2/data/select',[
data = this._normalizeItem(data);
data.element = $option[0];
- $.data($option[0], 'data', data);
+ Utils.StoreData($option[0], 'data', data);
return data;
};
SelectAdapter.prototype._normalizeItem = function (item) {
- if (!$.isPlainObject(item)) {
+ if (item !== Object(item)) {
item = {
id: item,
text: item
@@ -3329,15 +3476,19 @@ S2.define('select2/data/array',[
'jquery'
], function (SelectAdapter, Utils, $) {
function ArrayAdapter ($element, options) {
- var data = options.get('data') || [];
+ this._dataToConvert = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options);
-
- this.addOptions(this.convertToOptions(data));
}
Utils.Extend(ArrayAdapter, SelectAdapter);
+ ArrayAdapter.prototype.bind = function (container, $container) {
+ ArrayAdapter.__super__.bind.call(this, container, $container);
+
+ this.addOptions(this.convertToOptions(this._dataToConvert));
+ };
+
ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString();
@@ -3487,7 +3638,8 @@ S2.define('select2/data/ajax',[
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
- if ($request.status && $request.status === '0') {
+ if ('status' in $request &&
+ ($request.status === 0 || $request.status === '0')) {
return;
}
@@ -3626,8 +3778,6 @@ S2.define('select2/data/tags',[
};
Tags.prototype._removeOldTags = function (_) {
- var tag = this._lastTag;
-
var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () {
@@ -3702,7 +3852,7 @@ S2.define('select2/data/tokenizer',[
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
- this.$search.focus();
+ this.$search.trigger('focus');
}
params.term = tokenData.term;
@@ -3831,10 +3981,30 @@ S2.define('select2/data/maximumSelectionLength',[
decorated.call(this, $e, options);
}
+ MaximumSelectionLength.prototype.bind =
+ function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function () {
+ self._checkIfMaximumSelected();
+ });
+ };
+
MaximumSelectionLength.prototype.query =
function (decorated, params, callback) {
var self = this;
+ this._checkIfMaximumSelected(function () {
+ decorated.call(self, params, callback);
+ });
+ };
+
+ MaximumSelectionLength.prototype._checkIfMaximumSelected =
+ function (_, successCallback) {
+ var self = this;
+
this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 &&
@@ -3847,7 +4017,10 @@ S2.define('select2/data/maximumSelectionLength',[
});
return;
}
- decorated.call(self, params, callback);
+
+ if (successCallback) {
+ successCallback();
+ }
});
};
@@ -3886,7 +4059,7 @@ S2.define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
- // Should be implmented in subclasses
+ // Should be implemented in subclasses
};
Dropdown.prototype.destroy = function () {
@@ -3910,7 +4083,7 @@ S2.define('select2/dropdown/search',[
'' +
' ' +
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
' '
);
@@ -3925,6 +4098,8 @@ S2.define('select2/dropdown/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
+ var resultsId = container.id + '-results';
+
decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) {
@@ -3947,23 +4122,27 @@ S2.define('select2/dropdown/search',[
container.on('open', function () {
self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-controls', resultsId);
- self.$search.focus();
+ self.$search.trigger('focus');
window.setTimeout(function () {
- self.$search.focus();
+ self.$search.trigger('focus');
}, 0);
});
container.on('close', function () {
self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-controls');
+ self.$search.removeAttr('aria-activedescendant');
self.$search.val('');
+ self.$search.trigger('blur');
});
container.on('focus', function () {
if (!container.isOpen()) {
- self.$search.focus();
+ self.$search.trigger('focus');
}
});
@@ -3978,6 +4157,14 @@ S2.define('select2/dropdown/search',[
}
}
});
+
+ container.on('results:focus', function (params) {
+ if (params.data._resultId) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ } else {
+ self.$search.removeAttr('aria-activedescendant');
+ }
+ });
};
Search.prototype.handleSearch = function (evt) {
@@ -4062,6 +4249,7 @@ S2.define('select2/dropdown/infiniteScroll',[
if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore);
+ this.loadMoreIfNeeded();
}
};
@@ -4080,25 +4268,27 @@ S2.define('select2/dropdown/infiniteScroll',[
self.loading = true;
});
- this.$results.on('scroll', function () {
- var isLoadMoreVisible = $.contains(
- document.documentElement,
- self.$loadingMore[0]
- );
+ this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
+ };
- if (self.loading || !isLoadMoreVisible) {
- return;
- }
+ InfiniteScroll.prototype.loadMoreIfNeeded = function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ this.$loadingMore[0]
+ );
- var currentOffset = self.$results.offset().top +
- self.$results.outerHeight(false);
- var loadingMoreOffset = self.$loadingMore.offset().top +
- self.$loadingMore.outerHeight(false);
+ if (this.loading || !isLoadMoreVisible) {
+ return;
+ }
- if (currentOffset + 50 >= loadingMoreOffset) {
- self.loadMore();
- }
- });
+ var currentOffset = this.$results.offset().top +
+ this.$results.outerHeight(false);
+ var loadingMoreOffset = this.$loadingMore.offset().top +
+ this.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ this.loadMore();
+ }
};
InfiniteScroll.prototype.loadMore = function () {
@@ -4119,7 +4309,7 @@ S2.define('select2/dropdown/infiniteScroll',[
var $option = $(
' '
+ 'role="option" aria-disabled="true">'
);
var message = this.options.get('translations').get('loadingMore');
@@ -4137,7 +4327,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils'
], function ($, Utils) {
function AttachBody (decorated, $element, options) {
- this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+ this.$dropdownParent = $(options.get('dropdownParent') || document.body);
decorated.call(this, $element, options);
}
@@ -4145,27 +4335,14 @@ S2.define('select2/dropdown/attachBody',[
AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this;
- var setupResultsEvents = false;
-
decorated.call(this, container, $container);
container.on('open', function () {
self._showDropdown();
self._attachPositioningHandler(container);
- if (!setupResultsEvents) {
- setupResultsEvents = true;
-
- container.on('results:all', function () {
- self._positionDropdown();
- self._resizeDropdown();
- });
-
- container.on('results:append', function () {
- self._positionDropdown();
- self._resizeDropdown();
- });
- }
+ // Must bind after the results handlers to ensure correct sizing
+ self._bindContainerResultHandlers(container);
});
container.on('close', function () {
@@ -4214,6 +4391,44 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach();
};
+ AttachBody.prototype._bindContainerResultHandlers =
+ function (decorated, container) {
+
+ // These should only be bound once
+ if (this._containerResultsHandlersBound) {
+ return;
+ }
+
+ var self = this;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:message', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('select', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('unselect', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ this._containerResultsHandlersBound = true;
+ };
+
AttachBody.prototype._attachPositioningHandler =
function (decorated, container) {
var self = this;
@@ -4224,14 +4439,14 @@ S2.define('select2/dropdown/attachBody',[
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () {
- $(this).data('select2-scroll-position', {
+ Utils.StoreData(this, 'select2-scroll-position', {
x: $(this).scrollLeft(),
y: $(this).scrollTop()
});
});
$watchers.on(scrollEvent, function (ev) {
- var position = $(this).data('select2-scroll-position');
+ var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
});
@@ -4290,16 +4505,26 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};
- // Determine what the parent element is to use for calciulating the offset
+ // Determine what the parent element is to use for calculating the offset
var $offsetParent = this.$dropdownParent;
- // For statically positoned elements, we need to get the element
+ // For statically positioned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}
- var parentOffset = $offsetParent.offset();
+ var parentOffset = {
+ top: 0,
+ left: 0
+ };
+
+ if (
+ $.contains(document.body, $offsetParent[0]) ||
+ $offsetParent[0].isConnected
+ ) {
+ parentOffset = $offsetParent.offset();
+ }
css.top -= parentOffset.top;
css.left -= parentOffset.left;
@@ -4396,8 +4621,8 @@ S2.define('select2/dropdown/minimumResultsForSearch',[
});
S2.define('select2/dropdown/selectOnClose',[
-
-], function () {
+ '../utils'
+], function (Utils) {
function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) {
@@ -4428,7 +4653,7 @@ S2.define('select2/dropdown/selectOnClose',[
return;
}
- var data = $highlightedResults.data('data');
+ var data = Utils.GetData($highlightedResults[0], 'data');
// Don't re-select already selected resulte
if (
@@ -4469,7 +4694,7 @@ S2.define('select2/dropdown/closeOnSelect',[
var originalEvent = evt.originalEvent;
// Don't close if the control key is being held
- if (originalEvent && originalEvent.ctrlKey) {
+ if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
return;
}
@@ -4523,6 +4748,9 @@ S2.define('select2/i18n/en',[],function () {
},
searching: function () {
return 'Searching…';
+ },
+ removeAllItems: function () {
+ return 'Remove all items';
}
};
});
@@ -4761,66 +4989,29 @@ S2.define('select2/defaults',[
);
}
- if (typeof options.language === 'string') {
- // Check if the language is specified with a region
- if (options.language.indexOf('-') > 0) {
- // Extract the region information if it is included
- var languageParts = options.language.split('-');
- var baseLanguage = languageParts[0];
+ // If the defaults were not previously applied from an element, it is
+ // possible for the language option to have not been resolved
+ options.language = this._resolveLanguage(options.language);
- options.language = [options.language, baseLanguage];
- } else {
- options.language = [options.language];
+ // Always fall back to English since it will always be complete
+ options.language.push('en');
+
+ var uniqueLanguages = [];
+
+ for (var l = 0; l < options.language.length; l++) {
+ var language = options.language[l];
+
+ if (uniqueLanguages.indexOf(language) === -1) {
+ uniqueLanguages.push(language);
}
}
- if ($.isArray(options.language)) {
- var languages = new Translation();
- options.language.push('en');
+ options.language = uniqueLanguages;
- var languageNames = options.language;
-
- for (var l = 0; l < languageNames.length; l++) {
- var name = languageNames[l];
- var language = {};
-
- try {
- // Try to load it with the original name
- language = Translation.loadPath(name);
- } catch (e) {
- try {
- // If we couldn't load it, check if it wasn't the full path
- name = this.defaults.amdLanguageBase + name;
- language = Translation.loadPath(name);
- } catch (ex) {
- // The translation could not be loaded at all. Sometimes this is
- // because of a configuration problem, other times this can be
- // because of how Select2 helps load all possible translation files.
- if (options.debug && window.console && console.warn) {
- console.warn(
- 'Select2: The language file for "' + name + '" could not be ' +
- 'automatically loaded. A fallback will be used instead.'
- );
- }
-
- continue;
- }
- }
-
- languages.extend(language);
- }
-
- options.translations = languages;
- } else {
- var baseTranslation = Translation.loadPath(
- this.defaults.amdLanguageBase + 'en'
- );
- var customTranslation = new Translation(options.language);
-
- customTranslation.extend(baseTranslation);
-
- options.translations = customTranslation;
- }
+ options.translations = this._processTranslations(
+ options.language,
+ options.debug
+ );
return options;
};
@@ -4887,13 +5078,14 @@ S2.define('select2/defaults',[
debug: false,
dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup,
- language: EnglishTranslation,
+ language: {},
matcher: matcher,
minimumInputLength: 0,
maximumInputLength: 0,
maximumSelectionLength: 0,
minimumResultsForSearch: 0,
selectOnClose: false,
+ scrollAfterSelect: false,
sorter: function (data) {
return data;
},
@@ -4908,6 +5100,103 @@ S2.define('select2/defaults',[
};
};
+ Defaults.prototype.applyFromElement = function (options, $element) {
+ var optionLanguage = options.language;
+ var defaultLanguage = this.defaults.language;
+ var elementLanguage = $element.prop('lang');
+ var parentLanguage = $element.closest('[lang]').prop('lang');
+
+ var languages = Array.prototype.concat.call(
+ this._resolveLanguage(elementLanguage),
+ this._resolveLanguage(optionLanguage),
+ this._resolveLanguage(defaultLanguage),
+ this._resolveLanguage(parentLanguage)
+ );
+
+ options.language = languages;
+
+ return options;
+ };
+
+ Defaults.prototype._resolveLanguage = function (language) {
+ if (!language) {
+ return [];
+ }
+
+ if ($.isEmptyObject(language)) {
+ return [];
+ }
+
+ if ($.isPlainObject(language)) {
+ return [language];
+ }
+
+ var languages;
+
+ if (!$.isArray(language)) {
+ languages = [language];
+ } else {
+ languages = language;
+ }
+
+ var resolvedLanguages = [];
+
+ for (var l = 0; l < languages.length; l++) {
+ resolvedLanguages.push(languages[l]);
+
+ if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = languages[l].split('-');
+ var baseLanguage = languageParts[0];
+
+ resolvedLanguages.push(baseLanguage);
+ }
+ }
+
+ return resolvedLanguages;
+ };
+
+ Defaults.prototype._processTranslations = function (languages, debug) {
+ var translations = new Translation();
+
+ for (var l = 0; l < languages.length; l++) {
+ var languageData = new Translation();
+
+ var language = languages[l];
+
+ if (typeof language === 'string') {
+ try {
+ // Try to load it with the original name
+ languageData = Translation.loadPath(language);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ language = this.defaults.amdLanguageBase + language;
+ languageData = Translation.loadPath(language);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files
+ if (debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + language + '" could ' +
+ 'not be automatically loaded. A fallback will be used instead.'
+ );
+ }
+ }
+ }
+ } else if ($.isPlainObject(language)) {
+ languageData = new Translation(language);
+ } else {
+ languageData = language;
+ }
+
+ translations.extend(languageData);
+ }
+
+ return translations;
+ };
+
Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key);
@@ -4916,7 +5205,7 @@ S2.define('select2/defaults',[
var convertedData = Utils._convertData(data);
- $.extend(this.defaults, convertedData);
+ $.extend(true, this.defaults, convertedData);
};
var defaults = new Defaults();
@@ -4937,6 +5226,10 @@ S2.define('select2/options',[
this.fromElement($element);
}
+ if ($element != null) {
+ this.options = Defaults.applyFromElement(this.options, $element);
+ }
+
this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) {
@@ -4960,14 +5253,6 @@ S2.define('select2/options',[
this.options.disabled = $e.prop('disabled');
}
- if (this.options.language == null) {
- if ($e.prop('lang')) {
- this.options.language = $e.prop('lang').toLowerCase();
- } else if ($e.closest('[lang]').prop('lang')) {
- this.options.language = $e.closest('[lang]').prop('lang');
- }
- }
-
if (this.options.dir == null) {
if ($e.prop('dir')) {
this.options.dir = $e.prop('dir');
@@ -4981,7 +5266,7 @@ S2.define('select2/options',[
$e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple);
- if ($e.data('select2Tags')) {
+ if (Utils.GetData($e[0], 'select2Tags')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' +
@@ -4990,11 +5275,11 @@ S2.define('select2/options',[
);
}
- $e.data('data', $e.data('select2Tags'));
- $e.data('tags', true);
+ Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
+ Utils.StoreData($e[0], 'tags', true);
}
- if ($e.data('ajaxUrl')) {
+ if (Utils.GetData($e[0], 'ajaxUrl')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' +
@@ -5003,21 +5288,45 @@ S2.define('select2/options',[
);
}
- $e.attr('ajax--url', $e.data('ajaxUrl'));
- $e.data('ajax--url', $e.data('ajaxUrl'));
+ $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
+ Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
}
var dataset = {};
+ function upperCaseLetter(_, letter) {
+ return letter.toUpperCase();
+ }
+
+ // Pre-load all of the attributes which are prefixed with `data-`
+ for (var attr = 0; attr < $e[0].attributes.length; attr++) {
+ var attributeName = $e[0].attributes[attr].name;
+ var prefix = 'data-';
+
+ if (attributeName.substr(0, prefix.length) == prefix) {
+ // Get the contents of the attribute after `data-`
+ var dataName = attributeName.substring(prefix.length);
+
+ // Get the data contents from the consistent source
+ // This is more than likely the jQuery data helper
+ var dataValue = Utils.GetData($e[0], dataName);
+
+ // camelCase the attribute name to match the spec
+ var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
+
+ // Store the data attribute contents into the dataset since
+ dataset[camelDataName] = dataValue;
+ }
+ }
+
// Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
- dataset = $.extend(true, {}, $e[0].dataset, $e.data());
- } else {
- dataset = $e.data();
+ dataset = $.extend(true, {}, $e[0].dataset, dataset);
}
- var data = $.extend(true, {}, dataset);
+ // Prefer our internal data cache if it exists
+ var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
data = Utils._convertData(data);
@@ -5054,8 +5363,8 @@ S2.define('select2/core',[
'./keys'
], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) {
- if ($element.data('select2') != null) {
- $element.data('select2').destroy();
+ if (Utils.GetData($element[0], 'select2') != null) {
+ Utils.GetData($element[0], 'select2').destroy();
}
this.$element = $element;
@@ -5071,7 +5380,7 @@ S2.define('select2/core',[
// Set up the tabindex
var tabindex = $element.attr('tabindex') || 0;
- $element.data('old-tabindex', tabindex);
+ Utils.StoreData($element[0], 'old-tabindex', tabindex);
$element.attr('tabindex', '-1');
// Set up containers and adapters
@@ -5132,6 +5441,9 @@ S2.define('select2/core',[
// Synchronize any monitored attributes
this._syncAttributes();
+ Utils.StoreData($element[0], 'select2', this);
+
+ // Ensure backwards compatibility with $element.data('select2').
$element.data('select2', this);
};
@@ -5208,6 +5520,12 @@ S2.define('select2/core',[
return null;
}
+ if (method == 'computedstyle') {
+ var computedStyle = window.getComputedStyle($element[0]);
+
+ return computedStyle.width;
+ }
+
return method;
};
@@ -5248,8 +5566,8 @@ S2.define('select2/core',[
if (observer != null) {
this._observer = new observer(function (mutations) {
- $.each(mutations, self._syncA);
- $.each(mutations, self._syncS);
+ self._syncA();
+ self._syncS(null, mutations);
});
this._observer.observe(this.$element[0], {
attributes: true,
@@ -5371,7 +5689,7 @@ S2.define('select2/core',[
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
- self.close();
+ self.close(evt);
evt.preventDefault();
} else if (key === KEYS.ENTER) {
@@ -5405,7 +5723,7 @@ S2.define('select2/core',[
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
if (this.isOpen()) {
this.close();
}
@@ -5416,7 +5734,7 @@ S2.define('select2/core',[
}
};
- Select2.prototype._syncSubtree = function (evt, mutations) {
+ Select2.prototype._isChangeMutation = function (evt, mutations) {
var changed = false;
var self = this;
@@ -5444,7 +5762,22 @@ S2.define('select2/core',[
}
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
changed = true;
+ } else if ($.isArray(mutations)) {
+ $.each(mutations, function(evt, mutation) {
+ if (self._isChangeMutation(evt, mutation)) {
+ // We've found a change mutation.
+ // Let's escape from the loop and continue
+ changed = true;
+ return false;
+ }
+ });
}
+ return changed;
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = this._isChangeMutation(evt, mutations);
+ var self = this;
// Only re-pull the data if we think there is a change
if (changed) {
@@ -5466,7 +5799,8 @@ S2.define('select2/core',[
'open': 'opening',
'close': 'closing',
'select': 'selecting',
- 'unselect': 'unselecting'
+ 'unselect': 'unselecting',
+ 'clear': 'clearing'
};
if (args === undefined) {
@@ -5494,7 +5828,7 @@ S2.define('select2/core',[
};
Select2.prototype.toggleDropdown = function () {
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
return;
}
@@ -5510,15 +5844,40 @@ S2.define('select2/core',[
return;
}
+ if (this.isDisabled()) {
+ return;
+ }
+
this.trigger('query', {});
};
- Select2.prototype.close = function () {
+ Select2.prototype.close = function (evt) {
if (!this.isOpen()) {
return;
}
- this.trigger('close', {});
+ this.trigger('close', { originalEvent : evt });
+ };
+
+ /**
+ * Helper method to abstract the "enabled" (not "disabled") state of this
+ * object.
+ *
+ * @return {true} if the instance is not disabled.
+ * @return {false} if the instance is disabled.
+ */
+ Select2.prototype.isEnabled = function () {
+ return !this.isDisabled();
+ };
+
+ /**
+ * Helper method to abstract the "disabled" state of this object.
+ *
+ * @return {true} if the disabled option is true.
+ * @return {false} if the disabled option is false.
+ */
+ Select2.prototype.isDisabled = function () {
+ return this.options.get('disabled');
};
Select2.prototype.isOpen = function () {
@@ -5595,7 +5954,7 @@ S2.define('select2/core',[
});
}
- this.$element.val(newVal).trigger('change');
+ this.$element.val(newVal).trigger('input').trigger('change');
};
Select2.prototype.destroy = function () {
@@ -5621,10 +5980,12 @@ S2.define('select2/core',[
this._syncS = null;
this.$element.off('.select2');
- this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+ this.$element.attr('tabindex',
+ Utils.GetData(this.$element[0], 'old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false');
+ Utils.RemoveData(this.$element[0]);
this.$element.removeData('select2');
this.dataAdapter.destroy();
@@ -5652,7 +6013,7 @@ S2.define('select2/core',[
this.$container.addClass('select2-container--' + this.options.get('theme'));
- $container.data('element', this.$element);
+ Utils.StoreData($container[0], 'element', this.$element);
return $container;
};
@@ -5862,8 +6223,9 @@ S2.define('select2/compat/initSelection',[
});
S2.define('select2/compat/inputData',[
- 'jquery'
-], function ($) {
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
function InputData (decorated, $element, options) {
this._currentData = [];
this._valueSeparator = options.get('valueSeparator') || ',';
@@ -5927,13 +6289,13 @@ S2.define('select2/compat/inputData',[
});
this.$element.val(data.id);
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
} else {
var value = this.$element.val();
value += this._valueSeparator + data.id;
this.$element.val(value);
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
}
};
@@ -5956,7 +6318,7 @@ S2.define('select2/compat/inputData',[
}
self.$element.val(values.join(self._valueSeparator));
- self.$element.trigger('change');
+ self.$element.trigger('input').trigger('change');
});
};
@@ -5980,7 +6342,7 @@ S2.define('select2/compat/inputData',[
InputData.prototype.addOptions = function (_, $options) {
var options = $.map($options, function ($option) {
- return $.data($option[0], 'data');
+ return Utils.GetData($option[0], 'data');
});
this._currentData.push.apply(this._currentData, options);
@@ -6383,8 +6745,9 @@ S2.define('jquery.select2',[
'jquery-mousewheel',
'./select2/core',
- './select2/defaults'
-], function ($, _, Select2, Defaults) {
+ './select2/defaults',
+ './select2/utils'
+], function ($, _, Select2, Defaults, Utils) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
@@ -6405,7 +6768,7 @@ S2.define('jquery.select2',[
var args = Array.prototype.slice.call(arguments, 1);
this.each(function () {
- var instance = $(this).data('select2');
+ var instance = Utils.GetData(this, 'select2');
if (instance == null && window.console && console.error) {
console.error(
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.min.js b/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.min.js
index 96ba80cd81b..fa781916e8b 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.min.js
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/select2.full.min.js
@@ -1 +1,2 @@
-/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
+/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
+!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(' '),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n(' ');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(' '),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e(" ")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html(''),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('× ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n× ');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i(' ');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t(' ');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o(' ');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n(' '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(" "),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i ');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),e.call(this,t,n)}return e.prototype.current=function(e,t){function i(e,t){var n=[];return e.selected||-1!==s.inArray(e.id,t)?(e.selected=!0,n.push(e)):e.selected=!1,e.children&&n.push.apply(n,i(e.children,t)),n}for(var n=[],r=0;r'
+ ''
);
if (this.options.get('multiple')) {
@@ -814,7 +878,7 @@ S2.define('select2/results',[
this.hideLoading();
var $message = $(
- ' '
);
@@ -907,7 +971,7 @@ S2.define('select2/results',[
$options.each(function () {
var $option = $(this);
- var item = $.data(this, 'data');
+ var item = Utils.GetData(this, 'data');
// id needs to be converted to a string when comparing
var id = '' + item.id;
@@ -948,11 +1012,16 @@ S2.define('select2/results',[
option.className = 'select2-results__option';
var attrs = {
- 'role': 'treeitem',
+ 'role': 'option',
'aria-selected': 'false'
};
- if (data.disabled) {
+ var matches = window.Element.prototype.matches ||
+ window.Element.prototype.msMatchesSelector ||
+ window.Element.prototype.webkitMatchesSelector;
+
+ if ((data.element != null && matches.call(data.element, ':disabled')) ||
+ (data.element == null && data.disabled)) {
delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true';
}
@@ -1012,7 +1081,7 @@ S2.define('select2/results',[
this.template(data, option);
}
- $.data(option, 'data', data);
+ Utils.StoreData(option, 'data', data);
return option;
};
@@ -1053,7 +1122,10 @@ S2.define('select2/results',[
}
self.setClasses();
- self.highlightFirstItem();
+
+ if (self.options.get('scrollAfterSelect')) {
+ self.highlightFirstItem();
+ }
});
container.on('unselect', function () {
@@ -1062,7 +1134,10 @@ S2.define('select2/results',[
}
self.setClasses();
- self.highlightFirstItem();
+
+ if (self.options.get('scrollAfterSelect')) {
+ self.highlightFirstItem();
+ }
});
container.on('open', function () {
@@ -1098,7 +1173,7 @@ S2.define('select2/results',[
return;
}
- var data = $highlighted.data('data');
+ var data = Utils.GetData($highlighted[0], 'data');
if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {});
@@ -1116,8 +1191,9 @@ S2.define('select2/results',[
var currentIndex = $options.index($highlighted);
- // If we are already at te top, don't move further
- if (currentIndex === 0) {
+ // If we are already at the top, don't move further
+ // If no options, currentIndex will be -1
+ if (currentIndex <= 0) {
return;
}
@@ -1210,7 +1286,7 @@ S2.define('select2/results',[
function (evt) {
var $this = $(this);
- var data = $this.data('data');
+ var data = Utils.GetData(this, 'data');
if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) {
@@ -1233,7 +1309,7 @@ S2.define('select2/results',[
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) {
- var data = $(this).data('data');
+ var data = Utils.GetData(this, 'data');
self.getHighlightedResults()
.removeClass('select2-results__option--highlighted');
@@ -1348,14 +1424,15 @@ S2.define('select2/selection/base',[
this._tabindex = 0;
- if (this.$element.data('old-tabindex') != null) {
- this._tabindex = this.$element.data('old-tabindex');
+ if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
+ this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
} else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex');
}
$selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex);
+ $selection.attr('aria-disabled', 'false');
this.$selection = $selection;
@@ -1365,7 +1442,6 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.bind = function (container, $container) {
var self = this;
- var id = container.id + '-container';
var resultsId = container.id + '-results';
this.container = container;
@@ -1408,17 +1484,19 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');
- self.$selection.focus();
+ self.$selection.trigger('focus');
self._detachCloseHandler(container);
});
container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex);
+ self.$selection.attr('aria-disabled', 'false');
});
container.on('disable', function () {
self.$selection.attr('tabindex', '-1');
+ self.$selection.attr('aria-disabled', 'true');
});
};
@@ -1441,7 +1519,6 @@ S2.define('select2/selection/base',[
};
BaseSelection.prototype._attachCloseHandler = function (container) {
- var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target);
@@ -1451,13 +1528,11 @@ S2.define('select2/selection/base',[
var $all = $('.select2.select2-container--open');
$all.each(function () {
- var $this = $(this);
-
if (this == $select[0]) {
return;
}
- var $element = $this.data('element');
+ var $element = Utils.GetData(this, 'element');
$element.select2('close');
});
@@ -1481,6 +1556,27 @@ S2.define('select2/selection/base',[
throw new Error('The `update` method must be defined in child classes.');
};
+ /**
+ * Helper method to abstract the "enabled" (not "disabled") state of this
+ * object.
+ *
+ * @return {true} if the instance is not disabled.
+ * @return {false} if the instance is disabled.
+ */
+ BaseSelection.prototype.isEnabled = function () {
+ return !this.isDisabled();
+ };
+
+ /**
+ * Helper method to abstract the "disabled" state of this object.
+ *
+ * @return {true} if the disabled option is true.
+ * @return {false} if the disabled option is false.
+ */
+ BaseSelection.prototype.isDisabled = function () {
+ return this.options.get('disabled');
+ };
+
return BaseSelection;
});
@@ -1518,7 +1614,10 @@ S2.define('select2/selection/single',[
var id = container.id + '-container';
- this.$selection.find('.select2-selection__rendered').attr('id', id);
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) {
@@ -1542,17 +1641,15 @@ S2.define('select2/selection/single',[
container.on('focus', function (evt) {
if (!container.isOpen()) {
- self.$selection.focus();
+ self.$selection.trigger('focus');
}
});
-
- container.on('selection:update', function (params) {
- self.update(params.data);
- });
};
SingleSelection.prototype.clear = function () {
- this.$selection.find('.select2-selection__rendered').empty();
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ $rendered.empty();
+ $rendered.removeAttr('title'); // clear tooltip on empty
};
SingleSelection.prototype.display = function (data, container) {
@@ -1578,7 +1675,14 @@ S2.define('select2/selection/single',[
var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted);
- $rendered.prop('title', selection.title || selection.text);
+
+ var title = selection.title || selection.text;
+
+ if (title) {
+ $rendered.attr('title', title);
+ } else {
+ $rendered.removeAttr('title');
+ }
};
return SingleSelection;
@@ -1623,14 +1727,14 @@ S2.define('select2/selection/multiple',[
'.select2-selection__choice__remove',
function (evt) {
// Ignore the event if it is disabled
- if (self.options.get('disabled')) {
+ if (self.isDisabled()) {
return;
}
var $remove = $(this);
var $selection = $remove.parent();
- var data = $selection.data('data');
+ var data = Utils.GetData($selection[0], 'data');
self.trigger('unselect', {
originalEvent: evt,
@@ -1641,7 +1745,9 @@ S2.define('select2/selection/multiple',[
};
MultipleSelection.prototype.clear = function () {
- this.$selection.find('.select2-selection__rendered').empty();
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ $rendered.empty();
+ $rendered.removeAttr('title');
};
MultipleSelection.prototype.display = function (data, container) {
@@ -1679,9 +1785,14 @@ S2.define('select2/selection/multiple',[
var formatted = this.display(selection, $selection);
$selection.append(formatted);
- $selection.prop('title', selection.title || selection.text);
- $selection.data('data', selection);
+ var title = selection.title || selection.text;
+
+ if (title) {
+ $selection.attr('title', title);
+ }
+
+ Utils.StoreData($selection[0], 'data', selection);
$selections.push($selection);
}
@@ -1746,8 +1857,9 @@ S2.define('select2/selection/placeholder',[
S2.define('select2/selection/allowClear',[
'jquery',
- '../keys'
-], function ($, KEYS) {
+ '../keys',
+ '../utils'
+], function ($, KEYS, Utils) {
function AllowClear () { }
AllowClear.prototype.bind = function (decorated, container, $container) {
@@ -1776,7 +1888,7 @@ S2.define('select2/selection/allowClear',[
AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
return;
}
@@ -1789,10 +1901,22 @@ S2.define('select2/selection/allowClear',[
evt.stopPropagation();
- var data = $clear.data('data');
+ var data = Utils.GetData($clear[0], 'data');
+
+ var previousVal = this.$element.val();
+ this.$element.val(this.placeholder.id);
+
+ var unselectData = {
+ data: data
+ };
+ this.trigger('clear', unselectData);
+ if (unselectData.prevented) {
+ this.$element.val(previousVal);
+ return;
+ }
for (var d = 0; d < data.length; d++) {
- var unselectData = {
+ unselectData = {
data: data[d]
};
@@ -1802,11 +1926,12 @@ S2.define('select2/selection/allowClear',[
// If the event was prevented, don't clear it out.
if (unselectData.prevented) {
+ this.$element.val(previousVal);
return;
}
}
- this.$element.val(this.placeholder.id).trigger('change');
+ this.$element.trigger('input').trigger('change');
this.trigger('toggle', {});
};
@@ -1829,12 +1954,14 @@ S2.define('select2/selection/allowClear',[
return;
}
+ var removeAll = this.options.get('translations').get('removeAllItems');
+
var $remove = $(
- '' +
+ '' +
'×' +
' '
);
- $remove.data('data', data);
+ Utils.StoreData($remove[0], 'data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove);
};
@@ -1856,7 +1983,7 @@ S2.define('select2/selection/search',[
'' +
' ' +
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
' '
);
@@ -1873,14 +2000,18 @@ S2.define('select2/selection/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
+ var resultsId = container.id + '-results';
+
decorated.call(this, container, $container);
container.on('open', function () {
+ self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus');
});
container.on('close', function () {
self.$search.val('');
+ self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus');
});
@@ -1900,7 +2031,11 @@ S2.define('select2/selection/search',[
});
container.on('results:focus', function (params) {
- self.$search.attr('aria-activedescendant', params.id);
+ if (params.data._resultId) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ } else {
+ self.$search.removeAttr('aria-activedescendant');
+ }
});
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
@@ -1925,7 +2060,7 @@ S2.define('select2/selection/search',[
.prev('.select2-selection__choice');
if ($previousChoice.length > 0) {
- var item = $previousChoice.data('data');
+ var item = Utils.GetData($previousChoice[0], 'data');
self.searchRemoveChoice(item);
@@ -1934,6 +2069,12 @@ S2.define('select2/selection/search',[
}
});
+ this.$selection.on('click', '.select2-search--inline', function (evt) {
+ if (self.$search.val()) {
+ evt.stopPropagation();
+ }
+ });
+
// Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check.
@@ -2019,7 +2160,7 @@ S2.define('select2/selection/search',[
this.resizeSearch();
if (searchHadFocus) {
- this.$search.focus();
+ this.$search.trigger('focus');
}
};
@@ -2052,7 +2193,7 @@ S2.define('select2/selection/search',[
var width = '';
if (this.$search.attr('placeholder') !== '') {
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ width = this.$selection.find('.select2-selection__rendered').width();
} else {
var minimumWidth = this.$search.val().length + 1;
@@ -2076,10 +2217,13 @@ S2.define('select2/selection/eventRelay',[
'open', 'opening',
'close', 'closing',
'select', 'selecting',
- 'unselect', 'unselecting'
+ 'unselect', 'unselecting',
+ 'clear', 'clearing'
];
- var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+ var preventableEvents = [
+ 'opening', 'closing', 'selecting', 'unselecting', 'clearing'
+ ];
decorated.call(this, container, $container);
@@ -2412,6 +2556,7 @@ S2.define('select2/diacritics',[
'\u019F': 'O',
'\uA74A': 'O',
'\uA74C': 'O',
+ '\u0152': 'OE',
'\u01A2': 'OI',
'\uA74E': 'OO',
'\u0222': 'OU',
@@ -2821,6 +2966,7 @@ S2.define('select2/diacritics',[
'\uA74B': 'o',
'\uA74D': 'o',
'\u0275': 'o',
+ '\u0153': 'oe',
'\u01A3': 'oi',
'\u0223': 'ou',
'\uA74F': 'oo',
@@ -2989,8 +3135,9 @@ S2.define('select2/diacritics',[
'\u03CD': '\u03C5',
'\u03CB': '\u03C5',
'\u03B0': '\u03C5',
- '\u03C9': '\u03C9',
- '\u03C2': '\u03C3'
+ '\u03CE': '\u03C9',
+ '\u03C2': '\u03C3',
+ '\u2019': '\''
};
return diacritics;
@@ -3075,7 +3222,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) {
data.element.selected = true;
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
return;
}
@@ -3096,13 +3243,13 @@ S2.define('select2/data/select',[
}
self.$element.val(val);
- self.$element.trigger('change');
+ self.$element.trigger('input').trigger('change');
});
} else {
var val = data.id;
this.$element.val(val);
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
}
};
@@ -3118,7 +3265,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) {
data.element.selected = false;
- this.$element.trigger('change');
+ this.$element.trigger('input').trigger('change');
return;
}
@@ -3136,7 +3283,7 @@ S2.define('select2/data/select',[
self.$element.val(val);
- self.$element.trigger('change');
+ self.$element.trigger('input').trigger('change');
});
};
@@ -3158,7 +3305,7 @@ S2.define('select2/data/select',[
// Remove anything added to child elements
this.$element.find('*').each(function () {
// Remove any custom data set by Select2
- $.removeData(this, 'data');
+ Utils.RemoveData(this);
});
};
@@ -3231,7 +3378,7 @@ S2.define('select2/data/select',[
normalizedData.element = option;
// Override the option's data with the combined data
- $.data(option, 'data', normalizedData);
+ Utils.StoreData(option, 'data', normalizedData);
return $option;
};
@@ -3239,7 +3386,7 @@ S2.define('select2/data/select',[
SelectAdapter.prototype.item = function ($option) {
var data = {};
- data = $.data($option[0], 'data');
+ data = Utils.GetData($option[0], 'data');
if (data != null) {
return data;
@@ -3277,13 +3424,13 @@ S2.define('select2/data/select',[
data = this._normalizeItem(data);
data.element = $option[0];
- $.data($option[0], 'data', data);
+ Utils.StoreData($option[0], 'data', data);
return data;
};
SelectAdapter.prototype._normalizeItem = function (item) {
- if (!$.isPlainObject(item)) {
+ if (item !== Object(item)) {
item = {
id: item,
text: item
@@ -3329,15 +3476,19 @@ S2.define('select2/data/array',[
'jquery'
], function (SelectAdapter, Utils, $) {
function ArrayAdapter ($element, options) {
- var data = options.get('data') || [];
+ this._dataToConvert = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options);
-
- this.addOptions(this.convertToOptions(data));
}
Utils.Extend(ArrayAdapter, SelectAdapter);
+ ArrayAdapter.prototype.bind = function (container, $container) {
+ ArrayAdapter.__super__.bind.call(this, container, $container);
+
+ this.addOptions(this.convertToOptions(this._dataToConvert));
+ };
+
ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString();
@@ -3487,7 +3638,8 @@ S2.define('select2/data/ajax',[
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
- if ($request.status && $request.status === '0') {
+ if ('status' in $request &&
+ ($request.status === 0 || $request.status === '0')) {
return;
}
@@ -3626,8 +3778,6 @@ S2.define('select2/data/tags',[
};
Tags.prototype._removeOldTags = function (_) {
- var tag = this._lastTag;
-
var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () {
@@ -3702,7 +3852,7 @@ S2.define('select2/data/tokenizer',[
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
- this.$search.focus();
+ this.$search.trigger('focus');
}
params.term = tokenData.term;
@@ -3831,10 +3981,30 @@ S2.define('select2/data/maximumSelectionLength',[
decorated.call(this, $e, options);
}
+ MaximumSelectionLength.prototype.bind =
+ function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function () {
+ self._checkIfMaximumSelected();
+ });
+ };
+
MaximumSelectionLength.prototype.query =
function (decorated, params, callback) {
var self = this;
+ this._checkIfMaximumSelected(function () {
+ decorated.call(self, params, callback);
+ });
+ };
+
+ MaximumSelectionLength.prototype._checkIfMaximumSelected =
+ function (_, successCallback) {
+ var self = this;
+
this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 &&
@@ -3847,7 +4017,10 @@ S2.define('select2/data/maximumSelectionLength',[
});
return;
}
- decorated.call(self, params, callback);
+
+ if (successCallback) {
+ successCallback();
+ }
});
};
@@ -3886,7 +4059,7 @@ S2.define('select2/dropdown',[
};
Dropdown.prototype.position = function ($dropdown, $container) {
- // Should be implmented in subclasses
+ // Should be implemented in subclasses
};
Dropdown.prototype.destroy = function () {
@@ -3910,7 +4083,7 @@ S2.define('select2/dropdown/search',[
'' +
' ' +
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
' '
);
@@ -3925,6 +4098,8 @@ S2.define('select2/dropdown/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
+ var resultsId = container.id + '-results';
+
decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) {
@@ -3947,23 +4122,27 @@ S2.define('select2/dropdown/search',[
container.on('open', function () {
self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-controls', resultsId);
- self.$search.focus();
+ self.$search.trigger('focus');
window.setTimeout(function () {
- self.$search.focus();
+ self.$search.trigger('focus');
}, 0);
});
container.on('close', function () {
self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-controls');
+ self.$search.removeAttr('aria-activedescendant');
self.$search.val('');
+ self.$search.trigger('blur');
});
container.on('focus', function () {
if (!container.isOpen()) {
- self.$search.focus();
+ self.$search.trigger('focus');
}
});
@@ -3978,6 +4157,14 @@ S2.define('select2/dropdown/search',[
}
}
});
+
+ container.on('results:focus', function (params) {
+ if (params.data._resultId) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ } else {
+ self.$search.removeAttr('aria-activedescendant');
+ }
+ });
};
Search.prototype.handleSearch = function (evt) {
@@ -4062,6 +4249,7 @@ S2.define('select2/dropdown/infiniteScroll',[
if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore);
+ this.loadMoreIfNeeded();
}
};
@@ -4080,25 +4268,27 @@ S2.define('select2/dropdown/infiniteScroll',[
self.loading = true;
});
- this.$results.on('scroll', function () {
- var isLoadMoreVisible = $.contains(
- document.documentElement,
- self.$loadingMore[0]
- );
+ this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
+ };
- if (self.loading || !isLoadMoreVisible) {
- return;
- }
+ InfiniteScroll.prototype.loadMoreIfNeeded = function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ this.$loadingMore[0]
+ );
- var currentOffset = self.$results.offset().top +
- self.$results.outerHeight(false);
- var loadingMoreOffset = self.$loadingMore.offset().top +
- self.$loadingMore.outerHeight(false);
+ if (this.loading || !isLoadMoreVisible) {
+ return;
+ }
- if (currentOffset + 50 >= loadingMoreOffset) {
- self.loadMore();
- }
- });
+ var currentOffset = this.$results.offset().top +
+ this.$results.outerHeight(false);
+ var loadingMoreOffset = this.$loadingMore.offset().top +
+ this.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ this.loadMore();
+ }
};
InfiniteScroll.prototype.loadMore = function () {
@@ -4119,7 +4309,7 @@ S2.define('select2/dropdown/infiniteScroll',[
var $option = $(
' '
+ 'role="option" aria-disabled="true">'
);
var message = this.options.get('translations').get('loadingMore');
@@ -4137,7 +4327,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils'
], function ($, Utils) {
function AttachBody (decorated, $element, options) {
- this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+ this.$dropdownParent = $(options.get('dropdownParent') || document.body);
decorated.call(this, $element, options);
}
@@ -4145,27 +4335,14 @@ S2.define('select2/dropdown/attachBody',[
AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this;
- var setupResultsEvents = false;
-
decorated.call(this, container, $container);
container.on('open', function () {
self._showDropdown();
self._attachPositioningHandler(container);
- if (!setupResultsEvents) {
- setupResultsEvents = true;
-
- container.on('results:all', function () {
- self._positionDropdown();
- self._resizeDropdown();
- });
-
- container.on('results:append', function () {
- self._positionDropdown();
- self._resizeDropdown();
- });
- }
+ // Must bind after the results handlers to ensure correct sizing
+ self._bindContainerResultHandlers(container);
});
container.on('close', function () {
@@ -4214,6 +4391,44 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach();
};
+ AttachBody.prototype._bindContainerResultHandlers =
+ function (decorated, container) {
+
+ // These should only be bound once
+ if (this._containerResultsHandlersBound) {
+ return;
+ }
+
+ var self = this;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:message', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('select', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('unselect', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ this._containerResultsHandlersBound = true;
+ };
+
AttachBody.prototype._attachPositioningHandler =
function (decorated, container) {
var self = this;
@@ -4224,14 +4439,14 @@ S2.define('select2/dropdown/attachBody',[
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () {
- $(this).data('select2-scroll-position', {
+ Utils.StoreData(this, 'select2-scroll-position', {
x: $(this).scrollLeft(),
y: $(this).scrollTop()
});
});
$watchers.on(scrollEvent, function (ev) {
- var position = $(this).data('select2-scroll-position');
+ var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
});
@@ -4290,16 +4505,26 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};
- // Determine what the parent element is to use for calciulating the offset
+ // Determine what the parent element is to use for calculating the offset
var $offsetParent = this.$dropdownParent;
- // For statically positoned elements, we need to get the element
+ // For statically positioned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}
- var parentOffset = $offsetParent.offset();
+ var parentOffset = {
+ top: 0,
+ left: 0
+ };
+
+ if (
+ $.contains(document.body, $offsetParent[0]) ||
+ $offsetParent[0].isConnected
+ ) {
+ parentOffset = $offsetParent.offset();
+ }
css.top -= parentOffset.top;
css.left -= parentOffset.left;
@@ -4396,8 +4621,8 @@ S2.define('select2/dropdown/minimumResultsForSearch',[
});
S2.define('select2/dropdown/selectOnClose',[
-
-], function () {
+ '../utils'
+], function (Utils) {
function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) {
@@ -4428,7 +4653,7 @@ S2.define('select2/dropdown/selectOnClose',[
return;
}
- var data = $highlightedResults.data('data');
+ var data = Utils.GetData($highlightedResults[0], 'data');
// Don't re-select already selected resulte
if (
@@ -4469,7 +4694,7 @@ S2.define('select2/dropdown/closeOnSelect',[
var originalEvent = evt.originalEvent;
// Don't close if the control key is being held
- if (originalEvent && originalEvent.ctrlKey) {
+ if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
return;
}
@@ -4523,6 +4748,9 @@ S2.define('select2/i18n/en',[],function () {
},
searching: function () {
return 'Searching…';
+ },
+ removeAllItems: function () {
+ return 'Remove all items';
}
};
});
@@ -4761,66 +4989,29 @@ S2.define('select2/defaults',[
);
}
- if (typeof options.language === 'string') {
- // Check if the language is specified with a region
- if (options.language.indexOf('-') > 0) {
- // Extract the region information if it is included
- var languageParts = options.language.split('-');
- var baseLanguage = languageParts[0];
+ // If the defaults were not previously applied from an element, it is
+ // possible for the language option to have not been resolved
+ options.language = this._resolveLanguage(options.language);
- options.language = [options.language, baseLanguage];
- } else {
- options.language = [options.language];
+ // Always fall back to English since it will always be complete
+ options.language.push('en');
+
+ var uniqueLanguages = [];
+
+ for (var l = 0; l < options.language.length; l++) {
+ var language = options.language[l];
+
+ if (uniqueLanguages.indexOf(language) === -1) {
+ uniqueLanguages.push(language);
}
}
- if ($.isArray(options.language)) {
- var languages = new Translation();
- options.language.push('en');
+ options.language = uniqueLanguages;
- var languageNames = options.language;
-
- for (var l = 0; l < languageNames.length; l++) {
- var name = languageNames[l];
- var language = {};
-
- try {
- // Try to load it with the original name
- language = Translation.loadPath(name);
- } catch (e) {
- try {
- // If we couldn't load it, check if it wasn't the full path
- name = this.defaults.amdLanguageBase + name;
- language = Translation.loadPath(name);
- } catch (ex) {
- // The translation could not be loaded at all. Sometimes this is
- // because of a configuration problem, other times this can be
- // because of how Select2 helps load all possible translation files.
- if (options.debug && window.console && console.warn) {
- console.warn(
- 'Select2: The language file for "' + name + '" could not be ' +
- 'automatically loaded. A fallback will be used instead.'
- );
- }
-
- continue;
- }
- }
-
- languages.extend(language);
- }
-
- options.translations = languages;
- } else {
- var baseTranslation = Translation.loadPath(
- this.defaults.amdLanguageBase + 'en'
- );
- var customTranslation = new Translation(options.language);
-
- customTranslation.extend(baseTranslation);
-
- options.translations = customTranslation;
- }
+ options.translations = this._processTranslations(
+ options.language,
+ options.debug
+ );
return options;
};
@@ -4887,13 +5078,14 @@ S2.define('select2/defaults',[
debug: false,
dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup,
- language: EnglishTranslation,
+ language: {},
matcher: matcher,
minimumInputLength: 0,
maximumInputLength: 0,
maximumSelectionLength: 0,
minimumResultsForSearch: 0,
selectOnClose: false,
+ scrollAfterSelect: false,
sorter: function (data) {
return data;
},
@@ -4908,6 +5100,103 @@ S2.define('select2/defaults',[
};
};
+ Defaults.prototype.applyFromElement = function (options, $element) {
+ var optionLanguage = options.language;
+ var defaultLanguage = this.defaults.language;
+ var elementLanguage = $element.prop('lang');
+ var parentLanguage = $element.closest('[lang]').prop('lang');
+
+ var languages = Array.prototype.concat.call(
+ this._resolveLanguage(elementLanguage),
+ this._resolveLanguage(optionLanguage),
+ this._resolveLanguage(defaultLanguage),
+ this._resolveLanguage(parentLanguage)
+ );
+
+ options.language = languages;
+
+ return options;
+ };
+
+ Defaults.prototype._resolveLanguage = function (language) {
+ if (!language) {
+ return [];
+ }
+
+ if ($.isEmptyObject(language)) {
+ return [];
+ }
+
+ if ($.isPlainObject(language)) {
+ return [language];
+ }
+
+ var languages;
+
+ if (!$.isArray(language)) {
+ languages = [language];
+ } else {
+ languages = language;
+ }
+
+ var resolvedLanguages = [];
+
+ for (var l = 0; l < languages.length; l++) {
+ resolvedLanguages.push(languages[l]);
+
+ if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = languages[l].split('-');
+ var baseLanguage = languageParts[0];
+
+ resolvedLanguages.push(baseLanguage);
+ }
+ }
+
+ return resolvedLanguages;
+ };
+
+ Defaults.prototype._processTranslations = function (languages, debug) {
+ var translations = new Translation();
+
+ for (var l = 0; l < languages.length; l++) {
+ var languageData = new Translation();
+
+ var language = languages[l];
+
+ if (typeof language === 'string') {
+ try {
+ // Try to load it with the original name
+ languageData = Translation.loadPath(language);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ language = this.defaults.amdLanguageBase + language;
+ languageData = Translation.loadPath(language);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files
+ if (debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + language + '" could ' +
+ 'not be automatically loaded. A fallback will be used instead.'
+ );
+ }
+ }
+ }
+ } else if ($.isPlainObject(language)) {
+ languageData = new Translation(language);
+ } else {
+ languageData = language;
+ }
+
+ translations.extend(languageData);
+ }
+
+ return translations;
+ };
+
Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key);
@@ -4916,7 +5205,7 @@ S2.define('select2/defaults',[
var convertedData = Utils._convertData(data);
- $.extend(this.defaults, convertedData);
+ $.extend(true, this.defaults, convertedData);
};
var defaults = new Defaults();
@@ -4937,6 +5226,10 @@ S2.define('select2/options',[
this.fromElement($element);
}
+ if ($element != null) {
+ this.options = Defaults.applyFromElement(this.options, $element);
+ }
+
this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) {
@@ -4960,14 +5253,6 @@ S2.define('select2/options',[
this.options.disabled = $e.prop('disabled');
}
- if (this.options.language == null) {
- if ($e.prop('lang')) {
- this.options.language = $e.prop('lang').toLowerCase();
- } else if ($e.closest('[lang]').prop('lang')) {
- this.options.language = $e.closest('[lang]').prop('lang');
- }
- }
-
if (this.options.dir == null) {
if ($e.prop('dir')) {
this.options.dir = $e.prop('dir');
@@ -4981,7 +5266,7 @@ S2.define('select2/options',[
$e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple);
- if ($e.data('select2Tags')) {
+ if (Utils.GetData($e[0], 'select2Tags')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' +
@@ -4990,11 +5275,11 @@ S2.define('select2/options',[
);
}
- $e.data('data', $e.data('select2Tags'));
- $e.data('tags', true);
+ Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
+ Utils.StoreData($e[0], 'tags', true);
}
- if ($e.data('ajaxUrl')) {
+ if (Utils.GetData($e[0], 'ajaxUrl')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' +
@@ -5003,21 +5288,45 @@ S2.define('select2/options',[
);
}
- $e.attr('ajax--url', $e.data('ajaxUrl'));
- $e.data('ajax--url', $e.data('ajaxUrl'));
+ $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
+ Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
}
var dataset = {};
+ function upperCaseLetter(_, letter) {
+ return letter.toUpperCase();
+ }
+
+ // Pre-load all of the attributes which are prefixed with `data-`
+ for (var attr = 0; attr < $e[0].attributes.length; attr++) {
+ var attributeName = $e[0].attributes[attr].name;
+ var prefix = 'data-';
+
+ if (attributeName.substr(0, prefix.length) == prefix) {
+ // Get the contents of the attribute after `data-`
+ var dataName = attributeName.substring(prefix.length);
+
+ // Get the data contents from the consistent source
+ // This is more than likely the jQuery data helper
+ var dataValue = Utils.GetData($e[0], dataName);
+
+ // camelCase the attribute name to match the spec
+ var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
+
+ // Store the data attribute contents into the dataset since
+ dataset[camelDataName] = dataValue;
+ }
+ }
+
// Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
- dataset = $.extend(true, {}, $e[0].dataset, $e.data());
- } else {
- dataset = $e.data();
+ dataset = $.extend(true, {}, $e[0].dataset, dataset);
}
- var data = $.extend(true, {}, dataset);
+ // Prefer our internal data cache if it exists
+ var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
data = Utils._convertData(data);
@@ -5054,8 +5363,8 @@ S2.define('select2/core',[
'./keys'
], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) {
- if ($element.data('select2') != null) {
- $element.data('select2').destroy();
+ if (Utils.GetData($element[0], 'select2') != null) {
+ Utils.GetData($element[0], 'select2').destroy();
}
this.$element = $element;
@@ -5071,7 +5380,7 @@ S2.define('select2/core',[
// Set up the tabindex
var tabindex = $element.attr('tabindex') || 0;
- $element.data('old-tabindex', tabindex);
+ Utils.StoreData($element[0], 'old-tabindex', tabindex);
$element.attr('tabindex', '-1');
// Set up containers and adapters
@@ -5132,6 +5441,9 @@ S2.define('select2/core',[
// Synchronize any monitored attributes
this._syncAttributes();
+ Utils.StoreData($element[0], 'select2', this);
+
+ // Ensure backwards compatibility with $element.data('select2').
$element.data('select2', this);
};
@@ -5208,6 +5520,12 @@ S2.define('select2/core',[
return null;
}
+ if (method == 'computedstyle') {
+ var computedStyle = window.getComputedStyle($element[0]);
+
+ return computedStyle.width;
+ }
+
return method;
};
@@ -5248,8 +5566,8 @@ S2.define('select2/core',[
if (observer != null) {
this._observer = new observer(function (mutations) {
- $.each(mutations, self._syncA);
- $.each(mutations, self._syncS);
+ self._syncA();
+ self._syncS(null, mutations);
});
this._observer.observe(this.$element[0], {
attributes: true,
@@ -5371,7 +5689,7 @@ S2.define('select2/core',[
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
- self.close();
+ self.close(evt);
evt.preventDefault();
} else if (key === KEYS.ENTER) {
@@ -5405,7 +5723,7 @@ S2.define('select2/core',[
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
if (this.isOpen()) {
this.close();
}
@@ -5416,7 +5734,7 @@ S2.define('select2/core',[
}
};
- Select2.prototype._syncSubtree = function (evt, mutations) {
+ Select2.prototype._isChangeMutation = function (evt, mutations) {
var changed = false;
var self = this;
@@ -5444,7 +5762,22 @@ S2.define('select2/core',[
}
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
changed = true;
+ } else if ($.isArray(mutations)) {
+ $.each(mutations, function(evt, mutation) {
+ if (self._isChangeMutation(evt, mutation)) {
+ // We've found a change mutation.
+ // Let's escape from the loop and continue
+ changed = true;
+ return false;
+ }
+ });
}
+ return changed;
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = this._isChangeMutation(evt, mutations);
+ var self = this;
// Only re-pull the data if we think there is a change
if (changed) {
@@ -5466,7 +5799,8 @@ S2.define('select2/core',[
'open': 'opening',
'close': 'closing',
'select': 'selecting',
- 'unselect': 'unselecting'
+ 'unselect': 'unselecting',
+ 'clear': 'clearing'
};
if (args === undefined) {
@@ -5494,7 +5828,7 @@ S2.define('select2/core',[
};
Select2.prototype.toggleDropdown = function () {
- if (this.options.get('disabled')) {
+ if (this.isDisabled()) {
return;
}
@@ -5510,15 +5844,40 @@ S2.define('select2/core',[
return;
}
+ if (this.isDisabled()) {
+ return;
+ }
+
this.trigger('query', {});
};
- Select2.prototype.close = function () {
+ Select2.prototype.close = function (evt) {
if (!this.isOpen()) {
return;
}
- this.trigger('close', {});
+ this.trigger('close', { originalEvent : evt });
+ };
+
+ /**
+ * Helper method to abstract the "enabled" (not "disabled") state of this
+ * object.
+ *
+ * @return {true} if the instance is not disabled.
+ * @return {false} if the instance is disabled.
+ */
+ Select2.prototype.isEnabled = function () {
+ return !this.isDisabled();
+ };
+
+ /**
+ * Helper method to abstract the "disabled" state of this object.
+ *
+ * @return {true} if the disabled option is true.
+ * @return {false} if the disabled option is false.
+ */
+ Select2.prototype.isDisabled = function () {
+ return this.options.get('disabled');
};
Select2.prototype.isOpen = function () {
@@ -5595,7 +5954,7 @@ S2.define('select2/core',[
});
}
- this.$element.val(newVal).trigger('change');
+ this.$element.val(newVal).trigger('input').trigger('change');
};
Select2.prototype.destroy = function () {
@@ -5621,10 +5980,12 @@ S2.define('select2/core',[
this._syncS = null;
this.$element.off('.select2');
- this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+ this.$element.attr('tabindex',
+ Utils.GetData(this.$element[0], 'old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false');
+ Utils.RemoveData(this.$element[0]);
this.$element.removeData('select2');
this.dataAdapter.destroy();
@@ -5652,7 +6013,7 @@ S2.define('select2/core',[
this.$container.addClass('select2-container--' + this.options.get('theme'));
- $container.data('element', this.$element);
+ Utils.StoreData($container[0], 'element', this.$element);
return $container;
};
@@ -5672,8 +6033,9 @@ S2.define('jquery.select2',[
'jquery-mousewheel',
'./select2/core',
- './select2/defaults'
-], function ($, _, Select2, Defaults) {
+ './select2/defaults',
+ './select2/utils'
+], function ($, _, Select2, Defaults, Utils) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
@@ -5694,7 +6056,7 @@ S2.define('jquery.select2',[
var args = Array.prototype.slice.call(arguments, 1);
this.each(function () {
- var instance = $(this).data('select2');
+ var instance = Utils.GetData(this, 'select2');
if (instance == null && window.console && console.error) {
console.error(
diff --git a/htdocs/includes/jquery/plugins/select2/dist/js/select2.min.js b/htdocs/includes/jquery/plugins/select2/dist/js/select2.min.js
index 7ef2fda809e..e4214264342 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/js/select2.min.js
+++ b/htdocs/includes/jquery/plugins/select2/dist/js/select2.min.js
@@ -1 +1,2 @@
-/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
+/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
+!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(' '),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):ithis.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n(' ');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(' '),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e(" ")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html(''),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('× ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n× ');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r(' ');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t(' ');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o(' ');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n(' '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(" "),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r ');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1user->dir_temp.'" --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
}
elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF))
{
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 47d6cc7a971..0c5310fce0f 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -117,7 +117,8 @@ ErrorLoginDoesNotExists=User with login %s could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
-ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in thirdparty card) and apply it to the invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to allow the old behaviour.
+ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in thirdparty card) and apply it to the invoice.
+ErrorLinesCantBeNegativeForOneVATRate=Total of lines can't be negative for a given VAT rate.
ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so.
ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative
ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that
diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php
index c8a3275dced..88a7a7372ad 100644
--- a/htdocs/livraison/class/livraison.class.php
+++ b/htdocs/livraison/class/livraison.class.php
@@ -404,7 +404,7 @@ class Livraison extends CommonObject
{
$numref = $this->ref;
}
- $this->newref = $numref;
+ $this->newref = dol_sanitizeFileName($numref);
// Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice.
$sql = "SELECT ref";
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index ea81b0c1e6e..56c32847e62 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1915,17 +1915,22 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
$("#topmenu-login-dropdown").removeClass("open");
}
});
+ ';
- $("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
- console.log("toggle login dropdown");
- event.preventDefault();
- $("#topmenu-login-dropdown").toggleClass("open");
- });
+ if ($conf->theme != 'md') {
+ $btnUser .= '
+ $("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
+ console.log("toggle login dropdown");
+ event.preventDefault();
+ $("#topmenu-login-dropdown").toggleClass("open");
+ });
- $("#topmenuloginmoreinfo-btn").on("click", function() {
- $("#topmenuloginmoreinfo").slideToggle();
- });
+ $("#topmenuloginmoreinfo-btn").on("click", function() {
+ $("#topmenuloginmoreinfo").slideToggle();
+ });';
+ }
+ $btnUser .= '
});
';
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 89b0d0acf12..29fd1d99980 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -766,38 +766,38 @@ class MyObject extends CommonObject
$result .= $linkstart;
- if (empty($this->showphoto_on_popup)) {
- if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
- } else {
- if ($withpicto) {
- require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
+ if (empty($this->showphoto_on_popup)) {
+ if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+ } else {
+ if ($withpicto) {
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
- list($class, $module) = explode('@', $this->picto);
- $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref);
- $filearray = dol_dir_list($upload_dir, "files");
- $filename = $filearray[0]['name'];
- if(!empty($filename)){
- $pospoint = strpos($filearray[0]['name'], '.');
+ list($class, $module) = explode('@', $this->picto);
+ $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref);
+ $filearray = dol_dir_list($upload_dir, "files");
+ $filename = $filearray[0]['name'];
+ if(!empty($filename)){
+ $pospoint = strpos($filearray[0]['name'], '.');
- $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint);
- if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) {
- $result .= '';
- }
- else {
- $result .= '';
- }
+ $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint);
+ if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) {
+ $result .= '';
+ }
+ else {
+ $result .= '';
+ }
- $result .= '';
- }
- else {
- $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
- }
- }
- }
+ $result .= '';
+ }
+ else {
+ $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
+ }
+ }
+ }
- if ($withpicto != 2) $result .= $this->ref;
+ if ($withpicto != 2) $result .= $this->ref;
- $result .= $linkend;
+ $result .= $linkend;
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action, $hookmanager;
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index d80c7220866..a16b77b6667 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -546,7 +546,7 @@ if ($action == 'create' && $user->rights->projet->creer)
print ' ';
// Label
- print ''.$langs->trans("Label").' ';
+ print ''.$langs->trans("Label").' ';
// Usage (opp, task, bill time, ...)
print '';
@@ -786,7 +786,7 @@ elseif ($object->id > 0)
array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false)
);
- print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 300, 590);
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ToClone"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 300, 590);
}
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 260a3744e2e..c8802f6cd77 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -546,7 +546,7 @@ class Reception extends CommonObject
$numref = $this->ref;
}
- $this->newref = $numref;
+ $this->newref = dol_sanitizeFileName($numref);
$now = dol_now();
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index afa8fcf4d77..0570b78bcdd 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -1462,7 +1462,7 @@ class SupplierProposal extends CommonObject
{
$num = $this->ref;
}
- $this->newref = $num;
+ $this->newref = dol_sanitizeFileName($num);
$sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal";
$sql .= " SET ref = '".$this->db->escape($num)."',";
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 02652da5875..fdd8609fd06 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -68,6 +68,11 @@ $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
+$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
+$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
+$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
+$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
+$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_status = GETPOST('viewstatut', 'alpha') ?GETPOST('viewstatut', 'alpha') : GETPOST('search_status', 'int');
$object_statut = $db->escape(GETPOST('supplier_proposal_statut'));
$search_btn = GETPOST('button_search', 'alpha');
@@ -148,6 +153,11 @@ $arrayfields = array(
'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
'sp.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
+ 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
+ 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10),
'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@@ -191,6 +201,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_montant_ht = '';
$search_montant_vat = '';
$search_montant_ttc = '';
+ $search_multicurrency_code = '';
+ $search_multicurrency_tx = '';
+ $search_multicurrency_montant_ht = '';
+ $search_multicurrency_montant_vat = '';
+ $search_multicurrency_montant_ttc = '';
$search_login = '';
$search_product_category = '';
$search_town = '';
@@ -245,6 +260,7 @@ $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.tva as total_vat, sp.total as total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
+$sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,';
$sql .= ' sp.datec as date_creation, sp.tms as date_update,';
$sql .= " p.rowid as project_id, p.ref as project_ref,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
@@ -291,6 +307,11 @@ if ($search_author) $sql .= natural_search('u.login', $search_author);
if ($search_montant_ht) $sql .= natural_search('sp.total_ht=', $search_montant_ht, 1);
if ($search_montant_vat != '') $sql .= natural_search("sp.tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql .= natural_search("sp.total", $search_montant_ttc, 1);
+if ($search_multicurrency_code != '') $sql .= ' AND sp.multicurrency_code = "' . $db->escape($search_multicurrency_code) . '"';
+if ($search_multicurrency_tx != '') $sql .= natural_search('sp.multicurrency_tx', $search_multicurrency_tx, 1);
+if ($search_multicurrency_montant_ht != '') $sql .= natural_search('sp.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
+if ($search_multicurrency_montant_vat != '') $sql .= natural_search('sp.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
+if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('sp.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
if ($socid) $sql .= ' AND s.rowid = '.$socid;
if ($search_status >= 0 && $search_status != '') $sql .= ' AND sp.fk_statut IN ('.$db->escape($search_status).')';
@@ -371,6 +392,11 @@ if ($resql)
if ($search_user > 0) $param .= '&search_user='.$search_user;
if ($search_sale > 0) $param .= '&search_sale='.$search_sale;
if ($search_montant_ht) $param .= '&search_montant_ht='.$search_montant_ht;
+ if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
+ if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
+ if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
+ if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
+ if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
if ($search_author) $param .= '&search_author='.$search_author;
if ($search_town) $param .= '&search_town='.$search_town;
if ($search_zip) $param .= '&search_zip='.$search_zip;
@@ -550,6 +576,41 @@ if ($resql)
print ' ';
print ' ';
}
+ if (!empty($arrayfields['sp.multicurrency_code']['checked']))
+ {
+ // Currency
+ print '';
+ print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
+ print ' ';
+ }
+ if (!empty($arrayfields['sp.multicurrency_tx']['checked']))
+ {
+ // Currency rate
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['sp.multicurrency_total_ht']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['sp.multicurrency_total_vat']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
+ if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked']))
+ {
+ // Amount
+ print '';
+ print ' ';
+ print ' ';
+ }
if (!empty($arrayfields['u.login']['checked']))
{
// Author
@@ -604,6 +665,11 @@ if ($resql)
if (!empty($arrayfields['sp.total_ht']['checked'])) print_liste_field_titre($arrayfields['sp.total_ht']['label'], $_SERVER["PHP_SELF"], 'sp.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_vat']['checked'])) print_liste_field_titre($arrayfields['sp.total_vat']['label'], $_SERVER["PHP_SELF"], 'sp.total_vat', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_ttc']['checked'])) print_liste_field_titre($arrayfields['sp.total_ttc']['label'], $_SERVER["PHP_SELF"], 'sp.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['sp.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_code', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
+ if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
if (!empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, '', $sortfield, $sortorder, 'center ');
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -764,6 +830,40 @@ if ($resql)
$totalarray['val']['sp.total_ttc'] += $obj->total_ttc;
}
+ // Currency
+ if (!empty($arrayfields['sp.multicurrency_code']['checked']))
+ {
+ print ''.$obj->multicurrency_code . ' - ' . $langs->trans('Currency' . $obj->multicurrency_code)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
+ // Currency rate
+ if (!empty($arrayfields['sp.multicurrency_tx']['checked']))
+ {
+ print '';
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
+ print " \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount HT
+ if (!empty($arrayfields['sp.multicurrency_total_ht']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ht)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['sp.multicurrency_total_vat']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_vat)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked']))
+ {
+ print ''.price($obj->multicurrency_total_ttc)." \n";
+ if (!$i) $totalarray['nbfield']++;
+ }
+
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php
index a0915b8bd08..55f0536c02d 100644
--- a/htdocs/theme/eldy/dropdown.inc.php
+++ b/htdocs/theme/eldy/dropdown.inc.php
@@ -380,3 +380,16 @@ a.top-menu-dropdown-link {
.hidden-search-result{
display: none !important;
}
+
+/* smartphone */
+@media only screen and (max-width: 767px)
+{
+ .dropdown-search-input {
+ width: 100%;
+ }
+
+ .tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
+ margin-left: 5px;
+ right: 0;
+ }
+}
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index a48a624733a..657cb64f3da 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -1529,7 +1529,7 @@ div.nopadding {
td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto {
color: var(--colortexttitlenotab);
- opacity: 0.75;
+ opacity: 0.65;
}
.pictotitle {
margin-: 8px;
diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php
index 9a6962c3ca9..d68df84c0c8 100644
--- a/htdocs/theme/md/dropdown.inc.php
+++ b/htdocs/theme/md/dropdown.inc.php
@@ -29,6 +29,9 @@ div#topmenu-bookmark-dropdown {
display: none;
}
+#topmenu-bookmark-dropdown .dropdown-menu {
+ width: 300px;
+}
button.dropdown-item.global-search-item {
outline: none;
@@ -396,6 +399,32 @@ a.top-menu-dropdown-link {
}
+
+/* smartphone */
+@media only screen and (max-width: 767px)
+{
+ #topmenu-bookmark-dropdown a.login-dropdown-a {
+ color: #000;
+ }
+
+ #topmenu-bookmark-dropdown .dropdown-menu {
+ width: 230px;
+ }
+
+ div#topmenu-bookmark-dropdown {
+ position: unset;
+ }
+
+ div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown {
+ line-height: unset;
+ }
+
+ ul.tmenu {
+ margin-right: 2px;
+ }
+}
+
+
.dropdown-search-input::placeholder {
color: color(#575756 a(0.8));
letter-spacing: 1.5px;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 448e6ff2200..914a6a27b5d 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -1424,7 +1424,10 @@ body.sidebar-collapse .side-nav-vert, body.sidebar-collapse #id-right {
.side-nav-vert {
margin-left: 228px;
}
-body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block {
+
+/* body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block_other, body.sidebar-collapse #topmenu-login-dropdown */
+body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block
+{
display: none;
}
global->THEME_DISABLE_STICKY_TOPMENU)) { ?>
diff --git a/test/test_serialize.php b/test/test_serialize.php
new file mode 100644
index 00000000000..873698e95c2
--- /dev/null
+++ b/test/test_serialize.php
@@ -0,0 +1,50 @@
+#!/usr/bin/env php
+aaa = 'aaa';
+$object->bbb = 'bbb';
+$object->thirdparty = new stdClass();
+$tmp = new Societe($db);
+$tmp->name = 'MyBigCompany';
+foreach ($tmp as $key=>$value)
+{
+ if (!in_array($key, array(
+ 'name', 'name_alias', 'ref_ext', 'address', 'zip', 'town', 'state_code', 'country_code'
+ ))) continue; // Discard if not into a dedicated list
+ if (!is_object($value)) $object->thirdparty->{$key} = $value;
+}
+
+
+// Show information
+print "\n";
+print "*** PHP Version : ".PHP_VERSION." - Dolibarr Version : ".DOL_VERSION."\n";
+
+print "*** print_r() of object used to generate the key to hash for blockedlog on the object sample:\n";
+print print_r($object, true);
+print "*** We build hash(256) of this string:\n";
+print hash('sha256', print_r($object, true));
+print "\n";
+
+print "*** When it is serialized() to store in db, we got:\n";
+print serialize($object);
+print "\n";
+
+print "*** And when it is print_r(unserialized()) to reuse it:\n";
+print print_r(unserialize(serialize($object)), true);
+print "*** We build hash(256) of this string:\n";
+print hash('sha256', print_r(unserialize(serialize($object)), true));
+print "\n";
+
+print "\n";
+
+//print print_r(unserialize(serialize($object)));