Projet de stage 2021
This commit is contained in:
9
key4intranet.front/public/assets/js/bootstrap/bootstrap-select.min.js
vendored
Normal file
9
key4intranet.front/public/assets/js/bootstrap/bootstrap-select.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
key4intranet.front/public/assets/js/bootstrap/bootstrap.bundle.min.js
vendored
Normal file
7
key4intranet.front/public/assets/js/bootstrap/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: AM (Amharic)
|
||||
* Region: ET (Ethiopia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'ምንም አልተመረጠም',
|
||||
noneResultsText: 'ከ{0} ጋር ተመሳሳይ ውጤት የለም',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} ምርጫ ተመርጧል' : '{0} ምርጫዎች ተመርጠዋል';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫ)' : 'ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫዎች)',
|
||||
(numGroup == 1) ? 'የቡድን ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫ)' : 'የቡድን ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫዎች)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'ሁሉም ይመረጥ',
|
||||
deselectAllText: 'ሁሉም አይመረጥ',
|
||||
multipleSeparator: ' ፣ '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*!
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: AR (Arabic)
|
||||
* Author: Yasser Lotfy <y_l@alive.com>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'لم يتم إختيار شئ',
|
||||
noneResultsText: 'لا توجد نتائج مطابقة لـ {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} خيار تم إختياره' : '{0} خيارات تمت إختيارها';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'تخطى الحد المسموح ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح ({n} خيارات بحد أقصى)',
|
||||
(numGroup == 1) ? 'تخطى الحد المسموح للمجموعة ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح للمجموعة ({n} خيارات بحد أقصى)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'إختيار الجميع',
|
||||
deselectAllText: 'إلغاء إختيار الجميع',
|
||||
multipleSeparator: '، '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: BG (Bulgaria)
|
||||
* Region: BG (Bulgaria)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Нищо избрано',
|
||||
noneResultsText: 'Няма резултат за {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} избран елемент' : '{0} избрани елемента';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Лимита е достигнат ({n} елемент максимум)' : 'Лимита е достигнат ({n} елемента максимум)',
|
||||
(numGroup == 1) ? 'Груповия лимит е достигнат ({n} елемент максимум)' : 'Груповия лимит е достигнат ({n} елемента максимум)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Избери всички',
|
||||
deselectAllText: 'Размаркирай всички',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: CS
|
||||
* Region: CZ (Czech Republic)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Vyberte ze seznamu',
|
||||
noneResultsText: 'Pro hledání {0} nebyly nalezeny žádné výsledky',
|
||||
countSelectedText: 'Vybrané {0} z {1}',
|
||||
maxOptionsText: ['Limit překročen ({n} {var} max)', 'Limit skupiny překročen ({n} {var} max)', ['položek', 'položka']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Vybrat vše',
|
||||
deselectAllText: 'Zrušit výběr'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: DA (Danish)
|
||||
* Region: DK (Denmark)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Intet valgt',
|
||||
noneResultsText: 'Ingen resultater fundet {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} valgt' : '{0} valgt';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Begrænsning nået (max {n} valgt)' : 'Begrænsning nået (max {n} valgte)',
|
||||
(numGroup == 1) ? 'Gruppe-begrænsning nået (max {n} valgt)' : 'Gruppe-begrænsning nået (max {n} valgte)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Markér alle',
|
||||
deselectAllText: 'Afmarkér alle',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: DE (German, deutsch)
|
||||
* Region: DE (Germany, Deutschland)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Bitte wählen...',
|
||||
noneResultsText: 'Keine Ergebnisse für {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} Element ausgewählt' : '{0} Elemente ausgewählt';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Limit erreicht ({n} Element max.)' : 'Limit erreicht ({n} Elemente max.)',
|
||||
(numGroup == 1) ? 'Gruppen-Limit erreicht ({n} Element max.)' : 'Gruppen-Limit erreicht ({n} Elemente max.)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Alles auswählen',
|
||||
deselectAllText: 'Nichts auswählen',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: EN (English)
|
||||
* Region: US (United States)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nothing selected',
|
||||
noneResultsText: 'No results match {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} item selected' : '{0} items selected';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',
|
||||
(numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Select All',
|
||||
deselectAllText: 'Deselect All',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ES (Spanish)
|
||||
* Region: CL (Chile)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'No hay selección',
|
||||
noneResultsText: 'No hay resultados {0}',
|
||||
countSelectedText: 'Seleccionados {0} de {1}',
|
||||
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos', 'element']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Seleccionar Todos',
|
||||
deselectAllText: 'Desmarcar Todos'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ES (Spanish)
|
||||
* Region: ES (Spain)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'No hay selección',
|
||||
noneResultsText: 'No hay resultados {0}',
|
||||
countSelectedText: 'Seleccionados {0} de {1}',
|
||||
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos', 'element']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Seleccionar Todos',
|
||||
deselectAllText: 'Desmarcar Todos'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ET (Eesti keel)
|
||||
* Region: EE (Estonia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Valikut pole tehtud',
|
||||
noneResultsText: 'Otsingule {0} ei ole vasteid',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} item selected' : '{0} items selected';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'Limiit on {n} max',
|
||||
'Globaalne limiit on {n} max'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Vali kõik',
|
||||
deselectAllText: 'Tühista kõik',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: EU (Basque)
|
||||
* Region:
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Hautapenik ez',
|
||||
noneResultsText: 'Emaitzarik ez {0}',
|
||||
countSelectedText: '{1}(e)tik {0} hautatuta',
|
||||
maxOptionsText: ['Mugara iritsita ({n} {var} gehienez)', 'Taldearen mugara iritsita ({n} {var} gehienez)', ['elementu', 'elementu']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Hautatu Guztiak',
|
||||
deselectAllText: 'Desautatu Guztiak'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: FA (Farsi)
|
||||
* Region: IR (Iran)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'چیزی انتخاب نشده است',
|
||||
noneResultsText: 'هیج مشابهی برای {0} پیدا نشد',
|
||||
countSelectedText: '{0} از {1} مورد انتخاب شده',
|
||||
maxOptionsText: ['بیشتر ممکن نیست {حداکثر {n} عدد}', 'بیشتر ممکن نیست {حداکثر {n} عدد}'],
|
||||
selectAllText: 'انتخاب همه',
|
||||
deselectAllText: 'انتخاب هیچ کدام',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: FI (Finnish)
|
||||
* Region: FI (Finland)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Ei valintoja',
|
||||
noneResultsText: 'Ei hakutuloksia {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} valittu' : '{0} valitut';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Valintojen maksimimäärä ({n} saavutettu)' : 'Valintojen maksimimäärä ({n} saavutettu)',
|
||||
(numGroup == 1) ? 'Ryhmän maksimimäärä ({n} saavutettu)' : 'Ryhmän maksimimäärä ({n} saavutettu)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Valitse kaikki',
|
||||
deselectAllText: 'Poista kaikki',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: FR (French; Français)
|
||||
* Region: FR (France)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Aucune sélection',
|
||||
noneResultsText: 'Aucun résultat pour {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected > 1) ? '{0} éléments sélectionnés' : '{0} élément sélectionné';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll > 1) ? 'Limite atteinte ({n} éléments max)' : 'Limite atteinte ({n} élément max)',
|
||||
(numGroup > 1) ? 'Limite du groupe atteinte ({n} éléments max)' : 'Limite du groupe atteinte ({n} élément max)'
|
||||
];
|
||||
},
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Tout sélectionner',
|
||||
deselectAllText: 'Tout désélectionner'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: HR (Croatia)
|
||||
* Region: HR (Croatia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Odaberite stavku',
|
||||
noneResultsText: 'Nema rezultata pretrage {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} stavka selektirana' : '{0} stavke selektirane';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Limit je postignut ({n} stvar maximalno)' : 'Limit je postignut ({n} stavke maksimalno)',
|
||||
(numGroup == 1) ? 'Grupni limit je postignut ({n} stvar maksimalno)' : 'Grupni limit je postignut ({n} stavke maksimalno)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Selektiraj sve',
|
||||
deselectAllText: 'Deselektiraj sve',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: HU (Hungarian)
|
||||
* Region: HU (Hungary)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Válasszon!',
|
||||
noneResultsText: 'Nincs találat {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return '{0} elem kiválasztva';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'Legfeljebb {n} elem választható',
|
||||
'A csoportban legfeljebb {n} elem választható'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Mind',
|
||||
deselectAllText: 'Egyik sem',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ID (Indonesian; Bahasa Indonesia)
|
||||
* Region: ID (Indonesia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Tidak ada yang dipilih',
|
||||
noneResultsText: 'Tidak ada yang cocok {0}',
|
||||
countSelectedText: '{0} terpilih',
|
||||
maxOptionsText: ['Mencapai batas (maksimum {n})', 'Mencapai batas grup (maksimum {n})'],
|
||||
selectAllText: 'Pilih Semua',
|
||||
deselectAllText: 'Hapus Semua',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: IT (Italian; italiano)
|
||||
* Region: IT (Italy; Italia)
|
||||
* Author: Michele Beltrame <mb@cattlegrid.info>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nessuna selezione',
|
||||
noneResultsText: 'Nessun risultato per {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? 'Selezionato {0} di {1}' : 'Selezionati {0} di {1}';
|
||||
},
|
||||
maxOptionsText: ['Limite raggiunto ({n} {var} max)', 'Limite del gruppo raggiunto ({n} {var} max)', ['elementi', 'elemento']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Seleziona Tutto',
|
||||
deselectAllText: 'Deseleziona Tutto'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: JA (Japanese; 日本語)
|
||||
* Region: JP (Japan)
|
||||
* Author: Richard Snijders (Flaxis)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: '選択されていません',
|
||||
noneResultsText: '\'{0}\'は見つかりません',
|
||||
countSelectedText: '{0}/{1} 選択中',
|
||||
maxOptionsText: ['選択上限数を超えています(最大{n}{var})', 'グループの選択上限数を超えています(最大{n}{var})', ['アイテム', 'アイテム']],
|
||||
selectAllText: '全て選択',
|
||||
deselectAllText: '選択をクリア',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: KH (Khmer)
|
||||
* Region: kM (Khmer)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'មិនមានអ្វីបានជ្រើសរើស',
|
||||
noneResultsText: 'មិនមានលទ្ធផល {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} ធាតុដែលបានជ្រើស' : '{0} ធាតុដែលបានជ្រើស';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'ឈានដល់ដែនកំណត់ ( {n} ធាតុអតិបរមា)' : 'អតិបរមាឈានដល់ដែនកំណត់ ( {n} ធាតុ)',
|
||||
(numGroup == 1) ? 'ដែនកំណត់ក្រុមឈានដល់ ( {n} អតិបរមាធាតុ)' : 'អតិបរមាក្រុមឈានដល់ដែនកំណត់ ( {n} ធាតុ)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'ជ្រើសយកទាំងអស់',
|
||||
deselectAllText: 'មិនជ្រើសយកទាំងអស',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: KO (Korean)
|
||||
* Region: KR (South Korea)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: '항목을 선택해주세요',
|
||||
noneResultsText: '{0} 검색 결과가 없습니다',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return '{0}개를 선택하였습니다';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'{n}개까지 선택 가능합니다',
|
||||
'해당 그룹은 {n}개까지 선택 가능합니다'
|
||||
];
|
||||
},
|
||||
selectAllText: '전체선택',
|
||||
deselectAllText: '전체해제',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: LT (Lithuanian)
|
||||
* Region: LT (Lithuania)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Niekas nepasirinkta',
|
||||
noneResultsText: 'Niekas nesutapo su {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} elementas pasirinktas' : '{0} elementai(-ų) pasirinkta';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Pasiekta riba ({n} elementas daugiausiai)' : 'Riba pasiekta ({n} elementai(-ų) daugiausiai)',
|
||||
(numGroup == 1) ? 'Grupės riba pasiekta ({n} elementas daugiausiai)' : 'Grupės riba pasiekta ({n} elementai(-ų) daugiausiai)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Pasirinkti visus',
|
||||
deselectAllText: 'Atmesti visus',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: LV (Latvian)
|
||||
* Region: LV (Latvia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nekas nav atzīmēts',
|
||||
noneResultsText: 'Nav neviena rezultāta {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} ieraksts atzīmēts' : '{0} ieraksti atzīmēts';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Sasniegts limits ({n} ieraksts maksimums)' : 'Sasniegts limits ({n} ieraksti maksimums)',
|
||||
(numGroup == 1) ? 'Sasniegts grupas limits ({n} ieraksts maksimums)' : 'Sasniegts grupas limits ({n} ieraksti maksimums)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Atzīmēt visu',
|
||||
deselectAllText: 'Neatzīmēt nevienu',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: NB (Norwegian; Bokmål)
|
||||
* Region: NO (Norway)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Ingen valgt',
|
||||
noneResultsText: 'Søket gir ingen treff {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} alternativ valgt' : '{0} alternativer valgt';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Grense nådd (maks {n} valg)' : 'Grense nådd (maks {n} valg)',
|
||||
(numGroup == 1) ? 'Grense for grupper nådd (maks {n} grupper)' : 'Grense for grupper nådd (maks {n} grupper)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Merk alle',
|
||||
deselectAllText: 'Fjern alle',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: NL (Dutch; Nederlands)
|
||||
* Region: NL (Europe)
|
||||
* Author: Daan Rosbergen (Badmuts)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Niets geselecteerd',
|
||||
noneResultsText: 'Geen resultaten gevonden voor {0}',
|
||||
countSelectedText: '{0} van {1} geselecteerd',
|
||||
maxOptionsText: ['Limiet bereikt ({n} {var} max)', 'Groep limiet bereikt ({n} {var} max)', ['items', 'item']],
|
||||
selectAllText: 'Alles selecteren',
|
||||
deselectAllText: 'Alles deselecteren',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: PL (Polish)
|
||||
* Region: EU (Europe)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nic nie zaznaczono',
|
||||
noneResultsText: 'Brak wyników wyszukiwania {0}',
|
||||
countSelectedText: 'Zaznaczono {0} z {1}',
|
||||
maxOptionsText: ['Osiągnięto limit ({n} {var} max)', 'Limit grupy osiągnięty ({n} {var} max)', ['elementy', 'element']],
|
||||
selectAllText: 'Zaznacz wszystkie',
|
||||
deselectAllText: 'Odznacz wszystkie',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: PT (Portuguese; português)
|
||||
* Region: BR (Brazil; Brasil)
|
||||
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nada selecionado',
|
||||
noneResultsText: 'Nada encontrado contendo {0}',
|
||||
countSelectedText: 'Selecionado {0} de {1}',
|
||||
maxOptionsText: ['Limite excedido (máx. {n} {var})', 'Limite do grupo excedido (máx. {n} {var})', ['itens', 'item']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Selecionar Todos',
|
||||
deselectAllText: 'Desmarcar Todos'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: PT (Portuguese; português)
|
||||
* Region: PT (Portugal; Portugal)
|
||||
* Author: Burnspirit <burnspirit@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nenhum seleccionado',
|
||||
noneResultsText: 'Sem resultados contendo {0}',
|
||||
countSelectedText: 'Selecionado {0} de {1}',
|
||||
maxOptionsText: ['Limite ultrapassado (máx. {n} {var})', 'Limite de seleções ultrapassado (máx. {n} {var})', ['itens', 'item']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Selecionar Tudo',
|
||||
deselectAllText: 'Desmarcar Todos'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: RO (Romanian)
|
||||
* Region: RO (Romania)
|
||||
* Alex Florea <alecz.fia@gmail.com>
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
doneButtonText: 'Închide',
|
||||
noneSelectedText: 'Nu a fost selectat nimic',
|
||||
noneResultsText: 'Nu există niciun rezultat {0}',
|
||||
countSelectedText: '{0} din {1} selectat(e)',
|
||||
maxOptionsText: ['Limita a fost atinsă ({n} {var} max)', 'Limita de grup a fost atinsă ({n} {var} max)', ['iteme', 'item']],
|
||||
selectAllText: 'Selectează toate',
|
||||
deselectAllText: 'Deselectează toate',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: RU (Russian; Русский)
|
||||
* Region: RU (Russian Federation)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Ничего не выбрано',
|
||||
noneResultsText: 'Совпадений не найдено {0}',
|
||||
countSelectedText: 'Выбрано {0} из {1}',
|
||||
maxOptionsText: ['Достигнут предел ({n} {var} максимум)', 'Достигнут предел в группе ({n} {var} максимум)', ['шт.', 'шт.']],
|
||||
doneButtonText: 'Закрыть',
|
||||
selectAllText: 'Выбрать все',
|
||||
deselectAllText: 'Отменить все',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: SK
|
||||
* Region: SK (Slovak Republic)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Vyberte zo zoznamu',
|
||||
noneResultsText: 'Pre výraz {0} neboli nájdené žiadne výsledky',
|
||||
countSelectedText: 'Vybrané {0} z {1}',
|
||||
maxOptionsText: ['Limit prekročený ({n} {var} max)', 'Limit skupiny prekročený ({n} {var} max)', ['položiek', 'položka']],
|
||||
selectAllText: 'Vybrať všetky',
|
||||
deselectAllText: 'Zrušiť výber',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: SL (Slovenian)
|
||||
* Region: SI (Slovenia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Nič izbranega',
|
||||
noneResultsText: 'Ni zadetkov za {0}',
|
||||
countSelectedText: '{0} od {1} izbranih',
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'Omejitev dosežena (max. izbranih: {n})',
|
||||
'Omejitev skupine dosežena (max. izbranih: {n})'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Izberi vse',
|
||||
deselectAllText: 'Počisti izbor',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: SR (Serbian; Srpski)
|
||||
* Region: SR (Republic of Serbia)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Izaberite',
|
||||
noneResultsText: 'Nema rezultata za {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} izabrana' : '{0} izabrane';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Limit je dostignut ({n} stvar maximalno)' : 'Limit je dostignut ({n} stavke maksimalno)',
|
||||
(numGroup == 1) ? 'Grupni limit je dostignut ({n} stvar maksimalno)' : 'Grupni limit je dostignut ({n} stavke maksimalno)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Izaberi sve',
|
||||
deselectAllText: 'Obrisi sve',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: SV (Swedish)
|
||||
* Region: SE (Sweden)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Inget valt',
|
||||
noneResultsText: 'Inget sökresultat matchar {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected === 1) ? '{0} alternativ valt' : '{0} alternativ valda';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'Gräns uppnåd (max {n} alternativ)',
|
||||
'Gräns uppnåd (max {n} gruppalternativ)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Markera alla',
|
||||
deselectAllText: 'Avmarkera alla',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: TH (Thai)
|
||||
* Region: TH (Thailand)
|
||||
* Author: Ekkachai Sohmontha
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'ไม่ได้เลือกอะไรเลย',
|
||||
noneResultsText: 'ไม่มีผลลัพธ์ที่ตรงกัน {0}',
|
||||
countSelectedText: '{0} รายการที่เลือก',
|
||||
maxOptionsText: ['เกินจำนวนที่กำหนด (สูงสุด {n} รายการ)', 'เกินจำนวนที่กำหนด (สูงสุด {n} กลุ่ม)'],
|
||||
selectAllText: 'เลือกทั้งหมด',
|
||||
deselectAllText: 'ไม่เลือกทั้งหมด',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: TR (Turkey)
|
||||
* Region: TR (Europe)
|
||||
* Author: Serhan Güney
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Hiçbiri seçilmedi',
|
||||
noneResultsText: 'Hiçbir sonuç bulunamadı {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return (numSelected == 1) ? '{0} öğe seçildi' : '{0} öğe seçildi';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
(numAll == 1) ? 'Limit aşıldı (maksimum {n} sayıda öğe )' : 'Limit aşıldı (maksimum {n} sayıda öğe)',
|
||||
(numGroup == 1) ? 'Grup limiti aşıldı (maksimum {n} sayıda öğe)' : 'Grup limiti aşıldı (maksimum {n} sayıda öğe)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Tümünü Seç',
|
||||
deselectAllText: 'Seçiniz',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: UA (Ukrainian; Українська)
|
||||
* Region: UA (Ukraine)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Нічого не вибрано',
|
||||
noneResultsText: 'Збігів не знайдено {0}',
|
||||
countSelectedText: 'Вибрано {0} із {1}',
|
||||
maxOptionsText: ['Досягнута межа ({n} {var} максимум)', 'Досягнута межа в групі ({n} {var} максимум)', ['items', 'item']],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: 'Вибрати все',
|
||||
deselectAllText: 'Скасувати вибір усі'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Dịch các văn bản mặc định cho bootstrap-select.
|
||||
* Locale: VI (Vietnamese)
|
||||
* Region: VN (Việt Nam)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: 'Chưa chọn',
|
||||
noneResultsText: 'Không có kết quả cho {0}',
|
||||
countSelectedText: function (numSelected, numTotal) {
|
||||
return '{0} mục đã chọn';
|
||||
},
|
||||
maxOptionsText: function (numAll, numGroup) {
|
||||
return [
|
||||
'Không thể chọn (giới hạn {n} mục)',
|
||||
'Không thể chọn (giới hạn {n} mục)'
|
||||
];
|
||||
},
|
||||
selectAllText: 'Chọn tất cả',
|
||||
deselectAllText: 'Bỏ chọn',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ZH (Chinese)
|
||||
* Region: CN (China)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: '没有选中任何项',
|
||||
noneResultsText: '没有找到匹配项',
|
||||
countSelectedText: '选中{1}中的{0}项',
|
||||
maxOptionsText: ['超出限制 (最多选择{n}项)', '组选择超出限制(最多选择{n}组)'],
|
||||
multipleSeparator: ', ',
|
||||
selectAllText: '全选',
|
||||
deselectAllText: '取消全选'
|
||||
};
|
||||
})(jQuery);
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Translated default messages for bootstrap-select.
|
||||
* Locale: ZH (Chinese)
|
||||
* Region: TW (Taiwan)
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.selectpicker.defaults = {
|
||||
noneSelectedText: '沒有選取任何項目',
|
||||
noneResultsText: '沒有找到符合的結果',
|
||||
countSelectedText: '已經選取{0}個項目',
|
||||
maxOptionsText: ['超過限制 (最多選擇{n}項)', '超過限制(最多選擇{n}組)'],
|
||||
selectAllText: '選取全部',
|
||||
deselectAllText: '全部取消',
|
||||
multipleSeparator: ', '
|
||||
};
|
||||
})(jQuery);
|
12
key4intranet.front/public/assets/js/flickity.min.js
vendored
Normal file
12
key4intranet.front/public/assets/js/flickity.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
143
key4intranet.front/public/assets/js/infopanel.js
Normal file
143
key4intranet.front/public/assets/js/infopanel.js
Normal file
@@ -0,0 +1,143 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- Infopanel -------------------- */
|
||||
|
||||
function Infopanel(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
}
|
||||
|
||||
Infopanel.prototype.options = {
|
||||
position: 'top'
|
||||
};
|
||||
|
||||
Infopanel.prototype._init = function() {
|
||||
this.position = this.options.position;
|
||||
this.wrapper = $('<div id="infopanel" class="' + this.position + '" />').prependTo('body');
|
||||
this.panels = {};
|
||||
};
|
||||
|
||||
Infopanel.prototype.add = function(options) {
|
||||
var id = this.getUniqueID();
|
||||
var params = options;
|
||||
params['infopanel'] = this;
|
||||
params['id'] = 'info-' + id;
|
||||
this.panels[id] = new InfoItem(params);
|
||||
};
|
||||
|
||||
Infopanel.prototype.getUniqueID = function() {
|
||||
return new Date().valueOf() + '_' + Math.floor((Math.random() + 1) * 2000).toString();
|
||||
};
|
||||
|
||||
window.Infopanel = Infopanel;
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------- InfoItem -------------------- */
|
||||
|
||||
function InfoItem(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
InfoItem.prototype.options = {
|
||||
bgcolor: 'primary',
|
||||
title: '',
|
||||
content: '',
|
||||
contentsize: 'md',
|
||||
hideafter: 0
|
||||
};
|
||||
|
||||
InfoItem.prototype._init = function() {
|
||||
var $this = this;
|
||||
this.infopanel = this.options.infopanel;
|
||||
this.id = this.options.id;
|
||||
this.bgcolor = this.options.bgcolor;
|
||||
this.title = this.options.title;
|
||||
this.content = this.options.content;
|
||||
this.buttons = this.options.buttons;
|
||||
this.contentsize = this.options.contentsize;
|
||||
this.hideafter = this.options.hideafter;
|
||||
this.wrapper = $('<div id="' + this.id + '" class="infoitem bg-' + this.bgcolor + '" />');
|
||||
this.container = $('<div class="content size-' + this.contentsize + '">').appendTo(this.wrapper);
|
||||
this.text = $('<span class="text">' + this.content + '</span>').appendTo(this.container);
|
||||
if (this.title != '') $('<h5>' + this.title + '</h5>').prependTo(this.text);
|
||||
this.btns = $('<span class="buttons" />').appendTo(this.container);
|
||||
this.itembuttons = {};
|
||||
if (typeof this.buttons != 'undefined')
|
||||
for (var i=0; i<this.buttons.length; i++)
|
||||
this.itembuttons[i] = new InfoItemButton({
|
||||
item: this,
|
||||
label: this.buttons[i].label,
|
||||
color: (this.buttons[i].color) ? this.buttons[i].color : null,
|
||||
size: (this.contentsize) ? this.contentsize : null,
|
||||
action: this.buttons[i].action
|
||||
});
|
||||
this.wrapper.prependTo(this.infopanel.wrapper);
|
||||
this.closebtn = $('<a href="javascript:;" class="close-panel pt-1 text-center"><i class="fas fa-lg fa-times text-white align-middle"></i></a>').prependTo(this.wrapper);
|
||||
this.text.css('max-width', 'calc(100% - ' + Math.round(this.btns.width() + this.closebtn.width()) + 'px)');
|
||||
this.show();
|
||||
if (this.hideafter > 0) this.hideTo = setTimeout(function() { $this.hide(); }, this.hideafter);
|
||||
};
|
||||
|
||||
InfoItem.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
this.closebtn.click(function(e){
|
||||
e.stopPropagation();
|
||||
$this.hide();
|
||||
})
|
||||
};
|
||||
|
||||
InfoItem.prototype.show = function() {
|
||||
this.wrapper.addClass('show');
|
||||
};
|
||||
|
||||
InfoItem.prototype.hide = function() {
|
||||
this.wrapper.removeClass('show');
|
||||
};
|
||||
|
||||
window.InfoItem = InfoItem;
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------- InfoItemButton -------------------- */
|
||||
|
||||
function InfoItemButton(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
InfoItemButton.prototype._init = function() {
|
||||
this.item = this.options.item;
|
||||
this.label = (this.options.label != null) ? this.options.label : '[label]';
|
||||
this.color = (this.options.color != null) ? this.options.color : 'white';
|
||||
this.size = (this.options.size != null) ? this.options.size : 'md';
|
||||
this.action = (this.options.action != null) ? this.options.action : function() {console.log('Aucune action n\'a été définie pour ce bouton.');};
|
||||
this.link = (typeof this.options.action == 'string') ? this.options.action : 'javascript:;';
|
||||
this.button = $('<a href="' + this.link + '" class="btn btn-' + this.color + ' btn-' + this.size + ' m-1"><strong>' + this.label + '</strong></a>')
|
||||
.appendTo(this.item.btns);
|
||||
};
|
||||
|
||||
InfoItemButton.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
this.button.click(function(e){
|
||||
e.stopPropagation();
|
||||
if (typeof $this.action == 'function') $this.action();
|
||||
})
|
||||
};
|
||||
|
||||
window.InfoItemButton = InfoItemButton;
|
||||
|
||||
|
||||
})(window);
|
2
key4intranet.front/public/assets/js/jquery/jquery-3.5.1.min.js
vendored
Normal file
2
key4intranet.front/public/assets/js/jquery/jquery-3.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
key4intranet.front/public/assets/js/jquery/jquery-ui-1.12.1.min.js
vendored
Normal file
7
key4intranet.front/public/assets/js/jquery/jquery-ui-1.12.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,711 @@
|
||||
/**
|
||||
FCBKcomplete v2.8.9.3 is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
- Jquery version required: 1.6.x
|
||||
*/
|
||||
|
||||
/* Based on TextboxList by Guillermo Rauch http://devthought.com/ */
|
||||
|
||||
/**
|
||||
* width - element width (by default 512px)
|
||||
* json_url - url to fetch json object
|
||||
* cache - use cache
|
||||
* height - maximum number of element shown before scroll will apear
|
||||
* newel - show typed text like a element
|
||||
* firstselected - automaticly select first element from dropdown
|
||||
* filter_case - case sensitive filter
|
||||
* filter_selected - filter selected items from list
|
||||
* filter_begin - filter only from begin
|
||||
* complete_text - text for complete page
|
||||
* maxshownitems - maximum numbers that will be shown at dropdown list (less better performance)
|
||||
* oncreate - fire event on item create
|
||||
* onselect - fire event on item select
|
||||
* onremove - fire event on item remove
|
||||
* maxitimes - maximum items that can be added
|
||||
* delay - delay between ajax request (bigger delay, lower server time request)
|
||||
* addontab - add first visible element on tab or enter hit
|
||||
* addoncomma - add first visible element when pressing the comma key
|
||||
* attachto - after this element fcbkcomplete insert own elements
|
||||
* bricket - use square bricket with select (needed for asp or php) enabled by default
|
||||
* input_tabindex - the tabindex of the input element
|
||||
* input_min_size - minimum size of the input element (default: 1)
|
||||
* input_name - value of the input element's 'name'-attribute (no 'name'-attribute set if empty)
|
||||
* select_all_text - text for select all link
|
||||
*/
|
||||
|
||||
(function( $, undefined ) {
|
||||
$.fn.fcbkcomplete = function(opt) {
|
||||
return this.queue( function() {
|
||||
function init() {
|
||||
createFCBK();
|
||||
addInput(0);
|
||||
}
|
||||
|
||||
function createFCBK() {
|
||||
holder = $('<ul class="holder"></ul>').width(options.width);
|
||||
if (options.attachto) {
|
||||
if (typeof(options.attachto) == "object") {
|
||||
options.attachto.append(holder);
|
||||
} else {
|
||||
$(options.attachto).append(holder);
|
||||
}
|
||||
} else {
|
||||
element.after(holder);
|
||||
}
|
||||
complete = $('<div class="facebook-auto">').width(options.width);
|
||||
if (options.complete_text != "") {
|
||||
var completeText = options.complete_text;
|
||||
complete.append('<div class="default" id="' + elemid + '_completeText">' + completeText + '</div>');
|
||||
if (options.select_all_text) {
|
||||
complete.children('.default').append($('<a href="" class="select_all_items">' + options.select_all_text + '</a>').click(function(){$(element).trigger('selectAll'); return false;}));
|
||||
}
|
||||
}
|
||||
complete.hover(function() {complete_hover = 0;}, function() {complete_hover = 1;});
|
||||
feed = $('<ul id="'+elemid+'_feed"></ul>').width(options.width);
|
||||
holder.after(complete.prepend(feed));
|
||||
elPrepare();
|
||||
}
|
||||
|
||||
function elPrepare() {
|
||||
name = element.attr("name");
|
||||
if (options.bricket) {
|
||||
if (typeof(name) != 'undefined' && name.indexOf("[]") == -1) {
|
||||
name = name + "[]";
|
||||
}
|
||||
}
|
||||
|
||||
var temp_elem = $('<'+element.get(0).tagName+' name="'+name+'" id="'+elemid+'" multiple="multiple" class="' + element.get(0).className + ' hidden">').data('cache', {});
|
||||
|
||||
$.each(element.children('option'), function(i, option) {
|
||||
option = $(option);
|
||||
temp_elem.data('cache')[option.val()] = option.text();
|
||||
if (option.hasClass("selected")) {
|
||||
var id = addItem(option.text(), option.val(), true, option.hasClass("locked"));
|
||||
temp_elem.append('<option value="'+option.val()+'" selected="selected" id="opt_'+id+'"class="selected">'+option.text()+'</option>');
|
||||
}
|
||||
});
|
||||
|
||||
element.after(temp_elem);
|
||||
element.remove();
|
||||
element = temp_elem;
|
||||
|
||||
//public method to add new item
|
||||
$(element).bind("addItem", function(event, data) {
|
||||
addItem(data.title, data.value, 0, 0, 0);
|
||||
});
|
||||
|
||||
//public method to remove item
|
||||
$(element).bind("removeItem", function(event, data) {
|
||||
var item = holder.children('li[rel=' + data.value + ']');
|
||||
if (item.length) {
|
||||
removeItem(item);
|
||||
}
|
||||
});
|
||||
|
||||
//public method to remove item
|
||||
$(element).bind("destroy", function(event, data) {
|
||||
holder.remove();
|
||||
complete.remove();
|
||||
element.show();
|
||||
});
|
||||
|
||||
//public method to select all items
|
||||
$(element).bind("selectAll", function(event, data) {
|
||||
var currVals = $(element).val() || [];
|
||||
$.each($(element).data('cache'), function(key, value){
|
||||
if($.inArray(key, currVals) === -1){
|
||||
addItem(value, key, 0, 0, 0);
|
||||
}
|
||||
});
|
||||
feed.parent().hide()
|
||||
});
|
||||
|
||||
$(element).bind("setMaxItems", function (event, data) {
|
||||
setMaxItems(data, holder);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function addItem(title, value, preadded, locked, focusme) {
|
||||
if (!maxItems() || value.indexOf("disabled")>=0) {
|
||||
return false;
|
||||
}
|
||||
var liclass = "bit-box" + (locked ? " locked": "");
|
||||
var id = randomId();
|
||||
var txt = document.createTextNode(xssDisplay(title));
|
||||
var txtToAddOnClick = '';
|
||||
try {
|
||||
if (bIsAdmin)
|
||||
txtToAddOnClick = 'style="cursor:pointer;" onclick="OpenFCBKValue(' + value + ');" ';
|
||||
} catch (JsEx)
|
||||
{ }
|
||||
var aclose = $('<a class="closebutton" href="#"></a>');
|
||||
var li = $('<li ' + txtToAddOnClick + 'class="' + liclass + '" rel="' + value + '" id="pt_' + id + '"></li>').prepend(txt).append(aclose);
|
||||
|
||||
holder.append(li);
|
||||
if (!preadded)
|
||||
{
|
||||
try {
|
||||
if (bIsAdmin) {
|
||||
hasMadeChanges = true;
|
||||
try { HasMadeChanges(); } catch (ex) { };
|
||||
}
|
||||
} catch (K4REGex) { }
|
||||
}
|
||||
|
||||
aclose.click( function() {
|
||||
removeItem($(this).parent("li"));
|
||||
return false;
|
||||
});
|
||||
if (!preadded) {
|
||||
$("#" + elemid + "_annoninput").remove();
|
||||
addInput(focusme);
|
||||
var _item = $('<option value="'+xssDisplay(value, 1)+'" id="opt_'+id+'" class="selected" selected="selected">'+xssDisplay(title)+'</option>');
|
||||
element.append(_item);
|
||||
if (options.onselect) {
|
||||
funCall(options.onselect, _item);
|
||||
}
|
||||
element.change();
|
||||
}
|
||||
holder.children("li.bit-box.deleted").removeClass("deleted");
|
||||
clear_feed(1);
|
||||
return id;
|
||||
}
|
||||
|
||||
function removeItem(item) {
|
||||
if (!item.hasClass('locked')) {
|
||||
item.fadeOut("fast");
|
||||
var id = item.attr('id');
|
||||
if (options.onremove) {
|
||||
var _item = id ? $("#o" + id + "") : element.children("option[value=" + item.attr("rel") + "]");
|
||||
funCall(options.onremove, _item);
|
||||
}
|
||||
if (id) {
|
||||
$("#o" + id + "").remove();
|
||||
} else {
|
||||
element.children('option[value="' + item.attr("rel") + '"]').remove();
|
||||
}
|
||||
item.remove();
|
||||
element.change();
|
||||
deleting = 0;
|
||||
try {
|
||||
if (bIsAdmin) {
|
||||
hasMadeChanges = true;
|
||||
try { HasMadeChanges(); } catch (ex) { };
|
||||
}
|
||||
} catch (K4REGex) { }
|
||||
}
|
||||
}
|
||||
|
||||
function setMaxItems(maxItems, localHolder)
|
||||
{
|
||||
|
||||
if (maxItems == 0) {
|
||||
options.complete_text = ResourcesResourceAccompanyingPAXUnlimited;
|
||||
}
|
||||
else if (maxItems == 1) {
|
||||
options.complete_text = ResourcesResourceAccompanyingPAX1;
|
||||
}
|
||||
else {
|
||||
options.complete_text = ResourcesResourceAccompanyingPAXX.replace("{0}", maxItems);
|
||||
}
|
||||
document.getElementById(elemid + "_completeText").innerHTML = options.complete_text;
|
||||
options.maxitems = maxItems;
|
||||
var liToRemove = null;
|
||||
var isLastItemsTheSame = false;
|
||||
var lastItemsN = localHolder.children("li.bit-box").length + 1;
|
||||
while (!isLastItemsTheSame && options.maxitems != 0 && (localHolder.children("li.bit-box").length > options.maxitems))
|
||||
{
|
||||
lastItemsN = localHolder.children("li.bit-box").length;
|
||||
//le nombre max d'items est inférieur à celui de sélectionnés > il faut en désélectionner
|
||||
try {
|
||||
localHolder.children("li.bit-box").each(function() {
|
||||
liToRemove = $(this);
|
||||
});
|
||||
removeItem(liToRemove);
|
||||
|
||||
} catch (exception) { alert(exception); };
|
||||
if (lastItemsN == localHolder.children("li.bit-box").length)
|
||||
isLastItemsTheSame = true;
|
||||
}
|
||||
}
|
||||
|
||||
function addInput(focusme) {
|
||||
var li = $('<li class="bit-input" id="'+elemid + '_annoninput">');
|
||||
var input = $('<input type="text" class="maininput" size="' + options.input_min_size + '" autocomplete="off">');
|
||||
if (options.input_tabindex > 0) input.attr("tabindex", options.input_tabindex);
|
||||
if (options.input_name != "") input.attr("name", options.input_name);
|
||||
|
||||
holder.append(li.append(input));
|
||||
|
||||
input.focus( function() {
|
||||
isactive = true;
|
||||
if (maxItems()) {
|
||||
complete.fadeIn("fast");
|
||||
}
|
||||
});
|
||||
|
||||
input.blur( function() {
|
||||
isactive = false;
|
||||
clear_feed(1);
|
||||
complete.fadeOut('fast');
|
||||
/*if (complete_hover) {
|
||||
complete.fadeOut("fast");
|
||||
} else {
|
||||
input.focus();
|
||||
}*/
|
||||
});
|
||||
|
||||
holder.click( function() {
|
||||
if (options.input_min_size < 0 && feed.length) {
|
||||
load_feed(xssPrevent(input.val(), 1));
|
||||
}
|
||||
input.focus();
|
||||
if (feed.length && input.val().length > options.input_min_size) {
|
||||
feed.show();
|
||||
} else {
|
||||
clear_feed(1);
|
||||
complete.children(".default").show();
|
||||
}
|
||||
});
|
||||
|
||||
input.keypress( function(event) {
|
||||
if (event.keyCode == _key.enter) {
|
||||
return false;
|
||||
}
|
||||
//auto expand input
|
||||
var newsize = (options.input_min_size > input.val().length) ? options.input_min_size : (input.val().length + 1);
|
||||
input.attr("size", newsize).width(parseInt(input.css('font-size')) * newsize);
|
||||
});
|
||||
|
||||
input.keyup( function(event) {
|
||||
|
||||
var etext = xssPrevent(input.val(), 1);
|
||||
|
||||
if (event.keyCode == _key.backspace && etext.length == 0) {
|
||||
clear_feed(1);
|
||||
if (!holder.children("li.bit-box:last").hasClass('locked')) {
|
||||
if (holder.children("li.bit-box.deleted").length == 0) {
|
||||
holder.children("li.bit-box:last").addClass("deleted");
|
||||
return false;
|
||||
} else {
|
||||
if (deleting) {
|
||||
return;
|
||||
}
|
||||
deleting = 1;
|
||||
holder.children("li.bit-box.deleted").fadeOut("fast", function() {
|
||||
removeItem($(this));
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.keyCode != _key.downarrow && event.keyCode != _key.uparrow && event.keyCode!= _key.leftarrow && event.keyCode!= _key.rightarrow && etext.length > options.input_min_size) {
|
||||
load_feed(etext);
|
||||
complete.children(".default").hide();
|
||||
feed.show();
|
||||
}
|
||||
});
|
||||
if (options.oncreate) {
|
||||
funCall(options.oncreate, input);
|
||||
}
|
||||
if (focusme) {
|
||||
setTimeout( function() {
|
||||
input.focus();
|
||||
complete.children(".default").show();
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function addMembers(etext, data) {
|
||||
feed.html('');
|
||||
if (!options.cache && data != null) {
|
||||
cache.clear();
|
||||
}
|
||||
addTextItem(etext);
|
||||
if (data != null && data.length) {
|
||||
$.each(data, function(i, val) {
|
||||
cache.set(xssPrevent(val.key), xssPrevent(val.value));
|
||||
});
|
||||
}
|
||||
var maximum = options.maxshownitems < cache.length() ? options.maxshownitems: cache.length();
|
||||
var content = '';
|
||||
$.each(cache.search(etext), function (i, object) {
|
||||
if (options.filter_selected && element.children('option[value="' + object.key + '"]').hasClass("selected")) {
|
||||
//nothing here...
|
||||
} else {
|
||||
content += '<li rel="' + object.key + '">' + xssDisplay(itemIllumination(object.value, etext)) + '</li>';
|
||||
counter++;
|
||||
maximum--;
|
||||
}
|
||||
});
|
||||
feed.append(content);
|
||||
if (options.firstselected) {
|
||||
focuson = feed.children("li:visible:first");
|
||||
focuson.addClass("auto-focus");
|
||||
}
|
||||
|
||||
if (counter > options.height) {
|
||||
feed.css({
|
||||
"height": (options.height * 24) + "px",
|
||||
"overflow": "auto"
|
||||
});
|
||||
} else {
|
||||
feed.css("height", "auto");
|
||||
}
|
||||
|
||||
if (maxItems() && complete.is(':hidden')) {
|
||||
complete.show();
|
||||
}
|
||||
}
|
||||
|
||||
function itemIllumination(text, etext) {
|
||||
var string_regex_adder = options.filter_begin ? '': '(.*)';
|
||||
var regex_result = options.filter_begin ? '<em>$1</em>$2' : '$1<em>$2</em>$3';
|
||||
var string_regex = string_regex_adder + (options.filter_case ? "(" + etext + ")(.*)" : "(" + etext.toLowerCase() + ")(.*)");
|
||||
try {
|
||||
var regex = new RegExp(string_regex, ((options.filter_case) ? "g":"gi"));
|
||||
var text = text.replace(regex, regex_result);
|
||||
} catch(ex) {};
|
||||
return text;
|
||||
}
|
||||
|
||||
function bindFeedEvent() {
|
||||
feed.children("li").mouseover( function() {
|
||||
feed.children("li").removeClass("auto-focus");
|
||||
focuson = $(this);
|
||||
focuson.addClass("auto-focus");
|
||||
});
|
||||
feed.children("li").mouseout( function() {
|
||||
$(this).removeClass("auto-focus");
|
||||
focuson = null;
|
||||
});
|
||||
}
|
||||
|
||||
function removeFeedEvent() {
|
||||
feed.unbind("mouseover").unbind("mouseout").mousemove( function() {
|
||||
bindFeedEvent();
|
||||
feed.unbind("mousemove");
|
||||
});
|
||||
}
|
||||
|
||||
function bindEvents() {
|
||||
var maininput = $("#" + elemid + "_annoninput").children(".maininput");
|
||||
bindFeedEvent();
|
||||
|
||||
feed.children("li").unbind("mousedown").mousedown( function() {
|
||||
var option = $(this);
|
||||
addItem(option.text(), option.attr("rel"), 0, 0, 1);
|
||||
clear_feed(1);
|
||||
complete.hide();
|
||||
});
|
||||
|
||||
maininput.unbind("keydown");
|
||||
maininput.keydown( function(event) {
|
||||
if (event.keyCode != _key.backspace) {
|
||||
holder.children("li.bit-box.deleted").removeClass("deleted");
|
||||
}
|
||||
|
||||
if ((event.keyCode == _key.enter || event.keyCode == _key.tab || event.keyCode == _key.comma) && checkFocusOn()) {
|
||||
var option = focuson;
|
||||
addItem(option.text(), option.attr("rel"), 0, 0, 1);
|
||||
return _preventDefault(event);
|
||||
}
|
||||
|
||||
if ((event.keyCode == _key.enter || event.keyCode == _key.tab || event.keyCode == _key.comma) && !checkFocusOn()) {
|
||||
if (options.newel) {
|
||||
var value = xssPrevent($(this).val());
|
||||
addItem(value, value, 0, 0, 1);
|
||||
return _preventDefault(event);
|
||||
}
|
||||
if ((options.addontab || options.addoncomma) && options.newel) {
|
||||
focuson = feed.children("li:visible:first");
|
||||
var option = focuson;
|
||||
addItem(option.text(), option.attr("rel"), 0, 0, 1);
|
||||
return _preventDefault(event);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.keyCode == _key.downarrow) {
|
||||
nextItem('first');
|
||||
}
|
||||
if (event.keyCode == _key.uparrow) {
|
||||
nextItem('last');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function nextItem(position) {
|
||||
removeFeedEvent();
|
||||
if (focuson == null || focuson.length == 0) {
|
||||
focuson = feed.children("li:visible:" + position);
|
||||
feed.get(0).scrollTop = position == 'first' ? 0 : parseInt(focuson.get(0).scrollHeight, 10) * (parseInt(feed.children("li:visible").length, 10) - Math.round(options.height / 2));
|
||||
} else {
|
||||
focuson.removeClass("auto-focus");
|
||||
focuson = position == 'first' ? focuson.nextAll("li:visible:first") : focuson.prevAll("li:visible:first");
|
||||
var prev = parseInt(focuson.prevAll("li:visible").length, 10);
|
||||
var next = parseInt(focuson.nextAll("li:visible").length, 10);
|
||||
if (((position == 'first' ? prev : next) > Math.round(options.height / 2) || (position == 'first' ? prev : next) <= Math.round(options.height / 2)) && typeof(focuson.get(0)) != "undefined") {
|
||||
feed.get(0).scrollTop = parseInt(focuson.get(0).scrollHeight, 10) * (prev - Math.round(options.height / 2));
|
||||
}
|
||||
}
|
||||
feed.children("li").removeClass("auto-focus");
|
||||
focuson.addClass("auto-focus");
|
||||
}
|
||||
|
||||
function _preventDefault(event) {
|
||||
complete.hide();
|
||||
event.preventDefault();
|
||||
focuson = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
function maxItems() {
|
||||
return options.maxitems != 0 && (holder.children("li.bit-box").length < options.maxitems);
|
||||
}
|
||||
|
||||
function addTextItem(value) {
|
||||
if (options.newel && maxItems()) {
|
||||
feed.children("li[fckb=1]").remove();
|
||||
if (value.length == 0) {
|
||||
return;
|
||||
}
|
||||
var li = $('<li rel="'+value+'" fckb="1">').html(xssDisplay(value));
|
||||
feed.prepend(li);
|
||||
counter++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function funCall(func, item) {
|
||||
var _object = {};
|
||||
for (i = 0; i < item.get(0).attributes.length; i++) {
|
||||
if (item.get(0).attributes[i].nodeValue != null) {
|
||||
_object["_" + item.get(0).attributes[i].nodeName] = item.get(0).attributes[i].nodeValue;
|
||||
}
|
||||
}
|
||||
return func.call(func, _object);
|
||||
}
|
||||
|
||||
function checkFocusOn() {
|
||||
if (focuson == null || focuson.length == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function xssPrevent(string, flag) {
|
||||
if (typeof flag != "undefined") {
|
||||
for(i = 0; i < string.length; i++) {
|
||||
var charcode = string.charCodeAt(i);
|
||||
if ((_key.exclamation <= charcode && charcode <= _key.slash) ||
|
||||
(_key.colon <= charcode && charcode <= _key.at) ||
|
||||
(_key.squarebricket_left <= charcode && charcode <= _key.apostrof)) {
|
||||
string = string.replace(string[i], escape(string[i]));
|
||||
}
|
||||
}
|
||||
string = string.replace(/(\{|\}|\*)/i, "\\$1");
|
||||
}
|
||||
return string.replace(/script(.*)/g, "");
|
||||
}
|
||||
|
||||
function xssDisplay(string, flag) {
|
||||
string = string.toString();
|
||||
string = string.replace('\\', "");
|
||||
if (typeof flag != "undefined") {
|
||||
return string;
|
||||
}
|
||||
return unescape(string);
|
||||
}
|
||||
|
||||
function clear_feed(flag) {
|
||||
feed.children().remove();
|
||||
if (flag) {
|
||||
feed.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function load_feed(etext){
|
||||
counter = 0;
|
||||
if (options.json_url && maxItems()) {
|
||||
if (options.cache && json_cache_object.get(etext)) {
|
||||
addMembers(etext);
|
||||
bindEvents();
|
||||
} else {
|
||||
getBoxTimeout++;
|
||||
var getBoxTimeoutValue = getBoxTimeout;
|
||||
setTimeout( function() {
|
||||
if (getBoxTimeoutValue != getBoxTimeout) return;
|
||||
$.getJSON(options.json_url, {"tag": xssDisplay(etext)}, function(data) {
|
||||
if (!isactive) return; // prevents opening the selection again after the focus is already off
|
||||
addMembers(etext, data);
|
||||
json_cache_object.set(etext, 1);
|
||||
bindEvents();
|
||||
});
|
||||
}, options.delay);
|
||||
}
|
||||
} else {
|
||||
addMembers(etext);
|
||||
bindEvents();
|
||||
}
|
||||
}
|
||||
|
||||
var options = $.extend({
|
||||
json_url: null,
|
||||
width: 512,
|
||||
cache: false,
|
||||
height: "10",
|
||||
newel: false,
|
||||
addontab: false,
|
||||
addoncomma: false,
|
||||
firstselected: false,
|
||||
filter_case: false,
|
||||
filter_selected: false,
|
||||
filter_begin: false,
|
||||
complete_text: "Start to type...",
|
||||
select_all_text: null,
|
||||
maxshownitems: 30,
|
||||
maxitems: 10,
|
||||
oncreate: null,
|
||||
onselect: null,
|
||||
onremove: null,
|
||||
attachto: null,
|
||||
delay: 350,
|
||||
input_tabindex: 0,
|
||||
input_min_size: 1,
|
||||
input_name: "",
|
||||
bricket: true
|
||||
},
|
||||
opt);
|
||||
|
||||
//system variables
|
||||
var holder = null;
|
||||
var feed = null;
|
||||
var complete = null;
|
||||
var counter = 0;
|
||||
|
||||
var isactive = false;
|
||||
var focuson = null;
|
||||
var deleting = 0;
|
||||
var complete_hover = 1;
|
||||
|
||||
var element = $(this);
|
||||
var elemid = element.attr("id");
|
||||
var getBoxTimeout = 0;
|
||||
|
||||
var json_cache_object = {
|
||||
'set': function (id, val) {
|
||||
var data = element.data("jsoncache");
|
||||
data[id] = val;
|
||||
element.data("jsoncache", data);
|
||||
},
|
||||
'get': function(id) {
|
||||
return element.data("jsoncache")[id] != 'undefined' ? element.data("jsoncache")[id] : null;
|
||||
},
|
||||
'init' : function () {
|
||||
element.data("jsoncache", {});
|
||||
}
|
||||
};
|
||||
|
||||
var _key = { 'enter': 13,
|
||||
'tab': 9,
|
||||
'comma': 188,
|
||||
'backspace': 8,
|
||||
'leftarrow': 37,
|
||||
'uparrow': 38,
|
||||
'rightarrow': 39,
|
||||
'downarrow': 40,
|
||||
'exclamation': 33,
|
||||
'slash': 47,
|
||||
'colon': 58,
|
||||
'at': 64,
|
||||
'squarebricket_left': 91,
|
||||
'apostrof': 96
|
||||
};
|
||||
|
||||
var randomId = function() {
|
||||
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
|
||||
var randomstring = '';
|
||||
for (var i = 0; i < 32; i++) {
|
||||
var rnum = Math.floor(Math.random() * chars.length);
|
||||
randomstring += chars.substring(rnum, rnum + 1);
|
||||
}
|
||||
return randomstring;
|
||||
};
|
||||
|
||||
var cache = {
|
||||
'search': function (text, callback) {
|
||||
var temp = new Array();
|
||||
var regex = new RegExp((options.filter_begin ? '^' : '') + text, (options.filter_case ? "g": "gi"));
|
||||
$.each(element.data("cache"), function (i, _elem) {
|
||||
if (typeof _elem.search === 'function') {
|
||||
if (_elem.search(regex) != -1) {
|
||||
temp.push({'key': i, 'value': _elem});
|
||||
}
|
||||
}
|
||||
});
|
||||
return temp;
|
||||
},
|
||||
'set': function (id, val) {
|
||||
var data = element.data("cache");
|
||||
data[id] = val;
|
||||
element.data("cache", data);
|
||||
},
|
||||
'get': function(id) {
|
||||
return element.data("cache")[id] != 'undefined' ? element.data("cache")[id] : null;
|
||||
},
|
||||
'clear': function() {
|
||||
element.data("cache", {});
|
||||
},
|
||||
'length': function() {
|
||||
return element.data("cache").length;
|
||||
},
|
||||
'init': function () {
|
||||
if (element.data("cache") == 'undefined') {
|
||||
element.data("cache", {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//initialization
|
||||
init();
|
||||
|
||||
//cache initialization
|
||||
json_cache_object.init();
|
||||
cache.init();
|
||||
|
||||
return this;
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
function OpenFCBKValue(value) {
|
||||
var IDparsed = parseInt(value);
|
||||
if (IDparsed) {
|
||||
var xhr = null;
|
||||
if (window.XMLHttpRequest) // Objet de la fenêtre courant
|
||||
{
|
||||
xhr = new XMLHttpRequest(); // Firefox, Safari, ...
|
||||
}
|
||||
else
|
||||
if (window.ActiveXObject) // Version Active
|
||||
{
|
||||
xhr = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer
|
||||
}
|
||||
if (xhr != null) {
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) //réponse reçue du serveur
|
||||
{
|
||||
if (xhr.status == 200) //status http normal
|
||||
{
|
||||
if (xhr.responseText != '') {
|
||||
window.open('manage.aspx?e=' + JSEventID + '&guid=' + xhr.responseText + '&header=0', 'key4register_' + xhr.responseText.replace(new RegExp('(-)', 'g'), '_'));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.open("GET", "API.aspx?op=SearchByID&id=" + encodeURIComponent(IDparsed), true);
|
||||
xhr.send(null);
|
||||
}
|
||||
}
|
||||
}
|
1
key4intranet.front/public/assets/js/jquery/jquery.ui.touch-punch.min.js
vendored
Normal file
1
key4intranet.front/public/assets/js/jquery/jquery.ui.touch-punch.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(2($){$.t.u=\'F\'G v;3(!$.t.u){9}f d=$.H.I.J,h=d.h,i=d.i,6;2 m(e){e.w();e.K()}2 4(a,b){3(a.n.L.M>1){9}a.w();f c=a.n.x[0],o=v.N(\'O\');o.P(b,j,j,k,1,c.Q,c.R,c.S,c.T,7,7,7,7,0,p);a.U.V(o)}d.q=2(a){f b=5;3(6||!b.W(a.n.x[0])){9}b.l=7;k.X(\'y\',m);b.g=Y(2(){6=j;b.g=p;3(!b.l){4(a,\'Z\');4(a,\'z\');4(a,\'10\')}},k.11)};d.r=2(a){5.l=j;3(!6){9}4(a,\'z\')};d.s=2(a){3(5.g){12(5.g);5.g=p}k.13(\'y\',m);3(!6){9}4(a,\'14\');4(a,\'15\');3(!5.l){4(a,\'16\')}6=7};d.h=2(){f a=5;a.A.17({B:$.8(a,\'q\'),C:$.8(a,\'r\'),D:$.8(a,\'s\')});h.E(a)};d.i=2(){f a=5;a.A.18({B:$.8(a,\'q\'),C:$.8(a,\'r\'),D:$.8(a,\'s\')});i.E(a)}})(19);',62,72,'||function|if|simulateMouseEvent|this|touchHandled|false|proxy|return||||||var|_touchStartTimeout|_mouseInit|_mouseDestroy|true|window|_touchMoved|cancelEvent|originalEvent|simulatedEvent|null|_touchStart|_touchMove|_touchEnd|support|touch|document|preventDefault|changedTouches|contextmenu|mousemove|element|touchstart|touchmove|touchend|call|ontouchend|in|ui|mouse|prototype|stopPropagation|touches|length|createEvent|MouseEvents|initMouseEvent|screenX|screenY|clientX|clientY|target|dispatchEvent|_mouseCapture|addEventListener|setTimeout|mouseover|mousedown|touchPunchDelay|clearTimeout|removeEventListener|mouseup|mouseout|click|bind|unbind|jQuery'.split('|'),0,{}))
|
3
key4intranet.front/public/assets/js/modernizr.custom.46699.min.js
vendored
Normal file
3
key4intranet.front/public/assets/js/modernizr.custom.46699.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/*! modernizr 3.6.0 (Custom Build) | MIT *
|
||||
* https://modernizr.com/download/?-touchevents-setclasses !*/
|
||||
!function(e,n,t){function o(e,n){return typeof e===n}function s(){var e,n,t,s,a,i,r;for(var l in c)if(c.hasOwnProperty(l)){if(e=[],n=c[l],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(s=o(n.fn,"function")?n.fn():n.fn,a=0;a<e.length;a++)i=e[a],r=i.split("."),1===r.length?Modernizr[r[0]]=s:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=s),f.push((s?"":"no-")+r.join("-"))}}function a(e){var n=u.className,t=Modernizr._config.classPrefix||"";if(p&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(o,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),p?u.className.baseVal=n:u.className=n)}function i(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):p?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function r(){var e=n.body;return e||(e=i(p?"svg":"body"),e.fake=!0),e}function l(e,t,o,s){var a,l,f,c,d="modernizr",p=i("div"),h=r();if(parseInt(o,10))for(;o--;)f=i("div"),f.id=s?s[o]:d+(o+1),p.appendChild(f);return a=i("style"),a.type="text/css",a.id="s"+d,(h.fake?h:p).appendChild(a),h.appendChild(p),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(n.createTextNode(e)),p.id=d,h.fake&&(h.style.background="",h.style.overflow="hidden",c=u.style.overflow,u.style.overflow="hidden",u.appendChild(h)),l=t(p,e),h.fake?(h.parentNode.removeChild(h),u.style.overflow=c,u.offsetHeight):p.parentNode.removeChild(p),!!l}var f=[],c=[],d={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){c.push({name:e,fn:n,options:t})},addAsyncTest:function(e){c.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=d,Modernizr=new Modernizr;var u=n.documentElement,p="svg"===u.nodeName.toLowerCase(),h=d._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];d._prefixes=h;var m=d.testStyles=l;Modernizr.addTest("touchevents",function(){var t;if("ontouchstart"in e||e.DocumentTouch&&n instanceof DocumentTouch)t=!0;else{var o=["@media (",h.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");m(o,function(e){t=9===e.offsetTop})}return t}),s(),a(f),delete d.addTest,delete d.addAsyncTest;for(var v=0;v<Modernizr._q.length;v++)Modernizr._q[v]();e.Modernizr=Modernizr}(window,document);
|
14
key4intranet.front/public/assets/js/preloadjs.min.js
vendored
Normal file
14
key4intranet.front/public/assets/js/preloadjs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
key4intranet.front/public/assets/js/resizesensor.min.js
vendored
Normal file
1
key4intranet.front/public/assets/js/resizesensor.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('\'1F 1G\';(3(a,b){4(7 11==="3"&&11.1H){11(b)}P 4(7 1f==="Q"){1I.1f=b()}P{a.1J=b()}}(7 G!==\'H\'?G:9,3(){4(7 G==="H"){6 1g}2 B=7 G!=\'H\'&&G.N==N?G:7 12!=\'H\'&&12.N==N?12:1K(\'6 9\')();2 C=B.1L||B.1M||B.1N||3(a){6 B.1O(a,20)};2 D=B.1P||B.1Q||B.1R||3(a){B.1S(a)};3 W(a,b){2 c=13.1T.1U.X(a);2 d=(\'[Q 1V]\'===c||(\'[Q 1W]\'===c)||(\'[Q 1X]\'===c)||(\'[Q 13]\'===c)||(\'H\'!==7 1h&&a 1i 1h)||(\'H\'!==7 1j&&a 1i 1j));2 i=0,j=a.I;4(d){R(;i<j;i++){b(a[i])}}P{b(a)}}3 14(a){4(!a.1k){6{J:a.15,K:a.16}}2 b=a.1k();6{J:N.1l(b.J),K:N.1l(b.K)}}3 L(b,c){13.1Y(c).1Z(3(a){b.Y[a]=c[a]})}2 E=3(y,z){2 A=0;3 1m(){2 q=[];9.17=3(a){q.1n(a)};2 i,j;9.X=3(a){R(i=0,j=q.I;i<j;i++){q[i].X(9,a)}};9.1o=3(a){2 b=[];R(i=0,j=q.I;i<j;i++){4(q[i]!==a)b.1n(q[i])}q=b};9.I=3(){6 q.I}}3 1p(d,e){4(!d)6;4(d.8){d.8.17(e);6}d.8=1q 1m();d.8.17(e);d.5=M.S(\'T\');d.5.21=\'22\';d.5.18=\'19-1a\';2 f={23:\'24\',Z:\'1b\',1r:\'O\',1s:\'O\',25:\'O\',26:\'O\',27:\'1t\',28:\'-1\',29:\'1t\',2a:\'2b%\'};2 g={Z:\'1b\',1r:\'O\',1s:\'O\',2c:\'2d\',};L(d.5,f);2 h=M.S(\'T\');h.18=\'19-1a-2e\';L(h,f);2 i=M.S(\'T\');L(i,g);h.U(i);2 j=M.S(\'T\');j.18=\'19-1a-2f\';L(j,f);2 k=M.S(\'T\');L(k,g);L(k,{J:\'1u%\',K:\'1u%\'});j.U(k);d.5.U(h);d.5.U(j);d.U(d.5);2 l=G.2g(d);2 m=l?l.2h(\'Z\'):1g;4(\'1b\'!==m&&\'1v\'!==m&&\'2i\'!==m&&\'2j\'!==m){d.Y.Z=\'1v\'}2 n=1w;2 o=0;2 p=14(d);2 q=0;2 r=0;2 s=1c;A=0;2 t=3(){2 a=d.15;2 b=d.16;i.Y.J=(a+10)+\'1x\';i.Y.K=(b+10)+\'1x\';h.1y=a+10;h.1z=b+10;j.1y=a+10;j.1z=b+10};2 u=3(){4(s){2 a=d.15===0&&d.16===0;4(a){4(!A){A=C(3(){A=0;u()})}6}P{s=1w}}t()};d.5.V=u;2 v=3(){o=0;4(!n)6;q=p.J;r=p.K;4(d.8){d.8.X(p)}};2 w=3(){p=14(d);n=p.J!==q||p.K!==r;4(n&&!o){o=C(v)}u()};2 x=3(a,b,c){4(a.1A){a.1A(\'2k\'+b,c)}P{a.1B(b,c)}};x(h,\'1C\',w);x(j,\'1C\',w);A=C(3(){A=0;u()})}W(y,3(a){1p(a,z)});9.1d=3(a){4(A){D(A);A=0}E.1d(y,a)};9.1e=3(){4(y.5.V){y.5.V()}}};E.1e=3(b){W(b,3(a){4(b.5.V){a.5.V()}})};E.1d=3(b,c){W(b,3(a){4(!a)6;4(a.8&&7 c==="3"){a.8.1o(c);4(a.8.I())6}4(a.5){4(a.2l(a.5)){a.2m(a.5)}1D a.5;1D a.8}})};4(7 1E!=="H"){2 F=1q 1E(3(a){R(2 i 2n a){4(a.2o(i)){2 b=a[i].2p;R(2 j=0;j<b.I;j++){4(b[j].5){E.1e(b[j])}}}}});M.1B("2q",3(a){F.2r(M.2s,{2t:1c,2u:1c,})})}6 E}));',62,155,'||var|function|if|resizeSensor|return|typeof|resizedAttached|this|||||||||||||||||||||||||||||||||window|undefined|length|width|height|setStyle|document|Math|0px|else|object|for|createElement|div|appendChild|resetSensor|forEachElement|call|style|position||define|self|Object|getElementSize|offsetWidth|offsetHeight|add|className|resize|sensor|absolute|true|detach|reset|exports|null|jQuery|instanceof|Elements|getBoundingClientRect|round|EventQueue|push|remove|attachResizeEvent|new|left|top|hidden|200|relative|false|px|scrollLeft|scrollTop|attachEvent|addEventListener|scroll|delete|MutationObserver|use|strict|amd|module|ResizeSensor|Function|requestAnimationFrame|mozRequestAnimationFrame|webkitRequestAnimationFrame|setTimeout|cancelAnimationFrame|mozCancelAnimationFrame|webkitCancelAnimationFrame|clearTimeout|prototype|toString|Array|NodeList|HTMLCollection|keys|forEach||dir|ltr|pointerEvents|none|right|bottom|overflow|zIndex|visibility|maxWidth|100|transition|0s|expand|shrink|getComputedStyle|getPropertyValue|fixed|sticky|on|contains|removeChild|in|hasOwnProperty|addedNodes|DOMContentLoaded|observe|body|childList|subtree'.split('|'),0,{}))
|
666
key4intranet.front/public/assets/js/scripts.js
Normal file
666
key4intranet.front/public/assets/js/scripts.js
Normal file
@@ -0,0 +1,666 @@
|
||||
/*
|
||||
/*
|
||||
==============================================================================================
|
||||
--------------------------| |--------------------------
|
||||
--------------------------| JS / Key4events 2020 |--------------------------
|
||||
--------------------------| |--------------------------
|
||||
==============================================================================================
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* -------------------- Variables/fonctions globales -------------------- */
|
||||
|
||||
var leftMenu,
|
||||
carousel, checkFlickity,
|
||||
checkScrollable, checkExpandableH,
|
||||
MenuERP,
|
||||
infopanel,
|
||||
StatsTiles,
|
||||
ScrollNav,
|
||||
StickyObserver,
|
||||
windowRS,
|
||||
createPopover,
|
||||
popover,
|
||||
createModal,
|
||||
modal,
|
||||
istouch = !$('html').is('.no-touchevents'),
|
||||
userAgent = navigator.userAgent || navigator.vendor || window.opera,
|
||||
isiOS = /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream,
|
||||
isiPhone = /iPhone/.test(userAgent) && !window.MSStream,
|
||||
isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);
|
||||
|
||||
|
||||
function extend(a, b) {
|
||||
for(var key in b) {
|
||||
if(b.hasOwnProperty(key)) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
/* -------------------- Détection de Safari sur iPhone (gestion spécifique du menu bottom sticky) -------------------- */
|
||||
|
||||
if (isiPhone && isSafari) {
|
||||
$('html').addClass('isiPhone');
|
||||
originalVH = window.innerHeight;
|
||||
$(window).on('resize', function () {
|
||||
let isportrait = orientation => {
|
||||
switch (orientation) {
|
||||
case 90:
|
||||
case -90:
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
$('body').toggleClass('noiOSbottombar', (isportrait(window.orientation) && window.innerHeight != originalVH));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------- Ouverture/fermeture des menus gauche/droite -------------------- */
|
||||
|
||||
$('header .profile a, a.close-profile').click(function(e) {
|
||||
$('body').toggleClass('show-profile');
|
||||
if ($('body').hasClass('show-profile')) $('aside.profile > div').scrollTop(0);
|
||||
});
|
||||
$('header a.menu-left-trigger, a.close-menu-left').click(function(e) {
|
||||
$('body').toggleClass('show-menu-left');
|
||||
if ($('body').hasClass('show-params-left')) $('body').removeClass('show-params-left');
|
||||
if ($('body').hasClass('show-menu-left')) {
|
||||
$('.menu-params, .menu-left > div').scrollTop(0);
|
||||
} else if ($('#erp-menu').length > 0) MenuERP.reInit();
|
||||
});
|
||||
$('a.params, a.close-params-left').click(function(e) {
|
||||
$('body').toggleClass('show-params-left');
|
||||
});
|
||||
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode == 27)
|
||||
$('body')
|
||||
.removeClass('show-profile')
|
||||
.removeClass('show-menu-left')
|
||||
.removeClass('show-params-left');
|
||||
});
|
||||
|
||||
var checkLeftMenus = function (w) {
|
||||
if (w < 768) {
|
||||
if ($('body').is('.show-params-left:not(.show-menu-left)')) $('body').addClass('show-menu-left');
|
||||
} else {
|
||||
if ($('body').is('.show-params-left.show-menu-left')) $('body').removeClass('show-menu-left');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* -------------------- Caroussels Flickity -------------------- */
|
||||
|
||||
Flickity.prototype._createResizeClass = function() {
|
||||
this.element.classList.add('flickity-autoheight');
|
||||
};
|
||||
Flickity.createMethods.push('_createResizeClass');
|
||||
|
||||
var resize = Flickity.prototype.resize;
|
||||
Flickity.prototype.resize = function() {
|
||||
this.element.classList.remove('flickity-autoheight');
|
||||
resize.call(this);
|
||||
this.element.classList.add('flickity-autoheight');
|
||||
};
|
||||
|
||||
if ($('.x-carousel').length > 0) {
|
||||
var tapArea, startX, arrows;
|
||||
tapArea = document.querySelectorAll('.isflickity');
|
||||
startX = 0;
|
||||
|
||||
for (var item of tapArea) {
|
||||
item.ontouchstart = function(e) {
|
||||
startX = e.touches[0].clientX;
|
||||
};
|
||||
item.ontouchmove = function(e) {
|
||||
if (Math.abs(e.touches[0].clientX - startX) > 25 && e.cancelable) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
checkFlickity = function(obj) {
|
||||
var container = $(obj[0].element).closest('.x-carousel'),
|
||||
btns = $(obj[0].element).find('.flickity-prev-next-button'),
|
||||
draggabledlimit = container.attr('flickity-draggableunder'),
|
||||
flickity = container.find('.isflickity'),
|
||||
enabledlimit = container.attr('flickity-disabledover');
|
||||
container.addClass('flickity-ready');
|
||||
if (obj[0].size.width < obj[0].slideableWidth) btns.show();
|
||||
else btns.hide();
|
||||
if (draggabledlimit && draggabledlimit <= window.innerWidth) {
|
||||
obj[0].options.draggable = false;
|
||||
obj[0].updateDraggable();
|
||||
} else {
|
||||
obj[0].options.draggable = '>1';
|
||||
obj[0].updateDraggable();
|
||||
}
|
||||
if (enabledlimit && enabledlimit <= window.innerWidth) {
|
||||
container.addClass('flickity-disabled');
|
||||
if (flickity.data('flickity') && flickity.data('flickity').selectedIndex != 0)
|
||||
flickity.flickity('select', 0);
|
||||
}
|
||||
else container.removeClass('flickity-disabled');
|
||||
}
|
||||
|
||||
carousel =
|
||||
$('.isflickity').flickity({
|
||||
cellAlign: 'left',
|
||||
contain: true,
|
||||
pageDots: false,
|
||||
groupCells: false,
|
||||
resize: false,
|
||||
arrowShape: {
|
||||
x0: 10,
|
||||
x1: 50, y1: 80,
|
||||
x2: 60, y2: 80,
|
||||
x3: 20
|
||||
},
|
||||
on: {
|
||||
ready: function() {
|
||||
if ($(this.element).parents('.x-carousel').hasClass('flickity-freescroll'))
|
||||
$(this)[0].options.freeScroll = true;
|
||||
checkFlickity($(this));
|
||||
if ($(this.element).parents('.flickity-array').length > 0 && isiOS)
|
||||
$('html').addClass('noadvancedSticky');
|
||||
},
|
||||
change: function() {
|
||||
var expanded = $(this.element).find('.showall');
|
||||
if (expanded.length > 0) {
|
||||
$(this.element).find('.showall').removeClass('showall');
|
||||
$(window).scrollTop($(this.element).offset().top - 100);
|
||||
}
|
||||
},
|
||||
settle: function() {
|
||||
if ($(this.element).parents('.flickity-array').length == 0 && $(this.element).parents('.flickity-freescroll').length == 0)
|
||||
$(this.element).flickity('resize');
|
||||
},
|
||||
scroll: function() {
|
||||
if ($(this.element).parents('.flickity-array').length > 0)
|
||||
$('[data-toggle="popover"][aria-describedby]').each(function() {
|
||||
$(this).popover('hide');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.fonts.ready.then(function() {
|
||||
$.each(carousel, function(id, obj) {
|
||||
$(obj).flickity('resize');
|
||||
if ($(obj).hasClass('nav') && $(obj).find('.active').length > 0)
|
||||
$(obj).flickity('select', $(obj).find('.active').parent().index());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------- Gestion de la propriété "overflow" du menu droite -------------------- */
|
||||
|
||||
$('aside.profile')
|
||||
.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() {
|
||||
if ($('body').hasClass('show-profile')) $(this).addClass('opened');
|
||||
else $(this).removeClass('opened');
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Positionnement du lien "Support technique" -------------------- */
|
||||
|
||||
if ($('li.link-support').length > 0) {
|
||||
var lastEntry = $('li.link-support').closest('ul').prev(),
|
||||
lastY = lastEntry.offset().top + lastEntry.height() - 30,
|
||||
maxMargin = window.innerHeight - $('.menu-left').offset().top - lastY;
|
||||
$('li.link-support').css('margin-top', Math.max(40, maxMargin));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------- Gestion des évènements sur le layout liés au scroll -------------------- */
|
||||
|
||||
var prevScrollpos,
|
||||
scrollchange,
|
||||
lastScrollpos = 0,
|
||||
lastScrollmargin = 100;
|
||||
|
||||
document.addEventListener('scroll', function(e){
|
||||
checkScroll()
|
||||
}, this.supportsPassive ? { passive: true } : false);
|
||||
|
||||
function checkScroll() {
|
||||
let currentScrollPos = window.pageYOffset,
|
||||
scrollingdown = (prevScrollpos < currentScrollPos),
|
||||
ismobile = window.innerWidth < 992,
|
||||
hideheader = ismobile && currentScrollPos > 300,
|
||||
exceeding = (currentScrollPos + window.innerHeight) > $(document).height();
|
||||
if (exceeding) return;
|
||||
if (scrollingdown) {
|
||||
if (hideheader)
|
||||
$('body').addClass('hideheader');
|
||||
}
|
||||
else {
|
||||
if (currentScrollPos < (lastScrollpos - lastScrollmargin)) {
|
||||
$('body').removeClass('hideheader');
|
||||
}
|
||||
}
|
||||
if (scrollingdown == !$('body').hasClass('scrolldown')) {
|
||||
lastScrollpos = currentScrollPos;
|
||||
scrollchange = document.dispatchEvent(new CustomEvent('scrollchange', { detail: { dir: (scrollingdown) ? 'down' : 'up', pos: currentScrollPos }}));
|
||||
}
|
||||
$('body').toggleClass('scrolldown', scrollingdown);
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------- Instanciation de la navigation par système de scroll -------------------- */
|
||||
|
||||
if ($('#scrollnav').length > 0)
|
||||
ScrollNav = new Scrollnav({
|
||||
container: 'body',
|
||||
context: 'article',
|
||||
selector: '#scrollnav'
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Instanciation du suivi des éléments "sticky" -------------------- */
|
||||
|
||||
if ($('.sticky').length > 0)
|
||||
StickyObserver = new Stickyobserver({
|
||||
container: 'html, body',
|
||||
selector: '.sticky',
|
||||
stucked: 'is-stuck'
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Menu ERP -------------------- */
|
||||
|
||||
if ($('#erp-menu').length > 0)
|
||||
MenuERP = new Slidemenu({
|
||||
id: '#erp-menu',
|
||||
lang: {
|
||||
'addfav': 'Ajouter à mes favoris',
|
||||
'delfav': 'Supprimer de mes favoris',
|
||||
'confirm': 'Êtes-vous sûr(e) de vouloir supprimer ce lien de vos favoris ?',
|
||||
'empty': 'Vous n\'avez défini aucun favori',
|
||||
'cancel': 'Annuler',
|
||||
'delete': 'Supprimer'
|
||||
},
|
||||
favorites: {
|
||||
selector: '.favorites',
|
||||
toggler: '.toggle-favorites a',
|
||||
onChange: function (e) {
|
||||
console.log('Les favoris ont été modifiés (' + e.action + ')');
|
||||
switch (e.action) {
|
||||
case 'reorder' :
|
||||
break;
|
||||
case 'added' :
|
||||
infopanel.add({
|
||||
bgcolor: 'success',
|
||||
hideafter: 2000,
|
||||
content: 'Le favori a bien été ajouté.'
|
||||
});
|
||||
break;
|
||||
case 'removed' :
|
||||
infopanel.add({
|
||||
bgcolor: 'success',
|
||||
hideafter: 2000,
|
||||
content: 'Le favori a bien été supprimé.'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Menu ERP -------------------- */
|
||||
|
||||
if ($('body').is('.erp:not(.dashboard)') && $('.subheader #options').length > 0)
|
||||
$('.subheader #options')
|
||||
.on('show.bs.collapse', function () {
|
||||
$('.subheader h1').removeClass('text-truncate');
|
||||
})
|
||||
.on('hide.bs.collapse', function () {
|
||||
$('.subheader h1').addClass('text-truncate');
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Panneau d'information (top) -------------------- */
|
||||
|
||||
infopanel = new Infopanel({
|
||||
position: 'top'
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Gestion des blocs extensibles dans Flickity -------------------- */
|
||||
|
||||
checkScrollable = function (obj) {
|
||||
if (checkExpandableH(obj)) obj.find('.toggle-fullH').removeClass('d-none');
|
||||
else obj.find('.toggle-fullH').addClass('d-none');
|
||||
}
|
||||
checkExpandableH = function (obj) {
|
||||
return (obj.height() < obj[0].scrollHeight);
|
||||
}
|
||||
$('.expandable').each(function() {
|
||||
var $this = $(this);
|
||||
$(this).find('.toggle-fullH')
|
||||
.click(function(e) {
|
||||
$(this)
|
||||
.closest('.expandable')
|
||||
.toggleClass('showall')
|
||||
.closest('.isflickity').flickity('resize');
|
||||
if (!$(this).closest('.expandable').hasClass('showall') && $(this).closest('.isflickity').data('flickity').isDraggable)
|
||||
$(window).scrollTop($(this).closest('.isflickity').offset().top - 100);
|
||||
});
|
||||
new ResizeSensor($(this), function() {
|
||||
checkScrollable($this);
|
||||
});
|
||||
});
|
||||
|
||||
$('.sticky').each(function() {
|
||||
$(this).parent().addClass('has-sticky');
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Instanciation de bootstrap-select (champs select enrichis) -------------------- */
|
||||
|
||||
if ($('.bs-select').length > 0)
|
||||
$('.bs-select').selectpicker({
|
||||
style: '',
|
||||
styleBase: 'form-control custom-select',
|
||||
tickIcon: 'far fa-md fa-check text-white',
|
||||
selectedTextFormat: 'count'
|
||||
})
|
||||
|
||||
|
||||
|
||||
/* -------------------- Tooltips Bootstrap -------------------- */
|
||||
|
||||
$('[data-toggle="tooltip"]')
|
||||
.tooltip({
|
||||
delay: {
|
||||
'show': 500,
|
||||
'hide': 100
|
||||
}
|
||||
})
|
||||
.click(function(e) {
|
||||
$(this).tooltip('hide');
|
||||
});
|
||||
|
||||
if (istouch) {
|
||||
$(document)
|
||||
.on('show.bs.tooltip', '[data-toggle="tooltip"]', function(e){
|
||||
$(this).tooltip('dispose');
|
||||
$(this).trigger('click');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------- Popovers Bootstrap -------------------- */
|
||||
|
||||
if (istouch) $('[data-toggle="popover"][data-trigger="hover"]').removeAttr('data-trigger');
|
||||
|
||||
$(document)
|
||||
.on('click mouseover', '[data-toggle="popover"]', function(e) {
|
||||
let $this = this,
|
||||
popover = ($(this).data('bs.popover')) ? $(this).data('bs.popover').tip : null;
|
||||
if ($(this).attr('aria-describedby')) {
|
||||
clearTimeout(popover.hidepopoverTo);
|
||||
return;
|
||||
}
|
||||
if ((e.type == 'mouseover' && $(this).attr('data-trigger') == 'hover') || e.type == 'click') {
|
||||
if ($('[data-toggle="popover"][aria-describedby]').length > 0)
|
||||
$('[data-toggle="popover"][aria-describedby]').popover('hide');
|
||||
popover = createPopover($(this), {
|
||||
'title': '<h3 class="text">' + $(this).attr('title') + '</h3>',
|
||||
'content': $($this).attr('data-content') || {url: $($this).attr('data-extcontent')}
|
||||
});
|
||||
}
|
||||
})
|
||||
.on('mouseleave', '[data-toggle="popover"]', function(e) {
|
||||
let $this = this,
|
||||
timer = ($(this).attr('data-trigger') == 'hover') ? 300 : 1000;
|
||||
popover = ($(this).data('bs.popover')) ? $(this).data('bs.popover').tip : null;
|
||||
if (popover) {
|
||||
clearTimeout(popover.hidepopoverTo);
|
||||
popover.hidepopoverTo = setTimeout(function(){
|
||||
$($this).popover('hide');
|
||||
}, timer);
|
||||
}
|
||||
});
|
||||
|
||||
$(document)
|
||||
.on('mouseleave', '.popover', function (e) {
|
||||
let $this = this,
|
||||
source = $('[aria-describedby="' + $(this).attr('id') + '"]'),
|
||||
timer = (source.attr('data-trigger') == 'hover') ? 300 : 1000;
|
||||
clearTimeout(this.hidepopoverTo);
|
||||
if ($(this).find('*:focus').is(':input')) return;
|
||||
this.hidepopoverTo = setTimeout(function(){
|
||||
$($this).popover('hide');
|
||||
}, timer);
|
||||
})
|
||||
.on('mouseenter', '.popover', function (e) {
|
||||
clearTimeout(this.hidepopoverTo);
|
||||
});
|
||||
|
||||
createPopover = function (source, ctn) {
|
||||
isext = ctn.content.constructor === Object;
|
||||
return source.popover({
|
||||
trigger: 'manual',
|
||||
html: true,
|
||||
sanitize: false,
|
||||
boundary: 'viewport',
|
||||
content: function () {
|
||||
return $(this).attr('data-content') || '<span class="loader"><div class="spin"></div></span>';
|
||||
},
|
||||
template: '<div class="popover">' +
|
||||
'<div class="arrow"></div>' +
|
||||
'<div class="popover-header text-truncate"></div>' +
|
||||
'<div class="popover-body"></div>' +
|
||||
'<div class="popover-footer"></div>' +
|
||||
'</div>'
|
||||
})
|
||||
.on('shown.bs.popover', function () {
|
||||
let $this = $(this),
|
||||
exturl = ($(this).attr('data-extcontent')) ? $(this).attr('data-extcontent') : null,
|
||||
content = $($(this).data('bs.popover').tip).find('.popover-body');
|
||||
if (exturl)
|
||||
content.load(exturl, function() {
|
||||
let action = $(this).find('.popover-action'),
|
||||
hasaction = action.length > 0;
|
||||
if (hasaction)
|
||||
$('.popover-footer').html(action);
|
||||
$this.popover('update');
|
||||
});
|
||||
})
|
||||
.popover('show');
|
||||
};
|
||||
|
||||
$('body *')
|
||||
.on('mousedown', function(e) {
|
||||
if ($('[data-toggle="popover"][aria-describedby]').length > 0 && !$(e.target).parents('.popover').length > 0) {
|
||||
e.stopPropagation();
|
||||
$('[data-toggle="popover"][aria-describedby]').each(function() {
|
||||
$(this).popover('hide');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Modales Boostrap -------------------- */
|
||||
|
||||
$(document)
|
||||
.on('click', '[data-toggle="modal"]', function(e) {
|
||||
var $this = this;
|
||||
if (modal) modal.modal('hide');
|
||||
modal = createModal('modal', $(this).attr('data-modal-size'), {
|
||||
'title': '<h3 class="text">' + $(this).attr('title') + '</h3>',
|
||||
'content': $($this).attr('data-content') || {url: $($this).attr('data-extcontent')}
|
||||
});
|
||||
});
|
||||
|
||||
createModal = function (id, size='md', ctn) {
|
||||
isext = ctn.content.constructor === Object;
|
||||
var header = $('<div class="modal-header"/>')
|
||||
.append(ctn.title)
|
||||
.append('<button type="button" class="close" data-dismiss="modal" aria-label="Close">'
|
||||
+ '<span aria-hidden="true">×</span>'
|
||||
+ '</button>');
|
||||
content = $('<div class="modal-body"/>')
|
||||
.append((!isext)
|
||||
? (/<\/?[a-z][\s\S]*>/i.test(ctn.content))
|
||||
? $(ctn.content)
|
||||
: ctn.content
|
||||
: '<span class="loader"><div class="spin"></div></span>'
|
||||
),
|
||||
footer = $('<div class="modal-footer"/>')
|
||||
.append(ctn.footer),
|
||||
body = $('<div class="modal-content p-2"/>')
|
||||
.append(header)
|
||||
.append(content)
|
||||
.append(footer),
|
||||
dialog = $('<div class="modal-dialog modal-dialog-centered modal-' + size + '" role="document"/>')
|
||||
.append(body),
|
||||
modal = $('<div class="modal fade" id="' + id + '" tabindex="-1" role="dialog" aria-hidden="true"/>')
|
||||
.append(dialog);
|
||||
modal.modal().on('hidden.bs.modal', function (e) {
|
||||
$(this)
|
||||
.data('bs.modal', null)
|
||||
.remove();
|
||||
});
|
||||
if (ctn.content.constructor === Object)
|
||||
content.load(ctn.content.url, function() {
|
||||
|
||||
if (body.find('.bs-select').length > 0)
|
||||
body.find('.bs-select').selectpicker({
|
||||
style: '',
|
||||
styleBase: 'form-control custom-select',
|
||||
tickIcon: 'far fa-md fa-check text-white',
|
||||
selectedTextFormat: 'count'
|
||||
})
|
||||
})
|
||||
return modal.appendTo('body');
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* -------------------- Actions à effectuer au resize (wrapper & article) -------------------- */
|
||||
|
||||
var wrapperRS = new ResizeSensor($('.wrapper, article'), function(){
|
||||
let w = window.innerWidth;
|
||||
if ($('nav.menu-left').length > 0)
|
||||
checkLeftMenus(w);
|
||||
$('.isflickity').each(function() {
|
||||
//checkFlickity($(this).flickity('resize'));
|
||||
$(this).flickity('resize');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/* ======================================== Eléments de test ======================================== */
|
||||
|
||||
|
||||
/* -------------------- Test de saisie erronée (login) -------------------- */
|
||||
|
||||
$('body.login form').submit(function() {
|
||||
$(this).parents('.card').addClass('haserror');
|
||||
$(this).find('input').addClass('is-invalid');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Test de saisie erronée (login) -------------------- */
|
||||
|
||||
$('body.login form').submit(function() {
|
||||
$(this).parents('.card').addClass('haserror');
|
||||
$(this).find('input').addClass('is-invalid');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Test (coordonnées : passage en mode "édition") -------------------- */
|
||||
|
||||
$('aside.profile a.modify, aside.profile a.valid, aside.profile a.cancel').click(function() {
|
||||
$(this).parents('form')
|
||||
.toggleClass('readonly')
|
||||
.find('input, select').each(function() {
|
||||
if ($(this).attr('disabled'))
|
||||
$(this).removeAttr('disabled');
|
||||
else
|
||||
$(this).attr('disabled', 'disabled');
|
||||
if ($(this).hasClass('bs-select')) $(this).selectpicker('refresh');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* -------------------- Test menu gauche (développement / réduction) -------------------- */
|
||||
|
||||
if ($('body').is('.esp-cl')) {
|
||||
$('nav.menu-left a.toggler').click(function() {
|
||||
$('body').toggleClass('reduced-menu-left');
|
||||
});
|
||||
}
|
||||
if ($('body').is('.erp')) {
|
||||
var menuswapTo;
|
||||
$('nav.menu-left')
|
||||
.mouseenter(function() {
|
||||
clearTimeout(menuswapTo);
|
||||
if ($('body').hasClass('pinned-menu-left')) return false;
|
||||
if ($('body').hasClass('reduced-menu-left'))
|
||||
menuswapTo = setTimeout(function() {
|
||||
$('body').toggleClass('reduced-menu-left')
|
||||
}, 200);
|
||||
})
|
||||
.mouseleave(function() {
|
||||
clearTimeout(menuswapTo);
|
||||
if ($('body').hasClass('pinned-menu-left')) return false;
|
||||
if (!$('body').hasClass('reduced-menu-left'))
|
||||
menuswapTo = setTimeout(function() {
|
||||
$('body').toggleClass('reduced-menu-left');
|
||||
}, 750);
|
||||
})
|
||||
.find('a.toggler')
|
||||
.click(function() {
|
||||
$('body')
|
||||
.addClass('reduced-menu-left')
|
||||
.toggleClass('pinned-menu-left');
|
||||
clearTimeout(menuswapTo);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
175
key4intranet.front/public/assets/js/scrollnav.js
Normal file
175
key4intranet.front/public/assets/js/scrollnav.js
Normal file
@@ -0,0 +1,175 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- Scrollnav -------------------- */
|
||||
|
||||
function Scrollnav(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
Scrollnav.prototype.options = {
|
||||
defaultoffset: 40
|
||||
};
|
||||
|
||||
Scrollnav.prototype._init = function() {
|
||||
this.container = $(this.options.container);
|
||||
this.context = $(this.options.context);
|
||||
this.scrollnav = $(this.options.selector);
|
||||
this.scrolllinks = this.scrollnav.find('a');
|
||||
this.defaultoffset = this.options.defaultoffset;
|
||||
this.closebtn = this.scrollnav.find('.close-scrollnav');
|
||||
this.context.addClass('sticky-nav');
|
||||
this.checkMobileoffset();
|
||||
this.item = this.container.scrollspy({
|
||||
target: this.options.selector
|
||||
});
|
||||
this.scrollnavchecker = new ScrollnavChecker({
|
||||
scrollnav: this
|
||||
});
|
||||
};
|
||||
|
||||
Scrollnav.prototype._initEvents = function() {
|
||||
var $this = this,
|
||||
scrollnavTo;
|
||||
|
||||
$(document)
|
||||
.on('updatescrollnavoffset', function(e) {
|
||||
$this.updateScrollnavOffset(
|
||||
(e.detail)
|
||||
? e.detail
|
||||
: $this.defaultoffset
|
||||
);
|
||||
});
|
||||
|
||||
this.scrollnav
|
||||
.on('mouseenter mouseleave click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
clearTimeout(scrollnavTo);
|
||||
})
|
||||
.on('mouseenter click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
let $this = $(this);
|
||||
if (!istouch)
|
||||
scrollnavTo = setTimeout(function() {
|
||||
$this.addClass('hover');
|
||||
}, 250);
|
||||
else $this.addClass('hover');
|
||||
})
|
||||
.on('mouseleave', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
let $this = $(this);
|
||||
if (!istouch)
|
||||
scrollnavTo = setTimeout(function() {
|
||||
$this.removeClass('hover');
|
||||
}, 500);
|
||||
else $this.removeClass('hover');
|
||||
});
|
||||
|
||||
this.closebtn.click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
clearTimeout(scrollnavTo);
|
||||
$this.scrollnav.removeClass('hover');
|
||||
});
|
||||
|
||||
this.scrolllinks
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($this.scrollnav.hasClass('hover')) {
|
||||
let href = $(this).attr('href');
|
||||
if(/^#/.test(href)) {
|
||||
$('html, body').animate({scrollTop: $(href).offset().top - $this.getScrollnavOffset($(href)) + 1}, 500);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.rs = new ResizeSensor(this.context, function(){
|
||||
$this.checkMobileoffset();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
Scrollnav.prototype.checkMobileoffset = function() {
|
||||
var $this = this;
|
||||
setTimeout(function() {
|
||||
$this.mobileoffset = (window.innerWidth < 992) ? ($('.subheader').outerHeight(true) + 14) : 0;
|
||||
}, 400);
|
||||
|
||||
};
|
||||
|
||||
Scrollnav.prototype.getScrollnavOffset = function(href) {
|
||||
let offset,
|
||||
issticky = href.hasClass('has-sticky'),
|
||||
stickyparent = href.parents('.has-sticky'),
|
||||
topPos = href.offset().top,
|
||||
stickymargin =
|
||||
(issticky)
|
||||
? 0
|
||||
: ((stickyparent.length > 0)
|
||||
? stickyparent.find('.sticky').outerHeight(true) + Math.abs(parseInt(stickyparent.find('.sticky').css('margin-top')))
|
||||
: this.defaultoffset),
|
||||
ismobile = (window.innerWidth < 992),
|
||||
scrollup = (topPos < window.pageYOffset || (topPos - stickymargin) < 400),
|
||||
mobilemargin = (!ismobile || (!scrollup && ismobile)) ? 0 : this.mobileoffset;
|
||||
offset = Math.max(stickymargin, mobilemargin);
|
||||
return (offset);
|
||||
};
|
||||
|
||||
Scrollnav.prototype.updateScrollnavOffset = function(offset) {
|
||||
this.item.data()['bs.scrollspy']._config.offset = Math.max(offset, this.scrollnavchecker.mobileoffset);
|
||||
this.item.scrollspy('refresh');
|
||||
};
|
||||
|
||||
window.Scrollnav = Scrollnav;
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------- Scrollnavchecker -------------------- */
|
||||
|
||||
function ScrollnavChecker(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
ScrollnavChecker.prototype._init = function() {
|
||||
this.scrollnav = this.options.scrollnav;
|
||||
this.mobileoffset = (window.innerWidth < 992) ? this.scrollnav.mobileoffset : 0;
|
||||
};
|
||||
|
||||
ScrollnavChecker.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
$(document)
|
||||
.on('scrollchange', function(e) {
|
||||
$this.check(e.detail.dir, e.detail.pos);
|
||||
});
|
||||
};
|
||||
|
||||
ScrollnavChecker.prototype.check = function(dir, pos) {
|
||||
this.ismobile = window.innerWidth < 992;
|
||||
this.hideheader = this.ismobile && pos > 400;
|
||||
this.mobileoffset = (this.ismobile)
|
||||
? ((dir == 'down' && this.hideheader) ? 0 : this.scrollnav.mobileoffset)
|
||||
: 0;
|
||||
this.scrollnav.updateScrollnavOffset(
|
||||
($('.is-stuck').length > 0)
|
||||
? $('.is-stuck').outerHeight(true) + Math.abs(parseInt($('.is-stuck').css('margin-top')))
|
||||
: this.scrollnav.defaultoffset
|
||||
);
|
||||
};
|
||||
|
||||
window.ScrollnavChecker = ScrollnavChecker;
|
||||
|
||||
|
||||
})(window);
|
172
key4intranet.front/public/assets/js/sidelist.js
Normal file
172
key4intranet.front/public/assets/js/sidelist.js
Normal file
@@ -0,0 +1,172 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- SideList -------------------- */
|
||||
|
||||
function SideList(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
SideList.prototype.options = {};
|
||||
|
||||
SideList.prototype._init = function() {
|
||||
this.id = this.options.id;
|
||||
this.list = $(this.options.list);
|
||||
this.context = $(this.options.context);
|
||||
this.wrapper = $(this.options.list + '> div');
|
||||
this.detail = $(this.options.detail);
|
||||
this.toggler = $(this.options.toggler);
|
||||
this.togglerTooltip = this.toggler.find('i');
|
||||
this.subheader = $('.subheader'),
|
||||
this.footer = $('footer'),
|
||||
this.persistenthidden = false;
|
||||
this.opened = $('body').hasClass('show-sidelist');
|
||||
this.mobilelimit = 992;
|
||||
this.persistentOver = this.options.persistentOver;
|
||||
this.ispersistent = false;
|
||||
this.transitioning = false;
|
||||
this.ready = false;
|
||||
};
|
||||
|
||||
SideList.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
this.toggler
|
||||
.click(function(e) {
|
||||
$this.transitioning = true;
|
||||
$this.toggle(!$this.opened);
|
||||
});
|
||||
this.list
|
||||
.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() {
|
||||
$this.transitioning = false;
|
||||
});
|
||||
};
|
||||
|
||||
SideList.prototype.toggle = function(status) {
|
||||
this.check('toggle');
|
||||
if (this.ispersistent) {
|
||||
this.list.toggleClass('persistent-hidden', !this.persistenthidden);
|
||||
this.persistenthidden = !this.persistenthidden;
|
||||
} else {
|
||||
$('body').toggleClass('show-sidelist', !this.opened)
|
||||
this.opened = status;
|
||||
}
|
||||
this.set();
|
||||
};
|
||||
|
||||
SideList.prototype.set = function() {
|
||||
var $this = this;
|
||||
$('body')
|
||||
.toggleClass('noscroll', this.opened && !this.ispersistent)
|
||||
.css('top',
|
||||
(this.opened && !this.ispersistent)
|
||||
? -Math.abs(
|
||||
Math.min(
|
||||
((this.memState)
|
||||
? this.memState.scroll
|
||||
: 0
|
||||
),
|
||||
this.params.bodyH - this.params.winH
|
||||
)
|
||||
)
|
||||
: 0
|
||||
);
|
||||
if (this.memState)
|
||||
$('html, body').animate({scrollTop: this.memState.scroll}, 0, function() {
|
||||
$('body').toggleClass('hideheader', !$this.memState.header);
|
||||
});
|
||||
if (!this.ready) {
|
||||
this.ready = true;
|
||||
this.list.addClass('ready');
|
||||
if (this.list.find('li.active').length > 0)
|
||||
this.list.find('> div').animate({scrollTop: this.list.find('li.active')[0].offsetTop - 90}, 500);
|
||||
}
|
||||
if (this.ispersistent && !this.persistenthidden)
|
||||
$('body').removeClass('show-sidelist');
|
||||
else if (this.opened)
|
||||
$('body').addClass('show-sidelist');
|
||||
};
|
||||
|
||||
SideList.prototype.getParams = function(source) {
|
||||
var $this = this;
|
||||
this.params = {
|
||||
'scrolltop': $(window).scrollTop(),
|
||||
'winW': window.innerWidth,
|
||||
'winH': window.innerHeight,
|
||||
'bodyH': $('body').height(),
|
||||
'maxH': Math.round(Math.max((window.innerHeight - $this.detail.offset().top), $this.detail.innerHeight())),
|
||||
'contextW': $this.context.width(),
|
||||
'wrapperW': Math.round($this.wrapper.outerWidth(true)),
|
||||
'posY': $this.detail.offset().top - $(window).scrollTop(),
|
||||
'header': !$('body').hasClass('hideheader'),
|
||||
'subheaderH': $this.subheader.outerHeight(true),
|
||||
'footerOffT': $this.footer.offset().top
|
||||
}
|
||||
this.scrollbarM = ($(document).height() > $(window).height()) ? 20 : 0;
|
||||
this.ispersistent = (this.params.contextW - this.wrapper.find('> div').outerWidth(true) + this.scrollbarM) >= this.persistentOver;
|
||||
if (((!this.opened || this.ispersistent) && source == 'toggle') || (this.ispersistent && this.params.winW >= this.mobilelimit))
|
||||
this.memState = {
|
||||
scroll: this.params.scrolltop,
|
||||
header: this.params.header
|
||||
};
|
||||
};
|
||||
|
||||
SideList.prototype.check = function(source) {
|
||||
var $this = this,
|
||||
timer = (source == 'toggle') ? 0 : 100;
|
||||
$this.getParams(source);
|
||||
if (this.checkTo) clearTimeout(this.checkTo);
|
||||
this.checkTo = setTimeout(function() {
|
||||
$this.list.toggleClass('persistent', $this.ispersistent);
|
||||
$this.setStyles($this.getPaddingTop(), $this.getPaddingBottom(), $this.params.wrapperW, $this.params.maxH);
|
||||
$this.set();
|
||||
if ($this.list.find('li.active').length > 0 && ((!$this.ispersistent && $this.opened) || ($this.ispersistent && !$this.persistenthidden)))
|
||||
$this.list.find('> div').animate({scrollTop: $this.list.find('li.active')[0].offsetTop - 90}, 500);
|
||||
}, timer);
|
||||
};
|
||||
|
||||
SideList.prototype.getPaddingTop = function() {
|
||||
let pT =
|
||||
Math.max(
|
||||
this.params.posY - 30,
|
||||
((!this.params.header || this.params.winW >= this.mobilelimit)
|
||||
? 0
|
||||
: this.params.subheaderH
|
||||
)
|
||||
);
|
||||
return pT;
|
||||
};
|
||||
|
||||
SideList.prototype.getPaddingBottom = function() {
|
||||
let pB =
|
||||
Math.abs(
|
||||
Math.round(
|
||||
Math.min(
|
||||
(this.params.footerOffT - this.params.scrolltop - this.params.winH),
|
||||
0
|
||||
)
|
||||
)
|
||||
) + ((isiPhone)
|
||||
? 80
|
||||
: 0
|
||||
);
|
||||
return pB;
|
||||
};
|
||||
|
||||
SideList.prototype.setStyles = function(pT, pB, W, mH) {
|
||||
$(':root')
|
||||
.css('--sidelist-padding-top', pT + 'px')
|
||||
.css('--sidelist-padding-bottom', pB + 'px')
|
||||
.css('--sidelist-width', W + 'px')
|
||||
.css('--sidelist-max-height', mH + 'px')
|
||||
};
|
||||
|
||||
window.SideList = SideList;
|
||||
|
||||
|
||||
})(window);
|
588
key4intranet.front/public/assets/js/slidemenu.js
Normal file
588
key4intranet.front/public/assets/js/slidemenu.js
Normal file
@@ -0,0 +1,588 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- Slidemenu -------------------- */
|
||||
|
||||
function Slidemenu(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
Slidemenu.prototype.options = {};
|
||||
|
||||
Slidemenu.prototype._init = function() {
|
||||
this.id = this.options.id;
|
||||
this.container = $(this.id);
|
||||
this.lists = $(this.id + ' ul');
|
||||
this.setMaxHeight();
|
||||
this.toplinks = $(this.id + ' > ul> li > a');
|
||||
this.sublinks = $(this.id + ' > ul > li > ul a');
|
||||
this.currentlevel = 0;
|
||||
this.maxlevel = 0;
|
||||
this.faviconTo;
|
||||
this.lang = this.options.lang;
|
||||
this.istouch = !$('html').is('.no-touchevents');
|
||||
this.currentmenu = $(this.id).find('> ul');
|
||||
this.currentcolor = 'primary';
|
||||
this.menuhead = $('<a href="javascript:;" class="menuhead no-ul"/>').prependTo(this.container);
|
||||
this.title = $('<h4 class="title align-middle line" />').prependTo(this.menuhead);
|
||||
this.iconback = $('<i class="far fa-2x fa-chevron-left align-middle"></i>').prependTo(this.menuhead);
|
||||
this.setLevels(this.lists);
|
||||
this.setLinks(this.toplinks, this.sublinks);
|
||||
this.feedbackFunction = this.options.favorites.onChange;
|
||||
this.favorites = new Favorites({
|
||||
container: $(this.options.favorites.selector),
|
||||
favtoggler: $(this.options.favorites.toggler),
|
||||
slidemenu: this,
|
||||
istouch: this.istouch
|
||||
});
|
||||
};
|
||||
|
||||
Slidemenu.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
this.openers
|
||||
.click(function(e) {
|
||||
$this.prepareSlide($(this).closest('a').next().attr('data-sm-level'), $(this).closest('a'));
|
||||
});
|
||||
this.menuhead
|
||||
.click(function(e) {
|
||||
if ($this.currentlevel > 0) $this.prepareSlide($this.currentlevel - 1, $this.currentmenu.parentsUntil($this.container, 'ul'));
|
||||
});
|
||||
this.toplinks
|
||||
.mouseenter(function(e) {
|
||||
if (!$this.istouch) $($this.container).find('> ul > li > a.active').toggleClass('active wasactive');
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
if (!$this.istouch) $($this.container).find('> ul > li > a.wasactive').toggleClass('wasactive active');
|
||||
});
|
||||
this.sublinks.each(function(){
|
||||
var li = $(this).parent(),
|
||||
a = $(this),
|
||||
favicon = li.find('.favicon');
|
||||
li
|
||||
.mouseenter(function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
a
|
||||
.css('color', '#fff')
|
||||
.css('background-color', 'var(--' + $this.currentcolor + ')');
|
||||
if (!$this.istouch) {
|
||||
clearTimeout($this.faviconTo);
|
||||
$this.faviconTo = setTimeout($this.toggleSublink, 750, a, 'left', $this);
|
||||
}
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
if (!$('body').is('.modal-open')) {
|
||||
if (!$(this).parent().is('.active'))
|
||||
a
|
||||
.css('color', 'inherit')
|
||||
.css('background-color', 'inherit');
|
||||
if (!$this.istouch) {
|
||||
clearTimeout($this.faviconTo);
|
||||
$this.toggleSublink($(this), 'right', $this);
|
||||
}
|
||||
}
|
||||
});
|
||||
favicon
|
||||
.mousedown(function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
if ($(this).prev().hasClass('isfavorite')) {
|
||||
var id = $(this).parent().attr('data-favorite-id');
|
||||
$this.favorites.removeFavorite($this.favorites.container.find('[data-favorite-id="' + id + '"]'));
|
||||
}
|
||||
else {
|
||||
$this.favorites.addFavorite($(this).parent());
|
||||
}
|
||||
});
|
||||
});
|
||||
if (this.istouch) {
|
||||
this.subopeners
|
||||
.swipe({
|
||||
tap: function(e, t) {
|
||||
$this.prepareSlide($(this).closest('a').next().attr('data-sm-level'), $(this).closest('a'));
|
||||
},
|
||||
swipeLeft: function(e, dir, dist, dur, fingCtn, fingData) {
|
||||
$this.toggleSublink($(this), dir, $this, e);
|
||||
},
|
||||
swipeRight: function(e, dir, dist, dur, fingCtn, fingData) {
|
||||
$this.toggleSublink($(this), dir, $this, e);
|
||||
},
|
||||
threshold: 30
|
||||
});
|
||||
this.sublinks
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
})
|
||||
.swipe({
|
||||
tap: function(e, t) {
|
||||
$this.resetSublinks();
|
||||
$(this).parent().trigger('mouseenter');
|
||||
var link = $(this).attr('href');
|
||||
if (link && link != 'javascript:;') window.location.href = link;
|
||||
},
|
||||
swipe: function(e, dir, dist, dur, fingCtn, fingData) {
|
||||
$this.toggleSublink($(this), dir, $this, e);
|
||||
},
|
||||
allowPageScroll: 'vertical',
|
||||
threshold: 30
|
||||
});
|
||||
}
|
||||
$(document).on('onChangeFavorites', this.feedbackFunction);
|
||||
};
|
||||
|
||||
Slidemenu.prototype.prepareSlide = function(level, obj) {
|
||||
this.resetSublinks();
|
||||
if (this.currentlevel < level) {
|
||||
if (level == 1) {
|
||||
this.currentcolor = $(obj).find('svg').attr('class');
|
||||
this.menuhead
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)text-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('text-' + this.currentcolor)
|
||||
.find('.icon').remove();
|
||||
this.title
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)line-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('line-' + this.currentcolor)
|
||||
.html(obj.text())
|
||||
.before($(obj).find('i').clone());
|
||||
obj.parent()
|
||||
.find('.fa-angle-right')
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)text-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('text-' + this.currentcolor);
|
||||
}
|
||||
this.slideTo(level);
|
||||
this.container.find('[data-sm-level=' + level + ']').css('display', 'none');
|
||||
obj.next().css('display', 'block');
|
||||
this.currentmenu = obj.next();
|
||||
} else {
|
||||
this.slideTo(level);
|
||||
this.currentmenu = obj;
|
||||
}
|
||||
};
|
||||
|
||||
Slidemenu.prototype.slideTo = function(level) {
|
||||
var decal = '-' + level * 100 + '%';
|
||||
this.container.find('> ul')
|
||||
.css('-moz-transform', 'translateX(' + decal + ')')
|
||||
.css('-ms-transform', 'translateX(' + decal + ')')
|
||||
.css('-o-transform', 'translateX(' + decal + ')')
|
||||
.css('transform', 'translateX(' + decal + ')');
|
||||
this.currentlevel = level;
|
||||
if (level == 0) this.menuhead.removeClass('show');
|
||||
else this.menuhead.addClass('show');
|
||||
};
|
||||
|
||||
Slidemenu.prototype.setLinks = function(toplinks, sublinks) {
|
||||
var $this = this;
|
||||
toplinks.each(function(){
|
||||
var over = $('<div class="over"/>').appendTo($(this)),
|
||||
color = $this.hexToRgb(window.getComputedStyle(document.body).getPropertyValue('--' + $(this).find('svg').attr('class')))
|
||||
over.css('background', 'radial-gradient(ellipse at center, rgba(' + color + ', 1) 10%, rgba(' + color + ', 0) 100%) center center no-repeat');
|
||||
});
|
||||
sublinks.each(function() {
|
||||
var tooltiptxt = $(this).hasClass('isfavorite') ? $this.options.lang.delfav : $this.options.lang.addfav,
|
||||
tooltip = (!this.istouch) ? ' data-toggle="tooltip" data-placement="top" title="' + tooltiptxt + '"' : '';
|
||||
|
||||
$(this).wrapInner('<span class="align-middle" />');
|
||||
|
||||
if (!$(this).next().is('ul'))
|
||||
$(this).closest('li').append(
|
||||
'<a href="javascript:;" class="favicon text-white"' + tooltip + '>'
|
||||
+ '<i class="fas fa-md fa-star align-middle"></i>'
|
||||
+ '</a>');
|
||||
|
||||
if ($(this).next().is('ul')) $(this).append('<i class="far fa-md fa-angle-right align-middle"/>')
|
||||
if ($(this).hasClass('active')) {
|
||||
var topparent = $(this).parents('[data-sm-level="1"]').parent(),
|
||||
color = topparent.find('a svg').attr('class');
|
||||
$(this).parents('li').each(function() {
|
||||
if (!$(this).is(topparent))
|
||||
$(this)
|
||||
.addClass('active')
|
||||
.find('> a').addClass('text-white bg-' + color);
|
||||
else $(this).find('> a').addClass('active')
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Slidemenu.prototype.resetSublinks = function() {
|
||||
this.container.find('a').removeClass('hover');
|
||||
if (this.istouch) {
|
||||
this.container.find('a')
|
||||
.parent()
|
||||
.trigger('mouseleave');
|
||||
$('body').removeClass('sorting');
|
||||
}
|
||||
};
|
||||
|
||||
Slidemenu.prototype.toggleSublink = function(link, dir, scope, e) {
|
||||
if (e) e.preventDefault();
|
||||
if (link.next().is('ul')) return;
|
||||
scope.resetSublinks();
|
||||
switch (dir) {
|
||||
case 'left' :
|
||||
link.addClass('hover')
|
||||
if (e) link.parent().trigger('mouseenter');
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Slidemenu.prototype.setMaxHeight = function() {
|
||||
var $this = this,
|
||||
favorites = this.container.parent().find('.favorites');
|
||||
this.maxHeight = favorites.outerHeight(true) || 0;
|
||||
this.lists.each(function(){
|
||||
$this.maxHeight = Math.max($this.maxHeight, $(this).outerHeight(true));
|
||||
})
|
||||
this.container.css('height', this.maxHeight + 'px');
|
||||
};
|
||||
|
||||
Slidemenu.prototype.hexToRgb = function(hex) {
|
||||
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
|
||||
hex = hex.trim();
|
||||
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
|
||||
return r + r + g + g + b + b;
|
||||
});
|
||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result
|
||||
? parseInt(result[1], 16) + ',' + parseInt(result[2], 16) + ',' + parseInt(result[3], 16)
|
||||
: null;
|
||||
};
|
||||
|
||||
Slidemenu.prototype.setLevels = function(obj) {
|
||||
var $this = this;
|
||||
obj.each(function(){
|
||||
var level = $(this).parentsUntil(this.container, 'ul').length;
|
||||
$(this).attr('data-sm-level', level);
|
||||
$this.maxlevel = Math.max($this.maxlevel, level);
|
||||
});
|
||||
this.openers = $(this.container).find('[data-sm-level]').prev('a:not(.menuhead)');
|
||||
this.subopeners = this.openers.filter(function(id) {
|
||||
return ($(this).parents('[data-sm-level]').length > 1);
|
||||
});
|
||||
}
|
||||
|
||||
Slidemenu.prototype.setTitle = function(string) {
|
||||
return string.replace(/\<.*?\>/g, '').replace(/\(.*?\)/g, '')
|
||||
};
|
||||
|
||||
Slidemenu.prototype.reInit = function() {
|
||||
this.prepareSlide(0, this.container.find('> ul'));
|
||||
this.favorites.hideFavorites(0);
|
||||
};
|
||||
|
||||
window.Slidemenu = Slidemenu;
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------- Favorites -------------------- */
|
||||
|
||||
function Favorites(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
this._initModals();
|
||||
}
|
||||
|
||||
Favorites.prototype._init = function() {
|
||||
this.container = this.options.container;
|
||||
this.parent = this.container.parents('nav.menu-left');
|
||||
this.slidemenu = this.options.slidemenu;
|
||||
this.opener = this.options.favtoggler;
|
||||
this.istouch = this.options.istouch;
|
||||
this.links = $(this.container).find(' li > a');
|
||||
this.opened = false;
|
||||
this.transitioning = false;
|
||||
this.sorting = false;
|
||||
this.container.attr('text-empty-list', this.slidemenu.lang.empty);
|
||||
this.favoritesTo;
|
||||
this.faviconTo;
|
||||
this.setLinks(this.links);
|
||||
};
|
||||
|
||||
Favorites.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
this.opener
|
||||
.mouseenter(function(e) {
|
||||
$this.transitioning = false;
|
||||
if (!$this.istouch) {
|
||||
$this.showFavorites(200);
|
||||
}
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
if (!$this.istouch) $this.hideFavorites(350);
|
||||
})
|
||||
.mousedown(function(e) {
|
||||
if (!$this.transitioning) {
|
||||
if ($this.opened) $this.hideFavorites(0);
|
||||
else $this.showFavorites(0);
|
||||
}
|
||||
});
|
||||
this.container
|
||||
.mouseenter(function(e) {
|
||||
clearInterval($this.favoritesTo);
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
if (!$this.istouch) $this.hideFavorites(350);
|
||||
})
|
||||
.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() {
|
||||
$this.transitioning = false;
|
||||
});
|
||||
|
||||
this.container
|
||||
.on('mouseenter', 'li', function(e) {
|
||||
clearInterval($this.favoritesTo);
|
||||
if (!$this.istouch && !$this.sorting) {
|
||||
clearTimeout($this.faviconTo);
|
||||
$this.faviconTo = setTimeout($this.toggleLink, 750, $(this).find('> a'), 'left', $this);
|
||||
}
|
||||
})
|
||||
.on('mouseleave', 'li', function(e) {
|
||||
if (!$this.istouch && !$('body').is('.modal-open')) {
|
||||
clearTimeout($this.faviconTo);
|
||||
$this.toggleLink($(this).find('> a'), 'right', $this);
|
||||
}
|
||||
})
|
||||
.on('mousedown', 'li', function(e) {
|
||||
clearTimeout($this.faviconTo);
|
||||
})
|
||||
.on('mousedown', 'li > a.favicon', function(e) {
|
||||
$this.removeFavorite($(this).parent());
|
||||
});
|
||||
if (this.istouch) {
|
||||
this.links
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
})
|
||||
.each(function(){
|
||||
$this._initFavSwipe($(this));
|
||||
});
|
||||
window.touchPunchDelay = 250;
|
||||
}
|
||||
$(this.container)
|
||||
.sortable({
|
||||
containment: 'parent',
|
||||
items: '> li',
|
||||
axis: 'y',
|
||||
tolerance: 'pointer',
|
||||
delay: ($this.istouch) ? 300 : 0,
|
||||
start: function(e, ui) {
|
||||
$this.sorting = true;
|
||||
$this.container.find('a.hover').removeClass('hover');
|
||||
clearTimeout($this.faviconTo);
|
||||
},
|
||||
stop: function(e, ui) {
|
||||
$this.sorting = false;
|
||||
if ($this.istouch) $('body').removeClass('sorting');
|
||||
$(ui.item).removeClass('sorting');
|
||||
},
|
||||
update: function(e, ui) {
|
||||
$.event.trigger({
|
||||
type: 'onChangeFavorites',
|
||||
action: 'reordered'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Favorites.prototype._initFavSwipe = function(obj) {
|
||||
var $this = this;
|
||||
obj
|
||||
.swipe({
|
||||
tap: function(e, t) {
|
||||
$this.resetLinks();
|
||||
$(this).parent().trigger('mouseenter');
|
||||
var link = $(this).attr('href');
|
||||
if (link && link != 'javascript:;') window.location.href = link;
|
||||
},
|
||||
hold: function(e, t) {
|
||||
$(this).closest('li').addClass('sorting');
|
||||
$('body').addClass('sorting');
|
||||
},
|
||||
longTap: function(e, t) {
|
||||
e.preventDefault();
|
||||
$(this).closest('li').removeClass('sorting');
|
||||
$('body').removeClass('sorting');
|
||||
},
|
||||
swipe: function(e, dir, dist, dur, fingCtn, fingData) {
|
||||
$this.toggleLink($(this), dir, $this, e);
|
||||
},
|
||||
allowPageScroll: 'vertical',
|
||||
threshold: 30
|
||||
});
|
||||
};
|
||||
|
||||
Favorites.prototype._initModals = function() {
|
||||
var $this = this;
|
||||
this.modals = {
|
||||
'removeFavorite': {
|
||||
'content': '',
|
||||
'footer': $('<p class="w-100 text-center"><button class="btn btn-sm btn-light text-white m-1" type="button" data-dismiss="modal">' + this.slidemenu.lang.cancel + '</button><button id="favremove" class="btn btn-sm btn-danger m-1" type="button">' + this.slidemenu.lang.delete + '</button></p>')
|
||||
}
|
||||
}
|
||||
$(document)
|
||||
.on('click', '#favremove', function(e) {
|
||||
var id = $this.favtoremove.attr('data-favorite-id'),
|
||||
sourceli = $this.slidemenu.container.find('[data-favorite-id="' + id + '"]');
|
||||
sourceli
|
||||
.removeAttr('data-favorite-id')
|
||||
.find('> a:not(.favicon)').removeClass('isfavorite');
|
||||
sourceli
|
||||
.find('> a.favicon')
|
||||
.attr('data-original-title', $this.slidemenu.lang.addfav);
|
||||
$this.modal.modal('hide')
|
||||
$this.favtoremove.remove();
|
||||
$this.slidemenu.setMaxHeight();
|
||||
$.event.trigger({
|
||||
type: 'onChangeFavorites',
|
||||
action: 'removed'
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
Favorites.prototype.showFavorites = function(delay) {
|
||||
var $this = this;
|
||||
this.slidemenu.resetSublinks();
|
||||
clearInterval(this.favoritesTo);
|
||||
$this.transitioning = true;
|
||||
this.favoritesTo = setInterval(function() {
|
||||
$this.parent.addClass('show-favorites');
|
||||
$this.opened = true;
|
||||
}, delay);
|
||||
};
|
||||
|
||||
Favorites.prototype.hideFavorites = function(delay) {
|
||||
if (!this.sorting && !$('body').is('.modal-open')) {
|
||||
var $this = this;
|
||||
clearInterval(this.favoritesTo);
|
||||
this.transitioning = true;
|
||||
this.resetLinks();
|
||||
this.favoritesTo = setInterval(function() {
|
||||
$this.parent.removeClass('show-favorites');
|
||||
$this.opened = false;
|
||||
}, delay);
|
||||
}
|
||||
};
|
||||
|
||||
Favorites.prototype.setLinks = function(links) {
|
||||
var $this = this;
|
||||
links.each(function() {
|
||||
var icon = 'fa-times',
|
||||
tooltip = (!this.istouch) ? ' data-toggle="tooltip" data-placement="top" title="' + $this.slidemenu.lang.delfav + '"' : '';
|
||||
$(this)
|
||||
.wrapInner('<span class="align-middle" />')
|
||||
.closest('li').append(
|
||||
'<a href="javascript:;" class="favicon text-dark text-center"' + tooltip + '>'
|
||||
+ '<i class="fal fa-md fa-times text-white align-middle"></i>'
|
||||
+ '</a>');
|
||||
});
|
||||
};
|
||||
|
||||
Favorites.prototype.addFavorite = function(obj) {
|
||||
var $this = this,
|
||||
id = this.getUniqueID(),
|
||||
link = obj.find('> a:first-child').attr('href'),
|
||||
tooltip = (!this.istouch) ? ' data-toggle="tooltip" data-placement="top" title="' + $this.slidemenu.lang.delfav + '"' : '',
|
||||
icon = this.slidemenu.menuhead.find('.icon')
|
||||
.clone()
|
||||
.toggleClass('icon-lg icon-sm'),
|
||||
label = obj.find('> a:not(.favicon) > span').text(),
|
||||
favorite = $('<li data-favorite-id="' + id + '" />')
|
||||
.append('<a href="' + link + '" class="no-ul text-' + this.slidemenu.currentcolor + '"><span class="align-middle">' + label + '</span></a>')
|
||||
.append('<a href="javascript:;" class="favicon text-dark text-center"' + tooltip + '><i class="fas fa-md fa-times text-white align-middle"></i></a></li>');
|
||||
if (!this.istouch)
|
||||
favorite.find('> a.favicon')
|
||||
.tooltip({
|
||||
delay: {
|
||||
'show': 500,
|
||||
'hide': 100
|
||||
}
|
||||
});
|
||||
favorite.find('> a:not(.favicon) > span').prepend(icon);
|
||||
obj
|
||||
.attr('data-favorite-id', id)
|
||||
.find('> a:first-child').addClass('isfavorite');
|
||||
obj
|
||||
.find('> a.favicon')
|
||||
.removeAttr('title')
|
||||
.attr('data-original-title', this.slidemenu.lang.delfav);
|
||||
this.container.prepend(favorite);
|
||||
if (this.istouch) {
|
||||
this._initFavSwipe(favorite.find('> a:not(.favicon)'));
|
||||
this.slidemenu
|
||||
.container.find('a.hover')
|
||||
.removeClass('hover')
|
||||
.parent()
|
||||
.trigger('mouseleave');
|
||||
}
|
||||
this.slidemenu.setMaxHeight();
|
||||
$.event.trigger({
|
||||
type: 'onChangeFavorites',
|
||||
action: 'added'
|
||||
});
|
||||
this.container.removeClass('empty');
|
||||
};
|
||||
|
||||
Favorites.prototype.removeFavorite = function(obj) {
|
||||
var $this = this;
|
||||
this.favtoremove = obj;
|
||||
this.modals.removeFavorite.content = $('<p class="text-center">' + this.slidemenu.lang.confirm + '</p>');
|
||||
this.modal = createModal('modal-removefav', 'md', this.modals.removeFavorite);
|
||||
this.modal
|
||||
.modal('show')
|
||||
.on('hidden.bs.modal', function (e) {
|
||||
$this.container.find('a.hover').removeClass('hover');
|
||||
$this.slidemenu.container.find('a.hover')
|
||||
.removeClass('hover')
|
||||
.parent()
|
||||
.trigger('mouseleave');
|
||||
if ($this.container.find('li').length == 0) $this.container.addClass('empty');
|
||||
});
|
||||
};
|
||||
|
||||
Favorites.prototype.resetLinks = function() {
|
||||
this.container.find('a')
|
||||
.removeClass('hover');
|
||||
if (this.istouch)
|
||||
this.container.find('a')
|
||||
.parent()
|
||||
.trigger('mouseleave');
|
||||
};
|
||||
|
||||
Favorites.prototype.toggleLink = function(link, dir, scope, e) {
|
||||
if (e) e.preventDefault();
|
||||
switch (dir) {
|
||||
case 'left' :
|
||||
scope.resetLinks();
|
||||
link.addClass('hover');
|
||||
if (e)
|
||||
link
|
||||
.parent().trigger('mouseenter');
|
||||
break;
|
||||
case 'right' :
|
||||
scope.resetLinks();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Favorites.prototype.getUniqueID = function() {
|
||||
return new Date().valueOf() + '_' + Math.floor((Math.random() + 1) * 1000).toString();
|
||||
};
|
||||
|
||||
window.Favorites = Favorites;
|
||||
|
||||
|
||||
})(window);
|
296
key4intranet.front/public/assets/js/statstiles.js
Normal file
296
key4intranet.front/public/assets/js/statstiles.js
Normal file
@@ -0,0 +1,296 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- Statstiles -------------------- */
|
||||
|
||||
function Statstiles(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this._init();
|
||||
this._initEvents();
|
||||
this._initModals();
|
||||
}
|
||||
|
||||
Statstiles.prototype.options = {};
|
||||
|
||||
Statstiles.prototype._init = function() {
|
||||
this.container = $(this.options.id);
|
||||
this.configtmpl = $(this.options.configurator);
|
||||
this.slider = this.container.find('.isflickity');
|
||||
this.btnadd = $(this.options.btnadd);
|
||||
this.selreq = this.options.selectids['req'];
|
||||
this.selorder = this.options.selectids['order'];
|
||||
this.selcolor = this.options.selectids['color'];
|
||||
this.selicon = this.options.selectids['icon'];
|
||||
this.lang = this.options.lang;
|
||||
this.tiles = this.slider.find('li');
|
||||
this.numchildren = this.tiles.length;
|
||||
this.istouch = !$('html').is('.no-touchevents');
|
||||
this.feedbackFunction = this.options.onChange;
|
||||
this.tooltipconfig = {
|
||||
delay: {
|
||||
'show': 500,
|
||||
'hide': 100
|
||||
}};
|
||||
};
|
||||
|
||||
Statstiles.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
|
||||
this.btnadd
|
||||
.click(function(e) {
|
||||
$this.openConfigurator('add');
|
||||
$(this).toggleClass('d-none');
|
||||
});
|
||||
|
||||
this.slider
|
||||
.on('click', 'a.edit', function(e) {
|
||||
var tile = $(this).closest('li');
|
||||
if (!tile.is('.editing'))
|
||||
$this.openConfigurator('edit', tile);
|
||||
})
|
||||
.on('click', 'a.remove', function(e) {
|
||||
$this.tiletoremove = $(this).closest('li');
|
||||
$this.modals.removeTile.content = $('<p class="text-center">' + $this.lang.confirm + '</p>');
|
||||
$this.modal = createModal('modal-removetile', 'md', $this.modals.removeTile);
|
||||
$this.modal.modal('show');
|
||||
})
|
||||
.on('click', '.validate .cancel', function(e) {
|
||||
var tile = $(this).closest('li');
|
||||
$(this).tooltip('dispose');
|
||||
$this.cancelUpdate(
|
||||
(!tile.is('.editing'))
|
||||
? 'add'
|
||||
: 'edit',
|
||||
tile
|
||||
);
|
||||
$this.slider.flickity('resize');
|
||||
})
|
||||
.on('click', '.validate .valid', function(e) {
|
||||
var tile = $(this).closest('li');
|
||||
$(this).tooltip('dispose');
|
||||
$this.validUpdate(
|
||||
(!tile.is('.editing'))
|
||||
? 'add'
|
||||
: 'edit',
|
||||
tile
|
||||
);
|
||||
$this.slider.flickity('resize');
|
||||
});
|
||||
|
||||
$(document)
|
||||
.on('change', this.selcolor, function(e) {
|
||||
$this.changeBgcolor($(e.target).closest('li'), this.value);
|
||||
})
|
||||
.on('change', this.selicon, function(e) {
|
||||
$this.changeBgicon($(e.target).closest('li'), this.value);
|
||||
});
|
||||
$(document).on('onChangeStatsTiles', this.feedbackFunction);
|
||||
};
|
||||
|
||||
Statstiles.prototype._initModals = function() {
|
||||
var $this = this;
|
||||
this.modals = {
|
||||
'removeTile': {
|
||||
'content': '',
|
||||
'footer': $('<p class="w-100 text-center"><button class="btn btn-sm btn-light text-white m-1" type="button" data-dismiss="modal">' + this.lang.cancel + '</button><button id="tileremove" class="btn btn-sm btn-danger m-1" type="button">' + this.lang.delete + '</button></p>')
|
||||
}
|
||||
}
|
||||
$(document)
|
||||
.on('click', '#tileremove', function(e) {
|
||||
$this.slider.flickity('remove', $this.tiletoremove);
|
||||
$this.refreshOrderSelect();
|
||||
$this.modal.modal('hide');
|
||||
$this.numchildren--;
|
||||
})
|
||||
};
|
||||
|
||||
Statstiles.prototype.openConfigurator = function(type, obj) {
|
||||
switch (type) {
|
||||
case 'add':
|
||||
var config = this.configtmpl.clone(),
|
||||
configform = config.find('form');
|
||||
configform.addClass('add-tile');
|
||||
this.slider.flickity('insert', config, this.numchildren);
|
||||
this.setSelects(
|
||||
config,
|
||||
{
|
||||
'color': config.attr('data-color')
|
||||
}
|
||||
);
|
||||
break;
|
||||
case 'edit':
|
||||
var config = this.configtmpl.find('form').clone().prependTo(obj),
|
||||
content = obj.find('.content');
|
||||
obj.addClass('editing');
|
||||
content.toggleClass('d-none');
|
||||
this.setSelects(
|
||||
config,
|
||||
{
|
||||
'order': obj.attr('data-order'),
|
||||
'color': obj.attr('data-color'),
|
||||
'icon': obj.attr('data-icon')
|
||||
}
|
||||
);
|
||||
break;
|
||||
}
|
||||
this.slider.flickity('resize');
|
||||
if (!this.istouch)
|
||||
config.find('[data-toggle="tooltip"]').tooltip(this.tooltipconfig);
|
||||
};
|
||||
|
||||
Statstiles.prototype.setSelects = function(config, data) {
|
||||
this.tiles.find('[data-order]').each(function() {
|
||||
var id = $(this).attr('data-order');
|
||||
config.find(this.selorder)
|
||||
.append('<option value="' + id + '">' + id + '</option>');
|
||||
});
|
||||
if (data['order']) {
|
||||
this.initOrderSelect(config.find(this.selorder));
|
||||
config.find(this.selorder + ' [value="' + data['order'] + '"]').attr('selected', true);
|
||||
}
|
||||
if (data['color']) config.find(this.selcolor + ' [value="' + data['color'] + '"]').attr('selected', true);
|
||||
if (data['icon']) config.find(this.selicon + ' [value="' + data['icon'] + '"]').attr('selected', true);
|
||||
};
|
||||
|
||||
Statstiles.prototype.initOrderSelect = function(selorder) {
|
||||
selorder.empty();
|
||||
this.slider.find('[data-order]').each(function() {
|
||||
var id = $(this).attr('data-order');
|
||||
selorder
|
||||
.append('<option value="' + id + '">' + id + '</option>');
|
||||
});
|
||||
};
|
||||
|
||||
Statstiles.prototype.refreshOrderSelect = function() {
|
||||
var $this = this,
|
||||
i = 1;
|
||||
this.slider.find('li:not(' + $this.options.configurator + ')')
|
||||
.each(function() {
|
||||
$(this).attr('data-order', i);
|
||||
i++;
|
||||
})
|
||||
.each(function() {
|
||||
if ($(this).find('.configurator')) {
|
||||
var form = $(this).find('.configurator'),
|
||||
select = form.find($this.selorder);
|
||||
$this.setSelects(
|
||||
form,
|
||||
{
|
||||
'order': $(this).attr('data-order')
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Statstiles.prototype.cancelUpdate = function(type, obj) {
|
||||
switch (type) {
|
||||
case 'add':
|
||||
this.slider.flickity('remove', obj)
|
||||
this.btnadd.toggleClass('d-none');
|
||||
break;
|
||||
case 'edit':
|
||||
obj.removeClass('editing');
|
||||
obj.find('form').remove();
|
||||
obj.find('.content').toggleClass('d-none');
|
||||
this.resetBgcolor(obj, obj.attr('data-color'));
|
||||
this.resetBgicon(obj, obj.attr('data-icon'));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Statstiles.prototype.validUpdate = function(type, obj) {
|
||||
var $this = this;
|
||||
switch (type) {
|
||||
case 'add':
|
||||
var form = obj.find('form'),
|
||||
id = form.find($this.selreq).val();
|
||||
this.numchildren++;
|
||||
obj
|
||||
.attr('id', 'statstile-' + id)
|
||||
.attr('data-order', this.numchildren);
|
||||
form.remove();
|
||||
this.btnadd.toggleClass('d-none');
|
||||
$.event.trigger({
|
||||
type: 'onChangeStatsTiles',
|
||||
action: 'added',
|
||||
id: id
|
||||
});
|
||||
break;
|
||||
case 'edit':
|
||||
var currentorder = obj.attr('data-order'),
|
||||
neworder = obj.find(this.selorder).val();
|
||||
obj.removeClass('editing');
|
||||
obj.find('form').remove();
|
||||
obj.find('.content').toggleClass('d-none');
|
||||
if (currentorder != neworder) {
|
||||
var tile = obj.clone();
|
||||
this.slider.flickity('remove', obj);
|
||||
this.slider.flickity('insert', obj, neworder-1);
|
||||
this.refreshOrderSelect();
|
||||
}
|
||||
$.event.trigger({
|
||||
type: 'onChangeStatsTiles',
|
||||
action: 'modified'
|
||||
});
|
||||
break;
|
||||
}
|
||||
obj
|
||||
.attr('data-color', obj.attr('was-data-color'))
|
||||
.attr('data-icon', obj.attr('was-data-icon'))
|
||||
.removeAttr('was-data-color was-data-icon');
|
||||
};
|
||||
|
||||
Statstiles.prototype.resetBgcolor = function(obj, val) {
|
||||
obj
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)bg-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('bg-' + val);
|
||||
obj.removeAttr('was-data-color');
|
||||
};
|
||||
|
||||
Statstiles.prototype.resetBgicon = function(obj, val) {
|
||||
obj
|
||||
.find('> i')
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)fa-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('fa-' + val);
|
||||
obj.removeAttr('was-data-icon');
|
||||
};
|
||||
|
||||
Statstiles.prototype.changeBgcolor = function(obj, val) {
|
||||
obj
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)bg-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('bg-' + val)
|
||||
.attr('was-data-color', val);
|
||||
};
|
||||
|
||||
Statstiles.prototype.changeBgicon = function(obj, val) {
|
||||
obj.find('> i')
|
||||
.removeClass(function (index, className) {
|
||||
return (className.match (/(^|\s)fa-\S+/g) || []).join(' ');
|
||||
})
|
||||
.addClass('fa-' + val);
|
||||
obj.attr('was-data-icon', val);
|
||||
};
|
||||
|
||||
Statstiles.prototype.setContent = function(id, content) {
|
||||
var tile = this.slider.find('#statstile-' + id),
|
||||
val = tile.find('.content big'),
|
||||
label = tile.find('.content span');
|
||||
val.html(content['value']);
|
||||
label.html(content['label']);
|
||||
};
|
||||
|
||||
window.Statstiles = Statstiles;
|
||||
|
||||
|
||||
})(window);
|
159
key4intranet.front/public/assets/js/stickyobserver.js
Normal file
159
key4intranet.front/public/assets/js/stickyobserver.js
Normal file
@@ -0,0 +1,159 @@
|
||||
(function(window) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/* -------------------- Sticky Observer -------------------- */
|
||||
|
||||
function Stickyobserver(options) {
|
||||
this.options = extend({}, this.options);
|
||||
extend(this.options, options);
|
||||
this.container = $(this.options.container)[0];
|
||||
this.selector = this.options.selector;
|
||||
this.stucked = this.options.stucked;
|
||||
this.IntObsEnabled = (this.checkSticky($(this.selector)[0]) && window.IntersectionObserver);
|
||||
if (!this.IntObsEnabled) {
|
||||
this.sentinels = [];
|
||||
this.issticky = $(this.options.container).find('.sticky');
|
||||
}
|
||||
this._init();
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
Stickyobserver.prototype.options = {};
|
||||
|
||||
Stickyobserver.prototype._init = function() {
|
||||
this.observeBoundaries(this.container, 'top');
|
||||
this.observeBoundaries(this.container, 'bottom');
|
||||
};
|
||||
|
||||
Stickyobserver.prototype._initEvents = function() {
|
||||
var $this = this;
|
||||
$(document).on('sticky-change', function(e) {
|
||||
let [header, stuck] = [e.detail.target, e.detail.stuck],
|
||||
evt;
|
||||
header.classList.toggle($this.stucked, stuck);
|
||||
evt = new CustomEvent('updatescrollnavoffset', {
|
||||
detail: (stuck)
|
||||
? $(header).outerHeight(true) + Math.abs(parseInt($(header).css('margin-top')))
|
||||
: 0
|
||||
});
|
||||
document.dispatchEvent(evt);
|
||||
setTimeout(function() {
|
||||
$($this.selector).find('.isflickity ')
|
||||
.flickity('resize')
|
||||
.flickity('select', 0);
|
||||
}, 300);
|
||||
});
|
||||
if (!this.IntObsEnabled) {
|
||||
try {
|
||||
var opts = Object.defineProperty({}, 'passive', {
|
||||
get: function() {
|
||||
this.supportsPassive = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener('test', null, opts);
|
||||
} catch (e) {}
|
||||
document.addEventListener('scroll', function() {
|
||||
clearTimeout($this.checkTo);
|
||||
$this.checkTo = setTimeout(function() {
|
||||
$.each($this.issticky, function(index, entry) {
|
||||
$this.check(entry, $(entry).hasClass('sticky-top'));
|
||||
});
|
||||
}, 300);
|
||||
}, this.supportsPassive ? { passive: true } : false);
|
||||
$.each($this.issticky, function(index, entry) {
|
||||
$this.check(entry, $(entry).hasClass('sticky-top'));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Stickyobserver.prototype.checkSticky = function(obj) {
|
||||
return getComputedStyle(obj).position.match('sticky') !== null;
|
||||
};
|
||||
|
||||
Stickyobserver.prototype.observeBoundaries = function(container, type) {
|
||||
var $this = this,
|
||||
observer;
|
||||
if (this.IntObsEnabled)
|
||||
observer = new IntersectionObserver((records, observer) => {
|
||||
for (let record of records) {
|
||||
let targetInfo = record.boundingClientRect,
|
||||
stickyTarget = $(record.target).siblings('.sticky')[0],
|
||||
rootBoundsInfo = record.rootBounds,
|
||||
istop = $(record.target).hasClass('sticky-top');
|
||||
switch (type) {
|
||||
case 'top' :
|
||||
if (istop) {
|
||||
if (targetInfo.bottom < rootBoundsInfo.top)
|
||||
this.triggerEvent(true, stickyTarget);
|
||||
if (targetInfo.bottom >= rootBoundsInfo.top && targetInfo.bottom < rootBoundsInfo.bottom)
|
||||
this.triggerEvent(false, stickyTarget);
|
||||
} else {
|
||||
if (targetInfo.top > rootBoundsInfo.top)
|
||||
this.triggerEvent(false, stickyTarget);
|
||||
if (targetInfo.top <= rootBoundsInfo.bottom && targetInfo.top > rootBoundsInfo.top)
|
||||
this.triggerEvent(true, stickyTarget);
|
||||
}
|
||||
break;
|
||||
case 'bottom' :
|
||||
if (istop) {
|
||||
if (targetInfo.top > rootBoundsInfo.top && targetInfo.top <= targetInfo.height * 2)
|
||||
this.triggerEvent(true, stickyTarget);
|
||||
if (targetInfo.top < rootBoundsInfo.top)
|
||||
this.triggerEvent(false, stickyTarget);
|
||||
} else {
|
||||
if (targetInfo.bottom > rootBoundsInfo.bottom)
|
||||
this.triggerEvent(true, stickyTarget);
|
||||
else if (targetInfo.bottom < rootBoundsInfo.bottom)
|
||||
this.triggerEvent(false, stickyTarget);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
threshold: [((type == 'top') ? 0 : 1)]
|
||||
});
|
||||
let sentinels = this.addObservers(container, 'sticky-observer--' + type);
|
||||
if (this.IntObsEnabled)
|
||||
sentinels.forEach(el => observer.observe(el));
|
||||
};
|
||||
|
||||
Stickyobserver.prototype.check = function(el, istop) {
|
||||
let top = $(el).siblings('.sticky-observer--top'),
|
||||
bottom = $(el).siblings('.sticky-observer--bottom'),
|
||||
offset = window.pageYOffset,
|
||||
topExceed,
|
||||
bottomExceed;
|
||||
switch (istop) {
|
||||
case true :
|
||||
topExceed = (top.offset().top + top.height() - offset) <= 0;
|
||||
bottomExceed = (bottom.offset().top - offset) <= 0;
|
||||
this.triggerEvent((topExceed && !bottomExceed), el);
|
||||
break;
|
||||
case false :
|
||||
topExceed = top.offset().top < (offset + window.innerHeight);
|
||||
bottomExceed = bottom.offset().top < (offset - bottom.height() + window.innerHeight);
|
||||
this.triggerEvent(topExceed && !bottomExceed, el);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Stickyobserver.prototype.addObservers = function(container, className) {
|
||||
return Array.from(container.querySelectorAll(this.selector)).map(el => {
|
||||
let type = 'sticky-' + (($(el).attr('class').indexOf('sticky-bottom') < 0) ? 'top' : 'bottom'),
|
||||
observer = $('<div class="sticky-observer ' + className + ' ' + type + '" />').appendTo($(el).parent());
|
||||
return observer[0];
|
||||
});
|
||||
};
|
||||
|
||||
Stickyobserver.prototype.triggerEvent = function(stuck, target) {
|
||||
let evt = new CustomEvent('sticky-change', {detail: {stuck, target}});
|
||||
document.dispatchEvent(evt);
|
||||
};
|
||||
|
||||
window.Stickyobserver = Stickyobserver;
|
||||
|
||||
|
||||
})(window);
|
15
key4intranet.front/public/assets/js/touchswipe.min.js
vendored
Normal file
15
key4intranet.front/public/assets/js/touchswipe.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user