sha
string
github
string
commit_message
string
git_diff
string
is_security
int64
097a261b596233e6c3ac0898a252e4fbcb4e33fc
https://github.com/Matroska-Org/libebml/commit/097a261b596233e6c3ac0898a252e4fbcb4e33fc
remove remaining occurrences of `winapifamily`
diff --git a/ebml/EbmlConfig.h b/ebml/EbmlConfig.h index 5bb679f..e510d81 100644 --- a/ebml/EbmlConfig.h +++ b/ebml/EbmlConfig.h @@ -104,13 +104,6 @@ #define LIBEBML_DEBUG #endif -#ifdef HAVE_WINAPIFAMILY_H -# include <winapifamily.h> -# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -# undef LIBEBML_DEBUG -# endif -#endif - #ifdef __GNUC__ #define EBML_PRETTYLONGINT(c) (c ## ll) #else // __GNUC__
0
0064412359ae1089e9a28d409cfd51ed73bbb095
https://github.com/GNOME/gnome-shell/commit/0064412359ae1089e9a28d409cfd51ed73bbb095
appDisplay: Remove obsolete property Since commit f09fbb19c, all app grids use pagination and the old property is meaningless. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 574b9cd14a..2d81a85164 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -117,12 +117,6 @@ function _findBestFolderName(apps) { var BaseAppView = GObject.registerClass({ GTypeFlags: GObject.TypeFlags.ABSTRACT, - Properties: { - 'use-pagination': GObject.ParamSpec.boolean( - 'use-pagination', 'use-pagination', 'use-pagination', - GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, - false), - }, Signals: { 'view-loaded': {}, },
0
30eec879c8b446b0ea9a3bb0da1a441cc8482bc4
https://github.com/ImageMagick/ImageMagick/commit/30eec879c8b446b0ea9a3bb0da1a441cc8482bc4
Moved check for https://github.com/ImageMagick/ImageMagick/issues/92.
diff --git a/coders/psd.c b/coders/psd.c index 11d26ea852..9f69d8a712 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -487,6 +487,7 @@ static ssize_t DecodePSDPixels(const size_t number_compact_pixels, length++; for (j=0; j < (ssize_t) length; j++) { + CheckNumberCompactPixels; switch (depth) { case 1: @@ -525,7 +526,6 @@ static ssize_t DecodePSDPixels(const size_t number_compact_pixels, break; } } - CheckNumberCompactPixels; compact_pixels++; } }
1
66d69f8c0d0da2014ffce7564c10d1b2dfa20f49
https://github.com/Cotonti/Cotonti/commit/66d69f8c0d0da2014ffce7564c10d1b2dfa20f49
Fix#1577: Hits plugin inconsistency - fixes some bugs in lang files - added statistic interval configuration
diff --git a/plugins/hits/hits.admin.home.php b/plugins/hits/hits.admin.home.php index 73634f876..7d08f956d 100644 --- a/plugins/hits/hits.admin.home.php +++ b/plugins/hits/hits.admin.home.php @@ -18,13 +18,15 @@ require_once cot_langfile('hits', 'plug'); require_once cot_incfile('hits', 'plug'); +$timeback_interval = $cfg['plugin']['hits']['timeback']; +$timeback_interval_str = cot_declension($timeback_interval, $Ls['Days']); + $tt = new XTemplate(cot_tplfile('hits.admin.home', 'plug', true)); //Show hit stats -if (!$cfg['plugin']['hits']['disablehitstats']) +// INFO: `disablehitstats` var not actually defined in setup file now, but may be used (had been set) by another extension +if (!$cfg['plugin']['hits']['disablehitstats']) { - $timeback_stats = 15;// 15 days - - $sql = $db->query("SELECT * FROM $db_stats WHERE stat_name LIKE '20%' ORDER BY stat_name DESC LIMIT ".$timeback_stats); + $sql = $db->query("SELECT * FROM $db_stats WHERE stat_name LIKE '20%' ORDER BY stat_name DESC LIMIT ".$timeback_interval); while ($row = $sql->fetch()) { $year = mb_substr($row['stat_name'], 0, 4); @@ -51,13 +53,14 @@ } } $tt->assign('ADMIN_HOME_MORE_HITS_URL', cot_url('admin', 'm=other&p=hits')); + $tt->assign('HITS_STAT_HEADER', cot_rc($L['hits_hits'], "days=$timeback_interval_str") ); $tt->parse('MAIN.STAT'); } //Show activity stats if (!$cfg['plugin']['hits']['disableactivitystats'] && cot_module_active('page')) { - $timeback = $sys['now'] - (7 * 86400);// 7 days + $timeback = $sys['now'] - ($timeback_interval * 86400); require_once cot_incfile('page', 'module'); $sql = $db->query("SELECT COUNT(*) FROM $db_users WHERE user_regdate > $timeback"); $newusers = $sql->fetchColumn(); @@ -101,6 +104,7 @@ 'ADMIN_HOME_NEWCOMMENTS' => $newcomments, 'ADMIN_HOME_NEWPMS' => $newpms )); + $tt->assign('ACTIVITY_STAT_HEADER', cot_rc($L['hits_activity'], "days=$timeback_interval_str") ); $tt->parse('MAIN.ACTIVITY'); } diff --git a/plugins/hits/hits.admin.php b/plugins/hits/hits.admin.php index da027e926..a2767b28b 100644 --- a/plugins/hits/hits.admin.php +++ b/plugins/hits/hits.admin.php @@ -34,48 +34,48 @@ } /* ===== */ -if($f == 'year' || $f == 'month') +if ($f == 'year' || $f == 'month') { - $adminpath[] = array(cot_url('admin', 'm=other&p=hits&f='.$f.'&v='.$v), '('.$v.')'); - $sql = $db->query("SELECT * FROM $db_stats WHERE stat_name LIKE '".$db->prep($v)."%' ORDER BY stat_name DESC"); - - while($row = $sql->fetch()) - { - $y = mb_substr($row['stat_name'], 0, 4); - $m = mb_substr($row['stat_name'], 5, 2); - $d = mb_substr($row['stat_name'], 8, 2); - $dat = cot_date('date_full', mktime(0, 0, 0, $m, $d, $y)); - $hits_d[$dat] = $row['stat_value']; - } + $adminpath[] = array(cot_url('admin', 'm=other&p=hits&f=' . $f . '&v=' . $v), '(' . $v . ')'); + $sql = $db->query("SELECT * FROM $db_stats WHERE stat_name LIKE '" . $db->prep($v) . "%' ORDER BY stat_name DESC"); + + while ($row = $sql->fetch()) + { + $y = mb_substr($row['stat_name'], 0, 4); + $m = mb_substr($row['stat_name'], 5, 2); + $d = mb_substr($row['stat_name'], 8, 2); + $dat = cot_date('date_full', mktime(0, 0, 0, $m, $d, $y)); + $hits_d[$dat] = $row['stat_value']; + } $sql->closeCursor(); - - $hits_d_max = max($hits_d); - $ii = 0; - /* === Hook - Part1 : Set === */ - $extp = cot_getextplugins('hits.admin.loop'); - /* ===== */ - foreach($hits_d as $day => $hits) - { - $percentbar = floor(($hits / $hits_d_max) * 100); - $tt->assign(array( - 'ADMIN_HITS_ROW_DAY' => $day, - 'ADMIN_HITS_ROW_HITS' => $hits, - 'ADMIN_HITS_ROW_PERCENTBAR' => $percentbar, - 'ADMIN_HITS_ROW_ODDEVEN' => cot_build_oddeven($ii) - )); - - /* === Hook - Part2 : Include === */ - foreach ($extp as $pl) - { - include $pl; - } - /* ===== */ - - $tt->parse('MAIN.YEAR_OR_MONTH.ROW'); - $ii++; - } - - $tt->parse('MAIN.YEAR_OR_MONTH'); + $hits_d_max = max($hits_d); + $ii = 0; + /* === Hook - Part1 : Set === */ + $extp = cot_getextplugins('hits.admin.loop'); + /* ===== */ + foreach ($hits_d as $day => $hits) + { + $percentbar = floor(($hits / $hits_d_max) * 100); + $tt->assign( + array( + 'ADMIN_HITS_ROW_DAY' => $day, + 'ADMIN_HITS_ROW_HITS' => $hits, + 'ADMIN_HITS_ROW_PERCENTBAR' => $percentbar, + 'ADMIN_HITS_ROW_ODDEVEN' => cot_build_oddeven($ii) + )); + + /* === Hook - Part2 : Include === */ + foreach ($extp as $pl) + { + include $pl; + } + /* ===== */ + + $tt->parse('MAIN.YEAR_OR_MONTH.ROW'); + $ii ++; + } + + $tt->parse('MAIN.YEAR_OR_MONTH'); } else { @@ -173,7 +173,7 @@ 'ADMIN_HITS_MAXHITS' => sprintf($L['hits_maxhits'], $max_date, $max_hits) )); } - $tt->parse('MAIN.DEFAULT'); + $tt->parse('MAIN.DEFAULT'); } /* === Hook === */ diff --git a/plugins/hits/hits.setup.php b/plugins/hits/hits.setup.php index a05da90cd..3cd7aac74 100644 --- a/plugins/hits/hits.setup.php +++ b/plugins/hits/hits.setup.php @@ -5,10 +5,10 @@ Name=Hits Category=performance-seo Description=Simple Stat for Cotonti -Version=1.1.2 -Date=2013-11-11 +Version=1.2.0 +Date=2017-11-21 Author=Cotonti Team -Copyright=Copyright (c) Cotonti Team 2008-2016 +Copyright=Copyright (c) Cotonti Team 2008-2017 Notes=BSD License Auth_guests=R Lock_guests=12345A @@ -19,8 +19,9 @@ [BEGIN_COT_EXT_CONFIG] adminhits=01:radio::1: -hit_precision=21:select:10,100,1000:100: +timeback=07:select:2,3,5,7,10,15,30:7: disableactivitystats=12:radio::0: +hit_precision=21:select:10,100,1000:100: [END_COT_EXT_CONFIG] ==================== */ diff --git a/plugins/hits/lang/hits.en.lang.php b/plugins/hits/lang/hits.en.lang.php index fb17bd986..29553ee44 100644 --- a/plugins/hits/lang/hits.en.lang.php +++ b/plugins/hits/lang/hits.en.lang.php @@ -14,10 +14,12 @@ */ $L['cfg_adminhits'] = 'Count administrator hits'; -$L['cfg_disableactivitystats'] = 'Do not display stats for the last 7 days'; +$L['cfg_timeback'] = 'Period for stats count'; +$L['cfg_timeback_hint'] = '(in days)'; +$L['cfg_disableactivitystats'] = 'Do not display activity stats for period'; $L['cfg_disableactivitystats_hint'] = '(displayed on the administration panel home page)'; $L['cfg_hit_precision'] = 'Optimized hit counter precision'; -$L['cfg_hit_precision_hint'] = ''; +$L['cfg_hit_precision_hint'] = '(bigger values minimizes server load)'; $L['info_desc'] = 'Simple hit statistic recommended for small sites'; @@ -31,5 +33,5 @@ $L['hits_bymonth'] = 'By month'; $L['hits_byweek'] = 'By week'; -$L['hits_hits'] = 'Hits for the past 15 days'; -$L['hits_activity'] = 'Activity for the past 7 days'; +$L['hits_hits'] = 'Hits for the past {$days}'; +$L['hits_activity'] = 'Activity for the past {$days}'; diff --git a/plugins/hits/lang/hits.ru.lang.php b/plugins/hits/lang/hits.ru.lang.php index cf7a54b67..3e70e50d9 100644 --- a/plugins/hits/lang/hits.ru.lang.php +++ b/plugins/hits/lang/hits.ru.lang.php @@ -14,10 +14,12 @@ */ $L['cfg_adminhits'] = 'Считать посещения администраторов'; -$L['cfg_disableactivitystats'] = 'Не показывать статистику активности за последние 7 дней'; +$L['cfg_timeback'] = 'Период для подсчета статистики'; +$L['cfg_timeback_hint'] = '(в сутках)'; +$L['cfg_disableactivitystats'] = 'Отключить показ данных об активности за период'; $L['cfg_disableactivitystats_hint'] = '(отображается на главной странице админ-панели)'; $L['cfg_hit_precision'] = 'Точность оптимизированного счётчика просмотров'; -$L['cfg_hit_precision_hint'] = ''; +$L['cfg_hit_precision_hint'] = '(чем больше значение, тем меньше нагрузка на сервер)'; $L['info_desc'] = 'Простая статистика просмотров &mdash; для небольших сайтов'; @@ -31,5 +33,5 @@ $L['hits_bymonth'] = 'По месяцам'; $L['hits_byweek'] = 'По неделям'; -$L['hits_hits'] = 'Посещаемость за последние 7 дней'; -$L['hits_activity'] = 'Активность за последние 7 дней'; +$L['hits_hits'] = 'Посещаемость за последние {$days}'; +$L['hits_activity'] = 'Активность за последние {$days}'; diff --git a/plugins/hits/tpl/hits.admin.home.tpl b/plugins/hits/tpl/hits.admin.home.tpl index 63f0f7b9a..f986a7c62 100644 --- a/plugins/hits/tpl/hits.admin.home.tpl +++ b/plugins/hits/tpl/hits.admin.home.tpl @@ -2,7 +2,7 @@ <!-- BEGIN: STAT --> <div class="block"> - <h3>{PHP.L.hits_hits}</h3> + <h3>{HITS_STAT_HEADER}</h3> <table class="cells"> <!-- BEGIN: ADMIN_HOME_ROW --> <tr> @@ -23,7 +23,7 @@ <!-- BEGIN: ACTIVITY --> <div class="block"> - <h3>{PHP.L.hits_activity}</h3> + <h3>{ACTIVITY_STAT_HEADER}</h3> <table class="cells"> <tr> <td class="width80"><a href="{ADMIN_HOME_NEWUSERS_URL}">{PHP.L.home_newusers}</a></td>
0
8618870d1b4acfae4114dd247a362cfa8493ab9
https://github.com/apache/ranger/commit/8618870d1b4acfae4114dd247a362cfa8493ab9
RANGER-921 : Improve implementation of internal SQL calls Signed-off-by: Velmurugan Periasamy <[email protected]>
diff --git a/security-admin/src/main/java/org/apache/ranger/common/DateUtil.java b/security-admin/src/main/java/org/apache/ranger/common/DateUtil.java index b710020e2e..f9db7d227c 100644 --- a/security-admin/src/main/java/org/apache/ranger/common/DateUtil.java +++ b/security-admin/src/main/java/org/apache/ranger/common/DateUtil.java @@ -27,6 +27,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; +import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Component; @@ -105,5 +106,17 @@ public static Date getUTCDate(long epoh) { return null; } } - + public static Date stringToDate(String dateString, String dateFromat){ + SimpleDateFormat simpleDateFormat = null; + Date date = null; + if(!StringUtils.isEmpty(dateString) && !StringUtils.isEmpty(dateFromat)){ + try{ + simpleDateFormat = new SimpleDateFormat(dateFromat); + date = simpleDateFormat.parse(dateString); + }catch(Exception ex){ + return null; + } + } + return date; + } } diff --git a/security-admin/src/main/java/org/apache/ranger/db/XXDataHistDao.java b/security-admin/src/main/java/org/apache/ranger/db/XXDataHistDao.java index 07db4586ce..e0ba9e4cba 100644 --- a/security-admin/src/main/java/org/apache/ranger/db/XXDataHistDao.java +++ b/security-admin/src/main/java/org/apache/ranger/db/XXDataHistDao.java @@ -18,13 +18,11 @@ package org.apache.ranger.db; import java.util.ArrayList; +import java.util.Date; import java.util.List; import javax.persistence.NoResultException; -import javax.persistence.Query; - -import org.apache.ranger.biz.RangerBizUtil; -import org.apache.ranger.common.AppConstants; +import org.apache.ranger.common.DateUtil; import org.apache.ranger.common.db.BaseDao; import org.apache.ranger.entity.XXDataHist; @@ -53,26 +51,17 @@ public XXDataHist findObjByEventTimeClassTypeAndId(String eventTime, int classTy if (eventTime == null || objId == null) { return null; } + Date date=DateUtil.stringToDate(eventTime,"yyyy-MM-dd'T'HH:mm:ss'Z'"); + if(date==null){ + return null; + } try { - - int dbFlavor = RangerBizUtil.getDBFlavor(); - - String queryStr = ""; - - if (dbFlavor == AppConstants.DB_FLAVOR_ORACLE) { - queryStr = "select obj.* from x_data_hist obj where obj.obj_class_type = " + classType - + " and obj.obj_id = " + objId - + " and to_date(obj.create_time, 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') <= to_date('" + eventTime - + "', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') ORDER BY obj.id DESC"; - } else { - queryStr = "select obj.* from x_data_hist obj where obj.obj_class_type = " + classType - + " and obj.obj_id = " + objId + " and obj.create_time <= '" + eventTime - + "' ORDER BY obj.id DESC"; - } - - Query jpaQuery = getEntityManager().createNativeQuery(queryStr, tClass).setMaxResults(1); - - return (XXDataHist) jpaQuery.getSingleResult(); + return getEntityManager() + .createNamedQuery("XXDataHist.findLatestByObjectClassTypeAndObjectIdAndEventTime", tClass) + .setParameter("classType", classType) + .setParameter("objectId", objId) + .setParameter("createTime", date) + .setMaxResults(1).getSingleResult(); } catch (NoResultException e) { return null; } diff --git a/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserDao.java b/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserDao.java index 393252c510..fe9b32bcce 100644 --- a/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserDao.java +++ b/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserDao.java @@ -101,17 +101,4 @@ public XXPortalUser findByXUserId(Long xUserId) { } } - @SuppressWarnings("unchecked") - public List<String> findXPortalUserRolebyXPortalUserId(Long userId) - { - try { - return getEntityManager() - .createNativeQuery("select user_role from x_portal_user_role where user_id="+userId+"") - .getResultList(); - - } catch (Exception e) { - return null; - } - - } } diff --git a/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserRoleDao.java b/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserRoleDao.java index 99d0fe28f6..3a045f500c 100644 --- a/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserRoleDao.java +++ b/security-admin/src/main/java/org/apache/ranger/db/XXPortalUserRoleDao.java @@ -56,4 +56,18 @@ public XXPortalUserRole findByRoleUserId(Long userId, String role) { } return null; } + @SuppressWarnings("unchecked") + public List<String> findXPortalUserRolebyXPortalUserId(Long userId) { + if (userId == null) { + return new ArrayList<String>(); + } + try { + List<String> returnList = getEntityManager() + .createNamedQuery("XXPortalUserRole.findXPortalUserRolebyXPortalUserId") + .setParameter("userId", userId).getResultList(); + return returnList; + }catch (NoResultException e){ + return new ArrayList<String>(); + } + } } diff --git a/security-admin/src/main/java/org/apache/ranger/patch/PatchPersmissionModel_J10003.java b/security-admin/src/main/java/org/apache/ranger/patch/PatchPersmissionModel_J10003.java index 804d08e08d..764bb5dc86 100644 --- a/security-admin/src/main/java/org/apache/ranger/patch/PatchPersmissionModel_J10003.java +++ b/security-admin/src/main/java/org/apache/ranger/patch/PatchPersmissionModel_J10003.java @@ -81,7 +81,7 @@ public void assignPermissionToExistingUsers() { for (XXPortalUser xPortalUser : allPortalUser) { VXPortalUser vPortalUser = xPortalUserService.populateViewBean(xPortalUser); vPortalUsers.add(vPortalUser); - vPortalUser.setUserRoleList(daoManager.getXXPortalUser().findXPortalUserRolebyXPortalUserId(vPortalUser.getId())); + vPortalUser.setUserRoleList(daoManager.getXXPortalUserRole().findXPortalUserRolebyXPortalUserId(vPortalUser.getId())); xUserMgr.assignPermissionToUser(vPortalUser, false); countUserPermissionUpdated += 1; logger.info("Permissions assigned/updated on base of User's Role, UserId [" + xPortalUser.getId() + "]"); diff --git a/security-admin/src/main/resources/META-INF/jpa_named_queries.xml b/security-admin/src/main/resources/META-INF/jpa_named_queries.xml index 3826a37565..1e2bf9bc80 100644 --- a/security-admin/src/main/resources/META-INF/jpa_named_queries.xml +++ b/security-admin/src/main/resources/META-INF/jpa_named_queries.xml @@ -691,4 +691,12 @@ <query>select obj from XXPolicy obj, XXPolicyItem polItem,XXPolicyItemGroupPerm polItemGroupPerm where obj.id = polItem.policyId and polItem.id = polItemGroupPerm.policyItemId and polItemGroupPerm.groupId = :groupId</query> </named-query> + <named-query name="XXDataHist.findLatestByObjectClassTypeAndObjectIdAndEventTime"> + <query>select obj from XXDataHist obj where obj.objectId = :objectId and + obj.objectClassType = :classType and + obj.createTime &lt;= :createTime ORDER BY obj.id DESC</query> + </named-query> + <named-query name="XXPortalUserRole.findXPortalUserRolebyXPortalUserId"> + <query>select obj.userRole from XXPortalUserRole obj where obj.userId = :userId</query> + </named-query> </entity-mappings>
1
163b8d7ab1719417059d9e9ab1b099746a6914f0
https://github.com/moinwiki/moin-1.9/commit/163b8d7ab1719417059d9e9ab1b099746a6914f0
catch indexer error for too long names, fixes #57 xapian raises an exception if wikiname:pagename/attachmentname is > 254 chars. this used to abort the whole indexing run, but now we catch and log this exception so that only 1 item is affected, but the indexing run continues for the rest of items. also improved indexer logging to use %r so logging never crashes due to encoding issues for non-ascii page or attachment names.
diff --git a/MoinMoin/search/Xapian/indexing.py b/MoinMoin/search/Xapian/indexing.py index 4db698b6..600f4839 100644 --- a/MoinMoin/search/Xapian/indexing.py +++ b/MoinMoin/search/Xapian/indexing.py @@ -357,7 +357,7 @@ def _index_page(self, request, connection, pagename, mode='update'): for doc in docs_to_delete: connection.delete(doc.id) - logging.debug('page %s (all revs, all attachments) removed from xapian index' % pagename) + logging.debug('page %r (all revs, all attachments) removed from xapian index' % pagename) else: if request.cfg.xapian_index_history: @@ -404,7 +404,7 @@ def _index_page_rev(self, request, connection, pagename, revno, mode='update'): mtime = page.mtime_usecs() doc = self._get_document(connection, itemid, mtime, mode) - logging.debug("%s %s %r" % (pagename, revision, doc)) + logging.debug("%r %s %r" % (pagename, revision, doc)) if doc: mimetype = 'text/%s' % page.pi['format'] # XXX improve this @@ -447,7 +447,7 @@ def _remove_page_rev(self, request, connection, pagename, revno): revision = str(revno) itemid = "%s:%s:%s" % (wikiname, pagename, revision) connection.delete(itemid) - logging.debug('page %s, revision %d removed from index' % (pagename, revno)) + logging.debug('page %r, revision %d removed from index' % (pagename, revno)) def _index_attachment(self, request, connection, pagename, attachmentname, mode='update'): """ Index an attachment @@ -469,7 +469,7 @@ def _index_attachment(self, request, connection, pagename, attachmentname, mode= if os.path.exists(filename): mtime = wikiutil.timestamp2version(os.path.getmtime(filename)) doc = self._get_document(connection, itemid, mtime, mode) - logging.debug("%s %s %r" % (pagename, attachmentname, doc)) + logging.debug("%r %r %r" % (pagename, attachmentname, doc)) if doc: page = Page(request, pagename) mimetype, att_content = self.contentfilter(filename) @@ -490,12 +490,22 @@ def _index_attachment(self, request, connection, pagename, attachmentname, mode= self._add_fields_to_document(request, doc, fields, multivalued_fields) - connection.replace(doc) - logging.debug('attachment %s (page %s) updated in index' % (attachmentname, pagename)) + try: + connection.replace(doc) + except xapian.Error, err: + logging.error('attachment %r (page %r) could not be updated in index: %s' % ( + attachmentname, pagename, str(err))) + else: + logging.debug('attachment %r (page %r) updated in index' % (attachmentname, pagename)) else: # attachment file was deleted, remove it from index also - connection.delete(itemid) - logging.debug('attachment %s (page %s) removed from index' % (attachmentname, pagename)) + try: + connection.delete(itemid) + except xapian.Error, err: + logging.error('attachment %r (page %r) could not be removed from index: %s' % ( + attachmentname, pagename, str(err))) + else: + logging.debug('attachment %r (page %r) removed from index' % (attachmentname, pagename)) def _index_file(self, request, connection, filename, mode='update'): """ index files (that are NOT attachments, just arbitrary files) @@ -514,7 +524,7 @@ def _index_file(self, request, connection, filename, mode='update'): mtime = wikiutil.timestamp2version(os.path.getmtime(filename)) doc = self._get_document(connection, itemid, mtime, mode) - logging.debug("%s %r" % (filename, doc)) + logging.debug("%r %r" % (filename, doc)) if doc: mimetype, file_content = self.contentfilter(filename)
0
abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
https://github.com/php/php-src/commit/abd159cce48f3e34f08e4751c568e09677d5ec9c?w=1
Fix bug #72114 - int/size_t confusion in fread
diff --git a/ext/standard/file.c b/ext/standard/file.c index 0abc022ca6b15..e39c84f1cd41e 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1758,6 +1758,12 @@ PHPAPI PHP_FUNCTION(fread) RETURN_FALSE; } + if (len > INT_MAX) { + /* string length is int in 5.x so we can not read more than int */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be no more than %d", INT_MAX); + RETURN_FALSE; + } + Z_STRVAL_P(return_value) = emalloc(len + 1); Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len); diff --git a/ext/standard/tests/file/bug72114.phpt b/ext/standard/tests/file/bug72114.phpt new file mode 100644 index 0000000000000..5e591ee478e83 --- /dev/null +++ b/ext/standard/tests/file/bug72114.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #72114 (Integer underflow / arbitrary null write in fread/gzread) +--FILE-- +<?php +ini_set('memory_limit', "2500M"); +$fp = fopen("/dev/zero", "r"); +fread($fp, 2147483648); +?> +Done +--EXPECTF-- +Warning: fread(): Length parameter must be no more than 2147483647 in %s/bug72114.php on line %d +Done
1
72058f9253e7ed8c7243e2ff76a16d97b03d65ed
https://github.com/sosreport/sos-collector/commit/72058f9253e7ed8c7243e2ff76a16d97b03d65ed
[sos_collector] Set umask for all files created Sets a umask of 0077 for all files created by sos-collector. This ensures collected sosrpeorts are not world readable and maintains the original permissions of the sos archives. Signed-off-by: Jake Hunsaker <[email protected]>
diff --git a/soscollector/sos_collector.py b/soscollector/sos_collector.py index 874022b..f1d4716 100644 --- a/soscollector/sos_collector.py +++ b/soscollector/sos_collector.py @@ -41,6 +41,7 @@ class SosCollector(): '''Main sos-collector class''' def __init__(self, config): + os.umask(0077) self.config = config self.threads = [] self.workers = []
1
33cb47ee488b2381d87f5bb36818cae5fa76c22e
https://github.com/josh/rails/commit/33cb47ee488b2381d87f5bb36818cae5fa76c22e
Use the reference for the mime type to get the format Before we were calling to_sym in the mime type, even when it is unknown what can cause denial of service since symbols are not removed by the garbage collector. Fixes: CVE-2014-0082
diff --git a/actionview/lib/action_view/template/html.rb b/actionview/lib/action_view/template/html.rb index 282da1a8a2f44..0321f819b5849 100644 --- a/actionview/lib/action_view/template/html.rb +++ b/actionview/lib/action_view/template/html.rb @@ -27,7 +27,7 @@ def render(*args) end def formats - [@type.to_sym] + [@type.respond_to?(:ref) ? @type.ref : @type.to_s] end end end diff --git a/actionview/lib/action_view/template/text.rb b/actionview/lib/action_view/template/text.rb index 859c7bc3ced37..04f5b8d17a82b 100644 --- a/actionview/lib/action_view/template/text.rb +++ b/actionview/lib/action_view/template/text.rb @@ -27,7 +27,7 @@ def render(*args) end def formats - [@type.to_sym] + [@type.respond_to?(:ref) ? @type.ref : @type.to_s] end end end diff --git a/actionview/test/template/html_test.rb b/actionview/test/template/html_test.rb new file mode 100644 index 0000000000000..549c12c88cad5 --- /dev/null +++ b/actionview/test/template/html_test.rb @@ -0,0 +1,17 @@ +require 'abstract_unit' + +class HTMLTest < ActiveSupport::TestCase + test 'formats returns symbol for recognized MIME type' do + assert_equal [:html], ActionView::Template::HTML.new('', :html).formats + end + + test 'formats returns string for recognized MIME type when MIME does not have symbol' do + foo = Mime::Type.lookup("foo") + assert_nil foo.to_sym + assert_equal ['foo'], ActionView::Template::HTML.new('', foo).formats + end + + test 'formats returns string for unknown MIME type' do + assert_equal ['foo'], ActionView::Template::HTML.new('', 'foo').formats + end +end diff --git a/actionview/test/template/text_test.rb b/actionview/test/template/text_test.rb new file mode 100644 index 0000000000000..d899d54589482 --- /dev/null +++ b/actionview/test/template/text_test.rb @@ -0,0 +1,17 @@ +require 'abstract_unit' + +class TextTest < ActiveSupport::TestCase + test 'formats returns symbol for recognized MIME type' do + assert_equal [:text], ActionView::Template::Text.new('', :text).formats + end + + test 'formats returns string for recognized MIME type when MIME does not have symbol' do + foo = Mime::Type.lookup("foo") + assert_nil foo.to_sym + assert_equal ['foo'], ActionView::Template::Text.new('', foo).formats + end + + test 'formats returns string for unknown MIME type' do + assert_equal ['foo'], ActionView::Template::Text.new('', 'foo').formats + end +end
1
3270dfac43da861c714df76513456b46765ff47f
https://github.com/wireshark/wireshark/commit/3270dfac43da861c714df76513456b46765ff47f
Don't treat the packet length as unsigned. The scanf family of functions are as annoyingly bad at handling unsigned numbers as strtoul() is - both of them are perfectly willing to accept a value beginning with a negative sign as an unsigned value. When using strtoul(), you can compensate for this by explicitly checking for a '-' as the first character of the string, but you can't do that with sscanf(). So revert to having pkt_len be signed, and scanning it with %d, but check for a negative value and fail if we see a negative value. Bug: 12394 Change-Id: I4b19b95f2e1ffc96dac5c91bff6698c246f52007 Reviewed-on: https://code.wireshark.org/review/15230 Reviewed-by: Guy Harris <[email protected]>
diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c index 9a066811892..091b7908840 100644 --- a/wiretap/toshiba.c +++ b/wiretap/toshiba.c @@ -248,8 +248,7 @@ parse_toshiba_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, union wtap_pseudo_header *pseudo_header = &phdr->pseudo_header; char line[TOSHIBA_LINE_LENGTH]; int num_items_scanned; - guint pkt_len; - int pktnum, hr, min, sec, csec; + int pkt_len, pktnum, hr, min, sec, csec; char channel[10], direction[10]; int i, hex_lines; guint8 *pd; @@ -301,12 +300,17 @@ parse_toshiba_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, } while (strcmp(line, "OFFSET 0001-0203") != 0); - num_items_scanned = sscanf(line+64, "LEN=%9u", &pkt_len); + num_items_scanned = sscanf(line+64, "LEN=%9d", &pkt_len); if (num_items_scanned != 1) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup("toshiba: OFFSET line doesn't have valid LEN item"); return FALSE; } + if (pkt_len < 0) { + *err = WTAP_ERR_BAD_FILE; + *err_info = g_strdup("toshiba: packet header has a negative packet length"); + return FALSE; + } if (pkt_len > WTAP_MAX_PACKET_SIZE) { /* * Probably a corrupt capture file; don't blow up trying
1
be7509c05ef130e6d3a83a1ecdeff15e8b83a95e
https://github.com/tinymce/tinymce_spellchecker_php/commit/be7509c05ef130e6d3a83a1ecdeff15e8b83a95e
Merge remote-tracking branch 'alecpl/bugfix'
diff --git a/changelog.txt b/changelog.txt index cf97e2a..b4ae31f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 2.0.6 (2011-??-??) + Fixed handling of mispelled words with no suggestions in PSpellShell engine. + Fixed PSpellShell command on Windows. + Fixed bug where Javascript error is produced when enchant_dict_suggest() returns unexpected result. Version 2.0.5 (2011-03-24) Merged with the latest TinyMCE spellchecker version. Version 2.0.4 (2010-12-20) diff --git a/classes/EnchantSpell.php b/classes/EnchantSpell.php index 9bf4762..6b523e7 100644 --- a/classes/EnchantSpell.php +++ b/classes/EnchantSpell.php @@ -48,16 +48,20 @@ function &checkWords($lang, $words) { */ function &getSuggestions($lang, $word) { $r = enchant_broker_init(); - $suggs = array(); if (enchant_broker_dict_exists($r,$lang)) { $d = enchant_broker_request_dict($r, $lang); $suggs = enchant_dict_suggest($d, $word); + // enchant_dict_suggest() sometimes returns NULL + if (!is_array($suggs)) + $suggs = array(); + enchant_broker_free_dict($d); } else { - + $suggs = array(); } + enchant_broker_free($r); return $suggs; diff --git a/classes/PSpellShell.php b/classes/PSpellShell.php index 1705326..211a3f2 100644 --- a/classes/PSpellShell.php +++ b/classes/PSpellShell.php @@ -38,13 +38,13 @@ function &checkWords($lang, $words) { $matches = array(); // Skip this line. - if (strpos($dstr, "@") === 0) + if ($dstr[0] == "@") continue; - preg_match("/\& ([^ ]+) .*/i", $dstr, $matches); + preg_match("/(\&|#) ([^ ]+) .*/i", $dstr, $matches); - if (!empty($matches[1])) - $returnData[] = utf8_encode(trim($matches[1])); + if (!empty($matches[2])) + $returnData[] = utf8_encode(trim($matches[2])); } return $returnData; @@ -82,7 +82,7 @@ function &getSuggestions($lang, $word) { $matches = array(); // Skip this line. - if (strpos($dstr, "@") === 0) + if ($dstr[0] == "@") continue; preg_match("/\&[^:]+:(.*)/i", $dstr, $matches); @@ -103,10 +103,14 @@ function &getSuggestions($lang, $word) { function _getCMD($lang) { $this->_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); - if(preg_match("#win#i", php_uname())) - return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1"; + $file = $this->_tmpfile; + $lang = preg_replace("/[^-_a-z]/", "", strtolower($lang)); + $bin = $this->_config['PSpellShell.aspell']; - return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang); + if (preg_match("#win#i", php_uname())) + return "$bin -a --lang=$lang --encoding=utf-8 -H < $file 2>&1"; + + return "cat $file | $bin -a --lang=$lang --encoding=utf-8 -H"); } }
0
8a8bfce144b3955b887bb733baa9bfc3994b19f8
https://github.com/elric1/knc/commit/8a8bfce144b3955b887bb733baa9bfc3994b19f8
Clean up debugging code a bit.
diff --git a/lib/libknc.c b/lib/libknc.c index 41888fd..5705bd0 100644 --- a/lib/libknc.c +++ b/lib/libknc.c @@ -188,10 +188,18 @@ struct fd_cookie { /* mmm, macros. */ +#if __GNUC__ > 2 +#define __predict_true(exp) __builtin_expect((exp) != 0, 1) +#define __predict_false(exp) __builtin_expect((exp) != 0, 0) +#else +#define __predict_true(exp) (exp) +#define __predict_false(exp) (exp) +#endif + #define MAX_IOVCNT 32 #define KNC_GSS_ERROR(_ctx, _maj, _min, _ret, _str) do { \ - if (GSS_ERROR((_maj))) { \ + if (__predict_false(GSS_ERROR((_maj)))) { \ knc_gss_error((_ctx), (_maj), (_min), (_str)); \ return _ret; \ } \ @@ -203,7 +211,7 @@ struct fd_cookie { /* XXXrcd: eventually get rid of DEBUG() */ int debug = 0; #define DEBUG(x) do { \ - if (debug) { \ + if (__predict_false(debug)) { \ debug_printf x ; \ } \ } while (0/*CONSTCOND*/) @@ -211,10 +219,6 @@ int debug = 0; #define DEBUG(x) #endif -#define KNCDEBUG(x) do { \ - debug_printf x ; \ - } while (0/*CONSTCOND*/) - /* Local function declarations */ static void debug_printf(knc_ctx, const char *, ...) @@ -259,11 +263,11 @@ static stream knc_find_buf(knc_ctx, int, int); /* And, ta da: the code */ static void -debug_printf(knc_ctx ctx, const char *fmt, ...) +knc_debugf(knc_ctx ctx, const char *fmt, ...) { va_list ap; - if (ctx && !ctx->debug) + if (__predict_true(ctx && !ctx->debug)) return; #ifdef LOW_LEVEL_DEBUGGERY @@ -1448,7 +1452,7 @@ knc_state_init(knc_ctx ctx, void *buf, size_t len) out.length = 0; - KNCDEBUG((ctx, "knc_state_init: enter\n")); + knc_debugf(ctx, "knc_state_init: enter\n"); ctx->locally_initiated = 1; maj = gss_init_sec_context(&min, ctx->cred, &ctx->gssctx, ctx->service, ctx->req_mech, ctx->req_flags, ctx->time_req, @@ -1479,7 +1483,7 @@ knc_state_accept(knc_ctx ctx, void *buf, size_t len) if (ctx->state != STATE_ACCEPT) return -1; - KNCDEBUG((ctx, "knc_state_accept: enter\n")); + knc_debugf(ctx, "knc_state_accept: enter\n"); out.length = 0; @@ -1515,7 +1519,7 @@ knc_state_session(knc_ctx ctx, void *buf, size_t len) out.length = 0; - KNCDEBUG((ctx, "knc_state_session: enter\n")); + knc_debugf(ctx, "knc_state_session: enter\n"); maj = gss_unwrap(&min, ctx->gssctx, &in, &out, NULL, NULL); if (maj != GSS_S_COMPLETE) { @@ -1660,8 +1664,8 @@ command_match(knc_ctx ctx, uint32_t *cmdseqno, char **retbuf, uint32_t *retlen) if (len < *retlen) return NULL; - KNCDEBUG((ctx, "Received command \"%s\", seq=%u, \"%.*s\", len=%u\n", - value, *cmdseqno, (int)*retlen, *retbuf, *retlen)); + knc_debugf(ctx, "Received command \"%s\", seq=%u, \"%.*s\", len=%u\n", + value, *cmdseqno, (int)*retlen, *retbuf, *retlen); for (i=0; string_cmds[i].cmd; i++) if (!strcmp(value, string_cmds[i].cmd)) @@ -1688,7 +1692,7 @@ knc_state_command(knc_ctx ctx, void *buf, size_t len) out.length = 0; - KNCDEBUG((ctx, "knc_state_command: enter\n")); + knc_debugf(ctx, "knc_state_command: enter\n"); maj = gss_unwrap(&min, ctx->gssctx, &in, &out, NULL, NULL); if (maj != GSS_S_COMPLETE) { @@ -1712,7 +1716,7 @@ knc_state_command(knc_ctx ctx, void *buf, size_t len) */ if (out.length == 0) { - KNCDEBUG((ctx, "knc_state_command: received dual EOF\n")); + knc_debugf(ctx, "knc_state_command: received dual EOF\n"); /* XXXrcd: should check if we've sent EOF not if we're open */ if (ctx->open & OPEN_WRITE) knc_put_eof(ctx, KNC_DIR_SEND); @@ -1723,14 +1727,14 @@ knc_state_command(knc_ctx ctx, void *buf, size_t len) } if (out.length == 1 && *(char *)out.value == 0) { - KNCDEBUG((ctx, "knc_state_command: received read EOF\n")); + knc_debugf(ctx, "knc_state_command: received read EOF\n"); ctx->open &= ~OPEN_READ; goto done; } if (out.length == 1 && *(char *)out.value == 1) { /* XXXrcd: should check if we've sent EOF not if we're open */ - KNCDEBUG((ctx, "knc_state_command: received write EOF\n")); + knc_debugf(ctx, "knc_state_command: received write EOF\n"); if (ctx->open & OPEN_WRITE) knc_put_eof(ctx, KNC_DIR_SEND); ctx->open &= ~OPEN_WRITE; @@ -1768,7 +1772,7 @@ knc_state_process_in(knc_ctx ctx) size_t len; int ret; - KNCDEBUG((ctx, "knc_state_process_in: enter\n")); + knc_debugf(ctx, "knc_state_process_in: enter\n"); /* * We have two main flows in which we are interested, input @@ -1782,7 +1786,7 @@ knc_state_process_in(knc_ctx ctx) for (;;) { len = read_packet(&ctx->raw_recv, &buf); - KNCDEBUG((ctx, "read_packet returned %zd\n", len)); + knc_debugf(ctx, "read_packet returned %zd\n", len); if (len < 1) /* XXXrcd: How about 0? */ return 0; @@ -1821,7 +1825,7 @@ knc_state_process_out(knc_ctx ctx) size_t len; void *buf; - KNCDEBUG((ctx, "knc_state_process_out: enter\n")); + knc_debugf(ctx, "knc_state_process_out: enter\n"); /* * We only process our out buffer if we have established the @@ -1870,7 +1874,7 @@ knc_state_process_out(knc_ctx ctx) } - KNCDEBUG((ctx, "knc_state_process_out: leave\n")); + knc_debugf(ctx, "knc_state_process_out: leave\n"); return 0; } @@ -1991,11 +1995,11 @@ knc_put_eof(knc_ctx ctx, int dir) char buf[1]; if (dir == KNC_DIR_SEND) { - KNCDEBUG((ctx, "putting command: send EOF\n")); + knc_debugf(ctx, "putting command: send EOF\n"); buf[0] = 0; ctx->open &= ~OPEN_WRITE; } else { - KNCDEBUG((ctx, "putting command: recv EOF\n")); + knc_debugf(ctx, "putting command: recv EOF\n"); buf[0] = 1; } @@ -2043,7 +2047,7 @@ knc_put_command(knc_ctx ctx, const char *cmd, uint32_t cmdseqno, assert(tlen == len); - KNCDEBUG((ctx, "putting command: %s seq=%u\n", cmd, cmdseqno)); + knc_debugf(ctx, "putting command: %s seq=%u\n", cmd, cmdseqno); return put_stream_command(&ctx->raw_send, buf, len); } @@ -2106,7 +2110,7 @@ knc_initiate(knc_ctx ctx) /* XXXrcd: sanity! */ #if 0 /* XXXrcd: this should go somewhere... */ - KNCDEBUG((ctx, "going to get tickets for: %s\n", (char *)name.value)); + knc_debugf(ctx, "going to get tickets for: %s\n", (char *)name.value); #endif ctx->gssctx = GSS_C_NO_CONTEXT; @@ -2186,7 +2190,7 @@ connect_host(knc_ctx ctx, const char *domain, const char *service, int flags) int ret; int s = -1; - KNCDEBUG((ctx, "connecting to (%s, %s)...\n", service, domain)); + knc_debugf(ctx, "connecting to (%s, %s)...\n", service, domain); memset(&ai, 0x0, sizeof(ai)); ai.ai_socktype = SOCK_STREAM; @@ -2202,7 +2206,7 @@ connect_host(knc_ctx ctx, const char *domain, const char *service, int flags) s = get_socket(res->ai_family, res->ai_socktype, res->ai_protocol, flags); if (s == -1) { - KNCDEBUG((ctx, "connect: %s\n", strerror(errno))); + knc_debugf(ctx, "connect: %s\n", strerror(errno)); continue; } ret = connect(s, res->ai_addr, res->ai_addrlen); @@ -2210,7 +2214,7 @@ connect_host(knc_ctx ctx, const char *domain, const char *service, int flags) break; close(s); s = -1; - KNCDEBUG((ctx, "connect: %s\n", strerror(errno))); + knc_debugf(ctx, "connect: %s\n", strerror(errno)); } if (s == -1) @@ -2714,17 +2718,17 @@ knc_fill(knc_ctx ctx, int dir) return ENOMEM; } - KNCDEBUG((ctx, "knc_fill: about to read %zd bytes.\n", len)); + knc_debugf(ctx, "knc_fill: about to read %zd bytes.\n", len); ret = ourread(ourcookie, tmpbuf, (size_t)len); if (ret == -1) { - KNCDEBUG((ctx, "read error: %s\n", strerror(errno))); + knc_debugf(ctx, "read error: %s\n", strerror(errno)); return errno_switch(ctx, errno, "reading"); } if (ret == 0) { - KNCDEBUG((ctx, "knc_fill: got EOF\n")); + knc_debugf(ctx, "knc_fill: got EOF\n"); /* * XXXrcd: we may very well call this an error because * we are supposed to see an appropriate command @@ -2740,7 +2744,7 @@ knc_fill(knc_ctx ctx, int dir) } if (ret > 0) { - KNCDEBUG((ctx, "Read %zd bytes\n", ret)); + knc_debugf(ctx, "Read %zd bytes\n", ret); knc_fill_buf(ctx, dir, (size_t)ret); } @@ -2785,18 +2789,18 @@ knc_flush(knc_ctx ctx, int dir, size_t flushlen) len = knc_get_obufv(ctx, dir, MAX_IOVCNT, &vec, &iovcnt); if (len <= 0) break; - KNCDEBUG((ctx, "knc_flush: about to write %zu bytes.\n", len)); + knc_debugf(ctx, "knc_flush: about to write %zu bytes.\n", len); len = ourwritev(ourcookie, vec, iovcnt); if (len == -1) { - KNCDEBUG((ctx, "write error: %s\n", strerror(errno))); + knc_debugf(ctx, "write error: %s\n", strerror(errno)); return errno_switch(ctx, errno, "writev"); } *total += len; - KNCDEBUG((ctx, "knc_flush: wrote %zd bytes, total=%zd\n", - len, *total)); + knc_debugf(ctx, "knc_flush: wrote %zd bytes, total=%zd\n", + len, *total); knc_drain_buf(ctx, dir, (size_t)len); knc_garbage_collect(ctx); @@ -3042,7 +3046,7 @@ knc_gss_error(knc_ctx ctx, OM_uint32 maj_stat, OM_uint32 min_stat, ctx->errstr = knc_gss_errstring(maj_stat, min_stat, s); if (!ctx->errstr) ctx->errstr = strdup("Failed to construct GSS error"); - KNCDEBUG((ctx, "knc_gss_error: %s\n", ctx->errstr)); + knc_debugf(ctx, "knc_gss_error: %s\n", ctx->errstr); } void
0
0ba8fb1d2318d678ae86d17463aa162b22b3e1cc
https://github.com/mozilla-b2g/gaia/commit/0ba8fb1d2318d678ae86d17463aa162b22b3e1cc
Merge pull request #34378 from albertopq/1277836-incoming-calls Bug 1277836 - Open webapps on system messages r=gsvelto
diff --git a/apps/system/js/system_messages.js b/apps/system/js/system_messages.js index 1dcd52e2fb96..5dd7c2fce136 100644 --- a/apps/system/js/system_messages.js +++ b/apps/system/js/system_messages.js @@ -1,8 +1,17 @@ -/* global BaseModule */ +/* global BaseModule, BroadcastChannel, Service */ 'use strict'; (function() { - // System Messages placeholder + var BASE_URL = 'chrome://gaia/content'; + var MESSAGES = { + 'bluetooth-dialer-command': '/dialer/index.html#keyboard-view', + 'headset-button': '/dialer/index.html#keyboard-view', + 'notification': '/dialer/index.html#keyboard-view', + 'telephony-new-call': '/dialer/index.html#keyboard-view', + 'telephony-call-ended': '/dialer/index.html#keyboard-view', + 'ussd-received': '/dialer/index.html#keyboard-view' + }; + var SystemMessages = function(core) { }; @@ -17,15 +26,49 @@ }, _start: function() { navigator.mozSetMessageHandler = this._mozSetMessageHandler.bind(this); - window.addEventListener('mozSystemMessage', (e) => { - this._systemMessagesChannel.postMessage(e.detail); - var handlers = this._handlers[e.detail.type] - if (handlers && handlers.length) { - handlers.forEach((handler) => { - handler(e.detail.message); + window.addEventListener('mozSystemMessage', this._onMessage.bind(this)); + }, + + _onMessage: function(e) { + // Calling registered handlers in the system + var handlers = this._handlers[e.detail.type]; + if (handlers && handlers.length) { + handlers.forEach((handler) => { + handler(e.detail.message); + }); + } + + // Wake up the app, if we were waiting a system message + // for it. + if (MESSAGES[e.detail.type]) { + var url = BASE_URL + MESSAGES[e.detail.type]; + if (!Service.query('AppWindowManager.getApp', url)) { + this._openUrlAndPost(url, e.detail); + return; + } + } + + this._systemMessagesChannel.postMessage(e.detail); + }, + + _openUrlAndPost: function(url, detail) { + var messagesChannel = this._systemMessagesChannel; + var changeAppEvent = 'appwindowmanager-activated'; + window.addEventListener(changeAppEvent, function onOpen(evt) { + var activeApp = Service.query('AppWindowManager.getActiveApp'); + if (activeApp.url === url) { + window.removeEventListener(changeAppEvent, onOpen); + var frame = activeApp.element; + frame.addEventListener('mozbrowserloadend', function onAppOpen() { + frame.removeEventListener('mozbrowserloadend', onAppOpen); + messagesChannel.postMessage(detail); }); } }); + + window.dispatchEvent(new CustomEvent('webapps-launch', { + detail: {url: url} + })); } }); }());
0
b41d6dc247a175fe8e092d6ec2c460826fa62992
https://github.com/djabberd/DJabberd/commit/b41d6dc247a175fe8e092d6ec2c460826fa62992
Fix XML Parser to fail on external entities Bump dependency on LibXML to the latest because of their recent new() signature change
diff --git a/Makefile.PL b/Makefile.PL index cfc06e2..64e9546 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,6 +9,7 @@ WriteMakefile( PREREQ_PM => { 'Danga::Socket' => 1.51, 'XML::SAX' => 0, + 'XML::LibXML' => 1.70, 'XML::LibXML::SAX' => 0, 'Net::DNS' => 0.48, 'Net::SSLeay' => 0, diff --git a/lib/DJabberd/XMLParser.pm b/lib/DJabberd/XMLParser.pm index acac810..09b9aa4 100644 --- a/lib/DJabberd/XMLParser.pm +++ b/lib/DJabberd/XMLParser.pm @@ -16,7 +16,17 @@ sub new { # libxml mode: if (1) { - my $libxml = XML::LibXML->new; + my $libxml = XML::LibXML->new({ + no_network => 1, + load_ext_dtd => 0, + expand_entities => 0, + expand_xinclude => 0, + ext_ent_handler => sub { + # my ($sys_id, $pub_id) = @_; + # warn "Received external entity: $sys_id:$pub_id"; + ""; + }, + }); $libxml->set_handler($self); $self->{LibParser} = $libxml; diff --git a/t/v.txt b/t/v.txt new file mode 100644 index 0000000..d8f7879 --- /dev/null +++ b/t/v.txt @@ -0,0 +1 @@ +vuln diff --git a/t/xmlparsing.t b/t/xmlparsing.t index f1c662b..e4a46f4 100644 --- a/t/xmlparsing.t +++ b/t/xmlparsing.t @@ -6,7 +6,7 @@ use XML::SAX; use DJabberd::XMLParser; use XML::SAX::PurePerl; use Scalar::Util qw(weaken); -use Test::More tests => 10; +use Test::More tests => 14; use Data::Dumper; my $fulldoc = qq{<?xml version="1.0"?><root xmlns='root' xmlns:a='aa' global='foo' xmlns:b='bb' a:name='aname' b:name='bname' name='globalname'> @@ -43,7 +43,7 @@ ok(!$ref, "p went away"); { my $handler = EventRecorder->new(\$dummy); my $p = DJabberd::XMLParser->new(Handler => $handler); - $p->parse_more("<foo><tag>"); + $p->parse_more("<foo>&lt;<tag>"); $p->finish_push; like($dummy, qr/foo.+tag/s); $ref = \$p; @@ -51,6 +51,41 @@ ok(!$ref, "p went away"); } ok(!$ref, "p went away"); +## external entities are disabled +{ + use FindBin; + my $v = "$FindBin::Bin/v.txt"; + + my $xml1 = <<"EOF"; +<?xml version="1.0"?> +<!DOCTYPE foo [ +<!ENTITY a PUBLIC "//foo" "file:$v"> +]> +<root> + <a>&lt; A=&a;</a> +</root> +EOF + my $xml2 = <<"EOF"; +<?xml version="1.0"?> +<!DOCTYPE foo [ +<!ENTITY b SYSTEM "file://$v"> +]> +<root> + <b>B=&b;</b> +</root> +EOF + for ($xml1, $xml2) { + my $handler = EventRecorder->new(\$dummy); + my $p = DJabberd::XMLParser->new(Handler => $handler); + eval { + $p->parse_more($_); + $p->finish_push; + }; + ok $@, "died on unknown entity: $@"; + unlike($dummy, qr/vuln/si); + } +} + # byte at a time my $n = 0; my $byte_events; @@ -80,9 +115,14 @@ use Data::Dumper; sub new { my ($class, $outref) = @_; $$outref = ""; - return bless { - outref => $outref, - }; + my $self = $class->SUPER::new(); + $self->{outref} = $outref; + return $self; +} + +sub characters { + my ($self, $data) = @_; + ${ $self->{outref} } .= $data->{Data}; } sub start_element {
1
0e83ad3e547fc9a75a258799ef581249b40a82a6
https://github.com/apache/tomcat/commit/0e83ad3e547fc9a75a258799ef581249b40a82a6
Explicitly configure allowed credential types git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1767644 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java index fbf17f64602..5795ec5352e 100644 --- a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java +++ b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java @@ -264,6 +264,10 @@ public void lifecycleEvent(LifecycleEvent event) { serverCsf = new RmiClientLocalhostSocketFactory(serverCsf); } + env.put("jmx.remote.rmi.server.credential.types", new String[] { + String[].class.getName(), + String.class.getName() }); + // Populate the env properties used to create the server if (serverCsf != null) { env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, serverCsf); @@ -328,7 +332,7 @@ private JMXConnectorServer createServer(String serverName, cs = new RMIConnectorServer(serviceUrl, theEnv, server, ManagementFactory.getPlatformMBeanServer()); cs.start(); - registry.bind("jmxrmi", server); + registry.bind("jmxrmi", server.toStub()); log.info(sm.getString("jmxRemoteLifecycleListener.start", Integer.toString(theRmiRegistryPort), Integer.toString(theRmiServerPort), serverName)); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index d3022726268..a9016407be3 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -97,6 +97,10 @@ StoreConfig component includes the executor name when writing the Connector configuration. (markt) </fix> + <fix> + When configuring the JMX remote listener, specify the allowed types for + the credentials. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote">
1
5df2b817255ee919991da6c310239e08c8fcc1ae
https://github.com/sitaramc/gitolite/commit/5df2b817255ee919991da6c310239e08c8fcc1ae
tighten up security for rsync Nick Cleaton ([email protected]) found and reported a security issue caused by trusting the remote rsync too much. It appears that rsync cannot -- without special precautions -- be used in any "restricted" environment. Gitolite ships with a "bundle helper" called "rsync" (disabled by default; more details below). This fix tightens up this helper to close this hole. TLDR for administrators and packagers: 1. Am I affected? Look in ~/.gitolite.rc for "rsync"; if it is there, you are affected. This is NOT an essential program, and it is not enabled by default. You (or a previous administrator of your site) would have to have explicitly enabled it for you to be affected. 2. What's the quick fix? Comment out the "rsync" line in ~/.gitolite.rc IMMEDIATELY. DO NOT LEAVE IT ENABLED IF YOU ARE UNABLE TO UPGRADE IMMEDIATELY! Uncomment it only after you have upgraded or patched. 3. That bad, huh? Sadly, yes :( DETAILS: This program is not a core program. Despite the name, it will not function as a generic "rsync". This is *only* meant to help out people who are on flaky connections, trying to clone a large repo. Because git clone is not resumable, one common technique is to have someone create a "bundle", then download the bundle to seed the local repo, then "git fetch" to finish off. Since the bundle is a single file, you can use resumable mechanisms (like rsync) to download it. What this command does is allow that kind of bundling to happen automatically, if an administrator enables it. The user simply rsyncs a bundle file using his gitolite credentials. As a result, the rsync helper command that ships with gitolite is executed. This program manages the creation and expiry of bundle files, then passes control to the *real* rsync program to perform the actual data transfer. It is this last step that requires special care when used in a restricted environment, resulting in the need for this patch.
diff --git a/src/commands/rsync b/src/commands/rsync index 1109ac4d3..c7b25d187 100755 --- a/src/commands/rsync +++ b/src/commands/rsync @@ -28,11 +28,6 @@ BUNDLE SUPPORT (2) Add 'rsync' to the ENABLE list in the rc file - -GENERIC RSYNC SUPPORT - - TBD - =cut =for usage @@ -43,7 +38,7 @@ BUNDLE SUPPORT Admins: see src/commands/rsync for setup instructions Users: - rsync -P git@host:repo.bundle . + rsync git@host:repo.bundle . # downloads a file called "<basename of repo>.bundle"; repeat as # needed till the whole thing is downloaded git clone repo.bundle repo @@ -51,9 +46,8 @@ BUNDLE SUPPORT git remote set-url origin git@host:repo git fetch origin # and maybe git pull, etc. to freshen the clone -GENERIC RSYNC SUPPORT - - TBD + NOTE on options to the rsync command: you are only allowed to use the + "-v", "-n", "-q", and "-P" options. =cut @@ -62,9 +56,9 @@ usage() if not @ARGV or $ARGV[0] eq '-h'; # rsync driver program. Several things can be done later, but for now it # drives just the 'bundle' transfer. -if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (-[-\w=.]+ )+\. (\S+)\.bundle$/ ) { +if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (?:-[vn]*(?:e\d*\.\w*)? )?\. (\S+)\.bundle$/ ) { - my $repo = $2; + my $repo = $1; $repo =~ s/\.git$//; # all errors have the same message to avoid leaking info @@ -81,7 +75,7 @@ if ( $ENV{SSH_ORIGINAL_COMMAND} =~ /^rsync --server --sender (-[-\w=.]+ )+\. (\S exit 0; } -_warn "invalid rsync command '$ENV{SSH_ORIGINAL_COMMAND}'"; +_warn "Sorry, you are only allowed to use the '-v', '-n', '-q', and '-P' options."; usage(); # ----------------------------------------------------------------------
1
51afb40605aa280fce96bbf90df7a2c7a4727869
https://github.com/openSUSE/kiwi/commit/51afb40605aa280fce96bbf90df7a2c7a4727869
Merge pull request #669 from stanislav-brabec/master integrate last translation changes
diff --git a/locale/da/LC_MESSAGES/kiwi.po b/locale/da/LC_MESSAGES/kiwi.po index 7b96b43a1..a6d3ac5b1 100644 --- a/locale/da/LC_MESSAGES/kiwi.po +++ b/locale/da/LC_MESSAGES/kiwi.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: @PACKAGE@\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2005-07-27 16:23+0200\n" -"PO-Revision-Date: 2017-06-08 18:44+0000\n" +"PO-Revision-Date: 2018-09-16 16:01+0000\n" "Last-Translator: scootergrisen <[email protected]>\n" "Language-Team: Danish <https://l10n.opensuse.org/projects/kiwi/master/da/>\n" "Language: da\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.6\n" +"X-Generator: Weblate 2.18\n" #. /.../ #. Copyright (c) 2005 SuSE GmbH Nuernberg, Germany. All rights reserved. @@ -70,7 +70,7 @@ msgstr "OK" # cancel button label msgid "Cancel" -msgstr "Annullér" +msgstr "Annuller" msgid "Exit" msgstr "Afslut" diff --git a/locale/nb/LC_MESSAGES/kiwi.po b/locale/nb/LC_MESSAGES/kiwi.po index fbdca9817..29897fa1f 100644 --- a/locale/nb/LC_MESSAGES/kiwi.po +++ b/locale/nb/LC_MESSAGES/kiwi.po @@ -7,15 +7,16 @@ msgstr "" "Project-Id-Version: @PACKAGE@\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2005-07-27 16:23+0200\n" -"PO-Revision-Date: 2009-10-20 19:14+0200\n" -"Last-Translator: Olav Pettershagen <[email protected]>\n" -"Language-Team: Norwegian Bokmål <[email protected]>\n" -"Language: \n" +"PO-Revision-Date: 2018-09-06 23:04+0000\n" +"Last-Translator: Daniel Dybing <[email protected]>\n" +"Language-Team: Norwegian Bokmål " +"<https://l10n.opensuse.org/projects/kiwi/master/nb/>\n" +"Language: nb\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.0\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 2.18\n" #. /.../ #. Copyright (c) 2005 SuSE GmbH Nuernberg, Germany. All rights reserved. @@ -23,7 +24,7 @@ msgstr "" #. boot code for KIWI #. msgid "Boot continues in 10 sec" -msgstr "" +msgstr "Oppstarten fortsetter om 10 sekunder" msgid "Enter LUKS passphrase" msgstr "Angi passfrase for LUKS" @@ -84,6 +85,8 @@ msgid "" "The system will not be able to reboot. Please make sure to fixup and install " "the bootloader before next reboot. Check /var/log/boot.kiwi for details" msgstr "" +"Systemet vil ikke klare å starte. Du må reparere og installere bootloaderen " +"før neste omstart. Se /var/log/boot.kiwi for mer informasjon" msgid "Please remove the CD/DVD before reboot" msgstr "Ta ut CD/DVD-platen før du starter på nytt"
0
a04eaaecd33498614ae2e9613e59ceb39ad9cd35
https://github.com/aptana/Jaxer/commit/a04eaaecd33498614ae2e9613e59ceb39ad9cd35
mor gitignore stuff; fix socket tests
diff --git a/.gitignore b/.gitignore index aa3ec9c82..069e2785a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,12 @@ server/src/httpd-2.2.6/ server/src/libevent/ server/src/google/google_breakpad/ server/local_settings.py +server/framework/src/ +server/framework/tests/ +server/framework/build*Config.js +server/src/connectors/servlet/com/ +server/src/connectors/servlet/products/ +server/src/connectors/servlet/*.jar server/src/mozilla/.mozconfig server/src/mozilla/.mozconfig.mk server/src/mozilla/ff-release/ diff --git a/server/framework/IO/unit_tests_jaxer/test_IO_BinarySocket.html b/server/framework/IO/unit_tests_jaxer/test_IO_BinarySocket.html index aa49b8171..da7b7181a 100644 --- a/server/framework/IO/unit_tests_jaxer/test_IO_BinarySocket.html +++ b/server/framework/IO/unit_tests_jaxer/test_IO_BinarySocket.html @@ -10,7 +10,7 @@ try { - sock.open("www.aptana.com", 80); + sock.open("www.jaxer.org", 80); var strData = 'HEAD / HTTP/1.0\n\n'; var byteArray = []; for (var i=0, len = strData.length; i<len; i++) @@ -50,7 +50,7 @@ try { - sock.open("www.aptana.com", 80); + sock.open("www.jaxer.org", 80); var strData = 'HEAD / HTTP/1.0\n\n'; sock.writeByteString(strData); sock.flush(); diff --git a/server/framework/IO/unit_tests_jaxer/test_IO_Socket.html b/server/framework/IO/unit_tests_jaxer/test_IO_Socket.html index 35ed060e9..2b152c98c 100644 --- a/server/framework/IO/unit_tests_jaxer/test_IO_Socket.html +++ b/server/framework/IO/unit_tests_jaxer/test_IO_Socket.html @@ -10,7 +10,7 @@ try { - sock.open("www.aptana.com", 80); + sock.open("www.jaxer.org", 80); sock.writeString('GET / HTTP/1.0\n\n'); sock.flush();
0
bb76cbd5ae78658318f74cb2cf52b24929da1cca
https://github.com/GStreamer/gst-plugins-ugly/commit/bb76cbd5ae78658318f74cb2cf52b24929da1cca
Release 1.17.90
diff --git a/ChangeLog b/ChangeLog index f13613ce..b53c45e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,125 @@ +=== release 1.17.90 === + +2020-08-20 16:12:23 +0100 Tim-Philipp Müller <[email protected]> + + * ChangeLog: + * NEWS: + * RELEASE: + * gst-plugins-ugly.doap: + * meson.build: + Release 1.17.90 + +2020-07-15 10:49:03 +0300 Jordan Petridis <[email protected]> + + * tests/check/elements/amrnbenc.c: + amrnbenc: remove global variables + gstcheck is declaring its own buffers glist which ends up + overwritten, loks like the code meant to use that already + gcc 10 is also complaining about this, but only on static + builds for some reason + ``` + FAILED: subprojects/gst-plugins-ugly/tests/check/elements_amrnbenc + /usr/bin/ld: subprojects/gstreamer/libs/gst/check/libgstcheck-1.0.a(gstcheck.c.o):(.bss+0x38): multiple definition of `buffers'; subprojects/gst-plugins-ugly/tests/check/708af1f@@elements_amrnbenc@exe/elements_amrnbenc.c.o:(.bss+0x18): first defined here + collect2: error: ld returned 1 exit status + ``` + also remove unused var `current_buf` + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/62> + +2020-04-02 03:27:26 +1100 Jan Schmidt <[email protected]> + + * gst/realmedia/rmdemux.c: + rmdemux: Don't ignore the return value of gst_segment_do_seek() + If gst_segment_do_seek() fails, fail the seek. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/45> + +2020-04-01 19:34:30 +1100 Jan Schmidt <[email protected]> + + * gst/asfdemux/gstasfdemux.c: + asfdemux: Don't ignore the return result of gst_segment_do_seek() + gst_segment_do_seek() can fail, and our seek should fail + accordingly. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/45> + +2020-04-17 11:34:16 -0500 Derek Lesho <[email protected]> + + * gst/asfdemux/gstasfdemux.c: + asfdemux: Only forward SEEK event when in push mode. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/48> + +2020-07-25 21:19:20 +0100 Stéphane Cerveau <[email protected]> + + * meson.build: + meson: add a plugin summary + This summary displays a list of plugins which + have been enabled. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/65> + +2018-10-03 13:32:11 +0200 Thibault Saunier <[email protected]> + + * ext/x264/GstX264Enc.prs: + x264enc: Add a 'Zero Latency' profile + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/42> + +2020-07-22 17:31:37 +0200 Mathieu Duponchelle <[email protected]> + + * tests/check/elements/x264enc.c: + tests/x264enc: Don't declare variables inside the for loop header + This is a C99 feature + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/64> + +2020-07-21 15:40:26 +0200 Jan Alexander Steffens (heftig) <[email protected]> + + * tests/check/elements/x264enc.c: + tests: x264enc: Test formats are compatible with profile + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/59> + +2020-07-01 16:11:09 +0200 Jan Alexander Steffens (heftig) <[email protected]> + + * ext/x264/gstx264enc.c: + x264enc: Separate high-10 video formats from 8-bit formats + If downstream is constrained to an 8-bit profile, caps queries would + still allow I420_10LE as input. If upstream actually sends such a caps + event, downstream would fail to accept the high-10 profile. + The following pipeline now fails earlier, during the negotiation phase + instead of the stream start: + gst-launch-1.0 videotestsrc ! video/x-raw,format=I420_10LE \ + ! x264enc ! video/x-h264,profile=constrained-baseline \ + ! fakesink + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/59> + +2020-07-21 15:39:31 +0200 Jan Alexander Steffens (heftig) <[email protected]> + + * tests/check/elements/x264enc.c: + tests: x264enc: Test 10-bit formats + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/59> + +2020-07-21 15:33:57 +0200 Jan Alexander Steffens (heftig) <[email protected]> + + * tests/check/elements/x264enc.c: + tests: x264enc: Test all (8-bit) video formats + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/59> + +2020-07-06 22:13:55 -0400 Thibault Saunier <[email protected]> + + * ext/x264/gstx264enc.c: + x264enc: Forward downstream colorimetry and chroma-site upstream + So that the value can be used by upstream converters when necessary. + This whole logic has been copied from `__gst_video_element_proxy_caps` + but those 2 fields were missing. + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/60> + +2020-07-08 17:07:35 +0100 Tim-Philipp Müller <[email protected]> + + * meson.build: + * scripts/extract-release-date-from-doap-file.py: + meson: set release date from .doap file for releases + Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/61> + +2020-07-03 02:03:37 +0100 Tim-Philipp Müller <[email protected]> + + * meson.build: + Back to development + === release 1.17.2 === 2020-07-03 00:29:25 +0100 Tim-Philipp Müller <[email protected]> diff --git a/NEWS b/NEWS index 39b682a8..c216f07f 100644 --- a/NEWS +++ b/NEWS @@ -1,22 +1,14 @@ +GStreamer 1.18 Release Notes - -GSTREAMER 1.18 RELEASE NOTES - - -THESE RELEASE NOTES ARE A PLACEHOLDER, PLEASE BEAR WITH US WHILE WE -FINISH WRITING UP THE REAL THING. +These release notes are a placeholder, please bear with us while we +finish writing up the real thing. GStreamer 1.18.0 has not yet been released. It is scheduled for release -in summer 2020 now. +in late August / early September 2020. 1.17.x is the unstable development series that is currently being developed in the git master branch and which will eventually result in -1.18, and 1.17.2 is the current development release in that series. - -The schedule for the 1.18 development cycle is yet to be confirmed, but -it is expected that feature freeze will be in June/July 2020, followed -by several 1.17 pre-releases and then a new 1.18 stable release in -July/August 2020. +1.18, and 1.17.90 is the current 1.18 pre-release in that series. 1.18 will be backwards-compatible to the stable 1.16, 1.14, 1.12, 1.10, 1.8, 1.6, 1.4, 1.2 and 1.0 release series. @@ -24,8 +16,7 @@ July/August 2020. See https://gstreamer.freedesktop.org/releases/1.18/ for the latest version of this document. -_Last updated: Wednesday 1 July 2020, 23:50 UTC (log)_ - +Last updated: Wednesday 20 August 2020, 11:00 UTC (log) Introduction @@ -36,12 +27,10 @@ framework! As always, this release is again packed with many new features, bug fixes and other improvements. - Highlights - FIXME - Major new features and changes Noteworthy new API @@ -66,12 +55,10 @@ The following plugins have been removed from gst-plugins-bad: - FIXME - Miscellaneous API additions - FIXME - Miscellaneous performance and memory optimisations As always there have been many performance and memory usage improvements @@ -88,7 +75,6 @@ GstPlayer - FIXME - Miscellaneous changes - FIXME @@ -97,62 +83,50 @@ OpenGL integration - FIXME - Tracing framework and debugging improvements - FIXME - Tools - FIXME - GStreamer RTSP server - FIXME - GStreamer VAAPI - FIXME - GStreamer OMX - FIXME - GStreamer Editing Services and NLE - FIXME - GStreamer validate - FIXME - GStreamer Python Bindings - FIXME - GStreamer C# Bindings - FIXME - GStreamer Rust Bindings - FIXME - GStreamer Rust Plugins - FIXME - Build and Dependencies - The Autotools build system has finally been removed in favour of the @@ -177,7 +151,6 @@ Cerbero has seen a number of improvements: - FIXME - Platform-specific changes and improvements Android @@ -194,7 +167,6 @@ Windows - FIXME - Contributors - FIXME @@ -202,7 +174,6 @@ Contributors … and many others who have contributed bug reports, translations, sent suggestions or helped testing. - Stable 1.18 branch After the 1.18.0 release there will be several 1.18.x bug-fix releases @@ -215,12 +186,10 @@ the git 1.18 branch, which will be a stable branch. 1.18.0 has not been released yet. - Known Issues - FIXME - Schedule for 1.20 Our next major feature release will be 1.20, and 1.19 will be the @@ -234,7 +203,7 @@ The plan for the 1.20 development cycle is yet to be confirmed. ------------------------------------------------------------------------ -_These release notes have been prepared by Tim-Philipp Müller with_ -_contributions from … (FIXME)_ +These release notes have been prepared by Tim-Philipp Müller with +contributions from … (FIXME) -_License: CC BY-SA 4.0_ +License: CC BY-SA 4.0 diff --git a/RELEASE b/RELEASE index 8749338a..9942ac02 100644 --- a/RELEASE +++ b/RELEASE @@ -1,4 +1,4 @@ -This is GStreamer gst-plugins-ugly 1.17.2. +This is GStreamer gst-plugins-ugly 1.17.90. GStreamer 1.17 is the development branch leading up to the next major stable version which will be 1.18. diff --git a/gst-plugins-ugly.doap b/gst-plugins-ugly.doap index b67b8d77..eec778fa 100644 --- a/gst-plugins-ugly.doap +++ b/gst-plugins-ugly.doap @@ -33,6 +33,16 @@ might be widely known to present patent problems. </GitRepository> </repository> + <release> + <Version> + <revision>1.17.90</revision> + <branch>master</branch> + <name></name> + <created>2020-08-20</created> + <file-release rdf:resource="https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.17.90.tar.xz" /> + </Version> + </release> + <release> <Version> <revision>1.17.2</revision> diff --git a/meson.build b/meson.build index 7111f1e8..1f8d0b5f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gst-plugins-ugly', 'c', - version : '1.17.2.1', + version : '1.17.90', meson_version : '>= 0.48', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ])
0
a3002d3d416524c53da6534a819a41db8c952e9d
https://github.com/cocos2d/cocos2d-objc/commit/a3002d3d416524c53da6534a819a41db8c952e9d
Issue 444: fix memory leak from CF copy rule not being followed. Former-commit-id: 1c72ca8a62aa96e1ef973e497108859d3e77032f
diff --git a/CocosDenshion/CDOpenALSupport.h b/CocosDenshion/CDOpenALSupport.h index 981e8daeca..42f092acd2 100644 --- a/CocosDenshion/CDOpenALSupport.h +++ b/CocosDenshion/CDOpenALSupport.h @@ -240,6 +240,10 @@ void* MyGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *out CFStringRef extension = CFURLCopyPathExtension(inFileURL); CFComparisonResult isWavFile = CFStringCompare (extension,(CFStringRef)@"wav", kCFCompareCaseInsensitive); + if (extension != NULL) { + CFRelease(extension); + } + if (isWavFile == kCFCompareEqualTo) { return loadWaveAudioData(inFileURL, outDataSize, outDataFormat, outSampleRate); } else {
1
e643104ce36c851d7ab56f419ec4a4ddb743a548
https://github.com/Yubico/libu2f-host/commit/e643104ce36c851d7ab56f419ec4a4ddb743a548
Merge branch 'pr-151'
diff --git a/70-u2f.rules b/70-u2f.rules index 0c2bc69..1f90ddf 100644 --- a/70-u2f.rules +++ b/70-u2f.rules @@ -65,8 +65,8 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct # Infineon FIDO KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="058b", ATTRS{idProduct}=="022d", TAG+="uaccess", GROUP="plugdev", MODE="0660" -# Ledger Nano S and Nano X -KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001|0004", TAG+="uaccess", GROUP="plugdev", MODE="0660" +# Ledger Blue, Nano S and Nano X +KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0000|0001|0004|0005|0015|1005|1015|4005|4015", TAG+="uaccess", GROUP="plugdev", MODE="0660" # Kensington VeriMark KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="06cb", ATTRS{idProduct}=="0088", TAG+="uaccess", GROUP="plugdev", MODE="0660"
0
2be299cd6617427fe5c89f1894a9d91fd9e2ed08
https://github.com/Matroska-Org/libmatroska/commit/2be299cd6617427fe5c89f1894a9d91fd9e2ed08
KaxSemantic.h: fix missing function declarations
diff --git a/matroska/KaxSemantic.h b/matroska/KaxSemantic.h index 3d65db3..fc7f87e 100644 --- a/matroska/KaxSemantic.h +++ b/matroska/KaxSemantic.h @@ -693,9 +693,13 @@ DECLARE_MKX_BINARY (KaxFileReferral) }; DECLARE_MKX_UINTEGER(KaxFileUsedStartTime) +public: + filepos_t RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault); }; DECLARE_MKX_UINTEGER(KaxFileUsedEndTime) +public: + filepos_t RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault); };
0
75830a792c8d67dfc5a14b76af4b134727826680
https://github.com/litecart/litecart/commit/75830a792c8d67dfc5a14b76af4b134727826680
* Fix wrong variable name causing error while importing new categories via CSV
diff --git a/public_html/admin/catalog.app/csv.inc.php b/public_html/admin/catalog.app/csv.inc.php index 93312286..239e5be3 100644 --- a/public_html/admin/catalog.app/csv.inc.php +++ b/public_html/admin/catalog.app/csv.inc.php @@ -238,9 +238,9 @@ "insert into ". DB_TABLE_CATEGORIES ." (id, date_created) values (". (int)$row['id'] .", '". date('Y-m-d H:i:s') ."');" ); - $page = new ent_category($row['id']); + $category = new ent_category($row['id']); } else { - $page = new ent_category(); + $category = new ent_category(); } }
0
2edaafe5b93832715781851dfe2663da228a05ad
https://github.com/libav/libav/commit/2edaafe5b93832715781851dfe2663da228a05ad
libfdk-aacdec: Allow setting the new dynamic range control effect setting This is a new setting in FDK v2. Signed-off-by: Martin Storsjö <[email protected]>
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index c3d3b70fc9..ca70a49ad4 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -51,6 +51,7 @@ typedef struct FDKAACDecContext { int drc_level; int drc_boost; int drc_heavy; + int drc_effect; int drc_cut; int level_limit; } FDKAACDecContext; @@ -77,6 +78,10 @@ static const AVOption fdk_aac_dec_options[] = { OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, #if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 { "level_limit", "Signal level limiting", OFFSET(level_limit), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 1, AD }, +#endif +#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 + { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general", + OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL }, #endif { NULL } }; @@ -306,6 +311,15 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx) } #endif +#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 + if (s->drc_effect != -1) { + if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n"); + return AVERROR_UNKNOWN; + } + } +#endif + avctx->sample_fmt = AV_SAMPLE_FMT_S16; s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
0
34834eef8ac830b9145df169ec22016a4350f06e
https://github.com/johndyer/mediaelement/commit/34834eef8ac830b9145df169ec22016a4350f06e
Simplify allowed Flash querystring parameters
diff --git a/src/flash/FlashMediaElement.as b/src/flash/FlashMediaElement.as index 10a5e3815..98e4364ce 100644 --- a/src/flash/FlashMediaElement.as +++ b/src/flash/FlashMediaElement.as @@ -25,8 +25,6 @@ package { import htmlelements.HLSMediaElement; [SWF(backgroundColor="0x000000")] // Set SWF background color - - public class FlashMediaElement extends MovieClip { private var _mediaUrl:String; @@ -99,8 +97,10 @@ package { public function FlashMediaElement() { - // check for security issues (borrowed from jPLayer) - checkFlashVars(loaderInfo.parameters); + + if (isIllegalQuerystring()) { + return; + } // allows this player to be called from a different domain than the HTML page hosting the player CONFIG::cdnBuild { @@ -108,25 +108,7 @@ package { Security.allowInsecureDomain('*'); } - if (securityIssue) { - return; - } - - // get parameters - // Use only FlashVars, ignore QueryString - var params:Object, pos:int, query:Object; - - params = LoaderInfo(this.root.loaderInfo).parameters; - pos = root.loaderInfo.url.indexOf('?'); - if (pos !== -1) { - query = parseStr(root.loaderInfo.url.substr(pos + 1)); - - for (var key:String in params) { - if (query.hasOwnProperty(trim(key))) { - delete params[key]; - } - } - } + var params:Object = LoaderInfo(this.root.loaderInfo).parameters; CONFIG::debugBuild { _debug = (params['debug'] != undefined) ? (String(params['debug']) == "true") : false; @@ -456,43 +438,20 @@ package { } } - // borrowed from jPLayer - // https://github.com/happyworm/jPlayer/blob/e8ca190f7f972a6a421cb95f09e138720e40ed6d/actionscript/Jplayer.as#L228 - private function checkFlashVars(p:Object):void { - var i:Number = 0; - for (var s:String in p) { - if (isIllegalChar(p[s], s === 'file')) { - securityIssue = true; // Illegal char found - } - i++; - } - if (i === 0 || securityIssue) { - directAccess = true; - } - } - - private static function parseStr (str:String) : Object { - var hash:Object = {}, - arr1:Array, arr2:Array; - - str = unescape(str).replace(/\+/g, " "); - - arr1 = str.split('&'); - if (!arr1.length) { - return {}; - } - - for (var i:uint = 0, length:uint = arr1.length; i < length; i++) { - arr2 = arr1[i].split('='); - if (!arr2.length) { - continue; - } - hash[trim(arr2[0])] = trim(arr2[1]); - } - return hash; + private function isIllegalQuerystring():Boolean { + var query:String = ''; + var pos:Number = root.loaderInfo.url.indexOf('?') ; + + if ( pos > -1 ) { + query = root.loaderInfo.url.substring( pos ); + if ( ! /^\?\d+$/.test( query ) ) { + return true; + } + } + + return false; } - private static function trim(str:String) : String { if (!str) { return str; @@ -501,21 +460,6 @@ package { return str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); } - private function isIllegalChar(s:String, isUrl:Boolean):Boolean { - var illegals:String = "' \" ( ) { } * + \\ < >"; - if (isUrl) { - illegals = "\" { } \\ < >"; - } - if (Boolean(s)) { // Otherwise exception if parameter null. - for each (var illegal:String in illegals.split(' ')) { - if (s.indexOf(illegal) >= 0) { - return true; // Illegal char found - } - } - } - return false; - } - // START: Controls and events private function mouseActivityMove(event:MouseEvent):void { diff --git a/src/js/me-shim.js b/src/js/me-shim.js index ddc67fb97..bcc0cee40 100644 --- a/src/js/me-shim.js +++ b/src/js/me-shim.js @@ -579,7 +579,7 @@ mejs.HtmlMediaElementShim = { specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + -'<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' + +'<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date().getTime()) + '" />' + '<param name="flashvars" value="' + initVars.join('&amp;') + '" />' + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' +
1
e8155f1f3af88b4d08802716a7054950ef18d827
https://github.com/WAVM/WAVM/commit/e8155f1f3af88b4d08802716a7054950ef18d827
Fix `isSubtype(ReferenceType, ReferenceType)` getting out of sync with `isSubtype(ValueType, ValueType)`.
diff --git a/Include/WAVM/IR/Types.h b/Include/WAVM/IR/Types.h index 5d13b3e51..ea211f1ff 100644 --- a/Include/WAVM/IR/Types.h +++ b/Include/WAVM/IR/Types.h @@ -63,17 +63,7 @@ namespace WAVM { namespace IR { inline bool isSubtype(ReferenceType subtype, ReferenceType supertype) { - if(subtype == supertype) { return true; } - else - { - switch(supertype) - { - case ReferenceType::externref: return subtype == ReferenceType::funcref; - case ReferenceType::funcref: - case ReferenceType::none: - default: return false; - } - } + return isSubtype(asValueType(subtype), asValueType(supertype)); } inline std::string asString(I32 value) { return std::to_string(value); }
0
ac557ce7fd11e1a3486a756cdba008d67eb32fca
https://github.com/hs-web/hsweb-framework/commit/ac557ce7fd11e1a3486a756cdba008d67eb32fca
优化异常
diff --git a/hsweb-core/src/main/java/org/hswebframework/web/exception/NotFoundException.java b/hsweb-core/src/main/java/org/hswebframework/web/exception/NotFoundException.java index b63bf1d48..504504cce 100644 --- a/hsweb-core/src/main/java/org/hswebframework/web/exception/NotFoundException.java +++ b/hsweb-core/src/main/java/org/hswebframework/web/exception/NotFoundException.java @@ -18,9 +18,11 @@ package org.hswebframework.web.exception; -/** - * - */ +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + + +@ResponseStatus(HttpStatus.NOT_FOUND) public class NotFoundException extends BusinessException { public NotFoundException(String message) { super(message, 404); diff --git a/hsweb-core/src/main/java/org/hswebframework/web/exception/ValidationException.java b/hsweb-core/src/main/java/org/hswebframework/web/exception/ValidationException.java index 44e7852d5..da0af918f 100644 --- a/hsweb-core/src/main/java/org/hswebframework/web/exception/ValidationException.java +++ b/hsweb-core/src/main/java/org/hswebframework/web/exception/ValidationException.java @@ -3,14 +3,18 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; import javax.validation.ConstraintViolation; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Set; @Getter @Setter +@ResponseStatus(HttpStatus.BAD_REQUEST) public class ValidationException extends BusinessException { private List<Detail> details; @@ -19,6 +23,10 @@ public ValidationException(String message) { super(message); } + public ValidationException(String property, String message) { + this(message, Collections.singletonList(new Detail(property, message, null))); + } + public ValidationException(String message, List<Detail> details) { super(message); this.details = details;
0
780b77339bd2e0f6f40c68c632788151e14915f4
https://github.com/winscp/winscp/commit/780b77339bd2e0f6f40c68c632788151e14915f4
Bug 1946: Hang when S3 server returns a truncated listing with folders only https://winscp.net/tracker/1946 (cherry picked from commit c99d121067add5088d51545ce92a501c0de686b7) Source commit: 4f58f62525e13801145af0971f6ae94cba25bf3d
diff --git a/source/core/S3FileSystem.cpp b/source/core/S3FileSystem.cpp index 9ff5020d3..f04d67461 100644 --- a/source/core/S3FileSystem.cpp +++ b/source/core/S3FileSystem.cpp @@ -739,7 +739,7 @@ void TS3FileSystem::TryOpenDirectory(const UnicodeString & Directory) { FTerminal->LogEvent(FORMAT(L"Trying to open directory \"%s\".", (Directory))); std::unique_ptr<TRemoteFileList> FileList(new TRemoteFileList()); - ReadDirectoryInternal(Directory, FileList.get(), 1, UnicodeString()); + ReadDirectoryInternal(Directory, FileList.get(), -1, UnicodeString()); } //--------------------------------------------------------------------------- void __fastcall TS3FileSystem::ChangeDirectory(const UnicodeString ADirectory) @@ -901,9 +901,10 @@ void TS3FileSystem::ReadDirectoryInternal( MaxKeys = 0; } + int AMaxKeys = (MaxKeys == -1) ? 1 : MaxKeys; S3_list_service( FLibS3Protocol, FAccessKeyId.c_str(), FSecretAccessKey.c_str(), FSecurityToken, (FHostName + FPortSuffix).c_str(), - StrToS3(FAuthRegion), MaxKeys, FRequestContext, FTimeout, &ListServiceHandler, &Data); + StrToS3(FAuthRegion), AMaxKeys, FRequestContext, FTimeout, &ListServiceHandler, &Data); HandleNonBucketStatus(Data, Retry); } @@ -932,13 +933,20 @@ void TS3FileSystem::ReadDirectoryInternal( Continue = false; - if (Data.IsTruncated && ((MaxKeys == 0) || (Data.KeyCount < MaxKeys))) + if (Data.IsTruncated) { - bool Cancel = false; - FTerminal->DoReadDirectoryProgress(FileList->Count, false, Cancel); - if (!Cancel) + // We have report that with max-keys=1, server can return IsTruncated response with no keys, + // so we would loop infinitelly. For now, if we do GET request only to check for bucket/folder existence (MaxKeys == -1), + // we are happy with a successfull response and never loop, even if IsTruncated. + if ((MaxKeys == 0) || + ((MaxKeys > 0) && (Data.KeyCount < MaxKeys))) { - Continue = true; + bool Cancel = false; + FTerminal->DoReadDirectoryProgress(FileList->Count, false, Cancel); + if (!Cancel) + { + Continue = true; + } } } } while (Continue);
0
5430f30c79383e4d2d87785468905fcb00bace58
https://github.com/apache/tomcat80/commit/5430f30c79383e4d2d87785468905fcb00bace58
Expand the session attribute filtering options - new option to filter based on implementation class of value - new option to log a warning message if an attribute is filtered out - always log a message at at least debug level if an attribute is filtered out git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk@1726196 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/java/org/apache/catalina/ha/session/ClusterManagerBase.java b/java/org/apache/catalina/ha/session/ClusterManagerBase.java index 13439f735..a9525d995 100644 --- a/java/org/apache/catalina/ha/session/ClusterManagerBase.java +++ b/java/org/apache/catalina/ha/session/ClusterManagerBase.java @@ -192,6 +192,9 @@ protected void clone(ClusterManagerBase copy) { copy.setProcessExpiresFrequency(getProcessExpiresFrequency()); copy.setNotifyListenersOnReplication(isNotifyListenersOnReplication()); copy.setSessionAttributeFilter(getSessionAttributeFilter()); + copy.setSessionAttributeNameFilter(getSessionAttributeNameFilter()); + copy.setSessionAttributeValueClassNameFilter(getSessionAttributeValueClassNameFilter()); + copy.setWarnOnSessionAttributeFilterFailure(getWarnOnSessionAttributeFilterFailure()); copy.setSecureRandomClass(getSecureRandomClass()); copy.setSecureRandomProvider(getSecureRandomProvider()); copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm()); diff --git a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml index f19691ad5..b8bfa05b1 100644 --- a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml +++ b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml @@ -318,6 +318,14 @@ name="sessionAttributeNameFilter" descritpion="The string pattern used for including session attributes in replication. Null means all attributes are included." type="java.lang.String"/> + <attribute + name="sessionAttributeValueClassNameFilter" + description="The regular expression used to filter session attributes based on the implementation class of the value. The regular expression is anchored and must match the fully qualified class name." + type="java.lang.String"/> + <attribute + name="warnOnSessionAttributeFilterFailure" + description="Should a WARN level log message be generated if a session attribute fails to match sessionAttributeNameFilter or sessionAttributeClassNameFilter?" + type="boolean"/> <operation name="expireSession" description="Expired the given session" @@ -544,6 +552,14 @@ name="sessionAttributeNameFilter" descritpion="The string pattern used for including session attributes in replication. Null means all attributes are included." type="java.lang.String"/> + <attribute + name="sessionAttributeValueClassNameFilter" + description="The regular expression used to filter session attributes based on the implementation class of the value. The regular expression is anchored and must match the fully qualified class name." + type="java.lang.String"/> + <attribute + name="warnOnSessionAttributeFilterFailure" + description="Should a WARN level log message be generated if a session attribute fails to match sessionAttributeNameFilter or sessionAttributeClassNameFilter?" + type="boolean"/> <operation name="expireSession" description="Expired the given session" diff --git a/java/org/apache/catalina/session/LocalStrings.properties b/java/org/apache/catalina/session/LocalStrings.properties index 2758e9538..e6f046d04 100644 --- a/java/org/apache/catalina/session/LocalStrings.properties +++ b/java/org/apache/catalina/session/LocalStrings.properties @@ -33,6 +33,8 @@ JDBCStore.commitSQLException=SQLException committing connection before closing managerBase.container.noop=Managers added to containers other than Contexts will never be used managerBase.contextNull=The Context must be set to a non-null value before the Manager is used managerBase.createSession.ise=createSession: Too many active sessions +managerBase.sessionAttributeNameFilter=Skipped session attribute named [{0}] because it did not match the name filter [{1}] +managerBase.sessionAttributeValueClassNameFilter=Skipped session attribute named [{0}] because the value type [{1}] did not match the filter [{2}] managerBase.sessionTimeout=Invalid session timeout setting {0} managerBase.setContextNotNew=It is illegal to call setContext() to change the Context associated with a Manager if the Manager is not in the NEW state standardManager.loading=Loading persisted sessions from {0} diff --git a/java/org/apache/catalina/session/ManagerBase.java b/java/org/apache/catalina/session/ManagerBase.java index a1c170fa1..f42887093 100644 --- a/java/org/apache/catalina/session/ManagerBase.java +++ b/java/org/apache/catalina/session/ManagerBase.java @@ -33,6 +33,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; import org.apache.catalina.Container; import org.apache.catalina.Context; @@ -214,6 +215,10 @@ private Pattern sessionAttributeNamePattern; + private Pattern sessionAttributeValueClassNamePattern; + + private boolean warnOnSessionAttributeFilterFailure; + // ------------------------------------------------------------- Properties @@ -238,6 +243,86 @@ protected Pattern getSessionAttributeNamePattern() { } + /** + * Obtain the regular expression used to filter session attribute based on + * the implementation class of the value. The regular expression is anchored + * and must match the fully qualified class name. + * + * @return The regular expression currently used to filter class names. + * {@code null} means no filter is applied. If an empty string is + * specified then no names will match the filter and all attributes + * will be blocked. + */ + public String getSessionAttributeValueClassNameFilter() { + if (sessionAttributeValueClassNamePattern == null) { + return null; + } + return sessionAttributeValueClassNamePattern.toString(); + } + + + /** + * Provides {@link #getSessionAttributeValueClassNameFilter()} as a + * pre-compiled regular expression pattern. + * + * @return The pre-compiled pattern used to filter session attributes based + * on the implementation class name of the value. {@code null} means + * no filter is applied. + */ + protected Pattern getSessionAttributeValueClassNamePattern() { + return sessionAttributeValueClassNamePattern; + } + + + /** + * Set the regular expression to use to filter classes used for session + * attributes. The regular expression is anchored and must match the fully + * qualified class name. + * + * @param sessionAttributeValueClassNameFilter The regular expression to use + * to filter session attributes based on class name. Use {@code + * null} if no filtering is required. If an empty string is + * specified then no names will match the filter and all + * attributes will be blocked. + * + * @throws PatternSyntaxException If the expression is not valid + */ + public void setSessionAttributeValueClassNameFilter(String sessionAttributeValueClassNameFilter) + throws PatternSyntaxException { + if (sessionAttributeValueClassNameFilter == null || + sessionAttributeValueClassNameFilter.length() == 0) { + sessionAttributeValueClassNamePattern = null; + } + sessionAttributeValueClassNamePattern = + Pattern.compile(sessionAttributeValueClassNameFilter); + } + + + /** + * Should a warn level log message be generated if a session attribute is + * not persisted / replicated / restored. + * + * @return {@code true} if a warn level log message should be generated + */ + public boolean getWarnOnSessionAttributeFilterFailure() { + return warnOnSessionAttributeFilterFailure; + } + + + /** + * Configure whether or not a warn level log message should be generated if + * a session attribute is not persisted / replicated / restored. + * + * @param warnOnSessionAttributeFilterFailure {@code true} if the + * warn level message should be generated + * + */ + public void setWarnOnSessionAttributeFilterFailure( + boolean warnOnSessionAttributeFilterFailure) { + this.warnOnSessionAttributeFilterFailure = warnOnSessionAttributeFilterFailure; + } + + @Override @Deprecated public Container getContainer() { @@ -784,10 +869,39 @@ protected void changeSessionId(Session session, String newId, @Override public boolean willAttributeDistribute(String name, Object value) { Pattern sessionAttributeNamePattern = getSessionAttributeNamePattern(); - if (sessionAttributeNamePattern == null) { - return true; + if (sessionAttributeNamePattern != null) { + if (!sessionAttributeNamePattern.matcher(name).matches()) { + if (getWarnOnSessionAttributeFilterFailure() || log.isDebugEnabled()) { + String msg = sm.getString("managerBase.sessionAttributeNameFilter", + name, sessionAttributeNamePattern); + if (getWarnOnSessionAttributeFilterFailure()) { + log.warn(msg); + } else { + log.debug(msg); + } + } + return false; + } } - return sessionAttributeNamePattern.matcher(name).matches(); + + Pattern sessionAttributeValueClassNamePattern = getSessionAttributeValueClassNamePattern(); + if (value != null && sessionAttributeValueClassNamePattern != null) { + if (!sessionAttributeValueClassNamePattern.matcher( + value.getClass().getName()).matches()) { + if (getWarnOnSessionAttributeFilterFailure() || log.isDebugEnabled()) { + String msg = sm.getString("managerBase.sessionAttributeValueClassNameFilter", + name, value.getClass().getName(), sessionAttributeNamePattern); + if (getWarnOnSessionAttributeFilterFailure()) { + log.warn(msg); + } else { + log.debug(msg); + } + } + return false; + } + } + + return true; } diff --git a/java/org/apache/catalina/session/mbeans-descriptors.xml b/java/org/apache/catalina/session/mbeans-descriptors.xml index 31af91bba..cb4851ed3 100644 --- a/java/org/apache/catalina/session/mbeans-descriptors.xml +++ b/java/org/apache/catalina/session/mbeans-descriptors.xml @@ -137,6 +137,14 @@ descritpion="The string pattern used for including session attributes in distribution. Null means all attributes are included." type="java.lang.String"/> + <attribute name="sessionAttributeValueClassNameFilter" + description="The regular expression used to filter session attributes based on the implementation class of the value. The regular expression is anchored and must match the fully qualified class name." + type="java.lang.String"/> + + <attribute name="warnOnSessionAttributeFilterFailure" + description="Should a WARN level log message be generated if a session attribute fails to match sessionAttributeNameFilter or sessionAttributeClassNameFilter?" + type="boolean"/> + <operation name="backgroundProcess" description="Invalidate all sessions that have expired." impact="ACTION" @@ -329,6 +337,14 @@ descritpion="The string pattern used for including session attributes in distribution. Null means all attributes are included." type="java.lang.String"/> + <attribute name="sessionAttributeValueClassNameFilter" + description="The regular expression used to filter session attributes based on the implementation class of the value. The regular expression is anchored and must match the fully qualified class name." + type="java.lang.String"/> + + <attribute name="warnOnSessionAttributeFilterFailure" + description="Should a WARN level log message be generated if a session attribute fails to match sessionAttributeNameFilter or sessionAttributeClassNameFilter?" + type="boolean"/> + <operation name="backgroundProcess" description="Invalidate all sessions that have expired." impact="ACTION" diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 4972279fc..7938c2f38 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -161,6 +161,13 @@ well as unload to ensure that configuration changes made while the web application is stopped are applied to any persisted data. (markt) </add> + <add> + Extend the session attribute filtering options to include filtering + based on the implementation class of the value and optional + <code>WARN</code> level logging if an attribute is filtered. These + options are avaialble for all of the Manager implementations that ship + with Tomcat. (markt) + </add> </changelog> </subsection> <subsection name="Jasper"> diff --git a/webapps/docs/config/cluster-manager.xml b/webapps/docs/config/cluster-manager.xml index 5950e56d2..e0a7a9ddc 100644 --- a/webapps/docs/config/cluster-manager.xml +++ b/webapps/docs/config/cluster-manager.xml @@ -77,17 +77,6 @@ when session attributes are being replicated or removed across Tomcat nodes in the cluster. </attribute> - <attribute name="sessionAttributeNameFilter" required="false"> - A regular expression used to filter which session attributes will be - replicated. An attribute will only be replicated if its name matches - this pattern. If the pattern is zero length or <code>null</code>, all - attributes are eligible for replication. The pattern is anchored so the - session attribute name must fully match the pattern. As an example, the - value <code>(userName|sessionHistory)</code> will only replicate the - two session attributes named <code>userName</code> and - <code>sessionHistory</code>. If not specified, the default value of - <code>null</code> will be used. - </attribute> <attribute name="maxInactiveInterval" required="false"> <p>The initial maximum time interval, in seconds, between client requests before a session is invalidated. A negative value @@ -191,6 +180,26 @@ effective only when <code>sendAllSessions</code> is <code>false</code>. Default is <code>2000</code> milliseconds. </attribute> + <attribute name="sessionAttributeNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if its name matches + this pattern. If the pattern is zero length or <code>null</code>, all + attributes are eligible for replication. The pattern is anchored so the + session attribute name must fully match the pattern. As an example, the + value <code>(userName|sessionHistory)</code> will only replicate the + two session attributes named <code>userName</code> and + <code>sessionHistory</code>. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> + <attribute name="sessionAttributeValueClassNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if the implementation + class name of the value matches this pattern. If the pattern is zero + length or <code>null</code>, all attributes are eligible for + replication. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> <attribute name="stateTimestampDrop" required="false"> When this node sends a <code>GET_ALL_SESSIONS</code> message to other node, all session messages that are received as a response are queued. @@ -202,6 +211,14 @@ If set to <code>false</code>, all queued session messages are handled. Default is <code>true</code>. </attribute> + <attribute name="warnOnSessionAttributeFilterFailure" required="false"> + <p>If <strong>sessionAttributeNameFilter</strong> or + <strong>sessionAttributeValueClassNameFilter</strong> blocks an + attribute, should this be logged at <code>WARN</code> level? If + <code>WARN</code> level logging is disabled then it will be logged at + <code>DEBUG</code>. The default value of this attribute is + <code>false</code>.</p> + </attribute> </attributes> </subsection> <subsection name="org.apache.catalina.ha.session.BackupManager Attributes"> @@ -225,6 +242,26 @@ another map. Default value is <code>15000</code> milliseconds. </attribute> + <attribute name="sessionAttributeNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if its name matches + this pattern. If the pattern is zero length or <code>null</code>, all + attributes are eligible for replication. The pattern is anchored so the + session attribute name must fully match the pattern. As an example, the + value <code>(userName|sessionHistory)</code> will only replicate the + two session attributes named <code>userName</code> and + <code>sessionHistory</code>. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> + <attribute name="sessionAttributeValueClassNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if the implementation + class name of the value matches this pattern. If the pattern is zero + length or <code>null</code>, all attributes are eligible for + replication. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> <attribute name="terminateOnStartFailure" required="false"> Set to true if you wish to terminate replication map when replication map fails to start. If replication map is terminated, associated context @@ -232,6 +269,14 @@ does not end. It will try to join the map membership in the heartbeat. Default value is <code>false</code> . </attribute> + <attribute name="warnOnSessionAttributeFilterFailure" required="false"> + <p>If <strong>sessionAttributeNameFilter</strong> or + <strong>sessionAttributeValueClassNameFilter</strong> blocks an + attribute, should this be logged at <code>WARN</code> level? If + <code>WARN</code> level logging is disabled then it will be logged at + <code>DEBUG</code>. The default value of this attribute is + <code>false</code>.</p> + </attribute> </attributes> </subsection> </section> diff --git a/webapps/docs/config/manager.xml b/webapps/docs/config/manager.xml index 2c2a58b91..2ed089d89 100644 --- a/webapps/docs/config/manager.xml +++ b/webapps/docs/config/manager.xml @@ -176,7 +176,7 @@ </attribute> <attribute name="sessionAttributeNameFilter" required="false"> - A regular expression used to filter which session attributes will be + <p>A regular expression used to filter which session attributes will be distributed. An attribute will only be distributed if its name matches this pattern. If the pattern is zero length or <code>null</code>, all attributes are eligible for distribution. The pattern is anchored so the @@ -184,7 +184,26 @@ value <code>(userName|sessionHistory)</code> will only distribute the two session attributes named <code>userName</code> and <code>sessionHistory</code>. If not specified, the default value of - <code>null</code> will be used. + <code>null</code> will be used.</p> + </attribute> + + <attribute name="sessionAttributeValueClassNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + distributed. An attribute will only be distributed if the implementation + class name of the value matches this pattern. If the pattern is zero + length or <code>null</code>, all attributes are eligible for + distribution. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> + + <attribute name="warnOnSessionAttributeFilterFailure" required="false"> + <p>If <strong>sessionAttributeNameFilter</strong> or + <strong>sessionAttributeValueClassNameFilter</strong> blocks an + attribute, should this be logged at <code>WARN</code> level? If + <code>WARN</code> level logging is disabled then it will be logged at + <code>DEBUG</code>. The default value of this attribute is + <code>false</code>.</p> </attribute> </attributes> @@ -277,7 +296,7 @@ </attribute> <attribute name="sessionAttributeNameFilter" required="false"> - A regular expression used to filter which session attributes will be + <p>A regular expression used to filter which session attributes will be distributed. An attribute will only be distributed if its name matches this pattern. If the pattern is zero length or <code>null</code>, all attributes are eligible for distribution. The pattern is anchored so the @@ -285,7 +304,26 @@ value <code>(userName|sessionHistory)</code> will only distribute the two session attributes named <code>userName</code> and <code>sessionHistory</code>. If not specified, the default value of - <code>null</code> will be used. + <code>null</code> will be used.</p> + </attribute> + + <attribute name="sessionAttributeValueClassNameFilter" required="false"> + <p>A regular expression used to filter which session attributes will be + distributed. An attribute will only be distributed if the implementation + class name of the value matches this pattern. If the pattern is zero + length or <code>null</code>, all attributes are eligible for + distribution. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + <code>null</code> will be used.</p> + </attribute> + + <attribute name="warnOnSessionAttributeFilterFailure" required="false"> + <p>If <strong>sessionAttributeNameFilter</strong> or + <strong>sessionAttributeValueClassNameFilter</strong> blocks an + attribute, should this be logged at <code>WARN</code> level? If + <code>WARN</code> level logging is disabled then it will be logged at + <code>DEBUG</code>. The default value of this attribute is + <code>false</code>.</p> </attribute> </attributes>
1
778cbb37a5ace8d49c27811b0f26369a4d58a61a
https://github.com/octobercms/library/commit/778cbb37a5ace8d49c27811b0f26369a4d58a61a
Add color picker support to Field Parser. Includes support for "availableOptions" to be specified as an array, similar to the "options" attribute for dropdowns and checkbox lists. Fixes https://github.com/rainlab/pages-plugin/issues/373
diff --git a/src/Parse/Syntax/FieldParser.php b/src/Parse/Syntax/FieldParser.php index 5cdb69085..ec7db7293 100644 --- a/src/Parse/Syntax/FieldParser.php +++ b/src/Parse/Syntax/FieldParser.php @@ -1,6 +1,6 @@ <?php namespace October\Rain\Parse\Syntax; -use Exception; +use October\Rain\Exception\ApplicationException; /** * Dynamic Syntax parser @@ -48,6 +48,7 @@ class FieldParser 'fileupload', 'mediafinder', 'dropdown', + 'colorpicker', 'radio', 'checkbox', 'checkboxlist', @@ -243,6 +244,11 @@ protected function processTags($template, $usingTags = null) 'balloon-selector', ]; + // These fields take available colors for selection + $availableColors = [ + 'colorpicker', + ]; + foreach ($tagStrings as $key => $tagString) { $tagName = $tagNames[$key]; $params = $this->processParams($paramStrings[$key], $tagName); @@ -265,6 +271,10 @@ protected function processTags($template, $usingTags = null) $params['options'] = $this->processOptionsToArray($params['options']); } + if (in_array($tagName, $availableColors) && isset($params['availableColors'])) { + $params['availableColors'] = $this->processOptionsToArray($params['availableColors']); + } + // Convert trigger property to array if (isset($params['trigger'])) { $params['trigger'] = $this->processOptionsToArray($params['trigger']); @@ -398,7 +408,7 @@ protected function processTagsRegex($string, $tags) * \Path\To\Class::method -> \Path\To\Class::method(): array * * @param string $optionsString - * @throws Exception + * @throws ApplicationException if an invalid array is returned when using the callback method. * @return array */ protected function processOptionsToArray($optionsString) @@ -431,7 +441,7 @@ protected function processOptionsToArray($optionsString) if (strlen($key)) { if (!preg_match('/^[0-9a-z-_]+$/i', $key)) { - throw new Exception(sprintf( + throw new ApplicationException(sprintf( 'Invalid drop-down option key: %s. Option keys can contain only digits, Latin letters and characters _ and -', $key )); diff --git a/tests/Parse/SyntaxFieldParserTest.php b/tests/Parse/SyntaxFieldParserTest.php index 20bfecc10..38f7430d2 100644 --- a/tests/Parse/SyntaxFieldParserTest.php +++ b/tests/Parse/SyntaxFieldParserTest.php @@ -160,6 +160,23 @@ public function testParseDropdownAndRadio() ], $fields['radio']['options']); } + public function testParseColorPicker() + { + $content = ''; + $content .= '{colorpicker name="field1" label="Field 1" availableColors="#ffffff|#000000" allowEmpty="false"}{/colorpicker}'.PHP_EOL; + $content .= '{variable type="colorpicker" name="field2" label="Field 2" allowEmpty="true"}{/variable}'; + + $result = FieldParser::parse($content); + $fields = $result->getFields(); + + $this->assertArrayNotHasKey('availableColors', $fields['field2']); + $this->assertCount(2, $fields['field1']['availableColors']); + $this->assertEquals(['#ffffff', '#000000'], $fields['field1']['availableColors']); + + $this->assertFalse($fields['field1']['allowEmpty']); + $this->assertTrue($fields['field2']['allowEmpty']); + } + public function testParseRepeater() { $content = '';
0
e2c0c8cb66047962f7cfe8938bbfb12a4d928b75
https://github.com/strukturag/libheif/commit/e2c0c8cb66047962f7cfe8938bbfb12a4d928b75
3rd party: Update dav1d to 0.8.0 and rav1e to 0.3 maintenance branch - Updates dav1d.cmd to use 0.8.0 instead of 0.7.1 - Updates rav1e.cmd to use the 0.3 maintenance branch instead of 0.3.4
diff --git a/third-party/dav1d.cmd b/third-party/dav1d.cmd index 4937d7e4..01abad8d 100644 --- a/third-party/dav1d.cmd +++ b/third-party/dav1d.cmd @@ -10,7 +10,7 @@ : # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): : # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" -git clone -b 0.7.1 --depth 1 https://code.videolan.org/videolan/dav1d.git +git clone -b 0.8.0 --depth 1 https://code.videolan.org/videolan/dav1d.git cd dav1d diff --git a/third-party/rav1e.cmd b/third-party/rav1e.cmd index ebb57cae..1a384de3 100644 --- a/third-party/rav1e.cmd +++ b/third-party/rav1e.cmd @@ -10,7 +10,7 @@ : # Also, the error that "The target windows-msvc is not supported yet" can safely be ignored provided that rav1e/target/release : # contains rav1e.h and rav1e.lib. -git clone -b v0.3.4 --depth 1 https://github.com/xiph/rav1e.git +git clone -b 0.3 --depth 1 https://github.com/xiph/rav1e.git cd rav1e cargo install cargo-c
0
7becb4fe9846a949585680c246fc498f21e4da7b
https://github.com/Schine/MW-OAuth2Client/commit/7becb4fe9846a949585680c246fc498f21e4da7b
added license info
diff --git a/OAuth2Client.i18n.php b/OAuth2Client.i18n.php index 77e4e70..8e6d598 100644 --- a/OAuth2Client.i18n.php +++ b/OAuth2Client.i18n.php @@ -1,8 +1,8 @@ <?php - /** * Internationalization file for the OAuth2Client extension. * + * @license: LGPL (GNU Lesser General Public License) http://www.gnu.org/licenses/lgpl.html * @file OAuth2Client.i18n.php */ diff --git a/README.md b/README.md index 93b9207..0fbbca2 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,7 @@ Optional settings in global $wgOAuth2Client The callback url back to your wiki would be: http://your.wiki.domain/path/to/wiki/Special:OAuth2Client/callback + +License +------- +LGPL (GNU Lesser General Public License) http://www.gnu.org/licenses/lgpl.html
0
9495eb06f79c38adf4eb40cea100eab8ab524035
https://github.com/jtdowney/private_address_check/commit/9495eb06f79c38adf4eb40cea100eab8ab524035
Merge pull request #4 from akihikodaki/master Refer to IANA for special-purpose registry
diff --git a/lib/private_address_check.rb b/lib/private_address_check.rb index 5d9dc54..1b322c8 100644 --- a/lib/private_address_check.rb +++ b/lib/private_address_check.rb @@ -6,7 +6,8 @@ module PrivateAddressCheck module_function - # https://en.wikipedia.org/wiki/Reserved_IP_addresses + # https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml + # https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml CIDR_LIST = [ IPAddr.new("127.0.0.0/8"), # Loopback IPAddr.new("::1/128"), # Loopback
0
c4647e63a9857d31e2fbab5027ba1b8bc178c29c
https://github.com/plougher/squashfs-tools/commit/c4647e63a9857d31e2fbab5027ba1b8bc178c29c
Unsquashfs: reformat some code Signed-off-by: Phillip Lougher <[email protected]>
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c index 0dcc50e9..5276d881 100644 --- a/squashfs-tools/unsquashfs.c +++ b/squashfs-tools/unsquashfs.c @@ -346,8 +346,9 @@ struct cache_entry *cache_get(struct cache *cache, long long block, int size) if(entry) { /* - * found the block in the cache. If the block is currently unused - * remove it from the free list and increment cache used count. + * found the block in the cache. If the block is currently + * unused remove it from the free list and increment cache + * used count. */ if(entry->used == 0) { cache->used ++; @@ -762,7 +763,8 @@ void *read_inode_table(long long start, long long end) * * Always round to a multiple of SQUASHFS_METADATA_SIZE */ - alloc_size = ((end - start) + SQUASHFS_METADATA_SIZE) & ~(SQUASHFS_METADATA_SIZE - 1); + alloc_size = ((end - start) + SQUASHFS_METADATA_SIZE) & + ~(SQUASHFS_METADATA_SIZE - 1); while(start < end) { if(size - bytes < SQUASHFS_METADATA_SIZE) { @@ -813,22 +815,23 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time, struct utimbuf times = { time, time }; if(utime(pathname, &times) == -1) { - EXIT_UNSQUASH_STRICT("set_attributes: failed to set time on %s, because %s\n", - pathname, strerror(errno)); + EXIT_UNSQUASH_STRICT("set_attributes: failed to set time on " + "%s, because %s\n", pathname, strerror(errno)); return FALSE; } if(root_process) { if(chown(pathname, uid, guid) == -1) { - EXIT_UNSQUASH_STRICT("set_attributes: failed to change uid and gids " - "on %s, because %s\n", pathname, + EXIT_UNSQUASH_STRICT("set_attributes: failed to change" + " uid and gids on %s, because %s\n", pathname, strerror(errno)); return FALSE; } } else mode &= ~06000; - if((set_mode || (mode & 07000)) && chmod(pathname, (mode_t) mode) == -1) { + if((set_mode || (mode & 07000)) && + chmod(pathname, (mode_t) mode) == -1) { /* * Some filesystems require root privileges to use the sticky * bit. If we're not root and chmod() failed with EPERM when the @@ -837,8 +840,9 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time, */ if (root_process || errno != EPERM || !(mode & 01000) || chmod(pathname, (mode_t) (mode & ~01000)) == -1) { - EXIT_UNSQUASH_STRICT("set_attributes: failed to change mode %s, because %s\n", - pathname, strerror(errno)); + EXIT_UNSQUASH_STRICT("set_attributes: failed to change" + " mode %s, because %s\n", pathname, + strerror(errno)); return FALSE; } } @@ -1001,8 +1005,8 @@ int write_file(struct inode *inode, char *pathname) file_fd = open_wait(pathname, O_CREAT | O_WRONLY | (force ? O_TRUNC : 0), (mode_t) inode->mode & 0777); if(file_fd == -1) { - EXIT_UNSQUASH_IGNORE("write_file: failed to create file %s, because %s\n", - pathname, strerror(errno)); + EXIT_UNSQUASH_IGNORE("write_file: failed to create file %s," + " because %s\n", pathname, strerror(errno)); return FALSE; } @@ -1072,8 +1076,8 @@ int create_inode(char *pathname, struct inode *i) unlink(pathname); if(link(created_inode[i->inode_number - 1], pathname) == -1) { - EXIT_UNSQUASH_IGNORE("create_inode: failed to create hardlink, " - "because %s\n", strerror(errno)); + EXIT_UNSQUASH_IGNORE("create_inode: failed to create" + " hardlink, because %s\n", strerror(errno)); return FALSE; } @@ -1107,18 +1111,18 @@ int create_inode(char *pathname, struct inode *i) res = symlink(i->symlink, pathname); if(res == -1) { - EXIT_UNSQUASH_STRICT("create_inode: failed to create symlink " - "%s, because %s\n", pathname, - strerror(errno)); + EXIT_UNSQUASH_STRICT("create_inode: failed to" + " create symlink %s, because %s\n", + pathname, strerror(errno)); goto failed; } res = utimensat(AT_FDCWD, pathname, times, AT_SYMLINK_NOFOLLOW); if(res == -1) { - EXIT_UNSQUASH_STRICT("create_inode: failed to set time on " - "%s, because %s\n", pathname, - strerror(errno)); + EXIT_UNSQUASH_STRICT("create_inode: failed to" + " set time on %s, because %s\n", + pathname, strerror(errno)); } res = write_xattr(pathname, i->xattr); @@ -1128,10 +1132,10 @@ int create_inode(char *pathname, struct inode *i) if(root_process) { res = lchown(pathname, i->uid, i->gid); if(res == -1) { - EXIT_UNSQUASH_STRICT("create_inode: failed to change " - "uid and gids on %s, because " - "%s\n", pathname, - strerror(errno)); + EXIT_UNSQUASH_STRICT("create_inode: " + "failed to change uid and " + "gids on %s, because %s\n", + pathname, strerror(errno)); failed = TRUE; } } @@ -1157,17 +1161,19 @@ int create_inode(char *pathname, struct inode *i) if(force) unlink(pathname); - /* Ripped from new_decode_dev() in kernel sources. */ + /* Based on new_decode_dev() in kernel source */ major = (i->data & 0xfff00) >> 8; - minor = (i->data & 0xff) | ((i->data >> 12) & 0xfff00); + minor = (i->data & 0xff) | ((i->data >> 12) + & 0xfff00); - res = mknod(pathname, chrdev ? S_IFCHR : S_IFBLK, - makedev(major, minor)); + res = mknod(pathname, chrdev ? S_IFCHR : + S_IFBLK, makedev(major, minor)); if(res == -1) { - EXIT_UNSQUASH_STRICT("create_inode: failed to create " - "%s device %s, because %s\n", - chrdev ? "character" : "block", - pathname, strerror(errno)); + EXIT_UNSQUASH_STRICT("create_inode: " + "failed to create %s device " + "%s, because %s\n", chrdev ? + "character" : "block", pathname, + strerror(errno)); goto failed; } res = set_attributes(pathname, i->mode, i->uid, @@ -1177,10 +1183,10 @@ int create_inode(char *pathname, struct inode *i) dev_count ++; } else { - EXIT_UNSQUASH_STRICT("create_inode: could not create %s " - "device %s, because you're not " - "superuser!\n", chrdev ? "character" : - "block", pathname); + EXIT_UNSQUASH_STRICT("create_inode: could not" + " create %s device %s, because you're" + " not superuser!\n", chrdev ? + "character" : "block", pathname); goto failed; } break; @@ -1211,16 +1217,16 @@ int create_inode(char *pathname, struct inode *i) TRACE("create_inode: socket\n"); if (mknod(pathname, S_IFSOCK | i->mode, 0) == -1) { - ERROR("create_inode: failed to create socket %s, " - "because %s\n", - pathname, strerror(errno)); + ERROR("create_inode: failed to create socket " + "%s, because %s\n", pathname, + strerror(errno)); goto failed; } socket_count++; break; default: - EXIT_UNSQUASH_STRICT("Unknown inode type %d in create_inode_table!\n", - i->type); + EXIT_UNSQUASH_STRICT("Unknown inode type %d in " + "create_inode_table!\n", i->type); return FALSE; } @@ -1234,8 +1240,8 @@ int create_inode(char *pathname, struct inode *i) * any future hard links to it fail with a file not found, which * is correct as the file *is* missing. * - * If we don't mark it here as created, then any future hard links will try - * to create the file as a separate unlinked file. + * If we don't mark it here as created, then any future hard links + * will try to create the file as a separate unlinked file. * If we've had some transitory errors, this may produce files * in various states, which should be hard-linked, but are not. */ @@ -1266,11 +1272,13 @@ void *read_directory_table(long long start, long long end) * * Always round to a multiple of SQUASHFS_METADATA_SIZE */ - alloc_size = ((end - start) + SQUASHFS_METADATA_SIZE) & ~(SQUASHFS_METADATA_SIZE - 1); + alloc_size = ((end - start) + SQUASHFS_METADATA_SIZE) + & ~(SQUASHFS_METADATA_SIZE - 1); while(start < end) { if(size - bytes < SQUASHFS_METADATA_SIZE) { - directory_table = realloc(directory_table, size += alloc_size); + directory_table = realloc(directory_table, + size += alloc_size); if(directory_table == NULL) MEM_ERROR(); } @@ -1757,18 +1765,20 @@ int follow_path(char *path, char *name, unsigned int start_block, /* Detect circular symlinks */ if(symlinks >= MAX_FOLLOW_SYMLINKS) { - ERROR("Too many levels of symbolic links\n"); + ERROR("Too many levels of symbolic " + "links\n"); traversed = FALSE; free(symlink); break; } - /* Add symlink to list of symlinks found traversing - * the pathname */ + /* Add symlink to list of symlinks found + * traversing the pathname */ add_symlink(stack, name); - traversed = follow_path(symlink, "", start_block, - offset, depth, symlinks + 1, stack); + traversed = follow_path(symlink, "", + start_block, offset, depth, + symlinks + 1, stack); free(symlink); @@ -1781,20 +1791,24 @@ int follow_path(char *path, char *name, unsigned int start_block, * have left us at a directory to do * this */ if(path[0] != '\0') { - if(stack->type != SQUASHFS_DIR_TYPE) { + if(stack->type != + SQUASHFS_DIR_TYPE) { traversed = FALSE; break; } - /* "Jump" to the traversed point */ + /* "Jump" to the traversed + * point */ depth = stack->size; start_block = stack->start_block; offset = stack->offset; name = stack->name; - /* continue following the path */ - traversed = follow_path(path, name, start_block, - offset, depth + 1, symlinks, stack); + /* continue following path */ + traversed = follow_path(path, + name, start_block, + offset, depth + 1, + symlinks, stack); } } @@ -1865,7 +1879,8 @@ int pre_scan(char *parent_name, unsigned int start_block, unsigned int offset, MEM_ERROR(); if(type == SQUASHFS_DIR_TYPE) { - res = pre_scan(parent_name, start_block, offset, new, depth + 1); + res = pre_scan(parent_name, start_block, offset, new, + depth + 1); if(res == FALSE) scan_res = FALSE; } else if(new == NULL) { @@ -1926,9 +1941,9 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, * forcing and the error is -EEXIST */ if(!force || errno != EEXIST) { - EXIT_UNSQUASH_IGNORE("dir_scan: failed to make directory %s, " - "because %s\n", parent_name, - strerror(errno)); + EXIT_UNSQUASH_IGNORE("dir_scan: failed to make" + " directory %s, because %s\n", + parent_name, strerror(errno)); squashfs_closedir(dir); return FALSE; } @@ -1939,9 +1954,10 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, */ res = chmod(parent_name, S_IRUSR|S_IWUSR|S_IXUSR); if (res == -1) { - EXIT_UNSQUASH_IGNORE("dir_scan: failed to change permissions " - "for directory %s, because %s\n", - parent_name, strerror(errno)); + EXIT_UNSQUASH_IGNORE("dir_scan: failed to " + "change permissions for directory %s," + " because %s\n", parent_name, + strerror(errno)); squashfs_closedir(dir); return FALSE; } @@ -1949,12 +1965,13 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, } if(max_depth == -1 || depth <= max_depth) { - while(squashfs_readdir(dir, &name, &start_block, &offset, &type)) { + while(squashfs_readdir(dir, &name, &start_block, &offset, + &type)) { char *pathname; int res; - TRACE("dir_scan: name %s, start_block %d, offset %d, type %d\n", - name, start_block, offset, type); + TRACE("dir_scan: name %s, start_block %d, offset %d," + " type %d\n", name, start_block, offset, type); if(!matches(paths, name, &new)) @@ -1965,7 +1982,8 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, MEM_ERROR(); if(type == SQUASHFS_DIR_TYPE) { - res = dir_scan(pathname, start_block, offset, new, depth + 1); + res = dir_scan(pathname, start_block, offset, + new, depth + 1); if(res == FALSE) scan_res = FALSE; free(pathname); @@ -1984,7 +2002,7 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, } if(i->type == SQUASHFS_SYMLINK_TYPE || - i->type == SQUASHFS_LSYMLINK_TYPE) + i->type == SQUASHFS_LSYMLINK_TYPE) free(i->symlink); } else free(pathname); @@ -2006,7 +2024,8 @@ int dir_scan(char *parent_name, unsigned int start_block, unsigned int offset, void squashfs_stat(char *source) { time_t mkfs_time = (time_t) sBlk.s.mkfs_time; - struct tm *t = use_localtime ? localtime(&mkfs_time) : gmtime(&mkfs_time); + struct tm *t = use_localtime ? localtime(&mkfs_time) : + gmtime(&mkfs_time); char *mkfs_str = asctime(t); #if __BYTE_ORDER == __BIG_ENDIAN @@ -2029,16 +2048,19 @@ void squashfs_stat(char *source) printf("Compression %s\n", comp->name); if(SQUASHFS_COMP_OPTS(sBlk.s.flags)) { - char buffer[SQUASHFS_METADATA_SIZE] __attribute__ ((aligned)); + char buffer[SQUASHFS_METADATA_SIZE] + __attribute__ ((aligned)); int bytes; if(!comp->supported) - printf("\tCould not display compressor options, because %s compression is not supported\n", - comp->name); + printf("\tCould not display compressor " + "options, because %s compression is " + "not supported\n", comp->name); else { bytes = read_block(fd, sizeof(sBlk.s), NULL, 0, buffer); if(bytes == 0) { - ERROR("Failed to read compressor options\n"); + ERROR("Failed to read compressor " + "options\n"); return; } @@ -2381,8 +2403,9 @@ void *writer(void *arg) continue; } else if(file->fd == -1) { /* write attributes for directory file->pathname */ - res = set_attributes(file->pathname, file->mode, file->uid, - file->gid, file->time, file->xattr, TRUE); + res = set_attributes(file->pathname, file->mode, + file->uid, file->gid, file->time, file->xattr, + TRUE); if(res == FALSE) exit_code = TRUE; free(file->pathname); @@ -2406,16 +2429,21 @@ void *writer(void *arg) cache_block_wait(block->buffer); if(block->buffer->error) { - EXIT_UNSQUASH_IGNORE("writer: failed to read/uncompress file %s\n", file->pathname); + EXIT_UNSQUASH_IGNORE("writer: failed to " + "read/uncompress file %s\n", + file->pathname); exit_code = local_fail = TRUE; } if(local_fail == FALSE) { - res = write_block(file_fd, block->buffer->data + - block->offset, block->size, hole, file->sparse); + res = write_block(file_fd, + block->buffer->data + block->offset, + block->size, hole, file->sparse); if(res == FALSE) { - EXIT_UNSQUASH_IGNORE("writer: failed to write file %s\n", file->pathname); + EXIT_UNSQUASH_IGNORE("writer: failed " + "to write file %s\n", + file->pathname); exit_code = local_fail = TRUE; } } @@ -2440,21 +2468,25 @@ void *writer(void *arg) hole --; if(write_block(file_fd, "\0", 1, hole, file->sparse) == FALSE) { - EXIT_UNSQUASH_IGNORE("writer: failed to write sparse " - "data block for file %s\n", file->pathname); + EXIT_UNSQUASH_IGNORE("writer: failed " + "to write sparse data block " + "for file %s\n", + file->pathname); exit_code = local_fail = TRUE; } } else if(ftruncate(file_fd, file->file_size) == -1) { - EXIT_UNSQUASH_IGNORE("writer: failed to write sparse data " - "block for file %s\n", file->pathname); + EXIT_UNSQUASH_IGNORE("writer: failed to write " + "sparse data block for file %s\n", + file->pathname); exit_code = local_fail = TRUE; } } close_wake(file_fd); if(local_fail == FALSE) { - res = set_attributes(file->pathname, file->mode, file->uid, - file->gid, file->time, file->xattr, force); + res = set_attributes(file->pathname, file->mode, + file->uid, file->gid, file->time, file->xattr, + force); if(res == FALSE) exit_code = TRUE; } else @@ -2532,8 +2564,8 @@ void *progress_thread(void *arg) if(progress_enabled) { pthread_mutex_lock(&screen_mutex); - progress_bar(sym_count + dev_count + - fifo_count + socket_count + cur_blocks, total_inodes - + progress_bar(sym_count + dev_count + fifo_count + + socket_count + cur_blocks, total_inodes - total_files + total_blocks, columns); pthread_mutex_unlock(&screen_mutex); } @@ -2727,8 +2759,9 @@ void disable_progress_bar() { pthread_mutex_lock(&screen_mutex); if(progress_enabled) { - progress_bar(sym_count + dev_count + fifo_count + socket_count + cur_blocks, - total_inodes - total_files + total_blocks, columns); + progress_bar(sym_count + dev_count + fifo_count + socket_count + + cur_blocks, total_inodes - total_files + total_blocks, + columns); printf("\n"); } progress_enabled = FALSE; @@ -3108,9 +3141,13 @@ int main(int argc, char *argv[]) } else if(strcmp(argv[i], "-regex") == 0 || strcmp(argv[i], "-r") == 0) use_regex = TRUE; - else if(strcmp(argv[i], "-offset") == 0 || strcmp(argv[i], "-o") == 0) { - if((++i == argc) || !parse_numberll(argv[i], &start_offset, 1)) { - ERROR("%s: %s missing or invalid offset size\n", argv[0], argv[i - 1]); + else if(strcmp(argv[i], "-offset") == 0 || + strcmp(argv[i], "-o") == 0) { + if((++i == argc) || + !parse_numberll(argv[i], &start_offset, + 1)) { + ERROR("%s: %s missing or invalid offset size\n", + argv[0], argv[i - 1]); exit(1); } } else @@ -3121,10 +3158,12 @@ int main(int argc, char *argv[]) progress = FALSE; if(strict_errors && ignore_errors) - EXIT_UNSQUASH("Both -strict-errors and -ignore-errors should not be set\n"); + EXIT_UNSQUASH("Both -strict-errors and -ignore-errors should " + "not be set\n"); if(no_wildcards && use_regex) - EXIT_UNSQUASH("Both -no-wildcards and -regex should not be set\n"); + EXIT_UNSQUASH("Both -no-wildcards and -regex should not be " + "set\n"); if(missing_symlinks && !follow_symlinks) { follow_symlinks = TRUE; @@ -3334,8 +3373,10 @@ int main(int argc, char *argv[]) path = add_path(path, pathname, pathname); free(pathname); - for(symlink = stack->symlink; symlink; symlink = symlink->next) - path = add_path(path, symlink->pathname, symlink->pathname); + for(symlink = stack->symlink; symlink; + symlink = symlink->next) + path = add_path(path, symlink->pathname, + symlink->pathname); free_stack(stack); } @@ -3359,11 +3400,12 @@ int main(int argc, char *argv[]) inode_number = 1; if(!quiet) { - printf("Parallel unsquashfs: Using %d processor%s\n", processors, - processors == 1 ? "" : "s"); + printf("Parallel unsquashfs: Using %d processor%s\n", + processors, processors == 1 ? "" : "s"); - printf("%d inodes (%d blocks) to write\n\n", total_inodes, - total_inodes - total_files + total_blocks); + printf("%d inodes (%d blocks) to write\n\n", + total_inodes, + total_inodes - total_files + total_blocks); } enable_progress_bar();
0
6713ca45e7757297381f4b4cdb9cf5e624a9ad36
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
PR/454: Fix memory corruption when the continuation level jumps by more than 20 in a single step.
diff --git a/src/funcs.c b/src/funcs.c index 7ce431e5f..b7160cc73 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.80 2015/01/02 21:29:39 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.81 2015/05/28 19:26:59 christos Exp $") #endif /* lint */ #include "magic.h" @@ -416,7 +416,7 @@ file_check_mem(struct magic_set *ms, unsigned int level) size_t len; if (level >= ms->c.len) { - len = (ms->c.len += 20) * sizeof(*ms->c.li); + len = (ms->c.len = 20 + level) * sizeof(*ms->c.li); ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ? malloc(len) : realloc(ms->c.li, len));
1
a4c561aab1014c3630bc88faf6f5246fee16b020
https://github.com/gpg/libgcrypt/commit/a4c561aab1014c3630bc88faf6f5246fee16b020
GCM: move look-up table to .data section and unshare between processes * cipher/cipher-gcm.c (ATTR_ALIGNED_64): New. (gcmR): Move to 'gcm_table' structure. (gcm_table): New structure for look-up table with counters before and after. (gcmR): New macro. (prefetch_table): Handle input with length not multiple of 256. (do_prefetch_tables): Modify pre- and post-table counters to unshare look-up table pages between processes. -- GnuPG-bug-id: 4541 Signed-off-by: Jussi Kivilinna <[email protected]>
diff --git a/cipher/cipher-gcm.c b/cipher/cipher-gcm.c index 11f119aa7..194e2ec9d 100644 --- a/cipher/cipher-gcm.c +++ b/cipher/cipher-gcm.c @@ -30,6 +30,14 @@ #include "./cipher-internal.h" +/* Helper macro to force alignment to 16 or 64 bytes. */ +#ifdef HAVE_GCC_ATTRIBUTE_ALIGNED +# define ATTR_ALIGNED_64 __attribute__ ((aligned (64))) +#else +# define ATTR_ALIGNED_64 +#endif + + #ifdef GCM_USE_INTEL_PCLMUL extern void _gcry_ghash_setup_intel_pclmul (gcry_cipher_hd_t c); @@ -83,40 +91,54 @@ ghash_armv7_neon (gcry_cipher_hd_t c, byte *result, const byte *buf, #ifdef GCM_USE_TABLES -static const u16 gcmR[256] = { - 0x0000, 0x01c2, 0x0384, 0x0246, 0x0708, 0x06ca, 0x048c, 0x054e, - 0x0e10, 0x0fd2, 0x0d94, 0x0c56, 0x0918, 0x08da, 0x0a9c, 0x0b5e, - 0x1c20, 0x1de2, 0x1fa4, 0x1e66, 0x1b28, 0x1aea, 0x18ac, 0x196e, - 0x1230, 0x13f2, 0x11b4, 0x1076, 0x1538, 0x14fa, 0x16bc, 0x177e, - 0x3840, 0x3982, 0x3bc4, 0x3a06, 0x3f48, 0x3e8a, 0x3ccc, 0x3d0e, - 0x3650, 0x3792, 0x35d4, 0x3416, 0x3158, 0x309a, 0x32dc, 0x331e, - 0x2460, 0x25a2, 0x27e4, 0x2626, 0x2368, 0x22aa, 0x20ec, 0x212e, - 0x2a70, 0x2bb2, 0x29f4, 0x2836, 0x2d78, 0x2cba, 0x2efc, 0x2f3e, - 0x7080, 0x7142, 0x7304, 0x72c6, 0x7788, 0x764a, 0x740c, 0x75ce, - 0x7e90, 0x7f52, 0x7d14, 0x7cd6, 0x7998, 0x785a, 0x7a1c, 0x7bde, - 0x6ca0, 0x6d62, 0x6f24, 0x6ee6, 0x6ba8, 0x6a6a, 0x682c, 0x69ee, - 0x62b0, 0x6372, 0x6134, 0x60f6, 0x65b8, 0x647a, 0x663c, 0x67fe, - 0x48c0, 0x4902, 0x4b44, 0x4a86, 0x4fc8, 0x4e0a, 0x4c4c, 0x4d8e, - 0x46d0, 0x4712, 0x4554, 0x4496, 0x41d8, 0x401a, 0x425c, 0x439e, - 0x54e0, 0x5522, 0x5764, 0x56a6, 0x53e8, 0x522a, 0x506c, 0x51ae, - 0x5af0, 0x5b32, 0x5974, 0x58b6, 0x5df8, 0x5c3a, 0x5e7c, 0x5fbe, - 0xe100, 0xe0c2, 0xe284, 0xe346, 0xe608, 0xe7ca, 0xe58c, 0xe44e, - 0xef10, 0xeed2, 0xec94, 0xed56, 0xe818, 0xe9da, 0xeb9c, 0xea5e, - 0xfd20, 0xfce2, 0xfea4, 0xff66, 0xfa28, 0xfbea, 0xf9ac, 0xf86e, - 0xf330, 0xf2f2, 0xf0b4, 0xf176, 0xf438, 0xf5fa, 0xf7bc, 0xf67e, - 0xd940, 0xd882, 0xdac4, 0xdb06, 0xde48, 0xdf8a, 0xddcc, 0xdc0e, - 0xd750, 0xd692, 0xd4d4, 0xd516, 0xd058, 0xd19a, 0xd3dc, 0xd21e, - 0xc560, 0xc4a2, 0xc6e4, 0xc726, 0xc268, 0xc3aa, 0xc1ec, 0xc02e, - 0xcb70, 0xcab2, 0xc8f4, 0xc936, 0xcc78, 0xcdba, 0xcffc, 0xce3e, - 0x9180, 0x9042, 0x9204, 0x93c6, 0x9688, 0x974a, 0x950c, 0x94ce, - 0x9f90, 0x9e52, 0x9c14, 0x9dd6, 0x9898, 0x995a, 0x9b1c, 0x9ade, - 0x8da0, 0x8c62, 0x8e24, 0x8fe6, 0x8aa8, 0x8b6a, 0x892c, 0x88ee, - 0x83b0, 0x8272, 0x8034, 0x81f6, 0x84b8, 0x857a, 0x873c, 0x86fe, - 0xa9c0, 0xa802, 0xaa44, 0xab86, 0xaec8, 0xaf0a, 0xad4c, 0xac8e, - 0xa7d0, 0xa612, 0xa454, 0xa596, 0xa0d8, 0xa11a, 0xa35c, 0xa29e, - 0xb5e0, 0xb422, 0xb664, 0xb7a6, 0xb2e8, 0xb32a, 0xb16c, 0xb0ae, - 0xbbf0, 0xba32, 0xb874, 0xb9b6, 0xbcf8, 0xbd3a, 0xbf7c, 0xbebe, -}; +static struct +{ + volatile u32 counter_head; + u32 cacheline_align[64 / 4 - 1]; + u16 R[256]; + volatile u32 counter_tail; +} gcm_table ATTR_ALIGNED_64 = + { + 0, + { 0, }, + { + 0x0000, 0x01c2, 0x0384, 0x0246, 0x0708, 0x06ca, 0x048c, 0x054e, + 0x0e10, 0x0fd2, 0x0d94, 0x0c56, 0x0918, 0x08da, 0x0a9c, 0x0b5e, + 0x1c20, 0x1de2, 0x1fa4, 0x1e66, 0x1b28, 0x1aea, 0x18ac, 0x196e, + 0x1230, 0x13f2, 0x11b4, 0x1076, 0x1538, 0x14fa, 0x16bc, 0x177e, + 0x3840, 0x3982, 0x3bc4, 0x3a06, 0x3f48, 0x3e8a, 0x3ccc, 0x3d0e, + 0x3650, 0x3792, 0x35d4, 0x3416, 0x3158, 0x309a, 0x32dc, 0x331e, + 0x2460, 0x25a2, 0x27e4, 0x2626, 0x2368, 0x22aa, 0x20ec, 0x212e, + 0x2a70, 0x2bb2, 0x29f4, 0x2836, 0x2d78, 0x2cba, 0x2efc, 0x2f3e, + 0x7080, 0x7142, 0x7304, 0x72c6, 0x7788, 0x764a, 0x740c, 0x75ce, + 0x7e90, 0x7f52, 0x7d14, 0x7cd6, 0x7998, 0x785a, 0x7a1c, 0x7bde, + 0x6ca0, 0x6d62, 0x6f24, 0x6ee6, 0x6ba8, 0x6a6a, 0x682c, 0x69ee, + 0x62b0, 0x6372, 0x6134, 0x60f6, 0x65b8, 0x647a, 0x663c, 0x67fe, + 0x48c0, 0x4902, 0x4b44, 0x4a86, 0x4fc8, 0x4e0a, 0x4c4c, 0x4d8e, + 0x46d0, 0x4712, 0x4554, 0x4496, 0x41d8, 0x401a, 0x425c, 0x439e, + 0x54e0, 0x5522, 0x5764, 0x56a6, 0x53e8, 0x522a, 0x506c, 0x51ae, + 0x5af0, 0x5b32, 0x5974, 0x58b6, 0x5df8, 0x5c3a, 0x5e7c, 0x5fbe, + 0xe100, 0xe0c2, 0xe284, 0xe346, 0xe608, 0xe7ca, 0xe58c, 0xe44e, + 0xef10, 0xeed2, 0xec94, 0xed56, 0xe818, 0xe9da, 0xeb9c, 0xea5e, + 0xfd20, 0xfce2, 0xfea4, 0xff66, 0xfa28, 0xfbea, 0xf9ac, 0xf86e, + 0xf330, 0xf2f2, 0xf0b4, 0xf176, 0xf438, 0xf5fa, 0xf7bc, 0xf67e, + 0xd940, 0xd882, 0xdac4, 0xdb06, 0xde48, 0xdf8a, 0xddcc, 0xdc0e, + 0xd750, 0xd692, 0xd4d4, 0xd516, 0xd058, 0xd19a, 0xd3dc, 0xd21e, + 0xc560, 0xc4a2, 0xc6e4, 0xc726, 0xc268, 0xc3aa, 0xc1ec, 0xc02e, + 0xcb70, 0xcab2, 0xc8f4, 0xc936, 0xcc78, 0xcdba, 0xcffc, 0xce3e, + 0x9180, 0x9042, 0x9204, 0x93c6, 0x9688, 0x974a, 0x950c, 0x94ce, + 0x9f90, 0x9e52, 0x9c14, 0x9dd6, 0x9898, 0x995a, 0x9b1c, 0x9ade, + 0x8da0, 0x8c62, 0x8e24, 0x8fe6, 0x8aa8, 0x8b6a, 0x892c, 0x88ee, + 0x83b0, 0x8272, 0x8034, 0x81f6, 0x84b8, 0x857a, 0x873c, 0x86fe, + 0xa9c0, 0xa802, 0xaa44, 0xab86, 0xaec8, 0xaf0a, 0xad4c, 0xac8e, + 0xa7d0, 0xa612, 0xa454, 0xa596, 0xa0d8, 0xa11a, 0xa35c, 0xa29e, + 0xb5e0, 0xb422, 0xb664, 0xb7a6, 0xb2e8, 0xb32a, 0xb16c, 0xb0ae, + 0xbbf0, 0xba32, 0xb874, 0xb9b6, 0xbcf8, 0xbd3a, 0xbf7c, 0xbebe, + }, + 0 + }; + +#define gcmR gcm_table.R static inline void prefetch_table(const void *tab, size_t len) @@ -124,7 +146,7 @@ void prefetch_table(const void *tab, size_t len) const volatile byte *vtab = tab; size_t i; - for (i = 0; i < len; i += 8 * 32) + for (i = 0; len - i >= 8 * 32; i += 8 * 32) { (void)vtab[i + 0 * 32]; (void)vtab[i + 1 * 32]; @@ -135,6 +157,10 @@ void prefetch_table(const void *tab, size_t len) (void)vtab[i + 6 * 32]; (void)vtab[i + 7 * 32]; } + for (; i < len; i += 32) + { + (void)vtab[i]; + } (void)vtab[len - 1]; } @@ -142,8 +168,16 @@ void prefetch_table(const void *tab, size_t len) static inline void do_prefetch_tables (const void *gcmM, size_t gcmM_size) { + /* Modify counters to trigger copy-on-write and unsharing if physical pages + * of look-up table are shared between processes. Modifying counters also + * causes checksums for pages to change and hint same-page merging algorithm + * that these pages are frequently changing. */ + gcm_table.counter_head++; + gcm_table.counter_tail++; + + /* Prefetch look-up tables to cache. */ prefetch_table(gcmM, gcmM_size); - prefetch_table(gcmR, sizeof(gcmR)); + prefetch_table(&gcm_table, sizeof(gcm_table)); } #ifdef GCM_TABLES_USE_U64
1
21d4014ba5c4906585e24b2f1825f78ae6f3bb4d
https://github.com/jarofghosts/glance/commit/21d4014ba5c4906585e24b2f1825f78ae6f3bb4d
fix derp in bin
diff --git a/bin/glance.js b/bin/glance.js index 1c1bb3e..42e85b5 100755 --- a/bin/glance.js +++ b/bin/glance.js @@ -59,7 +59,9 @@ if(options.indices) options.indices = options.indices.split(',') options = xtend(defaults, options) -glance = new Glance(options).start() +glance = new Glance(options) + +glance.start() glance.on('read', onRead) glance.on('error', onError) @@ -69,13 +71,13 @@ function onStarted() { if(!options.verbose) return console.log( - color.purple('glance') + ' serving ' + color.yellow(self.dir, true) + - ' on port ' + color.green(self.port) + color.purple('glance') + ' serving ' + color.yellow(this.dir, true) + + ' on port ' + color.green(this.port) ) } function onRead(request) { - if(!self.options) return + if(!this.options) return console.log( color.green(request.ip) + ' read ' +
0
49e6d625cd8e498863a3e95a2d145e44df1e4164
https://github.com/apache/tomee/commit/49e6d625cd8e498863a3e95a2d145e44df1e4164
Merge remote-tracking branch 'apache/master'
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/CalendarTimerData.java b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/CalendarTimerData.java index 975b8046786..8fb31993f99 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/CalendarTimerData.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/CalendarTimerData.java @@ -17,6 +17,7 @@ package org.apache.openejb.core.timer; +import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.openejb.core.timer.EJBCronTrigger.ParseException; import org.apache.openejb.quartz.impl.triggers.AbstractTrigger; @@ -83,6 +84,6 @@ private void readObject(final ObjectInputStream in) throws IOException { @Override public String toString() { - return TimerType.Calendar.name() + " scheduleExpression = [" + scheduleExpression + "]"; + return TimerType.Calendar.name() + " scheduleExpression = [" + ToStringBuilder.reflectionToString(scheduleExpression) + "]"; } } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java index 52b6b165942..4b4e9f3bb16 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java @@ -104,6 +104,7 @@ private final TimeZone timezone; private final String rawValue; + private final boolean isExpired; public EJBCronTrigger(final ScheduleExpression expr) throws ParseException { @@ -118,7 +119,32 @@ public EJBCronTrigger(final ScheduleExpression expr) throws ParseException { timezone = expr.getTimezone() == null ? TimeZone.getDefault() : TimeZone.getTimeZone(expr.getTimezone()); setStartTime(expr.getStart() == null ? new Date() : expr.getStart()); - setEndTime(expr.getEnd()); + + /* + * @testName: endNeverExpires + * + * @test_Strategy: create a timer with year="currentYear - currentYear+1", and + * end="currentYear-1". The end value is prior to the year values, and this + * timer will never expire. Creating this timer will succeed, but any timer + * method access in a subsequent business method will result in + * NoSuchObjectLocalException. + * + * EJB32 TCK test tries to create an already expired Timer and it's supposed to not fail. + * This may happen whe you restart an application for instance. + * On the other hand, Quartz does not allow endTime to be before StartTime so we need to check first so we don't + * set the endDate but we flag up this timer as being expired. + * + * When the first time is computed we will fail and as a consequence TimerData will be flagged up as being expired. + * So if endDate is not set or endTime after startTime, then we can consider this timer as not expired. + * If endTime is set and it's before startTime, we swallow setEndTime to Quartz and set the expired flag to true + */ + if (expr.getEnd() == null || !isBefore(expr.getEnd(), getStartTime())) { + setEndTime(expr.getEnd()); + isExpired = false; + + } else { + isExpired = true; + } // If parsing fails on a field, record the error and move to the next field final Map<Integer, ParseException> errors = new HashMap<>(); @@ -143,6 +169,10 @@ public EJBCronTrigger(final ScheduleExpression expr) throws ParseException { + DELIMITER + expr.getHour() + DELIMITER + expr.getMinute() + DELIMITER + expr.getSecond(); } + private boolean isBefore(final Date end, final Date start) { + return start != null && end != null && start.after(end); + } + /** * Computes a set of allowed values for the given field of a calendar based * time expression. @@ -354,7 +384,7 @@ public Date getFinalFireTime() { } else if (currentFieldIndex >= 1) { // No suitable value was found, so move back to the previous field // and decrease the value - final int maxAffectedFieldType = upadteCalendar(calendar, expressions[currentFieldIndex - 1].field, -1); + final int maxAffectedFieldType = updateCalendar(calendar, expressions[currentFieldIndex - 1].field, -1); currentFieldIndex = CALENDAR_FIELD_TYPE_ORDERED_INDEX_MAP.get(maxAffectedFieldType); resetFields(calendar, maxAffectedFieldType, true); } else { @@ -367,6 +397,16 @@ public Date getFinalFireTime() { } + @Override + public Date computeFirstFireTime(final org.apache.openejb.quartz.Calendar calendar) { + // timer may be expired up on creation (see constructor comments) + if (isExpired) { + throw new TimerExpiredException(String.format("Timer %s expired.", this)); + } + + return super.computeFirstFireTime(calendar); + } + @Override public Date getFireTimeAfter(final Date afterTime) { log.debug("start to getFireTimeAfter:" + afterTime); @@ -447,7 +487,7 @@ public Date getFireTimeAfter(final Date afterTime) { // When current field is HOUR_OF_DAY, its upper field is DAY_OF_MONTH, so we need to -2 due to // DAY_OF_WEEK. final int parentFieldIndex = currentFieldIndex == 4 ? currentFieldIndex - 2 : currentFieldIndex - 1; - final int maxAffectedFieldType = upadteCalendar(calendar, expressions[parentFieldIndex].field, 1); + final int maxAffectedFieldType = updateCalendar(calendar, expressions[parentFieldIndex].field, 1); currentFieldIndex = CALENDAR_FIELD_TYPE_ORDERED_INDEX_MAP.get(maxAffectedFieldType); resetFields(calendar, maxAffectedFieldType, false); } @@ -491,7 +531,7 @@ public Date getFireTimeAfter(final Date afterTime) { * @param field * @return */ - private int upadteCalendar(final Calendar calendar, final int field, final int amount) { + private int updateCalendar(final Calendar calendar, final int field, final int amount) { final Calendar old = new GregorianCalendar(timezone); old.setTime(calendar.getTime()); calendar.add(field, amount); diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java index 22f5b00872e..effee7ca25d 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java @@ -773,7 +773,7 @@ public void ejbTimeout(final TimerData timerData) { try { transactionManager.begin(); } catch (final Exception e) { - log.warning("Exception occured while starting container transaction", e); + log.warning("Exception occurred while starting container transaction", e); return; } } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerData.java b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerData.java index 0ae1403dc75..6dfc1ff5960 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerData.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerData.java @@ -219,13 +219,19 @@ public boolean isNewTimer() { public void newTimer() { //Initialize the Quartz Trigger - trigger = initializeTrigger(); - trigger.computeFirstFireTime(null); - trigger.setGroup(OPEN_EJB_TIMEOUT_TRIGGER_GROUP_NAME); - trigger.setName(OPEN_EJB_TIMEOUT_TRIGGER_NAME_PREFIX + deploymentId + "_" + id); - newTimer = true; try { + trigger = initializeTrigger(); + trigger.computeFirstFireTime(null); + trigger.setGroup(OPEN_EJB_TIMEOUT_TRIGGER_GROUP_NAME); + trigger.setName(OPEN_EJB_TIMEOUT_TRIGGER_NAME_PREFIX + deploymentId + "_" + id); + newTimer = true; + registerTimerDataSynchronization(); + + } catch (final TimerExpiredException e) { + setExpired(true); + log.warning("Timer " + trigger + " is expired and will never trigger."); + } catch (final TimerStoreException e) { throw new EJBException("Failed to register new timer data synchronization", e); } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerExpiredException.java b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerExpiredException.java new file mode 100644 index 00000000000..ec8f7e6349d --- /dev/null +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/TimerExpiredException.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.openejb.core.timer; + +public class TimerExpiredException extends RuntimeException { + public TimerExpiredException(final String message) { + super(message); + } +} diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java b/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java index c5a534855c8..ca183301f5d 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java @@ -69,7 +69,9 @@ public static void reloadConfig() { "META-INF/services/javax.ws.rs.client.ClientBuilder," + "META-INF/services/javax.json.spi.JsonProvider," + "META-INF/services/javax.cache.spi.CachingProvider," + - "META-INF/javamail.default.providers,META-INF/javamail.default.address.map," + + "META-INF/services/javax.persistence.spi.PersistenceProvider," + + "META-INF/javamail.default.providers," + + "META-INF/javamail.default.address.map," + "META-INF/javamail.charset.map,META-INF/mailcap," + SLF4J_BINDER_CLASS); } diff --git a/container/openejb-core/src/test/java/org/apache/openejb/timer/EJBCronTriggerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/timer/EJBCronTriggerTest.java index e1fdcb32be9..0cf244a5de7 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/timer/EJBCronTriggerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/timer/EJBCronTriggerTest.java @@ -19,6 +19,7 @@ import org.apache.openejb.core.timer.EJBCronTrigger; import org.apache.openejb.core.timer.EJBCronTrigger.ParseException; +import org.apache.openejb.core.timer.TimerExpiredException; import org.junit.Test; import javax.ejb.ScheduleExpression; @@ -27,12 +28,28 @@ import java.util.GregorianCalendar; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; public class EJBCronTriggerTest { + @Test + public void shouldBeAbleToCreateExpiredTrigger() throws ParseException { + final ScheduleExpression expr = new ScheduleExpression().year(2008).month(12).dayOfMonth(1).end(new Date(0)); + final EJBCronTrigger trigger = new EJBCronTrigger(expr); + assertNotNull(trigger); + } + + @Test(expected = TimerExpiredException.class) + public void computeFailsOnExpiredTriggers() throws ParseException { + final ScheduleExpression expr = new ScheduleExpression().year(2008).month(12).dayOfMonth(1).end(new Date(0)); + final EJBCronTrigger trigger = new EJBCronTrigger(expr); + assertNotNull(trigger); + trigger.computeFirstFireTime(null); + } + @Test(timeout = 1000) public void testSimpleDate() throws ParseException { final ScheduleExpression expr = new ScheduleExpression().year(2008).month(12).dayOfMonth(1).start(new Date(0)); diff --git a/container/openejb-core/src/test/java/org/apache/openejb/timer/InitialIntervalTimerTest.java b/container/openejb-core/src/test/java/org/apache/openejb/timer/InitialIntervalTimerTest.java index 9f9252a514a..1390e48c066 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/timer/InitialIntervalTimerTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/timer/InitialIntervalTimerTest.java @@ -16,10 +16,10 @@ */ package org.apache.openejb.timer; +import org.apache.commons.lang3.time.DateUtils; import org.apache.openejb.jee.EnterpriseBean; -import org.apache.openejb.jee.SingletonBean; import org.apache.openejb.junit.ApplicationComposer; -import org.apache.openejb.testing.Module; +import org.apache.openejb.testing.Classes; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +29,9 @@ import javax.ejb.EJB; import javax.ejb.Lock; import javax.ejb.LockType; +import javax.ejb.NoMoreTimeoutsException; +import javax.ejb.NoSuchObjectLocalException; +import javax.ejb.ScheduleExpression; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.ejb.Timeout; @@ -36,24 +39,71 @@ import javax.ejb.TimerConfig; import javax.ejb.TimerService; +import java.util.Calendar; +import java.util.Date; + import static org.junit.Assert.assertEquals; @RunWith(ApplicationComposer.class) +@Classes(innerClassesAsBean = true) public class InitialIntervalTimerTest { - @Module - public EnterpriseBean bean() { - return new SingletonBean(TimerWithDelay.class).localBean(); - } @EJB private TimerWithDelay bean; + @EJB + private TimerNeverExpires scheduleBean; + @Test public void test() throws InterruptedException { Thread.sleep(5400); assertEquals(3, bean.getOk()); } + @Test + public void endNeverExpires() { + final Calendar cal = Calendar.getInstance(); + final int currentYear = getForSchedule(Calendar.YEAR, cal); + cal.add(Calendar.SECOND, 10); + final ScheduleExpression exp = getPreciseScheduleExpression(cal); + final Date end = DateUtils.setYears(cal.getTime(), cal.get(Calendar.YEAR) - 1); + exp.end(end); + exp.year((currentYear) + " - " + (currentYear + 1)); + + final Timer timer = scheduleBean.createTimer(exp); + scheduleBean.passIfNoMoreTimeouts(timer); + } + + public static ScheduleExpression getPreciseScheduleExpression(final Calendar... cals) { + Calendar cal = (cals.length == 0) ? Calendar.getInstance() : cals[0]; + return new ScheduleExpression() + .year(cal.get(Calendar.YEAR)).month(getForSchedule(Calendar.MONTH, cal)) + .dayOfMonth(getForSchedule(Calendar.DAY_OF_MONTH, cal)) + .hour(getForSchedule(Calendar.HOUR_OF_DAY, cal)) + .minute(getForSchedule(Calendar.MINUTE, cal)) + .second(getForSchedule(Calendar.SECOND, cal)); + } + + public static int getForSchedule(final int field, final Calendar... calendars) { + int result = 0; + Calendar cal = null; + if (calendars.length == 0) { + cal = Calendar.getInstance(); + } else { + cal = calendars[0]; + } + result = cal.get(field); + if (field == Calendar.DAY_OF_WEEK) { + result--; // 0 and 7 are both Sunday + if (result == 0) { + result = (Math.random() < 0.5) ? 0 : 7; + } + } else if (field == Calendar.MONTH) { + result++; + } + return result; + } + @Singleton @Startup @Lock(LockType.READ) @@ -85,4 +135,58 @@ public void stop() { timer.cancel(); } } + + @Singleton + @Startup + @Lock(LockType.READ) + public static class TimerNeverExpires { + + @Resource + private TimerService timerService; + + private int ok = 0; + + @Timeout + public void timeout(final Timer timer) { + ok++; + } + + public Timer createTimer(final ScheduleExpression exp) { + return timerService.createCalendarTimer(exp, new TimerConfig("TimerNeverExpires", false)); + } + + public String passIfNoMoreTimeouts(final Timer t) { + String result = ""; + try { + Date nextTimeout = t.getNextTimeout(); + throw new RuntimeException( + "Expecting NoSuchObjectLocalException or NoMoreTimeoutsException " + + "when accessing getNextTimeout, but actual " + nextTimeout); + + } catch (final NoMoreTimeoutsException e) { + result += " Got expected " + e; + + } catch (final NoSuchObjectLocalException e) { + result += " Got expected " + e; + + } + + try { + long timeRemaining = t.getTimeRemaining(); + throw new RuntimeException( + "Expecting NoSuchObjectLocalException or NoMoreTimeoutsException " + + "when accessing getTimeRemaining, but actual " + timeRemaining); + + } catch (final NoMoreTimeoutsException e) { + result += " Got expected " + e; + + } catch (final NoSuchObjectLocalException e) { + result += " Got expected " + e; + + } + return result; + } + + + } } diff --git a/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/unit/JaxbPersistenceFactory.java b/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/unit/JaxbPersistenceFactory.java index 1ca06174f0d..6caa2dc5933 100644 --- a/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/unit/JaxbPersistenceFactory.java +++ b/container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/unit/JaxbPersistenceFactory.java @@ -80,7 +80,11 @@ public PersistenceFilter(final XMLReader xmlReader) { @Override protected String eeUri(final String uri) { - return "http://xmlns.jcp.org/xml/ns/persistence".equals(uri) ? "http://java.sun.com/xml/ns/persistence": uri; + // there should not be any other namespace, but let's see if we can match all of them + // http://java.sun.com/xml/ns/persistence + // http://xmlns.jcp.org/xml/ns/persistence + // https://jakarta.ee/xml/ns/persistence + return uri != null && uri.contains("/persistence") ? PERSISTENCE_SCHEMA: uri; } @Override diff --git a/container/openejb-jee/src/test/java/org/apache/openejb/jee/jpa/PersistenceXmlTest.java b/container/openejb-jee/src/test/java/org/apache/openejb/jee/jpa/PersistenceXmlTest.java index cc0dc4fa751..2d1d3177f24 100644 --- a/container/openejb-jee/src/test/java/org/apache/openejb/jee/jpa/PersistenceXmlTest.java +++ b/container/openejb-jee/src/test/java/org/apache/openejb/jee/jpa/PersistenceXmlTest.java @@ -20,6 +20,7 @@ import junit.framework.TestCase; import org.apache.openejb.jee.JAXBContextFactory; +import org.apache.openejb.jee.jpa.unit.JaxbPersistenceFactory; import org.apache.openejb.jee.jpa.unit.Persistence; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier; @@ -97,6 +98,41 @@ public void testPersistenceVersion2() throws Exception { assertTrue("Files are similar " + myDiff, myDiff.similar()); } + public void testPersistenceJakarta() throws Exception { + + // make sure we can still parse previous versions + { + final URL resource = this.getClass().getClassLoader().getResource("persistence_2.0-example.xml"); + final InputStream in = resource.openStream(); + + final Persistence element = JaxbPersistenceFactory.getPersistence(Persistence.class, in); + + assertNotNull(element); + System.out.println("unmarshalled " + element); + } + { + final URL resource = this.getClass().getClassLoader().getResource("persistence-example.xml"); + final InputStream in = resource.openStream(); + + final Persistence element = JaxbPersistenceFactory.getPersistence(Persistence.class, in); + + assertNotNull(element); + System.out.println("unmarshalled " + element); + } + + // try new jakarta namespace + { + final URL resource = this.getClass().getClassLoader().getResource("persistence_2.0-jakarta.xml"); + final InputStream in = resource.openStream(); + + final Persistence element = JaxbPersistenceFactory.getPersistence(Persistence.class, in); + + assertNotNull(element); + System.out.println("unmarshalled " + element); + } + + } + private java.lang.String readContent(InputStream in) throws IOException { final StringBuilder sb = new StringBuilder(); in = new BufferedInputStream(in); diff --git a/container/openejb-jee/src/test/resources/persistence_2.0-jakarta.xml b/container/openejb-jee/src/test/resources/persistence_2.0-jakarta.xml new file mode 100644 index 00000000000..04f1240b008 --- /dev/null +++ b/container/openejb-jee/src/test/resources/persistence_2.0-jakarta.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- $Rev$ --> +<persistence xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" version="3.0"> + + <persistence-unit transaction-type="JTA" name="foo"> + <description>description</description> + <provider>org.acme.Provider</provider> + <jta-data-source>jtadatasource</jta-data-source> + <non-jta-data-source>nonjtadatasource</non-jta-data-source> + <mapping-file>mappingfile1</mapping-file> + <mapping-file>mappingfile2</mapping-file> + <jar-file>jarfile1</jar-file> + <jar-file>jarfile2</jar-file> + <class>org.acme.Person</class> + <class>org.acme.Animal</class> + <exclude-unlisted-classes>true</exclude-unlisted-classes> + <shared-cache-mode>ALL</shared-cache-mode> + <validation-mode>AUTO</validation-mode> + <properties> + <property value="rab" name="bar"/> + <property value="zab" name="baz"/> + <property value="oof" name="foo"/> + </properties> + </persistence-unit> + <persistence-unit transaction-type="RESOURCE_LOCAL" name="bar"> + <description>description2</description> + <provider>org.acme.Provider2</provider> + <jta-data-source>jtadatasource2</jta-data-source> + <non-jta-data-source>nonjtadatasource2</non-jta-data-source> + <mapping-file>mappingfile12</mapping-file> + <mapping-file>mappingfile22</mapping-file> + <jar-file>jarfile12</jar-file> + <jar-file>jarfile22</jar-file> + <class>org.acme.Person2</class> + <class>org.acme.Animal2</class> + <exclude-unlisted-classes>true</exclude-unlisted-classes> + <properties> + <property value="rab2" name="bar2"/> + <property value="oof2" name="foo2"/> + <property value="zab2" name="baz2"/> + </properties> + </persistence-unit> +</persistence> diff --git a/pom.xml b/pom.xml index 7fe4dfbec70..a46260d6200 100644 --- a/pom.xml +++ b/pom.xml @@ -394,7 +394,10 @@ <plugin> <groupId>org.owasp</groupId> <artifactId>dependency-check-maven</artifactId> - <version>6.0.3</version> + <version>6.0.5</version> + <configuration> + <suppressionFile>owasp-dc-suppression.xml</suppressionFile> + </configuration> </plugin> <plugin> <groupId>org.jacoco</groupId> @@ -750,7 +753,6 @@ <configuration> <skipProvidedScope>true</skipProvidedScope> <skipRuntimeScope>true</skipRuntimeScope> - <suppressionFiles>${maven.multiModuleProjectDirectory}/owasp-dc-suppression.xml</suppressionFiles> </configuration> <executions> <execution> @@ -774,7 +776,6 @@ <skipProvidedScope>true</skipProvidedScope> <skipRuntimeScope>true</skipRuntimeScope> <failBuildOnCVSS>8.0</failBuildOnCVSS> - <suppressionFiles>${maven.multiModuleProjectDirectory}/owasp-dc-suppression.xml</suppressionFiles> </configuration> <executions> <execution> diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java index d857d51c40e..1a79dd2bf0a 100644 --- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java +++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java @@ -39,7 +39,6 @@ import org.apache.cxf.jaxrs.provider.ProviderFactory; import org.apache.cxf.jaxrs.provider.ServerProviderFactory; import org.apache.cxf.jaxrs.sse.SseContextProvider; -import org.apache.cxf.jaxrs.sse.SseEventSinkContextProvider; import org.apache.cxf.jaxrs.utils.JAXRSUtils; import org.apache.cxf.jaxrs.utils.HttpUtils; import org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor; @@ -1236,7 +1235,7 @@ private Object getServiceObject(final Message message) { private static final ClassLoader SYSTEM_LOADER = ClassLoader.getSystemClassLoader(); public DefaultProviderComparator() { - super(null); + super(CxfUtil.getBus()); } @Override diff --git a/tomee/tomee-webaccess/src/main/webapp/app/js/templates/script-sample-javascript.handlebars b/tomee/tomee-webaccess/src/main/webapp/app/js/templates/script-sample-javascript.handlebars index 4fc3e7d0c9d..62ea4b5cbdb 100644 --- a/tomee/tomee-webaccess/src/main/webapp/app/js/templates/script-sample-javascript.handlebars +++ b/tomee/tomee-webaccess/src/main/webapp/app/js/templates/script-sample-javascript.handlebars @@ -16,7 +16,7 @@ --> var pairs = ctx.list(''); while(pairs.hasMore()) { - println('[entry] ' + pairs.next().getName()); + print('[entry] ' + pairs.next().getName()); } var user = ctx.lookup('java:comp/EJBContext').getCallerPrincipal().getName(); -println("Logged user: '" + user + "'"); \ No newline at end of file +print("Logged user: '" + user + "'");
0
726812fa2fa7ce16bcf58f6e115f65427a1c0950
https://github.com/ImageMagick/ImageMagick/commit/726812fa2fa7ce16bcf58f6e115f65427a1c0950
Prevent buffer overflow in magick/draw.c
diff --git a/ChangeLog b/ChangeLog index 1e88dc94cc..d2dfe6830a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2016-05-04 7.0.1-2 Cristy <quetzlzacatenango@image...> + * Check for buffer overflow in magick/draw.c/DrawStrokePolygon(). + 2016-05-03 7.0.1-1 Cristy <quetzlzacatenango@image...> * New version 7.0.1-1, GIT revision 10723:9fc8a0c:20160503. diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 547678410b..d9fe9e7f2d 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -1417,7 +1417,7 @@ MagickExport MagickBooleanType DrawClipPath(Image *image, return(MagickFalse); (void) QueryColorCompliance("#0000",AllCompliance, &clip_mask->background_color,exception); - clip_mask->background_color.alpha=(Quantum) TransparentAlpha; + clip_mask->background_color.alpha=(MagickRealType) TransparentAlpha; (void) SetImageBackgroundColor(clip_mask,exception); if (image->debug != MagickFalse) (void) LogMagickEvent(DrawEvent,GetMagickModule(),"\nbegin clip-path %s", @@ -1541,7 +1541,7 @@ static MagickBooleanType DrawDashPolygon(const DrawInfo *draw_info, status=MagickTrue; maximum_length=0.0; total_length=0.0; - for (i=1; (i < number_vertices) && (length >= 0.0); i++) + for (i=1; (i < (ssize_t) number_vertices) && (length >= 0.0); i++) { dx=primitive_info[i].point.x-primitive_info[i-1].point.x; dy=primitive_info[i].point.y-primitive_info[i-1].point.y; @@ -1794,7 +1794,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, /* Interpret graphic primitive. */ - GetNextToken(q,&q,extent,keyword); + GetNextToken(q,&q,MagickPathExtent,keyword); if (*keyword == '\0') break; if (*keyword == '#') @@ -2104,7 +2104,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, GetNextToken(q,&q,extent,token); weight=ParseCommandOption(MagickWeightOptions,MagickFalse,token); if (weight == -1) - weight=StringToUnsignedLong(token); + weight=(ssize_t) StringToUnsignedLong(token); graphic_context[n]->weight=(size_t) weight; break; } @@ -2353,7 +2353,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, (void) SetImageArtifact(image,key,token); (void) FormatLocaleString(key,MagickPathExtent,"%s-type",name); (void) SetImageArtifact(image,key,type); - (void) FormatLocaleString(key,MagickPathExtent,"%s-geometry",name); + (void) FormatLocaleString(key,MagickPathExtent,"%s-geometry", + name); (void) FormatLocaleString(geometry,MagickPathExtent, "%gx%g%+.15g%+.15g", MagickMax(fabs(bounds.x2-bounds.x1+1.0),1.0), @@ -4608,7 +4609,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, */ clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; - clone_info->stroke.alpha=(Quantum) TransparentAlpha; + clone_info->stroke.alpha=(MagickRealType) TransparentAlpha; status&=DrawPolygonPrimitive(image,clone_info,primitive_info, exception); clone_info=DestroyDrawInfo(clone_info); @@ -4643,7 +4644,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, } clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; - clone_info->stroke.alpha=(Quantum) TransparentAlpha; + clone_info->stroke.alpha=(MagickRealType) TransparentAlpha; status&=DrawPolygonPrimitive(image,clone_info,primitive_info, exception); clone_info=DestroyDrawInfo(clone_info); @@ -4743,7 +4744,7 @@ static MagickBooleanType DrawStrokePolygon(Image *image, if (clone_info->stroke_pattern != (Image *) NULL) clone_info->fill_pattern=CloneImage(clone_info->stroke_pattern,0,0, MagickTrue,exception); - clone_info->stroke.alpha=(Quantum) TransparentAlpha; + clone_info->stroke.alpha=(MagickRealType) TransparentAlpha; clone_info->stroke_width=0.0; clone_info->fill_rule=NonZeroRule; status=MagickTrue; @@ -4858,7 +4859,7 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info) draw_info->miterlimit=10; draw_info->decorate=NoDecoration; draw_info->pointsize=12.0; - draw_info->undercolor.alpha=(Quantum) TransparentAlpha; + draw_info->undercolor.alpha=(MagickRealType) TransparentAlpha; draw_info->compose=OverCompositeOp; draw_info->render=MagickTrue; draw_info->debug=IsEventLogging(); @@ -4925,7 +4926,7 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info) weight=ParseCommandOption(MagickWeightOptions,MagickFalse,option); if (weight == -1) - weight=StringToUnsignedLong(option); + weight=(ssize_t) StringToUnsignedLong(option); draw_info->weight=(size_t) weight; } exception=DestroyExceptionInfo(exception); @@ -6021,17 +6022,29 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info, } if (q >= (ssize_t) (max_strokes-6*BezierQuantum-360)) { - max_strokes+=6*BezierQuantum+360; - path_p=(PointInfo *) ResizeQuantumMemory(path_p,(size_t) max_strokes, - sizeof(*path_p)); - path_q=(PointInfo *) ResizeQuantumMemory(path_q,(size_t) max_strokes, - sizeof(*path_q)); - if ((path_p == (PointInfo *) NULL) || (path_q == (PointInfo *) NULL)) - { - polygon_primitive=(PrimitiveInfo *) - RelinquishMagickMemory(polygon_primitive); - return((PrimitiveInfo *) NULL); - } + if (~max_strokes < (6*BezierQuantum+360)) + { + path_p=(PointInfo *) RelinquishMagickMemory(path_p); + path_q=(PointInfo *) RelinquishMagickMemory(path_q); + } + else + { + max_strokes+=6*BezierQuantum+360; + path_p=(PointInfo *) ResizeQuantumMemory(path_p,max_strokes, + sizeof(*path_p)); + path_q=(PointInfo *) ResizeQuantumMemory(path_q,max_strokes, + sizeof(*path_q)); + } + if ((path_p == (PointInfo *) NULL) || (path_q == (PointInfo *) NULL)) + { + if (path_p != (PointInfo *) NULL) + path_p=(PointInfo *) RelinquishMagickMemory(path_p); + if (path_q != (PointInfo *) NULL) + path_q=(PointInfo *) RelinquishMagickMemory(path_q); + polygon_primitive=(PrimitiveInfo *) + RelinquishMagickMemory(polygon_primitive); + return((PrimitiveInfo *) NULL); + } } dot_product=dx.q*dy.p-dx.p*dy.q; if (dot_product <= 0.0)
1
9fe4ad0489ca42801e06abf05333a42213c3c9c8
https://github.com/Bitmessage/PyBitmessage/commit/9fe4ad0489ca42801e06abf05333a42213c3c9c8
test case for testing old knownnodes pickle -test case for testing old knownnodes pickle -fixed CQ for tests.core module -implemented shutil.copyfile feature and use small size knownnodes.dat file in test_pattern dir -remove unnecessary code -Fixed CQ of tests.core module
diff --git a/src/network/knownnodes.py b/src/network/knownnodes.py index 07871c7c7a..c92f8e9a3f 100644 --- a/src/network/knownnodes.py +++ b/src/network/knownnodes.py @@ -17,6 +17,8 @@ from bmconfigparser import BMConfigParser from network.node import Peer +state.Peer = Peer + knownNodesLock = threading.RLock() """Thread lock for knownnodes modification""" knownNodes = {stream: {} for stream in range(1, 4)} diff --git a/src/tests/core.py b/src/tests/core.py index 3d8ac98382..03e8b948f0 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -7,6 +7,7 @@ import pickle # nosec import Queue import random # nosec +import shutil import string import sys import time @@ -231,7 +232,8 @@ def test_version(self): msg = protocol.assembleVersionMessage('127.0.0.1', 8444, [1]) decoded = self._decode_msg(msg, "IQQiiQlsLv") peer, _, ua, streams = self._decode_msg(msg, "IQQiiQlsLv")[4:] - self.assertEqual(peer, Node(3, '127.0.0.1', 8444)) + self.assertEqual( + peer, Node(11 if state.dandelion else 3, '127.0.0.1', 8444)) self.assertEqual(ua, '/PyBitmessage:' + softwareVersion + '/') self.assertEqual(streams, [1]) # with multiple streams @@ -259,6 +261,19 @@ def test_insert_method_msgid(self): '''select typeof(msgid) from sent where ackdata=?''', result) self.assertEqual(column_type[0][0] if column_type else '', 'text') + def test_old_knownnodes_pickle(self): + """Testing old(v.0.6.2) version knownnodes.dat file""" + try: + old_source_file = os.path.join( + os.path.abspath(os.path.dirname(__file__)), 'test_pattern', 'knownnodes.dat') + new_destination_file = os.path.join(state.appdata, 'knownnodes.dat') + shutil.copyfile(old_source_file, new_destination_file) + knownnodes.readKnownNodes() + except AttributeError as e: + self.fail('Failed to load knownnodes: %s' % e) + finally: + cleanup(files=('knownnodes.dat',)) + def run(): """Starts all tests defined in this module""" diff --git a/src/tests/test_pattern/knownnodes.dat b/src/tests/test_pattern/knownnodes.dat new file mode 100644 index 0000000000..a78a4434b5 --- /dev/null +++ b/src/tests/test_pattern/knownnodes.dat @@ -0,0 +1,104 @@ +(dp0 +I1 +(dp1 +ccopy_reg +_reconstructor +p2 +(cstate +Peer +p3 +c__builtin__ +tuple +p4 +(S'85.180.139.241' +p5 +I8444 +tp6 +tp7 +Rp8 +I1608398841 +sg2 +(g3 +g4 +(S'158.222.211.81' +p9 +I8080 +tp10 +tp11 +Rp12 +I1608398841 +sg2 +(g3 +g4 +(S'178.62.12.187' +p13 +I8448 +tp14 +tp15 +Rp16 +I1608398841 +sg2 +(g3 +g4 +(S'109.147.204.113' +p17 +I1195 +tp18 +tp19 +Rp20 +I1608398841 +sg2 +(g3 +g4 +(S'5.45.99.75' +p21 +I8444 +tp22 +tp23 +Rp24 +I1608398841 +sg2 +(g3 +g4 +(S'178.11.46.221' +p25 +I8444 +tp26 +tp27 +Rp28 +I1608398841 +sg2 +(g3 +g4 +(S'95.165.168.168' +p29 +I8444 +tp30 +tp31 +Rp32 +I1608398841 +sg2 +(g3 +g4 +(S'24.188.198.204' +p33 +I8111 +tp34 +tp35 +Rp36 +I1608398841 +sg2 +(g3 +g4 +(S'75.167.159.54' +p37 +I8444 +tp38 +tp39 +Rp40 +I1608398841 +ssI2 +(dp41 +sI3 +(dp42 +s. \ No newline at end of file
0
b8edbda019eeb99da8663193e224efc9d1265dc7
https://github.com/quassel/quassel/commit/b8edbda019eeb99da8663193e224efc9d1265dc7
Merge pull request #153 from elxa/fix-op-command-crashing-core Fixes a crash of the core when executing "/op *" in a query.
diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index 7887a929a2..73aac48ae3 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -228,7 +228,7 @@ void CoreUserInputHandler::doMode(const BufferInfo &bufferInfo, const QChar& add if (!isNumber || maxModes == 0) maxModes = 1; QStringList nickList; - if (nicks == "*") { // All users in channel + if (nicks == "*" && bufferInfo.type() == BufferInfo::ChannelBuffer) { // All users in channel const QList<IrcUser*> users = network()->ircChannel(bufferInfo.bufferName())->ircUsers(); foreach(IrcUser *user, users) { if ((addOrRemove == '+' && !network()->ircChannel(bufferInfo.bufferName())->userModes(user).contains(mode))
1
04f805e576d8c1c9328088ddd12eeb8b8103251a
https://github.com/wikimedia/mediawiki-core/commit/04f805e576d8c1c9328088ddd12eeb8b8103251a
Fix DateInputWidget readonly LESS Follow-up to 31ca233d121244cae1016d1d7e0247ffa97c91a3 * Remove selector that is already covered by OOUI * Fix the selector to actually hit the intended element * Use WikimediaUI readonly grey instead of Apex Change-Id: I8a6468dbf481e73afd6ed4854da44cf2b57cccdc
diff --git a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less index e0e47841ff7..6a9785592d8 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less +++ b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less @@ -71,9 +71,8 @@ border-color: #72777d; } - .oo-ui-inputWidget-input[ readonly ]:not( .oo-ui-pendingElement-pending ), - & ~ .mw-widget-dateInputWidget-handle { - background-color: #f3f3f3; + .oo-ui-inputWidget-input[ readonly ]:not( .oo-ui-pendingElement-pending ) ~ .mw-widget-dateInputWidget-handle { + background-color: #f8f9fa; } }
0
fdafb5ec97838e4edbd685f587f28d3174ebb3db
https://github.com/exponentcms/exponent-cms/commit/fdafb5ec97838e4edbd685f587f28d3174ebb3db
iniitial effort to greatly enhance system security (xss, sql inject, file exploit, rce, etc...)
diff --git a/framework/core/controllers/expController.php b/framework/core/controllers/expController.php index 9f7d259dba..c90afd5c38 100755 --- a/framework/core/controllers/expController.php +++ b/framework/core/controllers/expController.php @@ -41,11 +41,19 @@ abstract class expController { 'create' => 'Create', 'edit' => 'Edit', 'delete' => 'Delete', - 'approve' => 'Approval', + ); + protected $m_permissions = array( // standard set of actions requiring manage permission for all modules + 'activate' => 'Activate', + 'approve' => 'Approve', + 'merge' => 'Merge', + 'rerank' => 'ReRank', + 'import' => 'Import Items', + 'export' => 'Export Items' ); protected $remove_permissions = array(); // $permissions not applicable for this module from above list - protected $add_permissions = array(); // additional $permissions processed for this module - public $requires_login = array(); // actions/methods which ONLY require user be logged in to access...$permissions take priority + protected $add_permissions = array(); // additional $permissions processed and visible for this module + protected $manage_permissions = array(); // additional actions requiring manage permission in addition to $m_permissions + public $requires_login = array(); // actions/methods which ONLY require user be logged in to access...$permissions take priority public $filepath = ''; // location of this controller's files public $viewpath = ''; // location of this controllers views; defaults to controller file location @@ -131,6 +139,8 @@ public function __construct($src = null, $params = array()) { $this->config = $config->config; $this->params = $params; + if (ENABLE_WORKFLOW) + $this->permissions = array_merge($this->permissions, array('approve'=>'Approval')); } /** @@ -294,7 +304,7 @@ public function showall_by_tags() { $modelname = $this->basemodel_name; // get the tag being passed - $tag = new expTag($this->params['tag']); + $tag = new expTag(expString::escape($this->params['tag'])); // find all the id's of the portfolios for this module $item_ids = $db->selectColumn($modelname, 'id', $this->aggregateWhereClause()); @@ -328,7 +338,7 @@ public function showall_by_tags() { assign_to_template(array( 'page' => $page, 'items' => $page->records, - 'moduletitle' => ucfirst($modelname) . ' ' . gt('items tagged with') . ' "' . expString::sanitize($this->params['tag']) . '"', + 'moduletitle' => ucfirst($modelname) . ' ' . gt('items tagged with') . ' "' . expString::escape($this->params['tag']) . '"', 'rank' => ($order === 'rank') ? 1 : 0 )); } @@ -454,7 +464,7 @@ public function show() { if (isset($this->params['id'])) { $id = $this->params['id']; } elseif (isset($this->params['title'])) { - $id = $this->params['title']; + $id = expString::escape($this->params['title']); } $record = new $modelname($id); @@ -485,6 +495,7 @@ public function showByTitle() { $modelname = $this->basemodel_name; // first we'll check to see if this matches the sef_url field...if not then we'll look for the // title field + $this->params['title'] = expString::escape($this->params['title']); // escape title to prevent sql injection $record = $this->$modelname->find('first', "sef_url='" . $this->params['title'] . "'"); if (!is_object($record)) { $record = $this->$modelname->find('first', "title='" . $this->params['title'] . "'"); @@ -1012,7 +1023,7 @@ public function getRSSContent($limit = 0) { public function rss() { require_once(BASE . 'external/feedcreator.class.php'); - $id = isset($this->params['title']) ? $this->params['title'] : (isset($this->params['id']) ? $this->params['id'] : null); + $id = isset($this->params['title']) ? expString::escape($this->params['title']) : (isset($this->params['id']) ? $this->params['id'] : null); if (empty($id)) { $module = !empty($this->params['module']) ? $this->params['module'] : $this->params['controller']; $id = array('module' => $module, 'src' => $this->params['src']); @@ -1143,7 +1154,7 @@ public function downloadfile() { } /** - * permission functions to aggregate a module's permissions based on add/remove permissions + * permission functions to aggregate a module's visible permissions based on add/remove permissions * * @return array */ @@ -1157,6 +1168,21 @@ public function permissions() { return $perms; } + /** + * permission functions to aggregate a module's permissions based on add/remove and manage permissions + * + * @return array + */ + public function permissions_all() { + //set the permissions array + $perms = array(); + foreach ($this->permissions as $perm => $name) { + if (!in_array($perm, $this->remove_permissions)) $perms[$perm] = $name; + } + $perms = array_merge($perms, $this->m_permissions, $this->add_permissions, $this->manage_permissions); + return $perms; + } + // create a psuedo global permission specific to the module; return true grants permission, false continues with other permission checks public static function checkPermissions($permission, $location) { return false; diff --git a/framework/core/expFramework.php b/framework/core/expFramework.php index 3943d34fe5..913905fd74 100755 --- a/framework/core/expFramework.php +++ b/framework/core/expFramework.php @@ -285,13 +285,13 @@ function renderAction(array $parms=array()) { // initialize the controller. $src = isset($parms['src']) ? $parms['src'] : null; - $controller = new $fullControllerName($src, $parms); - + $controller = new $fullControllerName($src, $parms); + //Set up the correct template to use for this action global $template; $view = !empty($parms['view']) ? $parms['view'] : $action; $template = expTemplate::get_template_for_action($controller, $view, $controller->loc); - + //setup default model(s) for this controller's actions to use foreach ($controller->getModels() as $model) { $controller->$model = new $model(null,false,false); //added null,false,false to reduce unnecessary queries. FJD @@ -324,28 +324,30 @@ function renderAction(array $parms=array()) { } // check the perms for this action - $perms = $controller->permissions(); - + $perms = $controller->permissions_all(); + + $common_action = null; + // action convention for controllers that manage more than one model (datatype). + // if you preface the name action name with a common crud action name we can check perms on + // it with the developer needing to specify any...better safe than sorry. + // i.e if the action is edit_mymodel it will be checked against the edit permission + if (stristr($parms['action'], '_')) + $parts = explode("_", $parms['action']); + else + $parts = preg_split('/(?=[A-Z])/', $parms['action']); // account for actions with camelCase action/perm such as editItem + $common_action = isset($parts[0]) ? $parts[0] : null; // we have to treat the update permission a little different..it's tied to the create/edit // permissions. Really the only way this will fail will be if someone bypasses the perm check // on the edit form somehow..like a hacker trying to bypass the form and just submit straight to // the action. To safeguard, we'll catch if the action is update and change it either to create or // edit depending on whether an id param is passed to. that should be sufficient. - $common_action = null; - //FIXME do we also need to account for actions with camelcase action/perm such as editItem ??? - if ($parms['action'] == 'update') { + if ($parms['action'] == 'update' || $common_action == 'update') { $perm_action = (!isset($parms['id']) || $parms['id'] == 0) ? 'create' : 'edit'; - } elseif ($parms['action'] == 'edit' && (!isset($parms['id']) || $parms['id'] == 0)) { + } elseif (($parms['action'] == 'edit' || $common_action == 'edit') && (!isset($parms['id']) || $parms['id'] == 0)) { $perm_action = 'create'; } elseif ($parms['action'] == 'saveconfig') { $perm_action = 'configure'; } else { - // action convention for controllers that manage more than one model (datatype). - // if you preface the name action name with a common crud action name we can check perms on - // it with the developer needing to specify any...better safe than sorry. - // i.e if the action is edit_mymodel it will be checked against the edit permission - if (stristr($parms['action'], '_')) $parts = explode("_", $parms['action']); - $common_action = isset($parts[0]) ? $parts[0] : null; $perm_action = $parms['action']; } @@ -424,7 +426,7 @@ function renderAction(array $parms=array()) { } elseif (array_key_exists($perm_action, $controller->requires_login)) { // check if the action requires the user to at least be logged in if (!$user->isLoggedIn()) { - $msg = empty($controller->requires_login[$perm_action]) ? gt("You must be logged in to perform this action") : $controller->requires_login[$perm_action]; + $msg = empty($controller->requires_login[$perm_action]) ? gt("You must be logged in to perform this action") : gt($controller->requires_login[$perm_action]); flash('error', $msg); notfoundController::handle_not_authorized(); expHistory::redirecto_login(); @@ -432,16 +434,16 @@ function renderAction(array $parms=array()) { } elseif (array_key_exists($common_action, $controller->requires_login)) { // check if the action requires the user to at least be logged in if (!$user->isLoggedIn()) { - $msg = empty($controller->requires_login[$common_action]) ? gt("You must be logged in to perform this action") : $controller->requires_login[$common_action]; + $msg = empty($controller->requires_login[$common_action]) ? gt("You must be logged in to perform this action") : gt($controller->requires_login[$common_action]); flash('error', $msg); notfoundController::handle_not_authorized(); expHistory::redirecto_login(); } - } - + } + // register this controllers permissions to the view for in view perm checks $template->register_permissions(array_keys($perms), $controller->loc); - + // globalizing $user inside all templates $template->assign('user', $user); @@ -486,7 +488,7 @@ function redirect_to($params=array(), $secure=false) { $link = (!is_array($params)) ? $params : $router->makeLink($params, false, $secure); header("Location: " . $link); exit(); -} +} function flash($name, $msg) { expQueue::flash($name, $msg); @@ -514,7 +516,7 @@ function show_msg_queue($name=null) { */ function assign_to_template(array $vars=array()) { global $template; - + if (empty($template) || count($vars) == 0) return false; foreach ($vars as $key=>$val) { $template->assign($key, $val); @@ -540,7 +542,7 @@ function get_common_template($view, $loc, $controllername='') { $controller = new stdClass(); $controller->baseclassname = empty($controllername) ? 'common' : $controllername; $controller->loc = $loc; - + $themepath = BASE . 'themes/' . DISPLAY_THEME . '/modules/common/views/' . $controllername . '/' . $view . '.tpl'; $basenewuipath = BASE . 'framework/modules/common/views/' . $controllername . '/' . $view . '.newui.tpl'; $basepath = BASE . 'framework/modules/common/views/' . $controllername . '/' . $view . '.tpl'; @@ -581,19 +583,19 @@ function get_config_templates($controller, $loc) { return expTemplate::get_config_templates($controller, $loc); // global $db; - + // set paths we will search in for the view $commonpaths = array( BASE.'framework/modules/common/views/configure', BASE.'themes/'.DISPLAY_THEME.'/modules/common/views/configure', ); - + $modpaths = array( $controller->viewpath.'/configure', BASE.'themes/'.DISPLAY_THEME.'/modules/'.$controller->relative_viewpath.'/configure' ); - - // get the common configuration files + + // get the common configuration files $common_views = expTemplate::find_config_views($commonpaths, $controller->remove_configs); foreach ($common_views as $key=>$value) { $common_views[$key]['name'] = gt($value['name']); @@ -608,7 +610,7 @@ function get_config_templates($controller, $loc) { $module_views[$key]['name'] = gt($value['name']); } - // look for a config form for this module's current view + // look for a config form for this module's current view // $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod); //check to see if hcview was passed along, indicating a hard-coded module // if (!empty($controller->params['hcview'])) { @@ -625,7 +627,7 @@ function get_config_templates($controller, $loc) { // $module_views[$viewname]['file'] =$path.'/'.$viewconfig; // } // } - + // sort the views highest to lowest by filename // we are reverse sorting now so our array merge // will overwrite property..we will run array_reverse @@ -671,7 +673,7 @@ function find_config_views($paths=array(), $excludes=array()) { } } } - + return $views; } @@ -759,12 +761,12 @@ function get_action_views($ctl, $action, $human_readable) { // $controller = new $controllerName(); $controller = expModules::getController($ctl); - // set path information + // set path information $paths = array( $controller->viewpath, BASE.'themes/'.DISPLAY_THEME.'/modules/'.$controller->relative_viewpath, ); - + $views = array(); foreach ($paths as $path) { if (is_readable($path)) { @@ -804,7 +806,7 @@ function get_filedisplay_views() { BASE.'framework/modules/common/views/file/', BASE.'themes/'.DISPLAY_THEME.'modules/common/views/file/', ); - + $views = array(); foreach ($paths as $path) { if (is_readable($path)) { @@ -817,7 +819,7 @@ function get_filedisplay_views() { } } } - + return $views; } diff --git a/framework/core/models/expRecord.php b/framework/core/models/expRecord.php index 0ffbfe7a77..b49d05a6fd 100644 --- a/framework/core/models/expRecord.php +++ b/framework/core/models/expRecord.php @@ -104,7 +104,7 @@ function __construct($params = null, $get_assoc = true, $get_attached = true) { $needs_approval = $this->needs_approval && ENABLE_WORKFLOW; // if the user passed in arguments to this constructor then we need to - // retrieve objects + // retrieve objects // If a number was sent in, we assume this is a DB record ID, so pull it if (!is_object($params) && !is_array($params)) { @@ -122,7 +122,7 @@ function __construct($params = null, $get_assoc = true, $get_attached = true) { $params = array('title'=> $params); } } else { - // Otherwise we assume that in inbound is an array or Object to be processed as is. + // Otherwise we assume that in inbound is an array or Object to be processed as is. $this->build($params); } @@ -135,7 +135,7 @@ function __construct($params = null, $get_assoc = true, $get_attached = true) { $this->publish_date = $this->created_at; } - // setup the exception array if it's not there. This array tells the getAssociatedObjectsForThisModel() function which + // setup the exception array if it's not there. This array tells the getAssociatedObjectsForThisModel() function which // modules NOT to setup. This stops us from getting infinite loops with many to many relationships. if (is_array($params)){ $params['except'] = isset($params['except']) ? $params['except'] : array(); @@ -180,6 +180,11 @@ public function find($range = 'all', $where = null, $order = null, $limit = null //eDebug("Supports Revisions:" . $this->supports_revisions); // if ($this->supports_revisions && $range != 'revisions') $sql .= " AND revision_id=(SELECT MAX(revision_id) FROM `" . $db->prefix . $this->tablename . "` WHERE $where)"; // $sql .= empty($order) ? '' : ' ORDER BY ' . $order; + $order = expString::escape($order); + if ($limit !== null) + $limit = intval($limit); + if ($limitstart !== null) + $limitstart = intval($limitstart); $supports_revisions = $this->supports_revisions && ENABLE_WORKFLOW; if (ENABLE_WORKFLOW && $this->needs_approval) { $needs_approval = $user->id; @@ -361,10 +366,10 @@ public function build($params = array()) { foreach ($table as $col=> $colDef) { // check if the DB column has a corresponding value in the params array // if not, we check to see if the column is boolean...if so we set it to false - // if not, then we check to see if we had a previous value in this particular + // if not, then we check to see if we had a previous value in this particular // record. if so we reset it to itself so we don't lose the existing value. - // this is good for when the developer is trying to update just a field or two - // in an existing record. + // this is good for when the developer is trying to update just a field or two + // in an existing record. if (array_key_exists($col, $params)) { $value = is_array($params) ? $params[$col] : $params->$col; if ($colDef[0] == DB_DEF_INTEGER || $colDef[0] == DB_DEF_ID) { @@ -464,7 +469,7 @@ public function save($validate = false, $force_no_revisions = false) { // Save this object's associated objects to the database. // FIXME: we're not going to do this automagically until we get the refreshing figured out. - //$this->saveAssociatedObjects(); + //$this->saveAssociatedObjects(); //Only grab fields that are valid and save this object $saveObj = new stdClass(); @@ -534,7 +539,7 @@ public function validate() { } // safeguard again loc data not being pass via forms...sometimes this happens when you're in a router - // mapped view and src hasn't been passed in via link to the form + // mapped view and src hasn't been passed in via link to the form if (isset($this->id) && empty($this->location_data)) { $loc = $db->selectValue($this->tablename, 'location_data', 'id=' . $this->id); if (!empty($loc)) $this->location_data = $loc; diff --git a/framework/core/subsystems/database/mysqli.php b/framework/core/subsystems/database/mysqli.php index 6a323b561e..f1b4328127 100644 --- a/framework/core/subsystems/database/mysqli.php +++ b/framework/core/subsystems/database/mysqli.php @@ -351,7 +351,7 @@ function sql($sql, $escape = true) { * @param int|null $where * @return void */ - function columnUpdate($table, $col, $val, $where=1) { + function columnUpdate($table, $col, $val, $where=1) { $res = @mysqli_query($this->connection, "UPDATE `" . $this->prefix . "$table` SET `$col`='" . $val . "' WHERE $where"); /*if ($res == null) return array(); @@ -484,8 +484,8 @@ function selectAndJoinObjects($colsA=null, $colsB=null, $tableA, $tableB, $keyA, function selectObjectBySql($sql) { //$logFile = "C:\\xampp\\htdocs\\supserg\\tmp\\queryLog.txt"; //$lfh = fopen($logFile, 'a'); - //fwrite($lfh, $sql . "\n"); - //fclose($lfh); + //fwrite($lfh, $sql . "\n"); + //fclose($lfh); $res = @mysqli_query($this->connection, $this->injectProof($sql)); if ($res == null) return null; @@ -740,8 +740,8 @@ function selectObject($table, $where) { */ function lockTable($table,$lockType="WRITE") { $sql = "LOCK TABLES `" . $this->prefix . "$table` $lockType"; - - $res = mysqli_query($this->connection, $sql); + + $res = mysqli_query($this->connection, $sql); return $res; } @@ -750,11 +750,11 @@ function lockTable($table,$lockType="WRITE") { */ function unlockTables() { $sql = "UNLOCK TABLES"; - + $res = mysqli_query($this->connection, $sql); return $res; } - + /** * Insert an Object into some table in the Database * @@ -768,7 +768,7 @@ function unlockTables() { * @return int|void */ function insertObject($object, $table) { - //if ($table=="text") eDebug($object,true); + //if ($table=="text") eDebug($object,true); $sql = "INSERT INTO `" . $this->prefix . "$table` ("; $values = ") VALUES ("; foreach (get_object_vars($object) as $var => $val) { @@ -828,7 +828,7 @@ function updateObject($object, $table, $where=null, $identifier='id', $is_revisi $object->revision_id++; //if ($table=="text") eDebug($object); $res = $this->insertObject($object, $table); - //if ($table=="text") eDebug($object,true); + //if ($table=="text") eDebug($object,true); $this->trim_revisions($table, $object->$identifier, WORKFLOW_REVISION_LIMIT); return $res; } @@ -838,7 +838,7 @@ function updateObject($object, $table, $where=null, $identifier='id', $is_revisi //if($is_revisioned && $var=='revision_id') $val++; if ($var{0} != '_') { if (is_array($val) || is_object($val)) { - $val = serialize($val); + $val = serialize($val); $sql .= "`$var`='".$val."',"; } else { $sql .= "`$var`='" . $this->escapeString($val) . "',"; @@ -850,7 +850,7 @@ function updateObject($object, $table, $where=null, $identifier='id', $is_revisi $sql .= $this->injectProof($where); else $sql .= "`" . $identifier . "`=" . $object->$identifier; - //if ($table == 'text') eDebug($sql,true); + //if ($table == 'text') eDebug($sql,true); $res = (@mysqli_query($this->connection, $sql) != false); return $res; } @@ -1109,7 +1109,7 @@ function inError() { } /** - * Unescape a string based on the database connection + * Escape a string based on the database connection * @param $string * @return string */ @@ -1162,7 +1162,7 @@ function selectArrays($table, $where = null, $orderby = null) { * @param string $sql The name of the table/object to look at * @return array */ - function selectArraysBySql($sql) { + function selectArraysBySql($sql) { $res = @mysqli_query($this->connection, $this->injectProof($sql)); if ($res == null) return array(); @@ -1294,7 +1294,7 @@ function getTextColumns($table) { while($row = mysqli_fetch_object($res)) { $records[] = $row->Field; } - + return $records; } diff --git a/framework/core/subsystems/expDatabase.php b/framework/core/subsystems/expDatabase.php index 50630c366f..7c0fca37ae 100644 --- a/framework/core/subsystems/expDatabase.php +++ b/framework/core/subsystems/expDatabase.php @@ -1099,14 +1099,14 @@ abstract function error(); abstract function inError(); /** - * Unescape a string based on the database connection + * Escape a string based on the database connection * @param $string * @return string */ abstract function escapeString($string); /** - * Unescape a string based on the database connection + * Attempt to prevent a sql injection * @param $string * @return string */ diff --git a/framework/core/subsystems/expPaginator.php b/framework/core/subsystems/expPaginator.php index 46ea29d0b1..318c5c1eea 100755 --- a/framework/core/subsystems/expPaginator.php +++ b/framework/core/subsystems/expPaginator.php @@ -23,14 +23,14 @@ * and paginate them and optionally group the by category. * It automagically handles the calls to other pages * and has built-in sorting using the defined column headers. - * + * * Usage Example: - * + * * <code> * * $page = new expPaginator(array( * 'model'=>'faq', - * 'where'=>1, + * 'where'=>1, * 'limit'=>25, * 'order'=>'rank', * 'controller'=>$this->baseclassname, @@ -38,7 +38,7 @@ * 'columns'=>array('In FAQ'=>'include_in_faq', 'Submitted'=>'created_at', 'Submitted By'=>'submitter_name'), * )); * </code> - * + * * @package Subsystems * @subpackage Subsystems */ @@ -52,7 +52,7 @@ class expPaginator { public $search_string = ''; public $sql = ''; public $count_sql = ''; - public $where = ''; + public $where = ''; public $controller = ''; public $action = ''; public $order = ''; @@ -91,7 +91,7 @@ class expPaginator { /**#@+ * @access public * @var array - */ + */ public $pages = array(); public $records = array(); public $cats = array(); @@ -106,21 +106,21 @@ class expPaginator { * @return \expPaginator */ public function __construct($params=array()) { - global $router,$db; + global $router, $db; $this->pages_to_show = expTheme::is_mobile() ? 6 : 10; // fewer paging links for small devices $this->where = empty($params['where']) ? null : $params['where']; $this->records = empty($params['records']) ? array() : $params['records']; // $this->limit = empty($params['limit']) ? 10 : $params['limit']; - $this->limit = empty($params['limit']) ? 0 : $params['limit']; + $this->limit = empty($params['limit']) ? 0 : intval($params['limit']); $this->page = empty($params['page']) ? 1 : intval($params['page']); $this->action = empty($params['action']) ? '' : $params['action']; $this->controller = empty($params['controller']) ? '' : $params['controller']; $this->sql = empty($params['sql']) ? '' : $params['sql']; $this->count_sql = empty($params['count_sql']) ? '' : $params['count_sql']; - $this->order = empty($params['order']) ? 'id' : $params['order']; - $this->dir = empty($params['dir']) ? 'ASC' : $params['dir']; - $this->src = empty($params['src']) ? null : $params['src']; + $this->order = empty($params['order']) ? 'id' : expString::escape($params['order']); + $this->dir = empty($params['dir']) || !in_array($params['dir'], array('ASC', 'DESC')) ? 'ASC' : $params['dir']; + $this->src = empty($params['src']) ? null : expString::escape($params['src']); $this->categorize = empty($params['categorize']) ? false : $params['categorize']; $this->uncat = !empty($params['uncat']) ? $params['uncat'] : gt('Not Categorized'); $this->groups = !empty($params['groups']) ? $params['groups'] : array(); @@ -137,7 +137,7 @@ public function __construct($params=array()) { $this->model = $params['model']; $class = new $this->model(null, false, false); } - + // auto-include the CSS for pagination links expCSS::pushToHead(array( // "unique"=>"pagination", @@ -145,7 +145,7 @@ public function __construct($params=array()) { 'corecss'=>'pagination' ) ); - + if ($this->limit) $this->start = (($this->page * $this->limit) - $this->limit); if ($this->start < 0) @@ -167,12 +167,12 @@ public function __construct($params=array()) { } } } - + //setup the default ordering of records // if we are in an action, see if the action is for this controller/action..if so pull the order // and order direction from the request params...this is how the params are passed via the column // headers. - $this->order_direction = $this->dir; + $this->order_direction = $this->dir; // allow passing of a single order/dir as stored in config if (strstr($this->order," ")) { @@ -180,6 +180,10 @@ public function __construct($params=array()) { $this->order = $orderby[0]; $this->order_direction = $orderby[1]; } + if(!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $this->order)) + $this->order = 'id'; + if (!in_array($this->order_direction, array('ASC', 'DESC'))) + $this->order_direction = 'ASC'; if ($this->dontsort) $sort = null; else @@ -209,13 +213,13 @@ public function __construct($params=array()) { //this is MUCH faster if you supply a proper count_sql param using a COUNT() function; if not, //we'll run the standard sql and do a queryRows with it //$this->total_records = $this->count_sql == '' ? $db->queryRows($this->sql) : $db->selectValueBySql($this->count_sql); //From Merge - + // $this->total_records = $db->countObjectsBySql($this->count_sql); //$db->queryRows($this->sql); //From most current Trunk if (!empty($sort)) $this->sql .= ' ORDER BY '.$sort; if (!empty($this->count_sql)) $this->total_records = $db->countObjectsBySql($this->count_sql); if (!empty($this->limit)) $this->sql .= ' LIMIT '.$this->start.','.$this->limit; - + $this->records = array(); if (isset($this->model) || isset($params['model_field'])) { foreach($db->selectObjectsBySql($this->sql) as $record) { @@ -227,7 +231,7 @@ public function __construct($params=array()) { } else { $this->records = $db->selectObjectsBySql($this->sql); } - } + } // next we'll sort them based on categories if needed if (!empty($this->categorize) && $this->categorize && empty($this->dontsort)) @@ -314,7 +318,7 @@ public function __construct($params=array()) { $this->firstrecord = 0; $this->lastrecord = 0; } - + // get the page parameters from the router to build the links $page_params = $router->params; // $page_params = $this->cleanParams($router->params); @@ -343,6 +347,10 @@ public function __construct($params=array()) { if ($this->controller == $mod && $this->action == $router->params['action']) { $this->order = isset($router->params['order']) ? $router->params['order'] : $this->order; $this->order_direction = isset($router->params['dir']) ? $router->params['dir'] : $this->dir; + if(!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $this->order)) + $this->order = 'id'; + if (!in_array($this->order_direction, array('ASC', 'DESC'))) + $this->order_direction = 'ASC'; } } else { if (isset($params->controller)) { @@ -353,12 +361,12 @@ public function __construct($params=array()) { } $page_params['controller'] = $mod; // we can't be passing an empty controller or module to the router } - + if (!empty($this->action)) $page_params['action'] = $this->action; if (!empty($this->src)) $page_params['src'] = $this->src; - + if (isset($page_params['section'])) unset($page_params['section']); @@ -370,10 +378,10 @@ public function __construct($params=array()) { //build a couple more links we can use in the views. $this->pagelink = $router->makeLink($page_params, false, false, true); - + // if don't have enough records for more than one page then we're done. //if ($this->total_records <= $this->limit) return true; - + $this->total_pages = ($this->limit > 0) ? ceil($this->total_records/$this->limit) : 0; // correct current page # to be within limits of number of pages @@ -407,7 +415,7 @@ public function __construct($params=array()) { $this->last_pagelink = $this->first_pagelink + $this->pages_to_show - 1; if ($this->last_pagelink > $this->total_pages) { $this->first_pagelink = max(1, $this->total_pages - $this->pages_to_show) + 1; - $this->last_pagelink = $this->total_pages; + $this->last_pagelink = $this->total_pages; } } else { $this->first_pagelink = 1; @@ -433,19 +441,19 @@ public function __construct($params=array()) { } // setup the links to the remaining pages being displayed. - for($i=$this->first_pagelink; $i<=$this->last_pagelink; $i++) { + for($i=$this->first_pagelink; $i<=$this->last_pagelink; $i++) { $page_params['page'] = $i; $this->pages[$i] = $router->makeLink($page_params, false, false, true); - } + } $links_template = expTemplate::get_common_template('pagination_links', null, 'common'); $links_template->assign('page', $this); $this->links = $links_template->render(); - + $this->makeHeaderCols($page_params); // headers for table view - + $sortparams = array_merge($page_params, $router->params); - + //From Merge **** if (isset($router->params['page'])) $sortparams['page'] = $router->params['page']; @@ -454,47 +462,47 @@ public function __construct($params=array()) { //End From Merge **** $this->makeSortDropdown($sortparams); // used on non-table views - + $table_template = expTemplate::get_common_template('pagination_table', null, 'common'); $table_template->assign('page', $this); $this->table = $table_template->render(); // table view - + } - + //From Merge private function cleanParams($params) { $defaultParams = array('title'=>'','module'=>'','controller'=>'','src'=>'','id'=>'','dir'=>'','_common'=>''); $newParams = array(); - $func = new ReflectionClass($this); + $func = new ReflectionClass($this); foreach ($params as $pKey=>$pVal) { $propname = $pKey; if (array_key_exists($propname,$defaultParams)) { - $newParams[$propname] = $params[$propname]; - } - } + $newParams[$propname] = $params[$propname]; + } + } foreach ($func->getProperties() as $p) { $propname = $p->name; if (array_key_exists($propname,$params)) { - $newParams[$propname] = $params[$propname]; - } - } - + $newParams[$propname] = $params[$propname]; + } + } + return $newParams; } - + public function makeHeaderCols($params) { global $router; if (!empty($this->columns) && is_array($this->columns)) { $this->header_columns = ''; - + // get the parameters used to make this page. if (!expTheme::inAction()) { unset($params['section']); if (empty($params['controller'])) $params['controller'] = $this->controller; if (empty($params['action'])) $params['action'] = $this->action; } - + // $current = ''; if (isset($params['order'])) { $current = $params['order']; @@ -502,20 +510,20 @@ public function makeHeaderCols($params) { } else { $current = $this->order; } - + //loop over the columns and build out a list of <th>'s to be used in the page table foreach ($this->columns as $colname=>$col) { // if this is the column we are sorting on right now we need to setup some class info $class = isset($this->class) ? $this->class : 'page'; $params['dir'] = 'ASC'; - + if ($col == $current) { $class = 'current '.strtolower($this->order_direction); $params['dir'] = $this->order_direction == 'ASC' ? 'DESC' : 'ASC'; - } + } $params['order'] = $col; - + $this->header_columns .= '<th class="'.$class.'">'; // if this column is empty then it's not supposed to be a sortable column @@ -524,7 +532,7 @@ public function makeHeaderCols($params) { $this->columns[$colname] = ' '; } else if($colname=="actupon") { $this->header_columns .= '<input type=checkbox name=selall id=selall value=1 class="select-all"/>'; - + // $js = " // YUI(EXPONENT.YUI3_CONFIG).use('node', function(Y) { // Y.all('input[type=checkbox]').on('click',function(e){ @@ -565,12 +573,12 @@ public function makeHeaderCols($params) { $this->header_columns .= '<a href="'.$router->makeLink($params, false, false, true).'" alt="sort by '.$colname.'" rel="nofollow">'.$colname.'</a>'; } } - + $this->header_columns .= '</th>'; } } } - + //here if we want to modify the record for some reason. e.g. Using in search results w/ products private function runCallback() { foreach ($this->records as &$record) { @@ -585,9 +593,9 @@ private function runCallback() { } } } - } + } } - + public function makeSortDropdown($params) { global $router; @@ -600,7 +608,7 @@ public function makeSortDropdown($params) { if (empty($params['controller'])) $params['controller'] = $this->controller; if (empty($params['action'])) $params['action'] = $this->action; } - + /*$current = ''; if (isset($params['order'])) { $current = $params['order']; @@ -608,7 +616,7 @@ public function makeSortDropdown($params) { } else { $current = $this->order; } */ - + //loop over the columns and build out a list of <th>'s to be used in the page table // eDebug($router); $defaultParams['controller'] = $params['controller']; @@ -617,13 +625,13 @@ public function makeSortDropdown($params) { $defaultParams['title'] = $params['title']; if (isset($params['page'])) $defaultParams['page'] = $params['page']; - + $this->sort_dropdown[$router->makeLink($defaultParams, false, false, true)] = "Default"; foreach ($this->columns as $colname=>$col) { // if this is the column we are sorting on right now we need to setup some class info /*$class = isset($this->class) ? $this->class : 'page'; $params['dir'] = 'ASC';*/ - + /*if ($col == $current) { $class = 'current'; $class .= ' '.$this->order_direction; @@ -632,27 +640,27 @@ public function makeSortDropdown($params) { } else { $params['dir'] = $this->order_direction == 'ASC' ? 'DESC' : 'ASC'; } - } + } */ - $params['order'] = $col; - - if (!empty($col)) { + $params['order'] = $col; + + if (!empty($col)) { if ($colname == 'Price') { - $params['dir'] = 'ASC'; + $params['dir'] = 'ASC'; $this->sort_dropdown[$router->makeLink($params, false, false, true)] = $colname . " - Lowest to Highest"; - $params['dir'] = 'DESC'; + $params['dir'] = 'DESC'; $this->sort_dropdown[$router->makeLink($params, false, false, true)] = $colname . " - Highest to Lowest"; } else { - $params['dir'] = 'ASC'; + $params['dir'] = 'ASC'; $this->sort_dropdown[$router->makeLink($params, false, false, true)] = $colname . " - A-Z"; $params['dir'] = 'DESC'; $this->sort_dropdown[$router->makeLink($params, false, false, true)] = $colname . " - Z-A"; - } - } + } + } } } } - + /** exdoc * Object/Array sorting comparison function -- sorts by a specified column in ascending order. * @node Subsystems:expPaginator diff --git a/framework/core/subsystems/expSettings.php b/framework/core/subsystems/expSettings.php index 104e5d650d..2abcbe5e45 100644 --- a/framework/core/subsystems/expSettings.php +++ b/framework/core/subsystems/expSettings.php @@ -191,13 +191,13 @@ public static function saveValues($values, $configname = '') //FIXME only used // $value = str_replace(array('\r\n', '\r', '\n'), "", $value); $str .= "exponent_unhtmlentities('$value')"; } elseif (is_int($value)) { - $str .= "'" . $value . "'"; + $str .= "'" . intval($value) . "'"; } else { if ($directive != 'SESSION_TIMEOUT') { - $str .= "'" . str_replace("'", "\'", $value) . "'"; //FIXME is this still necessary since we stripslashes above??? + $str .= "'" . expString::escape(str_replace("'", "\'", $value)) . "'"; //FIXME is this still necessary since we stripslashes above??? } // $str .= "'".$value."'"; else { - $str .= "'" . str_replace("'", '', $value) . "'"; + $str .= "'" . expString::escape(str_replace("'", '', $value)) . "'"; } } $str .= ");\n"; @@ -584,6 +584,10 @@ public static function deleteProfile($profile) //FIXME this method is never use */ public static function activateProfile($profile) { + if (!empty($profile) && (strpos($profile, '..') !== false || strpos($profile, '/') !== false)) { + header('Location: ' . URL_FULL); + exit(); // attempt to hack the site + } if (is_readable(BASE . "framework/conf/profiles/$profile.php") && expUtil::isReallyWritable( BASE . "framework/conf" ) @@ -635,4 +639,4 @@ public static function dropdownData($dropdown_name) expSettings::initialize(); // auto-initialize when loaded -?> \ No newline at end of file +?> diff --git a/framework/core/subsystems/expString.php b/framework/core/subsystems/expString.php index 2639cf57d1..677884fded 100644 --- a/framework/core/subsystems/expString.php +++ b/framework/core/subsystems/expString.php @@ -34,7 +34,7 @@ class expString { */ static function convertUTF($string) { return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); - } + } /** * Routine to check if string is valid UTF string @@ -46,7 +46,7 @@ static function convertUTF($string) { static function validUTF($string) { if(!mb_check_encoding($string, 'UTF-8') OR !($string === mb_convert_encoding(mb_convert_encoding($string, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { return false; - } + } return true; } @@ -105,9 +105,9 @@ static function parseAndTrim($str, $unescape=false) { $str = str_replace("¾","&#190;",$str); $str = str_replace("™","&trade;", $str); $str = trim($str); - + if ($unescape) { - $str = stripcslashes($str); + $str = stripcslashes($str); } else { $str = addslashes($str); } @@ -130,15 +130,15 @@ static function convertXMLFeedSafeChar($str) { $str = str_replace("&quot;",'"',$str); $str = str_replace("&#39;","'",$str); $str = str_replace("&rsquo;","'",$str); - $str = str_replace("&lsquo;","'",$str); + $str = str_replace("&lsquo;","'",$str); $str = str_replace("&#174;","",$str); $str = str_replace("�","-", $str); - $str = str_replace("�","-", $str); + $str = str_replace("�","-", $str); $str = str_replace("�", '"', $str); $str = str_replace("&rdquo;",'"', $str); $str = str_replace("�", '"', $str); $str = str_replace("&ldquo;",'"', $str); - $str = str_replace("\r\n"," ",$str); + $str = str_replace("\r\n"," ",$str); $str = str_replace("�"," 1/4",$str); $str = str_replace("&#188;"," 1/4", $str); $str = str_replace("�"," 1/2",$str); @@ -148,9 +148,9 @@ static function convertXMLFeedSafeChar($str) { $str = str_replace("�", "(TM)", $str); $str = str_replace("&trade;","(TM)", $str); $str = str_replace("&reg;","(R)", $str); - $str = str_replace("�","(R)",$str); - $str = str_replace("&","&amp;",$str); - $str = str_replace(">","&gt;",$str); + $str = str_replace("�","(R)",$str); + $str = str_replace("&","&amp;",$str); + $str = str_replace(">","&gt;",$str); return trim($str); } @@ -449,7 +449,7 @@ public static function parseAndTrimExport($str, $isHTML = false) { //�Death fr public static function parseAndTrimImport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); - global $db; +// global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); @@ -471,13 +471,13 @@ public static function parseAndTrimImport($str, $isHTML = false) { //�Death fr //$str = htmlspecialchars($str); //$str = utf8_encode($str); // if (DB_ENGINE=='mysqli') { -// $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "&trade;", $str))); +// $str = self::escape(trim(str_replace("�", "&trade;", $str))); // } elseif(DB_ENGINE=='mysql') { -// $str = @mysql_real_escape_string(trim(str_replace("�", "&trade;", $str)),$db->connection); +// $str = self::escape(trim(str_replace("�", "&trade;", $str))); // } else { // $str = trim(str_replace("�", "&trade;", $str)); // } - $str = @$db->escapeString($db->connection, trim(str_replace("�", "&trade;", $str))); + $str = self::escape(trim(str_replace("�", "&trade;", $str))); //echo "2<br>"; eDebug($str,die); return $str; } diff --git a/framework/core/subsystems/expTheme.php b/framework/core/subsystems/expTheme.php index 617d7be1fa..a87d4017f5 100755 --- a/framework/core/subsystems/expTheme.php +++ b/framework/core/subsystems/expTheme.php @@ -241,13 +241,19 @@ public static function headerInfo($config) $config['meta']['ie_compat'] = true; } - $str = '<title>' . $metainfo['title'] . "</title>\n"; + $str = ''; if ($config['meta']['content_type']) { - $str .= "\t" . '<meta http-equiv="Content-Type" content="text/html; charset=' . LANG_CHARSET . '" ' . XHTML_CLOSING . '>' . "\n"; + $str .= '<meta charset="' . LANG_CHARSET . XHTML_CLOSING . '>' . "\n"; // html5 + $str .= "\t" . '<meta http-equiv="Content-Type" content="text/html; charset=' . LANG_CHARSET . '" ' . XHTML_CLOSING . '>' . "\n"; // html4 or xhtml? } + if ($config['meta']['ie_compat']) { + // turn off ie compatibility mode which will break the display + $str .= "\t" . '<meta http-equiv="X-UA-Compatible" content="IE=edge"' . XHTML_CLOSING . '>' . "\n"; + } + $str .= "\t" . '<title>' . $metainfo['title'] . "</title>\n"; $locale = strtolower(str_replace('_', '-', LOCALE)); if ($config['meta']['content_language']) { - $str .= "\t" . '<meta content="' . $locale . '" http-equiv="Content-Language" ' . XHTML_CLOSING . '>' . "\n"; + $str .= "\t" . '<meta http-equiv="Content-Language" content="' . $locale . '" ' . XHTML_CLOSING . '>' . "\n"; } if ($config['meta']['generator']) { $str .= "\t" . '<meta name="Generator" content="Exponent Content Management System - v' . expVersion::getVersion( @@ -361,9 +367,6 @@ public static function headerInfo($config) //Win 8/IE 10 work around $str .= "\t" . '<!--[if IE 10]><link rel="stylesheet" href="' . PATH_RELATIVE . 'external/ie10-viewport-bug-workaround.css" type="text/css"' . XHTML_CLOSING . '><![endif]-->' . "\n"; $str .= "\t" . '<!--[if IE 10]><script src="' . PATH_RELATIVE . 'external/ie10-viewport-bug-workaround.js"></script><![endif]-->' . "\n"; - - // turn off ie compatibility mode which will break the display - $str .= "\t" . '<meta http-equiv="X-UA-Compatible" content="IE=edge"' . XHTML_CLOSING . '>' . "\n"; } return $str; @@ -1970,4 +1973,4 @@ public static function deprecated($newcall = "expTheme::module()", $controller = } -?> \ No newline at end of file +?> diff --git a/framework/modules/addressbook/controllers/addressController.php b/framework/modules/addressbook/controllers/addressController.php index 269b2d63e1..0f800575bd 100755 --- a/framework/modules/addressbook/controllers/addressController.php +++ b/framework/modules/addressbook/controllers/addressController.php @@ -22,17 +22,17 @@ */ class addressController extends expController { - public $useractions = array( +// public $useractions = array( // 'myaddressbook'=>'Show my addressbook' - ); +// ); protected $remove_permissions = array( 'create', 'edit', 'delete' ); - protected $add_permissions = array( - 'import' => 'Import External Addresses', -// 'export' => 'Export External Addresses' + protected $manage_permissions = array( +// 'import' => 'Import External Addresses', + 'process' => 'Import External Addresses' ); public $remove_configs = array( 'aggregation', @@ -59,7 +59,7 @@ function showall() { // redirect_to(array("controller"=>'address',"action"=>'myaddressbook')); $this->myaddressbook(); } - + public function edit() { if((isset($this->params['id']))) $record = new address(intval($this->params['id'])); @@ -75,7 +75,7 @@ public function edit() )); } } - + public function myaddressbook() { global $user; @@ -87,7 +87,7 @@ public function myaddressbook() { 'addresses'=>$this->address->find('all', 'user_id='.$userid) )); } - + function show() { expHistory::set('viewable', $this->params); assign_to_template(array( @@ -111,7 +111,7 @@ public function update() { // check to see how many other addresses this user has already. $count = $this->address->find('count', 'user_id='.$user->id); // if this is first address save for this user we'll make this the default - if ($count == 0) + if ($count == 0) { $this->params['is_default'] = 1; $this->params['is_billing'] = 1; @@ -123,22 +123,22 @@ public function update() { $this->address->update($this->params); } else { //if (ecomconfig::getConfig('allow_anonymous_checkout')){ - //user is not logged in, but allow anonymous checkout is enabled so we'll check + //user is not logged in, but allow anonymous checkout is enabled so we'll check //a few things that we don't check in the parent 'stuff and create a user account. $this->params['is_default'] = 1; $this->params['is_billing'] = 1; - $this->params['is_shipping'] = 1; + $this->params['is_shipping'] = 1; $this->address->update($this->params); } - expHistory::back(); + expHistory::back(); } - + public function delete() { global $user; $count = $this->address->find('count', 'user_id=' . $user->id); if($count > 1) - { + { $address = new address($this->params['id']); if ($user->isAdmin() || ($user->id == $address->user_id)) { if ($address->is_billing) @@ -147,7 +147,7 @@ public function delete() { $billAddress->is_billing = true; $billAddress->save(); } - if ($address->is_shipping) + if ($address->is_shipping) { $shipAddress = $this->address->find('first', 'user_id=' . $user->id . " AND id != " . $address->id); $shipAddress->is_shipping = true; @@ -162,33 +162,33 @@ public function delete() { } expHistory::back(); } - + public function activate_address() { global $db, $user; $object = new stdClass(); $object->id = $this->params['id']; - $db->setUniqueFlag($object, 'addresses', $this->params['is_what'], "user_id=" . $user->id); + $db->setUniqueFlag($object, 'addresses', expString::escape($this->params['is_what']), "user_id=" . $user->id); flash("message", gt("Successfully updated address.")); - expHistory::back(); + expHistory::back(); } - + public function manage() { expHistory::set('manageable',$this->params); $gc = new geoCountry(); $countries = $gc->find('all'); - - $gr = new geoRegion(); + + $gr = new geoRegion(); $regions = $gr->find('all',null,'rank asc,name asc'); - + assign_to_template(array( 'countries'=>$countries, 'regions'=>$regions )); } - + public function manage_update() { global $db; @@ -199,16 +199,16 @@ public function manage_update() foreach($this->params['country'] as $country_id=>$is_active) { $gc = new geoCountry($country_id); - $gc->active = true; - $gc->save(); + $gc->active = true; + $gc->save(); } //country default $db->columnUpdate('geo_country','is_default',0,'is_default=1'); if(isset($this->params['country_default'])) { - $gc = new geoCountry($this->params['country_default']); - $db->setUniqueFlag($gc,'geo_country','is_default','id=' . $gc->id); - $gc->refresh(); + $gc = new geoCountry(intval($this->params['country_default'])); + $db->setUniqueFlag($gc,'geo_country','is_default','id=' . $gc->id); + $gc->refresh(); } //regions $db->columnUpdate('geo_region','active',0,'active=1'); @@ -217,7 +217,7 @@ public function manage_update() $gr = new geoRegion($region_id); $gr->active = true; if(isset($this->params['region_rank'][$region_id])) $gr->rank = $this->params['region_rank'][$region_id]; - $gr->save(); + $gr->save(); } flash('message',gt('Address configurations successfully updated.')); redirect_to(array('controller'=>'address','action'=>'manage')); diff --git a/framework/modules/administration/controllers/administrationController.php b/framework/modules/administration/controllers/administrationController.php index 80e5a2c8a6..2e35d5cbb3 100644 --- a/framework/modules/administration/controllers/administrationController.php +++ b/framework/modules/administration/controllers/administrationController.php @@ -24,17 +24,17 @@ class administrationController extends expController { public $basemodel_name = 'expRecord'; - protected $add_permissions = array( + protected $manage_permissions = array( + 'change'=>'Change Settings', 'clear'=>'Clear Caches', //FIXME this requires a logged in user to perform? "fix"=>"Fix Database", "install"=>"Installation", + 'mass'=>'Mass Mailing', + 'save'=>'Save Settings', "theme"=>"Manage Themes", 'test_smtp'=>'Test SMTP Server Settings', 'toggle'=>'Toggle Settings', - 'mass'=>'Mass Mailing', - 'update'=>'Update Settings', - 'change'=>'Change Settings', - 'save'=>'Save Settings', +// 'update'=>'Update Settings', ); static function displayname() { return gt("Administration Controls"); } @@ -62,7 +62,7 @@ public function delete_unused_columns() { public function manage_unused_tables() { global $db; - + expHistory::set('manageable', $this->params); $unused_tables = array(); $used_tables = array(); @@ -114,12 +114,12 @@ public function manage_unused_tables() { $unused_tables[$basename]->rows = $db->countObjects($basename); } } - + assign_to_template(array( 'unused_tables'=>$unused_tables )); } - + public function delete_unused_tables() { global $db; @@ -128,7 +128,7 @@ public function delete_unused_tables() { $basename = str_replace($db->prefix, '', $table); $count += $db->dropTable($basename); } - + flash('message', gt('Deleted').' '.$count.' '.gt('unused tables').'.'); expHistory::back(); } @@ -147,14 +147,14 @@ public function fix_optimize_database() { )); } - public function fixsessions() { - global $db; - -// $test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket'); - $fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket'); - flash('message', gt('Sessions Table was Repaired')); - expHistory::back(); - } +// public function fix_sessions() { +// global $db; +// +//// $test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket'); +// $fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket'); +// flash('message', gt('Sessions Table was Repaired')); +// expHistory::back(); +// } public function fix_database() { global $db; @@ -218,7 +218,6 @@ public function fix_database() { $newSecRef->refcount = 1; // $newSecRef->is_original = 1; $eloc = expUnserialize($container->external); -// $section = $db->selectObject('sectionref',"module='containermodule' AND source='".$eloc->src."'"); $section = $db->selectObject('sectionref',"module='container' AND source='".$eloc->src."'"); if (!empty($section)) { $newSecRef->section = $section->id; @@ -286,28 +285,28 @@ public function toolbar() { } // sort the top level menus alphabetically by filename - ksort($menu); + ksort($menu); $sorted = array(); foreach($menu as $m) $sorted[] = $m; - + // slingbar position if (isset($_COOKIE['slingbar-top'])){ $top = $_COOKIE['slingbar-top']; } else { $top = SLINGBAR_TOP; } - + assign_to_template(array( 'menu'=>(bs3()) ? $sorted : json_encode($sorted), "top"=>$top )); } - + // public function index() { // redirect_to(array('controller'=>'administration', 'action'=>'toolbar')); //// $this->toolbar(); // } - + public function update_SetSlingbarPosition() { setcookie('slingbar-top', $this->params['top']); expHistory::back(); @@ -385,7 +384,7 @@ public function toggle_minify() { } expHistory::back(); } - + public function toggle_dev() { if (!expUtil::isReallyWritable(BASE.'framework/conf/config.php')) { // we can't write to the config.php file flash('error',gt('The file /framework/conf/config.php is NOT Writeable. You will be unable to change Error Reporting settings.')); @@ -1047,7 +1046,7 @@ public function manage_themes() { 'themes'=>$themes )); } - + public function theme_switch() { if (!expUtil::isReallyWritable(BASE.'framework/conf/config.php')) { // we can't write to the config.php file flash('error',gt('The file /framework/conf/config.php is NOT Writeable. You will be unable to change the theme.')); @@ -1074,8 +1073,8 @@ public function theme_switch() { // expTheme::removeSmartyCache(); expSession::clearAllUsersSessionCache(); expHistory::returnTo('manageable'); - } - + } + public function theme_preview() { expSession::set('display_theme',$this->params['theme']); $sv = isset($this->params['sv'])?$this->params['sv']:''; @@ -1179,13 +1178,13 @@ public function configure_site () { '0'=>'-- '.gt('Please Select an Anti-Spam Control').' --', "recaptcha"=>'reCAPTCHA' ); - + //THEMES FOR RECAPTCHA $as_themes = array( "light"=>gt('Light (Default)'), "dark"=>gt('Dark'), ); - + // Available Themes $themes = array(); if (is_readable(BASE.'themes')) { @@ -1243,16 +1242,16 @@ public function configure_site () { $attribution = expSettings::dropdownData('attribution'); // These funcs need to be moved up in to new subsystems - + // Date/Time Format $datetime_format = expSettings::dropdownData('datetime_format'); // Date Format $date_format = expSettings::dropdownData('date_format'); - + // Time Format $time_format = expSettings::dropdownData('time_format'); - + // Start of Week // $start_of_week = glist(expSettings::dropdownData('start_of_week')); $daysofweek = event::dayNames(); @@ -1260,7 +1259,7 @@ public function configure_site () { // File Permissions $file_permisions = glist(expSettings::dropdownData('file_permissions')); - + // File Permissions $dir_permissions = glist(expSettings::dropdownData('dir_permissions')); diff --git a/framework/modules/banners/controllers/bannerController.php b/framework/modules/banners/controllers/bannerController.php index 5a5496a246..6fcabb2da4 100755 --- a/framework/modules/banners/controllers/bannerController.php +++ b/framework/modules/banners/controllers/bannerController.php @@ -22,6 +22,12 @@ */ class bannerController extends expController { + public $useractions = array( + 'showall'=>'Display Banner(s)' + ); + protected $manage_permissions = array( + 'reset' => 'Reset Stats' + ); public $remove_configs = array( 'aggregation', 'categories', @@ -34,43 +40,40 @@ class bannerController extends expController { 'tags', 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) - public $useractions = array( - 'showall'=>'Display Banner(s)' - ); static function displayname() { return gt("Banners"); } static function description() { return gt("Display banners on your website and track 'clicks'."); } - + public function showall() { $banners = array(); if (!empty($this->config['banners'])) { // only show banners that this module is configured to show. // do not show banners that have gone over their impression limit // do not show banners that have gone over their click limit - // randomly grab one banner to be displayed + // randomly grab one banner to be displayed // increase the impression count for this banner - $where = 'id IN ('.implode(',', $this->config['banners']).')'; + $where = 'id IN ('.implode(',', $this->config['banners']).')'; $where .= ' AND (impression_limit > impressions || impression_limit=0)'; $where .= ' AND (click_limit > clicks || click_limit=0)'; $limit = isset($this->config['limit']) ? $this->config['limit'] : 1; $banners = $this->banner->find('all', $where , 'RAND()', $limit); - foreach($banners as $banner) { + foreach($banners as $banner) { $banner->increaseImpressions(); } } - + // assign banner to the template and show it! assign_to_template(array( 'banners'=>$banners )); } - + public function click() { $banner = new banner($this->params['id']); $banner->increaseClicks(); redirect_to($banner->url); } - + public function create() { // global $db; //make sure we have companies. @@ -85,15 +88,15 @@ public function create() { parent::create(); } } - + public function manage() { expHistory::set('manageable', $this->params); - + // build out a SQL query that gets all the data we need and is sortable. $sql = 'SELECT b.*, c.title as companyname, f.expfiles_id as file_id '; $sql .= 'FROM '.DB_TABLE_PREFIX.'_banner b, '.DB_TABLE_PREFIX.'_companies c , '.DB_TABLE_PREFIX.'_content_expFiles f '; $sql .= 'WHERE b.companies_id = c.id AND (b.id = f.content_id AND f.content_type="banner")'; - + $page = new expPaginator(array( 'model'=>'banner', 'sql'=>$sql, @@ -114,12 +117,12 @@ public function manage() { 'page'=>$page )); } - + public function configure() { $this->config['defaultbanner'] = array(); if (!empty($this->config['defaultbanner_id'])) { $this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']); - } + } parent::configure(); $banners = $this->banner->find('all', null, 'companies_id'); assign_to_template(array( @@ -127,12 +130,12 @@ public function configure() { 'title'=>static::displayname() )); } - + public function saveconfig() { $this->params['defaultbanner_id'] = isset($this->params['expFile'][0]) ? $this->params['expFile'][0] : 0; parent::saveconfig(); } - + public function export() { // gather all the data $banners = $this->banner->find('all'); @@ -140,15 +143,15 @@ public function export() { foreach ($banners as $l) { $out .='"'.$l->id.'","'.$l->title.'","'.$l->url.'","'.$l->company->title.'","'.$l->impression_limit.'","'.$l->click_limit.'","'.$l->impressions.'","'.$l->clicks.'"' . "\n"; } - + // open the file $dir = BASE.'tmp'; - $filename = 'banner_export' . date("m-d-Y") . '.csv'; + $filename = 'banner_export' . date("m-d-Y") . '.csv'; $fh = fopen ($dir .'/'. $filename, 'w'); // Put all values from $out to export.csv. fputs($fh, $out); - fclose($fh); + fclose($fh); // push the file to the user $export = new expFile(array('directory'=>$dir, 'filename'=>$filename)); //FIXME we are using a full path BASE instead of relative to root @@ -163,8 +166,8 @@ function reset_stats() { banner::resetImpressions(); // $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1'); banner::resetClicks(); - - // let the user know we did stuff. + + // let the user know we did stuff. flash('message', gt("Banner statistics reset.")); expHistory::back(); } diff --git a/framework/modules/blog/controllers/blogController.php b/framework/modules/blog/controllers/blogController.php index e077420ecd..d2c6fa183e 100755 --- a/framework/modules/blog/controllers/blogController.php +++ b/framework/modules/blog/controllers/blogController.php @@ -29,15 +29,13 @@ class blogController extends expController { 'dates'=>"Show Post Dates", 'comments'=>"Show Recent Post Comments", ); + protected $manage_permissions = array( +// 'approve'=>"Approve Comments", + ); public $remove_configs = array( // 'categories', // 'ealerts' ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'approve'=>"Approve Comments", - 'import'=>'Import Blog Items', - 'export'=>'Export Blog Items' - ); static function displayname() { return gt("Blog"); } static function description() { return gt("Run a blog on your site."); } @@ -168,6 +166,7 @@ public function showall_by_date() { public function showall_by_author() { expHistory::set('viewable', $this->params); + $this->params['author'] = expString::escape($this->params['author']); $user = user::getUserByName($this->params['author']); $page = new expPaginator(array( 'model'=>$this->basemodel_name, @@ -194,7 +193,7 @@ public function show() { $id = isset($this->params['title']) ? $this->params['title'] : $this->params['id']; $record = new blog($id); if (empty($record->id)) - redirect_to(array('controller'=>'notfound','action'=>'page_not_found','title'=>$this->params['title'])); + redirect_to(array('controller'=>'notfound','action'=>'page_not_found','title'=>expString::escape($this->params['title']))); // since we are probably getting here via a router mapped url // some of the links (tags in particular) require a source, we will @@ -231,7 +230,7 @@ function showByTags() { // setup some objects $tagobj = new expTag(); - $modelname = empty($this->params['model']) ? $this->basemodel_name : $this->params['model']; + $modelname = empty($this->params['model']) ? $this->basemodel_name : expString::escape($this->params['model']); $model = new $modelname(); // start building the sql query diff --git a/framework/modules/core/controllers/expCatController.php b/framework/modules/core/controllers/expCatController.php index 12b88dc52b..8f421c57a0 100644 --- a/framework/modules/core/controllers/expCatController.php +++ b/framework/modules/core/controllers/expCatController.php @@ -23,6 +23,9 @@ */ class expCatController extends expController { + protected $manage_permissions = array( + 'change' => 'Change Cats' + ); /** * name of module diff --git a/framework/modules/core/controllers/expCommentController.php b/framework/modules/core/controllers/expCommentController.php index 8f3248ca4d..8173d2be57 100644 --- a/framework/modules/core/controllers/expCommentController.php +++ b/framework/modules/core/controllers/expCommentController.php @@ -24,29 +24,30 @@ class expCommentController extends expController { public $base_class = 'expComment'; - protected $add_permissions = array( - 'approve'=>"Approve Comments" - ); - protected $remove_permissions = array( + protected $remove_permissions = array( 'create' ); + protected $add_permissions = array( + 'approve'=>"Approve Comments", + 'bulk'=>"Bulk Actions" + ); static function displayname() { return gt("Comments"); } static function description() { return gt("Use this module to add comments to a page."); } - + function edit() { if (empty($this->params['content_id'])) { flash('message',gt('An error occurred: No content id set.')); - expHistory::back(); - } + expHistory::back(); + } /* The global constants can be overridden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - - + + $id = empty($this->params['id']) ? null : $this->params['id']; $comment = new expComment($id); //FIXME here is where we might sanitize the comment before displaying/editing it @@ -55,8 +56,8 @@ function edit() { 'content_type'=>$this->params['content_type'], 'comment'=>$comment )); - } - + } + function manage() { expHistory::set('manageable', $this->params); @@ -68,7 +69,7 @@ function manage() { // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + $sql = 'SELECT c.*, cnt.* FROM '.DB_TABLE_PREFIX.'_expComments c '; $sql .= 'JOIN '.DB_TABLE_PREFIX.'_content_expComments cnt ON c.id=cnt.expcomments_id '; if (!empty($this->params['content_id']) && !empty($this->params['content_type'])) { @@ -80,7 +81,7 @@ function manage() { $page = new expPaginator(array( // 'model'=>'expComment', - 'sql'=>$sql, + 'sql'=>$sql, 'limit'=>10, 'order'=>$order, 'dir'=>$dir, @@ -115,10 +116,10 @@ function showComments() { /* The global constants can be overridden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet - $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; - $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; - $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; - $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; + $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : intval($this->params['require_login']); + $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : intval($this->params['require_approval']); + $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : intval($this->params['require_notification']); + $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : expString::escape($this->params['notification_email']); // $sql = 'SELECT c.*, ua.image, u.username FROM '.$db->prefix.'expComments c '; // $sql .= 'JOIN '.$db->prefix.'content_expComments cnt ON c.id=cnt.expcomments_id '; @@ -128,14 +129,14 @@ function showComments() { $sql = 'SELECT c.* FROM '.$db->prefix.'expComments c '; $sql .= 'JOIN '.$db->prefix.'content_expComments cnt ON c.id=cnt.expcomments_id '; - $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; + $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".expString::escape($this->params['content_type'])."' "; if (!$user->isAdmin()) { $sql .= 'AND c.approved=1'; } $comments = new expPaginator(array( //'model'=>'expComment', - 'sql'=>$sql, + 'sql'=>$sql, // 'limit'=>999, 'order'=>'created_at', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), @@ -157,18 +158,18 @@ function showComments() { if (empty($this->params['config']['disable_nested_comments'])) $comments->records = self::arrangecomments($comments->records); // eDebug($sql, true); - + // count the unapproved comments if ($require_approval == 1 && $user->isAdmin()) { $sql = 'SELECT count(com.id) as c FROM '.$db->prefix.'expComments com '; $sql .= 'JOIN '.$db->prefix.'content_expComments cnt ON com.id=cnt.expcomments_id '; - $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; + $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".expString::escape($this->params['content_type'])."' "; $sql .= 'AND com.approved=0'; $unapproved = $db->countObjectsBySql($sql); } else { $unapproved = 0; - } - + } + $this->config = $this->params['config']; $type = !empty($this->params['type']) ? $this->params['type'] : gt('Comment'); $ratings = !empty($this->params['ratings']) ? true : false; @@ -177,7 +178,7 @@ function showComments() { 'comments'=>$comments, 'config'=>$this->params['config'], 'unapproved'=>$unapproved, - 'content_id'=>$this->params['content_id'], + 'content_id'=>$this->params['content_id'], 'content_type'=>$this->params['content_type'], 'user'=>$user, 'hideform'=>$this->params['hideform'], @@ -324,7 +325,7 @@ public static function getComments($params) { function update() { global $user; - + /* The global constants can be overridden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; @@ -339,19 +340,19 @@ function update() { if (!(ANTI_SPAM_USERS_SKIP && $user->isLoggedIn())) { expValidator::check_antispam($this->params, gt('Your comment was not posted.') . ' ' . gt("Anti-spam verification failed. Please try again. Please try again.")); } - + // figure out the name and email address if (!empty($user->id) && empty($this->params['id'])) { $this->params['name'] = $user->firstname." ".$user->lastname; $this->params['email'] = $user->email; } - + // save the comment if (empty($require_approval)) { $this->expComment->approved=1; } $this->expComment->update($this->params); - + // attach the comment to the datatype it belongs to (blog, news, etc..); // $obj = new stdClass(); // $obj->content_type = $this->params['content_type']; @@ -366,7 +367,7 @@ function update() { $msg .= ' '.gt('Your comment is now pending approval. You will receive an email to').' '; $msg .= $this->expComment->email.' '.gt('letting you know when it has been approved.'); } - + if ($require_notification && !$user->isAdmin()) { $this->sendNotification($this->expComment,$this->params); } @@ -375,55 +376,55 @@ function update() { } flash('message', $msg); - + expHistory::back(); } - + public function approve() { expHistory::set('editable', $this->params); - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + if (empty($this->params['id'])) { flash('error', gt('No ID supplied for comment to approve')); expHistory::back(); } - + $comment = new expComment($this->params['id']); assign_to_template(array( 'comment'=>$comment )); } - + public function approve_submit() { if (empty($this->params['id'])) { flash('error', gt('No ID supplied for comment to approve')); expHistory::back(); } - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + $comment = new expComment($this->params['id']); $comment->body = $this->params['body']; $comment->approved = $this->params['approved']; $comment->save(); expHistory::back(); } - + public function approve_toggle() { if (empty($this->params['id'])) return; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; @@ -479,42 +480,42 @@ function bulk_process() { public function delete() { global $db; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + if (empty($this->params['id'])) { flash('error', gt('Missing id for the comment you would like to delete')); expHistory::back(); } - + // delete the comment $comment = new expComment($this->params['id']); $comment->delete(); - + // delete the association too - $db->delete($comment->attachable_table, 'expcomments_id='.$this->params['id']); - + $db->delete($comment->attachable_table, 'expcomments_id='.$this->params['id']); + // send the user back where they came from. expHistory::back(); } - + private function sendNotification($comment,$params) { // global $db; if (empty($comment)) return false; - + //eDebug($comment,1); - /* The global constants can be overriden by passing appropriate params */ + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + // setup some email variables. $subject = gt('Notification of a New Comment Posted to').' '.URL_BASE; $tos = explode(',', str_replace(' ', '', $notification_email)); @@ -526,7 +527,7 @@ private function sendNotification($comment,$params) { $posting = makelink(array('controller'=>$params['content_type'], 'action'=>'show', 'title'=>$model->sef_url)); $editlink = makelink(array('controller'=>'expComment', 'action'=>'edit', 'content_id'=>$params['content_id'], 'content_type'=>$params['content_type'], 'id'=>$comment->id)); - + // make the email body $body = '<h1>'.gt('New Comment Posted').'</h1>'; $body .= '<h2>'.gt('Posted By').'</h2>'; @@ -540,29 +541,29 @@ private function sendNotification($comment,$params) { //1$body .= "<br><br>"; $body .= '<h3>'.gt('Edit / Approve comment').'</h3>'; $body .= '<a href="'.$editlink.'">'.$editlink.'</a>'; - + // create the mail message - $mail = new expMail(); + $mail = new expMail(); $mail->quickSend(array( 'html_message'=>$body, 'to'=>$tos, 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), 'subject'=>$subject, )); - + return true; } private function sendApprovalNotification($comment,$params) { if (empty($comment)) return false; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet // $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; - + // setup some email variables. $subject = gt('Notification of Comment Approval on').' '.URL_BASE; $tos = explode(',', str_replace(' ', '', $notification_email)); @@ -587,14 +588,14 @@ private function sendApprovalNotification($comment,$params) { $body .= '<a href="'.$posting.'">'.$posting.'</a>'; // create the mail message - $mail = new expMail(); + $mail = new expMail(); $mail->quickSend(array( 'html_message'=>$body, 'to'=>$tos, 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), 'subject'=>$subject, )); - + return true; } diff --git a/framework/modules/core/controllers/expDefinableFieldController.php b/framework/modules/core/controllers/expDefinableFieldController.php index d48269a639..7ff6e354c8 100644 --- a/framework/modules/core/controllers/expDefinableFieldController.php +++ b/framework/modules/core/controllers/expDefinableFieldController.php @@ -47,7 +47,7 @@ static function hasSources() { return false; } * default view for individual field */ function show() { - assign_to_template(array('record'=>$record,'tag'=>$tag)); //FIXME $record & $tag are undefined +// assign_to_template(array('record'=>$record,'tag'=>$tag)); //FIXME $record & $tag are undefined } /** @@ -55,7 +55,7 @@ function show() { */ function manage() { global $db; - + expHistory::set('manageable', $this->params); $fields = $db->selectObjects("expDefinableFields",'1','rank'); $types = expTemplate::listControlTypes(); @@ -63,10 +63,10 @@ function manage() { array_unshift($types,'['.gt('Please Select'.']')); assign_to_template(array('fields'=>$fields, 'types'=>$types)); } - + function edit() { global $db; - + $control_type = ""; $ctl = null; if (isset($this->params['id'])) { @@ -80,7 +80,7 @@ function edit() { } if ($control_type == "") $control_type = $this->params['control_type']; $form = call_user_func(array($control_type,"form"),$ctl); - if ($ctl) { + if ($ctl) { $form->controls['identifier']->disabled = true; $form->meta("id",$ctl->id); $form->meta("identifier",$ctl->identifier); @@ -91,10 +91,10 @@ function edit() { $form->meta("type", $control_type); $types = expTemplate::listControlTypes(); - assign_to_template(array('form_html'=>$form->toHTML(), 'types'=>$types[$control_type])); + assign_to_template(array('form_html'=>$form->toHTML(), 'types'=>$types[$control_type])); } - - function save() { + + function save() { global $db; $ctl = null; $control = null; @@ -106,30 +106,30 @@ function save() { } } - if (call_user_func(array($_POST['control_type'],'useGeneric')) == true) { + if (call_user_func(array($_POST['control_type'],'useGeneric')) == true) { $ctl = call_user_func(array('genericcontrol','update'),expString::sanitize($_POST),$ctl); } else { $ctl = call_user_func(array($_POST['control_type'],'update'),expString::sanitize($_POST),$ctl); } - + if ($ctl != null) { $name = substr(preg_replace('/[^A-Za-z0-9]/','_',$ctl->identifier),0,20); - + if (!isset($this->params['id'])) { $control->name = $name; } - + if (!empty($ctl->pattern)) $ctl->pattern = addslashes($ctl->pattern); $control->data = serialize($ctl); $control->type = $this->params['type']; - + if (isset($control->id)) { $db->updateObject($control,'expDefinableFields'); } else { $db->insertObject($control,'expDefinableFields'); } } - + redirect_to(array('controller'=>'expDefinableField','action'=>'manage')); } diff --git a/framework/modules/core/controllers/expHTMLEditorController.php b/framework/modules/core/controllers/expHTMLEditorController.php index 0433259e82..392e3027c2 100644 --- a/framework/modules/core/controllers/expHTMLEditorController.php +++ b/framework/modules/core/controllers/expHTMLEditorController.php @@ -24,6 +24,14 @@ class expHTMLEditorController extends expController { + protected $manage_permissions = array( + 'activate' => "Activate", + 'preview' => "Preview Editor Toolbars" + ); + public $requires_login = array( + 'preview'=>'Preview Editor', + ); + static function displayname() { return gt("Editors"); @@ -49,11 +57,6 @@ static function hasContent() return false; } - protected $add_permissions = array( - 'activate' => "Activate", - 'preview' => "Preview Editor Toolbars" - ); - function __construct($src = null, $params = array()) { parent:: __construct($src, $params); diff --git a/framework/modules/core/controllers/expSimpleNoteController.php b/framework/modules/core/controllers/expSimpleNoteController.php index 2bd630314d..ae04f3dd20 100644 --- a/framework/modules/core/controllers/expSimpleNoteController.php +++ b/framework/modules/core/controllers/expSimpleNoteController.php @@ -24,8 +24,8 @@ class expSimpleNoteController extends expController { public $base_class = 'expSimpleNote'; - protected $add_permissions = array( - 'approve'=>"Approve Comments" + protected $manage_permissions = array( + 'approve'=>"Approve Notes" ); // protected $remove_permissions = array( // 'edit', @@ -35,18 +35,18 @@ class expSimpleNoteController extends expController { static function displayname() { return gt("Simple Notes"); } static function description() { return gt("Use this module to add Simple Notes attached to something (product, order, etc)"); } static function author() { return "Jonathan Worent @ OIC Group, Inc"; } - + function edit() { global $user; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - - if (empty($this->params['formtitle'])) + + if (empty($this->params['formtitle'])) { if (empty($this->params['id'])) { @@ -61,7 +61,7 @@ function edit() { { $formtitle = $this->params['formtitle']; } - + $id = empty($this->params['id']) ? null : $this->params['id']; $simpleNote = new expSimpleNote($id); //FIXME here is where we might sanitize the note before displaying/editing it @@ -78,26 +78,26 @@ function edit() { 'content_id'=>$this->params['content_id'], 'tab'=>empty($this->params['tab'])?0:$this->params['tab'] )); - } - + } + function manage() { expHistory::set('manageable', $this->params); - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + $sql = 'SELECT n.* FROM '.DB_TABLE_PREFIX.'_expSimpleNote n '; $sql .= 'JOIN '.DB_TABLE_PREFIX.'_content_expSimpleNote cnt ON n.id=cnt.expsimplenote_id '; $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; $sql .= 'AND n.approved=0'; - + $page = new expPaginator(array( // 'model'=>'expSimpleNote', // brings in all of model - 'sql'=>$sql, + 'sql'=>$sql, 'limit'=>10, 'order'=>'created_at', 'dir'=>'DESC', @@ -110,7 +110,7 @@ function manage() { gt('Comment')=>'body' ), )); - + //FIXME here is where we might sanitize the notes before displaying them assign_to_template(array( @@ -122,26 +122,26 @@ function manage() { 'tab'=>$this->params['tab'] )); } - + function getNotes() { global $user, $db; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet - $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; - $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; - $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; - $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - - + $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : intval($this->params['require_login']); + $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : intval($this->params['require_approval']); + $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : intval($this->params['require_notification']); + $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : expString::escape($this->params['notification_email']); + + $sql = 'SELECT n.* FROM '.$db->prefix.'expSimpleNote n '; $sql .= 'JOIN '.$db->prefix.'content_expSimpleNote cnt ON n.id=cnt.expsimplenote_id '; - $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; + $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".expString::escape($this->params['content_type'])."' "; $sql .= 'AND n.approved=1'; - + $simplenotes = new expPaginator(array( //'model'=>'expSimpleNote', - 'sql'=>$sql, + 'sql'=>$sql, 'limit'=>10, 'order'=>'created_at', 'dir'=>'DESC', @@ -152,24 +152,24 @@ function getNotes() { gt('Readable Column Name')=>'Column Name' ), )); - - // count the unapproved comments + + // count the unapproved notes if ($require_approval == 1 && $user->isAdmin()) { $sql = 'SELECT count(com.id) as c FROM '.$db->prefix.'expSimpleNote com '; $sql .= 'JOIN '.$db->prefix.'content_expSimpleNote cnt ON com.id=cnt.expsimplenote_id '; - $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; + $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".expString::escape($this->params['content_type'])."' "; $sql .= 'AND com.approved=0'; $unapproved = $db->countObjectsBySql($sql); } else { $unapproved = 0; - } - + } + //FIXME here is where we might sanitize the notes before displaying them assign_to_template(array( 'simplenotes'=>$simplenotes, - 'unapproved'=>$unapproved, - 'content_id'=>$this->params['content_id'], + 'unapproved'=>$unapproved, + 'content_id'=>$this->params['content_id'], 'content_type'=>$this->params['content_type'], 'user'=>$user, 'hideform'=>$this->params['hideform'], @@ -186,28 +186,28 @@ function getNotes() { function update() { global $db, $user, $history; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + // figure out the name and email address if (!empty($user->id)) { $this->params['name'] = $user->firstname." ".$user->lastname; $this->params['email'] = $user->email; } - - // if simplenotes are configed to require approvals set this to 0 otherwise we + + // if simplenotes are configed to require approvals set this to 0 otherwise we // will just go ahead and turn the approval on for this comment. $this->expSimpleNote->approved = ($require_approval == 1 && !$user->isAdmin()) ? 0 : 1; - + // save the note //FIXME here is where we might sanitize the note before saving it $this->expSimpleNote->update($this->params); - + // attach the note to the datatype it belongs to (product, order, etc..); // $obj = new stdClass(); // $obj->content_type = $this->params['content_type']; @@ -222,14 +222,14 @@ function update() { $msg .= ' '.gt('Your note is now pending approval. You will receive an email to').' '; $msg .= $this->expSimpleNote->email.' '.gt('letting you know when it has been approved.'); } - + if ($require_notification && !$user->isAdmin()) { $this->sendNotification($this->expComment); } - + flash('message', $msg); - - + + $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']); if (!empty($this->params['tab'])) { @@ -237,22 +237,22 @@ function update() { } redirect_to($lastUrl); } - + public function approve() { expHistory::set('editable', $this->params); - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + if (empty($this->params['id'])) { flash('error', gt('No ID supplied for note to approve')); $lastUrl = expHistory::getLast('editable'); } - + $simplenote = new expSimpleNote($this->params['id']); assign_to_template(array( 'simplenote'=>$simplenote, @@ -263,28 +263,28 @@ public function approve() { 'tab'=>$this->params['tab'] )); } - + public function approve_submit() { global $history; - + if (empty($this->params['id'])) { flash('error', gt('No ID supplied for comment to approve')); $lastUrl = expHistory::getLast('editable'); } - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + $simplenote = new expSimpleNote($this->params['id']); //FIXME here is where we might sanitize the note before approving it $simplenote->body = $this->params['body']; $simplenote->approved = $this->params['approved']; $simplenote->save(); - + $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']); if (!empty($this->params['tab'])) { @@ -292,24 +292,24 @@ public function approve_submit() { } redirect_to($lastUrl); } - + public function approve_toggle() { global $history; - + if (empty($this->params['id'])) return; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - - + + $simplenote = new expSimpleNote($this->params['id']); $simplenote->approved = $simplenote->approved == 1 ? 0 : 1; $simplenote->save(); - + $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']); if (!empty($this->params['tab'])) { @@ -317,29 +317,29 @@ public function approve_toggle() { } redirect_to($lastUrl); } - + public function delete() { global $db, $history; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + if (empty($this->params['id'])) { flash('error', gt('Missing id for the comment you would like to delete')); $lastUrl = expHistory::getLast('editable'); } - + // delete the note $simplenote = new expSimpleNote($this->params['id']); $rows = $simplenote->delete(); - + // delete the assocication too - $db->delete($simplenote->attachable_table, 'expsimplenote_id='.$this->params['id']); - + $db->delete($simplenote->attachable_table, 'expsimplenote_id='.$this->params['id']); + // send the user back where they came from. $lastUrl = expHistory::getLast('editable'); if (!empty($this->params['tab'])) @@ -348,38 +348,38 @@ public function delete() { } redirect_to($lastUrl); } - + private function sendNotification($simplenote) { if (empty($simplenote)) return false; - - /* The global constants can be overriden by passing appropriate params */ + + /* The global constants can be overriden by passing appropriate params */ //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet - $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login']; - $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval']; - $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification']; - $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email']; - + $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : intval($this->params['require_login']); + $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : intval($this->params['require_approval']); + $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : intval($this->params['require_notification']); + $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : expString::escape($this->params['notification_email']); + // setup some email variables. $subject = 'Notification of a New Note Posted to '.URL_BASE; $tos = explode(',', str_replace(' ', '', $notification_email)); $editlink = makelink(array('controller'=>'expSimpleNote', 'action'=>'edit', 'id'=>$simplenote->id)); - + // make the email body $body = gt('Posted By').':&#160;'.$simplenote->name."<br>"; $body .= gt('Posters Email').':&#160;'.$simplenote->email."<br><br>"; $body .= $simplenote->body."<br><br>"; $body .= gt('You can view, edit and optionally approved this comment by going to').' '; $body .= '<a href="'.$editlink.'">'.$editlink.'</a>'; - + // create the mail message - $mail = new expMail(); + $mail = new expMail(); $mail->quickSend(array( 'html_message'=>$body, 'to'=>$tos, 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), 'subject'=>$subject, )); - + return true; } diff --git a/framework/modules/core/controllers/expTagController.php b/framework/modules/core/controllers/expTagController.php index 0c32d22513..3a623aabfa 100644 --- a/framework/modules/core/controllers/expTagController.php +++ b/framework/modules/core/controllers/expTagController.php @@ -23,6 +23,12 @@ */ class expTagController extends expController { + protected $manage_permissions = array( +// 'import' => 'Import Tags', +// 'importTags' => 'Import Tags', +// 'export' => 'Export Tags', + 'change' => 'Change Tags', + ); /** * name of module * @return string @@ -59,7 +65,7 @@ function show() { if (isset($this->params['id'])) { $id = $this->params['id']; } elseif (isset($this->params['title'])) { - $id = $this->params['title']; + $id = expString::escape($this->params['title']); $tag = $id; } diff --git a/framework/modules/eaas/controllers/eaasController.php b/framework/modules/eaas/controllers/eaasController.php index 90a7f6f784..6b2453c582 100644 --- a/framework/modules/eaas/controllers/eaasController.php +++ b/framework/modules/eaas/controllers/eaasController.php @@ -41,10 +41,6 @@ class eaasController extends expController { 'tags', 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - protected $add_permissions = array( - // 'approve'=>"Approve Comments" - ); - public $tabs = array( 'aboutus'=>'About Us', 'blog'=>'Blog', @@ -54,7 +50,6 @@ class eaasController extends expController { 'filedownload'=>'File Downloads', 'news'=>'News' ); - protected $data = array(); static function displayname() { return gt("Exponent as a Service"); } diff --git a/framework/modules/ealerts/controllers/ealertController.php b/framework/modules/ealerts/controllers/ealertController.php index ac3216774b..1ec8e9306a 100755 --- a/framework/modules/ealerts/controllers/ealertController.php +++ b/framework/modules/ealerts/controllers/ealertController.php @@ -23,7 +23,9 @@ class ealertController extends expController { public $basemodel_name = 'expeAlerts'; - + protected $manage_permissions = array( + 'send'=>'Send E-Alert', + ); public $remove_configs = array( 'aggregation', 'categories', @@ -36,10 +38,10 @@ class ealertController extends expController { 'tags', 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) - + static function displayname() { return gt("E-Alerts"); } static function description() { return gt("This module will allow users to sign up for email alerts on a module by module basis."); } - + static function hasSources() { return false; } @@ -52,12 +54,12 @@ public function showall() { 'subscriptions'=>$subscriptions )); } - + public function send_confirm() { global $db; // find this E-Alert in the database - $src = empty($this->params['src']) ? null : $this->params['src']; + $src = empty($this->params['src']) ? null : expString::escape($this->params['src']); $ealert = $db->selectObject('expeAlerts', 'module="'.$this->params['orig_controller'].'" AND src="'.$src.'"'); if (!empty($ealert->autosend_ealerts)) { redirect_to(array('controller'=>'ealert','action'=>'send_auto','model'=>$this->params['model'],'id'=>$this->params['id'], 'src'=>$this->params['src'])); @@ -69,17 +71,17 @@ public function send_confirm() { // setup the content for the view $subject = $record->title; $body = $record->body; - + // figure out how many subscribers there are $number_of_subscribers = $db->countObjects('user_subscriptions', 'expeAlerts_id='.$ealert->id); - + assign_to_template(array( 'record'=>$record, 'number_of_subscribers'=>$number_of_subscribers, 'ealert'=>$ealert )); } - + public function send_process() { global $db, $router; @@ -90,22 +92,22 @@ public function send_process() { $obj->body .= '<hr><a href="'.$link.'">'.gt('View posting').'.</a>'; $obj->created_at = time(); $id = $db->insertObject($obj, 'expeAlerts_temp'); - + $bot = new expBot(array( 'url'=>PATH_RELATIVE."index.php?controller=ealert&action=send&id=".$id.'&ealert_id='.$this->params['id'], 'method'=>'POST', )); - + $bot->fire(); flash('message', gt("E-Alerts are being sent to subscribers.")); expHistory::back(); } - + public function send_auto() { global $db, $router; // find this E-Alert in the database - $src = empty($this->params['src']) ? null : $this->params['src']; + $src = empty($this->params['src']) ? null : expString::escape($this->params['src']); $ealert = $db->selectObject('expeAlerts', 'module="'.$this->params['model'].'" AND src="'.$src.'"'); // find the content for the E-Alerts @@ -136,22 +138,22 @@ public function send_auto() { public function send() { global $db, $router; - + // get the message body we saved in the temp table $message = $db->selectObject('expeAlerts_temp', 'id='.$this->params['id']); - + // look up the subscribers $sql = 'SELECT s.* FROM '.$db->prefix.'user_subscriptions es '; $sql .= 'LEFT JOIN '.$db->prefix.'user s ON s.id=es.user_id WHERE es.expeAlerts_id='.$this->params['ealert_id']; $subscribers = $db->selectObjectsBySql($sql); - + $count = 1; $total = count($subscribers); foreach($subscribers as $subscriber) { // $link = $router->makelink(array('controller'=>'ealert', 'action'=>'subscriptions', 'id'=>$subscriber->id, 'key'=>$subscriber->hash)); // $body = $message->body; // $body .= '<br><a href="'.$link.'">'.gt('Click here to change your E-Alert subscription settings').'.</a>'; - + $mail = new expMail(); $mail->quickSend(array( 'html_message'=>$message->body, @@ -159,13 +161,13 @@ public function send() { 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), 'subject'=>$message->subject, )); - + $message->edited_at = time(); $message->status = 'Sent message '.$count.' of '.$total; $db->updateObject($message, 'expeAlerts_temp'); $count++; - } - + } + $db->delete('expeAlerts_temp', 'id='.$message->id); } @@ -201,154 +203,158 @@ public function unsubscribe() { /** * @deprecated */ - public function subscriptions() { - global $db; - - expHistory::set('manageable', $this->params); - // make sure we have what we need. - if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); - if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); - - // verify the id/key pair - $sub = new subscribers($this->params['id']); - if (empty($sub->id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.')); - - // get this users subscriptions - $subscriptions = $db->selectColumn('expeAlerts_subscribers', 'expeAlerts_id', 'subscribers_id='.$sub->id); - - // get a list of all available E-Alerts - $ealerts = new expeAlerts(); - assign_to_template(array( - 'subscriber'=>$sub, - 'subscriptions'=>$subscriptions, - 'ealerts'=>$ealerts->find('all') - )); - } - +// public function subscriptions() { +// global $db; +// +// expHistory::set('manageable', $this->params); +// // make sure we have what we need. +// if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); +// if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); +// +// // verify the id/key pair +// $sub = new subscribers($this->params['id']); +// if (empty($sub->id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.')); +// +// // get this users subscriptions +// $subscriptions = $db->selectColumn('expeAlerts_subscribers', 'expeAlerts_id', 'subscribers_id='.$sub->id); +// +// // get a list of all available E-Alerts +// $ealerts = new expeAlerts(); +// assign_to_template(array( +// 'subscriber'=>$sub, +// 'subscriptions'=>$subscriptions, +// 'ealerts'=>$ealerts->find('all') +// )); +// } + /** * @deprecated */ - public function subscription_update() { - global $db; - - // make sure we have what we need. - if (empty($this->params['email'])) expQueue::flashAndFlow('error', gt('You must supply an email address to sign up for email alerts.')); - if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); - if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); - - // find the subscriber and validate the security key - $subscriber = new subscribers($this->params['id']); - if ($subscriber->hash != $this->params['key']) expQueue::flashAndFlow('error', gt('The security key you supplied does not match the one we have on file.')); - - // delete any old subscriptions and add the user to new subscriptions - $db->delete('expeAlerts_subscribers', 'subscribers_id='.$subscriber->id); - foreach($this->params['ealerts'] as $ea_id) { - $obj = new stdClass(); - $obj->subscribers_id = $subscriber->id; - $obj->expeAlerts_id = $ea_id; - $db->insertObject($obj, 'expeAlerts_subscribers'); - } - - $count = count($this->params['ealerts']); - - if ($count > 0) { - flash('message', gt("Your subscriptions have been updated. You are now subscriber to")." ".$count.' '.gt('E-Alerts.')); - } else { - flash('error', gt("You have been unsubscribed from all E-Alerts.")); - } - - expHistory::back(); - } - +// public function subscription_update() { +// global $db; +// +// // make sure we have what we need. +// if (empty($this->params['email'])) expQueue::flashAndFlow('error', gt('You must supply an email address to sign up for email alerts.')); +// if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); +// if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); +// +// // find the subscriber and validate the security key +// $subscriber = new subscribers($this->params['id']); +// if ($subscriber->hash != $this->params['key']) expQueue::flashAndFlow('error', gt('The security key you supplied does not match the one we have on file.')); +// +// // delete any old subscriptions and add the user to new subscriptions +// $db->delete('expeAlerts_subscribers', 'subscribers_id='.$subscriber->id); +// foreach($this->params['ealerts'] as $ea_id) { +// $obj = new stdClass(); +// $obj->subscribers_id = $subscriber->id; +// $obj->expeAlerts_id = $ea_id; +// $db->insertObject($obj, 'expeAlerts_subscribers'); +// } +// +// $count = count($this->params['ealerts']); +// +// if ($count > 0) { +// flash('message', gt("Your subscriptions have been updated. You are now subscriber to")." ".$count.' '.gt('E-Alerts.')); +// } else { +// flash('error', gt("You have been unsubscribed from all E-Alerts.")); +// } +// +// expHistory::back(); +// } + /** * @deprecated */ - public function signup() { - global $db; - // check the anti-spam control - expValidator::check_antispam($this->params, gt("Anti-spam verification failed. Please try again.")); - - // make sure we have what we need. - if (empty($this->params['email'])) expQueue::flashAndFlow('error', gt('You must supply an email address to sign up for email alerts.')); - if (empty($this->params['ealerts'])) expQueue::flashAndFlow('error', gt('You did not select any E-Alert topics to subscribe to.')); - - // find or create the subscriber - $id = $db->selectValue('subscribers', 'id', 'email="'.$this->params['email'].'"'); - $subscriber = new subscribers($id); - if (empty($subscriber->id)) { - $subscriber->email = trim($this->params['email']); - $subscriber->hash = md5($subscriber->email.time()); - $subscriber->save(); - } - - // delete any old subscriptions and add the user to new subscriptions - $db->delete('expeAlerts_subscribers', 'subscribers_id='.$subscriber->id); - foreach($this->params['ealerts'] as $ea_id) { - $obj = new stdClass(); - $obj->subscribers_id = $subscriber->id; - $obj->expeAlerts_id = $ea_id; - $db->insertObject($obj, 'expeAlerts_subscribers'); - } - - // send a confirmation email to the user. - $ealerts = $db->selectObjects('expeAlerts', 'id IN ('.implode(',', $this->params['ealerts']).')'); - $body = expTemplate::get_template_for_action($this, 'email/confirmation_email', $this->loc); - $body->assign('ealerts', $ealerts); - $body->assign('subscriber', $subscriber); - - $mail = new expMail(); - $mail->quickSend(array( - 'html_message'=>$body->render(), - 'to'=>$subscriber->email, - 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), - 'subject'=>gt('Please confirm your E-Alert subscriptions'), - )); - - redirect_to(array('controller'=>'ealert', 'action'=>'pending', 'id'=>$subscriber->id)); - } - +// public function signup() { +// global $db; +// // check the anti-spam control +// expValidator::check_antispam($this->params, gt("Anti-spam verification failed. Please try again.")); +// +// // make sure we have what we need. +// if (empty($this->params['email'])) expQueue::flashAndFlow('error', gt('You must supply an email address to sign up for email alerts.')); +// if (empty($this->params['ealerts'])) expQueue::flashAndFlow('error', gt('You did not select any E-Alert topics to subscribe to.')); +// +// // find or create the subscriber +// $id = $db->selectValue('subscribers', 'id', 'email="'.$this->params['email'].'"'); +// $subscriber = new subscribers($id); +// if (empty($subscriber->id)) { +// $subscriber->email = trim($this->params['email']); +// $subscriber->hash = md5($subscriber->email.time()); +// $subscriber->save(); +// } +// +// // delete any old subscriptions and add the user to new subscriptions +// $db->delete('expeAlerts_subscribers', 'subscribers_id='.$subscriber->id); +// foreach($this->params['ealerts'] as $ea_id) { +// $obj = new stdClass(); +// $obj->subscribers_id = $subscriber->id; +// $obj->expeAlerts_id = $ea_id; +// $db->insertObject($obj, 'expeAlerts_subscribers'); +// } +// +// // send a confirmation email to the user. +// $ealerts = $db->selectObjects('expeAlerts', 'id IN ('.implode(',', $this->params['ealerts']).')'); +// $body = expTemplate::get_template_for_action($this, 'email/confirmation_email', $this->loc); +// $body->assign('ealerts', $ealerts); +// $body->assign('subscriber', $subscriber); +// +// $mail = new expMail(); +// $mail->quickSend(array( +// 'html_message'=>$body->render(), +// 'to'=>$subscriber->email, +// 'from'=>array(trim(SMTP_FROMADDRESS) => trim(ORGANIZATION_NAME)), +// 'subject'=>gt('Please confirm your E-Alert subscriptions'), +// )); +// +// redirect_to(array('controller'=>'ealert', 'action'=>'pending', 'id'=>$subscriber->id)); +// } + /** * @deprecated */ - public function pending() { +// public function pending() { +//// global $db; +// +// // make sure we have what we need. +// if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('Your subscriber ID was not supplied.')); +// +// // find the subscriber and their pending subscriptions +// $ealerts = expeAlerts::getPendingBySubscriber($this->params['id']); +// $subscriber = new subscribers($this->params['id']); +// +// // render the template +// assign_to_template(array( +// 'subscriber'=>$subscriber, +// 'ealerts'=>$ealerts +// )); +// } + + /** + * @deprecated + */ +// public function confirm() { // global $db; - - // make sure we have what we need. - if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('Your subscriber ID was not supplied.')); +// +// // make sure we have what we need. +// if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); +// if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); +// +// // verify the id/key pair +// $id = $db->selectValue('subscribers','id', 'id='.$this->params['id'].' AND hash="'.$this->params['key'].'"'); +// if (empty($id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.')); +// +// // activate this users pending subscriptions +// $sub = new stdClass(); +// $sub->enabled = 1; +// $db->updateObject($sub, 'expeAlerts_subscribers', 'subscribers_id='.$id); +// +// // find the users active subscriptions +// $ealerts = expeAlerts::getBySubscriber($id); +// assign_to_template(array( +// 'ealerts'=>$ealerts +// )); +// } - // find the subscriber and their pending subscriptions - $ealerts = expeAlerts::getPendingBySubscriber($this->params['id']); - $subscriber = new subscribers($this->params['id']); - - // render the template - assign_to_template(array( - 'subscriber'=>$subscriber, - 'ealerts'=>$ealerts - )); - } - - public function confirm() { - global $db; - - // make sure we have what we need. - if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.')); - if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.')); - - // verify the id/key pair - $id = $db->selectValue('subscribers','id', 'id='.$this->params['id'].' AND hash="'.$this->params['key'].'"'); - if (empty($id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.')); - - // activate this users pending subscriptions - $sub = new stdClass(); - $sub->enabled = 1; - $db->updateObject($sub, 'expeAlerts_subscribers', 'subscribers_id='.$id); - - // find the users active subscriptions - $ealerts = expeAlerts::getBySubscriber($id); - assign_to_template(array( - 'ealerts'=>$ealerts - )); - } } ?> \ No newline at end of file diff --git a/framework/modules/ecommerce/controllers/billingController.php b/framework/modules/ecommerce/controllers/billingController.php index 9f71b233d0..9fa9b4fe8d 100755 --- a/framework/modules/ecommerce/controllers/billingController.php +++ b/framework/modules/ecommerce/controllers/billingController.php @@ -22,14 +22,15 @@ */ class billingController extends expController { - protected $add_permissions = array( - 'activate'=>'Activate Payment Options' + protected $manage_permissions = array( + 'select'=>'Select Feature', + 'toggle'=>'Toggle Feature', ); - + static function displayname() { return gt("e-Commerce Billing Controller"); } static function description() { return ""; } static function hasSources() { return false; } - + function selectBillingCalculator() { $billing = new billing(); $billing->billingmethod->update($this->params); @@ -45,12 +46,12 @@ function setAddress() { } function selectBillingOptions() { - + } - + function manage() { global $db; - + expHistory::set('manageable', $this->params); // $classes = array(); $dir = BASE."framework/modules/ecommerce/billingcalculators"; @@ -68,7 +69,7 @@ function manage() { $obj = new billingcalculator(array( 'title'=>$calcobj->name(), // 'user_title'=>$calcobj->title, - 'body'=>$calcobj->description(), + 'body'=>$calcobj->description(), 'calculator_name'=>$classname, 'enabled'=>false)); $obj->save(); @@ -77,15 +78,15 @@ function manage() { } } } - + $bcalc = new billingcalculator(); $calculators = $bcalc->find('all'); assign_to_template(array( 'calculators'=>$calculators )); } - - public function activate(){ + + public function activate(){ if (isset($this->params['id'])) { $calc = new billingcalculator($this->params['id']); $calc->update($this->params); @@ -121,7 +122,7 @@ public function configure() { 'title'=>static::displayname() )); } - + public function saveconfig() { $calc = new billingcalculator($this->params['id']); $conf = serialize($calc->calculator->parseConfig($this->params)); diff --git a/framework/modules/ecommerce/controllers/ecomconfigController.php b/framework/modules/ecommerce/controllers/ecomconfigController.php index 3a3a330f98..6fd2dff834 100755 --- a/framework/modules/ecommerce/controllers/ecomconfigController.php +++ b/framework/modules/ecommerce/controllers/ecomconfigController.php @@ -26,7 +26,10 @@ class ecomconfigController extends expController { protected $add_permissions = array( 'show'=>'View Admin Options' ); - + protected $manage_permissions = array( + 'options'=>'Display Options' + ); + static function displayname() { return gt("e-Commerce Configuration Manager"); } static function description() { return gt("Use this module to configure your e-Commerce store"); } static function hasSources() { return false; } @@ -34,20 +37,20 @@ static function hasSources() { return false; } function show() { expHistory::set('manageable', $this->params); } - + /*****************************************************************/ /*************** PRODUCT OPTIONS *******************************/ /*****************************************************************/ function edit_optiongroup_master() { expHistory::set('editable', $this->params); - + $id = isset($this->params['id']) ? $this->params['id'] : null; - $record = new optiongroup_master($id); + $record = new optiongroup_master($id); assign_to_template(array( 'record'=>$record )); } - + function update_optiongroup_master() { global $db; @@ -55,72 +58,72 @@ function update_optiongroup_master() { $og = new optiongroup_master($id); $oldtitle = $og->title; $og->update($this->params); - + // if the title of the master changed we should update the option groups that are already using it. if ($oldtitle != $og->title) { $db->sql('UPDATE '.$db->prefix.'optiongroup SET title="'.$og->title.'" WHERE title="'.$oldtitle.'"'); } - + expHistory::back(); } - + function delete_optiongroup_master() { global $db; - + $mastergroup = new optiongroup_master($this->params); - + // delete all the options for this optiongroup master foreach ($mastergroup->option_master as $masteroption) { $db->delete('option', 'option_master_id='.$masteroption->id); $masteroption->delete(); } - + // delete the mastergroup $db->delete('optiongroup', 'optiongroup_master_id='.$mastergroup->id); $mastergroup->delete(); - + expHistory::back(); } - + function delete_option_master() { global $db; $masteroption = new option_master($this->params['id']); - + // delete any implementations of this option master $db->delete('option', 'option_master_id='.$masteroption->id); $masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id); //eDebug($masteroption); expHistory::back(); } - + function edit_option_master() { expHistory::set('editable', $this->params); - + $params = isset($this->params['id']) ? $this->params['id'] : $this->params; - $record = new option_master($params); + $record = new option_master($params); assign_to_template(array( 'record'=>$record )); } - - function update_option_master() { + + function update_option_master() { global $db; $id = empty($this->params['id']) ? null : $this->params['id']; $opt = new option_master($id); $oldtitle = $opt->title; - + $opt->update($this->params); - + // if the title of the master changed we should update the option groups that are already using it. if ($oldtitle != $opt->title) { - + }$db->sql('UPDATE '.$db->prefix.'option SET title="'.$opt->title.'" WHERE option_master_id='.$opt->id); - + expHistory::back(); } - + public function options() { expHistory::set('viewable', $this->params); $optiongroup = new optiongroup_master(); @@ -129,19 +132,19 @@ public function options() { 'optiongroups'=>$optiongroups )); } - + function rerank_optionmaster() { $om = new option_master($this->params['id']); $om->rerank($this->params['push'], 'optiongroup_master_id=' . $this->params['master_id']); expHistory::back(); } - + /*****************************************************************/ /*************** DISCOUNTS *******************************/ /*****************************************************************/ public function manage_discounts() { expHistory::set('manageable', $this->params); - + $page = new expPaginator(array( 'model'=>'discounts', 'sql'=>'SELECT * FROM '.DB_TABLE_PREFIX.'_discounts', @@ -158,16 +161,16 @@ public function manage_discounts() { 'page'=>$page )); } - + public function edit_discount() { $id = empty($this->params['id']) ? null : $this->params['id']; $discount = new discounts($id); - + //grab all user groups $group = new group(); - + //create two 'default' groups: - $groups = array( + $groups = array( -1 => 'ALL LOGGED IN USERS', -2 => 'ALL NON-LOGGED IN USERS' ); @@ -183,17 +186,17 @@ public function edit_discount() { }; } //find our selected groups for this discount already - // eDebug($discount); + // eDebug($discount); $selected_groups = array(); if (!empty($discount->group_ids)) { $selected_groups = expUnserialize($discount->group_ids); } - + if ($discount->minimum_order_amount == "") $discount->minimum_order_amount = 0; if ($discount->discount_amount == "") $discount->discount_amount = 0; if ($discount->discount_percent == "") $discount->discount_percent = 0; - + // get the shipping options and their methods $shipping_services = array(); $shipping_methods = array(); @@ -205,7 +208,7 @@ public function edit_discount() { $shipping_methods[$calcid] = $calc->availableMethods(); } } - + assign_to_template(array( 'discount'=>$discount, 'groups'=>$groups, @@ -214,7 +217,7 @@ public function edit_discount() { 'shipping_methods'=>$shipping_methods )); } - + public function update_discount() { $id = empty($this->params['id']) ? null : $this->params['id']; $discount = new discounts($id); @@ -224,12 +227,12 @@ public function update_discount() { } else { $this->params['required_shipping_calculator_id'] = 0; } - + $discount->update($this->params); expHistory::back(); } - - public function activate_discount(){ + + public function activate_discount(){ if (isset($this->params['id'])) { $discount = new discounts($this->params['id']); $discount->update($this->params); @@ -238,10 +241,10 @@ public function activate_discount(){ //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id)); //} } - + expHistory::back(); } - + /*****************************************************************/ /*************** PROMO CODE *******************************/ /*****************************************************************/ @@ -264,7 +267,7 @@ public function update_promocode() { $code->update($this->params); expHistory::back(); } - + /*****************************************************************/ /*************** GROUP DISCOUNTS *******************************/ /*****************************************************************/ @@ -289,7 +292,7 @@ public function manage_groupdiscounts() { public function update_groupdiscounts() { global $db; - + if (empty($this->params['id'])) { // look for existing discounts for the same group $existing_id = $db->selectValue('groupdiscounts', 'id', 'group_id='.$this->params['group_id']); @@ -300,32 +303,32 @@ public function update_groupdiscounts() { $gd->update($this->params); expHistory::back(); } - + function rerank_groupdiscount() { $gd = new groupdiscounts($this->params['id']); $gd->rerank($this->params['push']); expHistory::back(); } - + /*****************************************************************/ /*************** GENERAL STORE CONFIG *******************************/ /*****************************************************************/ function configure() { expHistory::set('editable', $this->params); // little bit of trickery so that that categories can have their own configs - + $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc); $views = expTemplate::get_config_templates($this, $this->loc); - - $gc = new geoCountry(); + + $gc = new geoCountry(); $countries = $gc->find('all'); - - $gr = new geoRegion(); + + $gr = new geoRegion(); $regions = $gr->find('all'); - + assign_to_template(array( 'config'=>$this->config, 'pullable_modules'=>$pullable_modules, @@ -334,7 +337,7 @@ function configure() { 'regions'=>$regions, 'title'=>static::displayname() )); - } + } function saveconfig() { $this->params['min_order'] = substr($this->params['min_order'], 1) ; @@ -354,16 +357,16 @@ function saveconfig() { /*****************************************************************/ /*************** Upcharge Rate *******************************/ /*****************************************************************/ - + function manage_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; - $gc = new geoCountry(); + $gc = new geoCountry(); $countries = $gc->find('all'); - - $gr = new geoRegion(); + + $gr = new geoRegion(); $regions = $gr->find('all',null,'rank asc,name asc'); assign_to_template(array( 'countries'=>$countries, @@ -371,12 +374,12 @@ function manage_upcharge() { 'upcharge'=>!empty($this->config['upcharge'])?$this->config['upcharge']:'' )); } - + function update_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; - + //This will make sure that only the country or region that given a rate value will be saved in the db $upcharge = array(); foreach($this->params['upcharge'] as $key => $item) { @@ -385,12 +388,12 @@ function update_upcharge() { } } $this->config['upcharge'] = $upcharge; - + $config->update(array('config'=>$this->config)); flash('message', gt('Configuration updated')); expHistory::back(); } - + } ?> \ No newline at end of file diff --git a/framework/modules/ecommerce/controllers/eventregistrationController.php b/framework/modules/ecommerce/controllers/eventregistrationController.php index b20e0c1ac0..35ca16b6fd 100755 --- a/framework/modules/ecommerce/controllers/eventregistrationController.php +++ b/framework/modules/ecommerce/controllers/eventregistrationController.php @@ -31,14 +31,18 @@ function compare($x, $y) { class eventregistrationController extends expController { public $basemodel_name = 'eventregistration'; - public $useractions = array( 'showall' => 'Show all events', 'eventsCalendar' => 'Calendar View', 'upcomingEvents' => 'Upcoming Events', // 'showByTitle' => "Show events by title", ); - + protected $add_permissions = array( +// 'emailRegistrants'=> 'Email Registrants', + ); + protected $manage_permissions = array( + 'emailRegistrants'=> 'Email Registrants', + ); // hide the configs we don't need public $remove_configs = array( 'aggregation', @@ -52,11 +56,6 @@ class eventregistrationController extends expController { 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'view_registrants'=> 'View Registrants', - 'emailRegistrants'=> 'Email Registrants', - ); - static function displayname() { return gt("e-Commerce Online Event Registration"); } diff --git a/framework/modules/ecommerce/controllers/orderController.php b/framework/modules/ecommerce/controllers/orderController.php index 2ddfbdadad..d05c3285de 100755 --- a/framework/modules/ecommerce/controllers/orderController.php +++ b/framework/modules/ecommerce/controllers/orderController.php @@ -22,30 +22,32 @@ */ class orderController extends expController { - protected $add_permissions = array( - 'showall' => 'Manage', - 'show' => 'View Orders', - 'setStatus' => 'Change Status', - 'edit_payment_info' => 'Edit Payment Info', + protected $manage_permissions = array( + 'add_order_item' => 'Add Order Item', + 'download' => 'Download Label', +// 'create_new_order' => 'Create A New Order', +// 'createReferenceOrder'=> 'Create Reference Order', +// 'edit_address' => 'Edit Address', +// 'edit_invoice_id' => 'Edit Invoice Id', +// 'edit_order_item' => 'Edit Order Item', +// 'edit_payment_info' => 'Edit Payment Info', +// 'edit_shipping_method'=> 'Edit Shipping Method', +// 'edit_totals' => 'Edit Totals', + 'email' => 'Send Email', + 'quickfinder'=> 'Do a quick order lookup', 'save_payment_info'=> 'Save Payment Info', - 'edit_address' => 'Edit Address', 'save_address'=> 'Save Address', - 'edit_order_item' => 'Edit Order Item', 'save_order_item'=> 'Save Order Item', - 'add_order_item' => 'Add Order Item', - 'save_new_order_item'=> 'Save New Order Item', - 'edit_totals' => 'Edit Totals', +// 'save_new_order_item'=> 'Save New Order Item', 'save_totals'=> 'Save Totals', - 'edit_invoice_id' => 'Edit Invoice Id', 'save_invoice_id'=> 'Save Invoice Id', - 'update_sales_reps' => 'Manage Sales Reps', - 'quickfinder'=> 'Do a quick order lookup', - 'edit_shipping_method'=> 'Edit Shipping Method', 'save_shipping_method'=> 'Save Shipping Method', - 'create_new_order' => 'Create A New Order', 'save_new_order'=> 'Save a new order', - 'createReferenceOrder'=> 'Create Reference Order', - 'save_reference_order'=> 'Save Reference Order' + 'save_reference_order'=> 'Save Reference Order', + 'set' => 'Change Status', + 'showall' => 'Manage', + 'show' => 'View Orders', + 'update' => 'update order', ); static function displayname() { @@ -66,21 +68,21 @@ function showall() { for($i=0; $i<$count; $i++) { // get the cart $cart = $db->selectObject('orders','purchased=0'); - + // check to make sure this isn't an active session $ticket = $db->selectObject('sessionticket', "ticket='".$cart->sessionticket_ticket."'"); if (empty($ticket)) { // delete all the order items for this cart and their shippingmethods foreach($db->selectObjects('orderitems', 'orders_id='.$cart->id) as $oi) { $db->delete('shippingmethods', 'id='.$oi->shippingmethods_id); - $db->delete('orderitems', 'orders_id='.$cart->id); + $db->delete('orderitems', 'orders_id='.$cart->id); } - + // delete the billing methods for this cart. $db->delete('billingmethods', 'orders_id='.$cart->id); $db->delete('orders', 'id='.$cart->id); - } - + } + } */ // find orders with a "closed" status type @@ -247,7 +249,7 @@ function myOrder() { //check here for the hash in the params, or session set w/ perms to view...shs = xaf7y0s87d7elshd70 etc //if present, prompt user for the order number and email address on the order //and if they pass, show the order to them. Need to maybe set something in the session then for subsequent - //viewing of the order? + //viewing of the order? if ($user->id != $order->user_id) { if ($user->isAdmin()) { redirect_to(array('controller'=> 'order', 'action'=> 'show', 'id'=> $this->params['id'])); @@ -415,7 +417,7 @@ function getPDF($orders = null) { foreach ($orders as $order) { if ($user->isAdmin()) { $invoice .= renderAction(array('controller'=> 'order', 'action'=> 'show', 'view'=> 'show_printable', 'id'=> $order['id'], 'printerfriendly'=> '1', 'no_output'=> 'true')); - //eDebug($order['id'] . ": " . $timer->mark()); + //eDebug($order['id'] . ": " . $timer->mark()); } else { $invoice .= renderAction(array('controller'=> 'order', 'action'=> 'myOrder', 'view'=> 'show_printable', 'id'=> $order['id'], 'printerfriendly'=> '1', 'no_output'=> 'true')); } @@ -550,7 +552,7 @@ function getPDF($orders = null) { // END OF FILE //============================================================+ - + // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); @@ -878,7 +880,7 @@ function emailCustomer() { // $db->insertObject($noteObj, 'content_expSimpleNote'); $note->attachNote('order', $order->id); - //eDebug($note,true); + //eDebug($note,true); } else { flash('error', gt('The email was NOT sent. An email address was not found for this customer')); expHistory::back(); @@ -920,7 +922,7 @@ function metainfo() { if (empty($router->params['action'])) return false; - // figure out what metadata to pass back based on the action + // figure out what metadata to pass back based on the action // we are in. $action = $router->params['action']; $metainfo = array('title'=>'', 'keywords'=>'', 'description'=>'', 'canonical'=> '', 'noindex' => true, 'nofollow' => true); @@ -957,7 +959,7 @@ function metainfo() { function captureAuthorization() { //eDebug($this->params,true); $order = new order($this->params['id']); - /*eDebug($this->params); + /*eDebug($this->params); //eDebug($order,true);*/ //eDebug($order,true); //$billing = new billing(); @@ -1293,7 +1295,7 @@ function save_reference_order() { //eDebug($this->params,true); $order = new order($this->params['original_orderid']); - //eDebug($order,true); + //eDebug($order,true); //x $newOrder = new order(); $newOrder->order_status_id = $this->params['order_status_id']; @@ -1348,8 +1350,8 @@ function save_reference_order() { $newBillingMethod->billing_options = serialize($tObj); $newBillingMethod->save(); - //eDebug(expUnserialize($order->billingmethod[0]->billing_options)); - //eDebug(expUnserialize($order->billingmethod[0]->billingtransaction[0]->billing_options),true); + //eDebug(expUnserialize($order->billingmethod[0]->billing_options)); + //eDebug(expUnserialize($order->billingmethod[0]->billingtransaction[0]->billing_options),true); $newBillingTransaction = new billingtransaction(); // $newBillingTransaction->billingcalculator_id = 6; ///setting to manual/passthru @@ -1377,7 +1379,7 @@ function save_reference_order() { $newOi->products_name = $this->params['products_name'][$oikey]; $newOi->products_price = $this->params['products_price'][$oikey]; $newOi->products_price_adjusted = $this->params['products_price'][$oikey]; - //$newOi->products_tax = 0; + //$newOi->products_tax = 0; $newOi->shippingmethods_id = $newShippingMethod->id; $newOi->save(); } @@ -1406,7 +1408,7 @@ function save_new_order() { // global $user, $db; //eDebug($this->params,true); //$order = new order($this->params['original_orderid']); - //eDebug($order,true); + //eDebug($order,true); $newAddy = new address(); if ($this->params['customer_type'] == 1) { @@ -1490,8 +1492,8 @@ function save_new_order() { $newBillingMethod->email = $newAddy->email; $newBillingMethod->save(); - //eDebug(expUnserialize($order->billingmethod[0]->billing_options)); - //eDebug(expUnserialize($order->billingmethod[0]->billingtransaction[0]->billing_options),true); + //eDebug(expUnserialize($order->billingmethod[0]->billing_options)); + //eDebug(expUnserialize($order->billingmethod[0]->billingtransaction[0]->billing_options),true); $newBillingTransaction = new billingtransaction(); // $newBillingTransaction->billingcalculator_id = 6; ///setting to manual/passthru @@ -1666,7 +1668,7 @@ function edit_order_item() { $oi->product = new product($oi->product->id, true, true); if ($oi->product->parent_id != 0) { $parProd = new product($oi->product->parent_id); - //$oi->product->optiongroup = $parProd->optiongroup; + //$oi->product->optiongroup = $parProd->optiongroup; $oi->product = $parProd; } //FIXME we don't use selectedOpts? @@ -1776,20 +1778,20 @@ function save_order_item() { //$this->user_input_fields = expUnserialize($this->user_input_fields); //eDebug($this,true); if (!empty($oi->product->user_input_fields)) foreach ($oi->product->user_input_fields as $uifkey=> $uif) { - /*if ($uif['is_required'] || (!$uif['is_required'] && strlen($params['user_input_fields'][$uifkey]) > 0)) + /*if ($uif['is_required'] || (!$uif['is_required'] && strlen($params['user_input_fields'][$uifkey]) > 0)) { if (strlen($params['user_input_fields'][$uifkey]) < $uif['min_length']) { - //flash('error', 'test'); - //redirect_to(array('controller'=>cart, 'action'=>'displayForm', 'form'=>'addToCart', 'product_id'=>$this->id, 'product_type'=>$this->product_type)); + //flash('error', 'test'); + //redirect_to(array('controller'=>cart, 'action'=>'displayForm', 'form'=>'addToCart', 'product_id'=>$this->id, 'product_type'=>$this->product_type)); $params['error'] .= $uif['name'].' field has a minimum requirement of ' . $uif['min_length'] . ' characters.<br/>'; - + }else if (strlen($params['user_input_fields'][$uifkey]) > $uif['max_length'] && $uif['max_length'] > 0) { - //flash('error', ); - //redirect_to(array('controller'=>cart, 'action'=>'displayForm', 'form'=>'addToCart', 'product_id'=>$this->id, 'product_type'=>$this->product_type)); + //flash('error', ); + //redirect_to(array('controller'=>cart, 'action'=>'displayForm', 'form'=>'addToCart', 'product_id'=>$this->id, 'product_type'=>$this->product_type)); $params['error'] .= $uif['name'].' field has a maximum requirement of ' . $uif['max_length'] . ' characters.<br/>'; - } + } }*/ $user_input_info[] = array($uif['name']=> $this->params['user_input_fields'][$uifkey]); } @@ -1798,7 +1800,7 @@ function save_order_item() { $oi->options = serialize($options); $oi->user_input_fields = serialize($user_input_info); - //eDebug($oi); + //eDebug($oi); $oi->save(); $oi->refresh(); //eDebug($oi,true); @@ -1856,7 +1858,7 @@ function save_new_order_item() { //FIXME we need to be able to call this from p $order = new order($this->params['orderid']); if (isset($this->params['prod-quantity'])) { //we are adding multiple children, so we approach a bit different - //we'll send over the product_id of the parent, along with id's and quantities of children we're adding + //we'll send over the product_id of the parent, along with id's and quantities of children we're adding foreach ($this->params['prod-quantity'] as $qkey=> &$quantity) { if (in_array($qkey, $this->params['prod-check'])) { $this->params['children'][$qkey] = $quantity; @@ -2007,14 +2009,14 @@ function quickfinder() { /*$o = new order(); $b = new billingmethod(); $s = new shippingmethod(); - + $search = intval($this->params['ordernum']); if (is_int($oid) && $oid > 0) { $orders = $o->find('all',"invoice_id LIKE '%".$oid."%'"); if(count($orders == 1)) { - redirect_to(array('controller'=>'order','action'=>'show','id'=>$order[0]->id)); + redirect_to(array('controller'=>'order','action'=>'show','id'=>$order[0]->id)); } else { @@ -2033,7 +2035,7 @@ function quickfinder() { $order = $o->find('first','invoice_id='.$oid); if(!empty($order->id)) { - redirect_to(array('controller'=>'order','action'=>'show','id'=>$order->id)); + redirect_to(array('controller'=>'order','action'=>'show','id'=>$order->id)); } else { @@ -2042,7 +2044,7 @@ function quickfinder() { } else { - flashAndFlow('message','Invalid order number.'); + flashAndFlow('message','Invalid order number.'); }*/ } @@ -2071,7 +2073,7 @@ public function verifyAndRestoreCart() { if (isset($sessAr) && isset($this->params['cid']) && $this->params['cid'] == $sessAr['cid']) { $tmpCart = new order($sessAr['cid']); if (isset($tmpCart->id)) { - //eDebug($tmpCart,true); + //eDebug($tmpCart,true); $shippingMethod = $tmpCart->shippingmethod; $billingMethod = $tmpCart->billingmethod[0]; @@ -2125,7 +2127,7 @@ public function search() { global $db; $sql = "select DISTINCT(a.id) as id, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; - $sql .= "from " . $db->prefix . "addresses as a "; //R JOIN " . + $sql .= "from " . $db->prefix . "addresses as a "; //R JOIN " . //$db->prefix . "billingmethods as bm ON bm.addresses_id=a.id "; $sql .= " WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) "; @@ -2148,7 +2150,7 @@ public function search_external() { global $db; $sql = "select DISTINCT(a.id) as id, a.source as source, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; - $sql .= "from " . $db->prefix . "external_addresses as a "; //R JOIN " . + $sql .= "from " . $db->prefix . "external_addresses as a "; //R JOIN " . //$db->prefix . "billingmethods as bm ON bm.addresses_id=a.id "; $sql .= " WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) "; diff --git a/framework/modules/ecommerce/controllers/order_statusController.php b/framework/modules/ecommerce/controllers/order_statusController.php index 3e3cf78ac4..f58a2ba7d3 100755 --- a/framework/modules/ecommerce/controllers/order_statusController.php +++ b/framework/modules/ecommerce/controllers/order_statusController.php @@ -22,14 +22,17 @@ */ class order_statusController extends expController { + protected $manage_permissions = array( + 'toggle'=>'Toggle Status' + ); static function displayname() { return gt("e-Commerce Order Statuses"); } static function description() { return gt("Manage e-Commerce order status codes"); } static function hasSources() { return false; } static function hasContent() { return false; } - + public function manage() { expHistory::set('viewable', $this->params); - + $page = new expPaginator(array( 'model'=>'order_status', 'where'=>1, @@ -45,10 +48,10 @@ public function manage() { 'page'=>$page )); } - + public function manage_messages() { expHistory::set('manageable', $this->params); - + $page = new expPaginator(array( 'model'=>'order_status_messages', 'where'=>1, @@ -65,7 +68,7 @@ public function manage_messages() { 'page'=>$page )); } - + public function edit_message() { $id = isset($this->params['id']) ? $this->params['id'] : null; $msg = new order_status_messages($id); @@ -74,28 +77,28 @@ public function edit_message() { )); //$msg->update($this->params); } - + public function update_message() { $id = isset($this->params['id']) ? $this->params['id'] : null; $msg = new order_status_messages($id); $msg->update($this->params); expHistory::back(); } - + public function delete_message() { if (empty($this->params['id'])) return false; $msg = new order_status_messages($this->params['id']); $msg->delete(); expHistory::back(); } - + public function toggle_closed() { global $db; $db->toggle('order_status', 'treat_as_closed', 'id='.$this->params['id']); expHistory::back(); } - + public function toggle_default() { global $db; @@ -103,17 +106,17 @@ public function toggle_default() { $db->setUniqueFlag($order_status, 'order_status', 'is_default'); expHistory::back(); } - + public function showall() { redirect_to(array('controller'=>'order_status', 'action'=>'manage')); // $this->manage(); } - + public function show() { redirect_to(array('controller'=>'order_status', 'action'=>'manage')); // $this->manage(); } - + } ?> \ No newline at end of file diff --git a/framework/modules/ecommerce/controllers/purchaseOrderController.php b/framework/modules/ecommerce/controllers/purchaseOrderController.php index a93ff1373c..e87f1e8ff1 100644 --- a/framework/modules/ecommerce/controllers/purchaseOrderController.php +++ b/framework/modules/ecommerce/controllers/purchaseOrderController.php @@ -22,24 +22,17 @@ */ class purchaseOrderController extends expController { - public $basemodel_name = 'purchase_order'; - protected $add_permissions = array( - 'manage'=>'Manage Purchase Orders', - 'edit'=>'Edit Purchase Orders', - 'manage_vendors'=>'Manage Vendors', + protected $manage_permissions = array( 'show_vendor'=>'Show Vendor Details', - 'edit_vendor'=>'Edit Vendor', - 'update_vendor'=>'Update Vendor', - 'delete_vendor'=>'Delete vendors', ); - + static function displayname() { return gt("e-Commerce Purchase Order Manager"); } static function description() { return gt("Use this module to create and manage purchase orders for your ecommerce store."); } - + function manage () { expHistory::set('viewable', $this->params); - + $vendor = new vendor(); $vendors = $vendor->find('all'); if(!empty($this->params['vendor'])) { @@ -47,34 +40,34 @@ function manage () { } else { $purchase_orders = $this->purchase_order->find('all'); } - + assign_to_template(array( 'purchase_orders'=>$purchase_orders, 'vendors' => $vendors, 'vendor_id' => @$this->params['vendor'] )); } - + function edit () { // global $db; assign_to_template(array( 'record'=>$this->params )); } - + function manage_vendors () { expHistory::set('viewable', $this->params); $vendor = new vendor(); - + $vendors = $vendor->find('all'); assign_to_template(array( 'vendors'=>$vendors )); } - + function show_vendor () { $vendor = new vendor(); - + if(isset($this->params['id'])) { $vendor = $vendor->find('first', 'id =' .$this->params['id']); $vendor_title = $vendor->title; @@ -88,17 +81,17 @@ function show_vendor () { $vendor->classname, $vendor->identifier ); - + assign_to_template(array( 'vendor_title' => $vendor_title, 'vendor'=>$vendor )); } } - + function edit_vendor() { $vendor = new vendor(); - + if(isset($this->params['id'])) { $vendor = $vendor->find('first', 'id =' .$this->params['id']); assign_to_template(array( @@ -106,34 +99,34 @@ function edit_vendor() { )); } } - + function update_vendor() { $vendor = new vendor(); - + $vendor->update($this->params['vendor']); expHistory::back(); } - + function delete_vendor() { global $db; - + if (!empty($this->params['id'])){ $db->delete('vendor', 'id =' .$this->params['id']); } expHistory::back(); } - + public function getPurchaseOrderByJSON() { - + if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchase_order->find('all'); } - + echo json_encode($purchase_orders); } - + } ?> \ No newline at end of file diff --git a/framework/modules/ecommerce/controllers/shippingController.php b/framework/modules/ecommerce/controllers/shippingController.php index f64259c831..baf0cab6f7 100755 --- a/framework/modules/ecommerce/controllers/shippingController.php +++ b/framework/modules/ecommerce/controllers/shippingController.php @@ -22,8 +22,11 @@ */ class shippingController extends expController { - protected $add_permissions = array( - 'toggle'=>'Enable/Disable Options' + protected $manage_permissions = array( + 'editspeed'=>'Edit Shipping Speed', + 'save'=>'Save Configuration', + 'select'=>'Select Feature', + 'toggle'=>'Enable/Disable Options', ); static function displayname() { return gt("e-Commerce Shipping Controller"); } @@ -38,16 +41,16 @@ function selectShippingCalculator() { global $db; $shipping = new shipping(); - + // update the shippingmethod $shipping->shippingmethod->update(array('shippingcalculator_id'=>$this->params['shippingcalculator_id'],'option'=>null,'option_title'=>null)); - + // fetch the calculator $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['shippingcalculator_id']); //eDebug($this->params['shippingcalculator_id']); //eDebug($calcname); $shipping->calculator = new $calcname($this->params['shippingcalculator_id']); - + $ar = new expAjaxReply(200, 'ok', $shipping, array('controller'=>'cart', 'action'=>'checkout'),true); $ar->send(); } @@ -77,26 +80,26 @@ function setAddress() { $ar = new expAjaxReply(200, 'ok', new address($shipping->shippingmethod->addresses_id), array('controller'=>'cart', 'action'=>'checkout'),true); $ar->send(); } - + /** * Ajax method to set a shipping 'gift' message */ function leaveMessage() { if (!empty($this->params['shippingmessageid'])) { $sm = new shippingmethod($this->params['shippingmessageid']); - + if ($this->params['nosave'] == false) { - $sm->to = empty($this->params['shpmessageto']) ? null : $this->params['shpmessageto']; - $sm->from = empty($this->params['shpmessagefrom']) ? null : $this->params['shpmessagefrom']; - $sm->message = empty($this->params['shpmessage']) ? null : $this->params['shpmessage']; + $sm->to = empty($this->params['shpmessageto']) ? null : $this->params['shpmessageto']; + $sm->from = empty($this->params['shpmessagefrom']) ? null : $this->params['shpmessagefrom']; + $sm->message = empty($this->params['shpmessage']) ? null : $this->params['shpmessage']; $sm->save(); } } - + $ar = new expAjaxReply(200, 'ok', $sm, array('controller'=>'cart', 'action'=>'checkout'),true); - $ar->send(); + $ar->send(); } - + function renderOptions() { //FIXME do we ever call this? // global $db, $order; global $order; //FIXME we do NOT want the global $order @@ -119,15 +122,15 @@ function renderOptions() { //FIXME do we ever call this? $opt = $shipping->pricelist[$shipping->shippingmethod->option]; } } - + $shipping->shippingmethod->update(array('option'=>$opt['id'],'option_title'=>$opt['title'],'shipping_cost'=>$opt['cost'])); - + assign_to_template(array( 'shipping'=>$shipping, 'order'=>$order )); } - + /** * Ajax method to return a shipping calculator object within a shipping object */ @@ -136,10 +139,10 @@ function listPrices() { $ar = new expAjaxReply(200, 'ok', $shipping->listPrices(), array('controller'=>'cart', 'action'=>'checkout'),true); $ar->send(); } - + function manage() { global $db; - + expHistory::set('manageable', $this->params); $calculators = array(); $dir = BASE."framework/modules/ecommerce/shippingcalculators"; @@ -151,10 +154,10 @@ function manage() { if (is_file("$dir/$file") && substr("$dir/$file", -4) == ".php") { include_once("$dir/$file"); $classname = substr($file, 0, -4); - $id = $db->selectValue('shippingcalculator', 'id', 'calculator_name="'.$classname.'"'); + $id = $db->selectValue('shippingcalculator', 'id', 'calculator_name="'.$classname.'"'); if (empty($id)) { $calcobj = new $classname($this->params); - if ($calcobj->isSelectable() == true) { + if ($calcobj->isSelectable() == true) { $calcobj->update(array('title'=>$calcobj->name(),'body'=>$calcobj->description(),'calculator_name'=>$classname,'enabled'=>false)); } } else { @@ -176,8 +179,8 @@ function manage() { 'calculators'=>$calculators )); } - - + + public function toggle() { global $db; @@ -222,18 +225,18 @@ public function configure() { 'title'=>static::displayname() )); } - + public function saveconfig() { global $db; if (empty($this->params['id'])) return false; $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['id']); $calc = new $calcname($this->params['id']); - $conf = serialize($calc->parseConfig($this->params)); + $conf = serialize($calc->parseConfig($this->params)); $calc->update(array('config'=>$conf)); expHistory::back(); } - + public function editspeed() { global $db; @@ -243,9 +246,9 @@ public function editspeed() { assign_to_template(array( 'calculator'=>$calc )); - + } - + public function saveEditSpeed() { global $db; @@ -255,7 +258,7 @@ public function saveEditSpeed() { $db->insertObject($obj, $this->params['table']); redirect_to(array('controller'=>'shipping', 'action'=>'configure', 'id'=>$this->params['shippingcalculator_id'])); } - + public function deleteSpeed() { global $db; diff --git a/framework/modules/ecommerce/controllers/storeCategoryController.php b/framework/modules/ecommerce/controllers/storeCategoryController.php index af742414fa..ff82021282 100755 --- a/framework/modules/ecommerce/controllers/storeCategoryController.php +++ b/framework/modules/ecommerce/controllers/storeCategoryController.php @@ -22,18 +22,11 @@ */ class storeCategoryController extends expNestedNodeController { - static function displayname() { - return gt("e-Commerce Category Manager"); - } - - static function description() { - return gt("This module is for managing categories in your store."); - } - - protected $add_permissions = array( + protected $manage_permissions = array( +// 'import' => 'Import Category', +// 'importCategory' => 'Import Category', 'fix_categories' => 'to run this action.' ); - // hide the configs we don't need public $remove_configs = array( 'aggregation', @@ -49,6 +42,14 @@ static function description() { 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) + static function displayname() { + return gt("e-Commerce Category Manager"); + } + + static function description() { + return gt("This module is for managing categories in your store."); + } + static function canImportData() { return true; } @@ -190,18 +191,18 @@ function manage() { expHistory::set('viewable', $this->params); // $category = new storeCategory(); // $categories = $category->getFullTree(); - // + // // // foreach($categories as $i=>$val){ // // if (!empty($this->values) && in_array($val->id,$this->values)) { // // $this->tags[$i]->value = true; // // } else { // // $this->tags[$i]->value = false; // // } - // // $this->tags[$i]->draggable = $this->draggable; - // // $this->tags[$i]->checkable = $this->checkable; + // // $this->tags[$i]->draggable = $this->draggable; + // // $this->tags[$i]->checkable = $this->checkable; // // } // - // $obj = json_encode($categories); + // $obj = json_encode($categories); } public function update() { @@ -405,7 +406,7 @@ function recurseBuild(&$thisNode, &$thisLeft, &$thisRight) { // and adds the lft and rgt extents correctly for a nested set /*function nestify($categories) { - // Trees mapped + // Trees mapped $trees = array(); $trackParents = array(); $depth=0; @@ -439,10 +440,10 @@ function recurseBuild(&$thisNode, &$thisLeft, &$thisRight) { $counter++; $l--; } - + $categories[$key]['lft'] = $counter; //???$counter++; - } + } $prevDepth=$val['depth']; } @@ -497,7 +498,7 @@ function recurseBuild(&$thisNode, &$thisLeft, &$thisRight) { // eDebug(toHierarchy(nestify(flattenArray($TheTree))),1); /*$flat_fixed_cats = nestify(flattenArray($TheTree)); - + foreach ($flat_fixed_cats as $k=>$v) { $cat = new storeCategory($v['id']); $cat->lft = $v['lft']; @@ -508,13 +509,13 @@ function recurseBuild(&$thisNode, &$thisLeft, &$thisRight) { */ //-Show Array Structure--// // print_r($TheTree); - // - // + // + // // //--Print the Categories, and send their children to DrawBranch--// // //--The code below allows you to keep track of what category you're currently drawing--// - // + // // printf("<ul>"); - // + // // foreach($TheTree as $MyNode) { // printf("<li>{$MyNode['Name']}</li>"); // if(is_array($MyNode["Children"]) && !empty($MyNode["Children"])) { @@ -523,17 +524,17 @@ function recurseBuild(&$thisNode, &$thisLeft, &$thisRight) { // } // printf("</ul>"); // //--Recursive printer, should draw a child, and any of its children--// - // + // // function DrawBranch($Node){ // printf("<ul>"); - // + // // foreach($Node as $Entity) { // printf("<li>{$Entity['Name']}</li>"); - // + // // if(is_array($Entity["Children"]) && !empty($Entity["Children"])) { // DrawBranch($Entity["Children"]); // } - // + // // printf("</ul>"); // } // } diff --git a/framework/modules/ecommerce/controllers/storeController.php b/framework/modules/ecommerce/controllers/storeController.php index 07a773ff70..bafe73433c 100755 --- a/framework/modules/ecommerce/controllers/storeController.php +++ b/framework/modules/ecommerce/controllers/storeController.php @@ -24,7 +24,6 @@ class storeController extends expController { public $basemodel_name = 'product'; - public $useractions = array( 'showall' => 'Products - All Products and Categories', 'showallFeaturedProducts' => 'Products - Only Featured', @@ -40,7 +39,30 @@ class storeController extends expController { 'quicklinks' => 'Links - User Links', 'showGiftCards' => 'Gift Cards UI', ); - + protected $manage_permissions = array( + 'batch_process' => 'Batch capture order transactions', + 'cleanNonUnicodeProducts' => 'Clean all non-unicode charset products', + 'copyProduct' => "Copy Product", +// 'delete_children' => "Delete Children", + 'reimport' => 'ReImport Products', + 'findDupes' => 'Fix Duplicate SEF Names', +// 'manage_sales_reps' => 'Manage Sales Reps', +// 'import_external_addresses' => 'Import addresses from other sources', + 'showallImpropercategorized' => 'View products in top level categories that should not be', + 'showallUncategorized' => 'View all uncategorized products', + 'nonUnicodeProducts' => 'View all non-unicode charset products', + 'process_orders' => 'Batch capture order transactions', + 'processModelAliases' => 'Process uploaded model aliases', + 'saveModelAliases' => 'Save uploaded model aliases', +// 'deleteProcessedModelAliases' => 'Delete processed uploaded model aliases', +// 'delete_model_alias' => 'Process model aliases', +// 'update_model_alias' => 'Save model aliases', +// 'edit_model_alias' => 'Delete model aliases', +// 'import' => 'Import Products', +// 'importProduct' => 'Import Products', +// 'export' => 'Export Products', + 'uploadModelAliases' => 'Upload model aliases', + ); // hide the configs we don't need public $remove_configs = array( 'aggregation', @@ -54,31 +76,6 @@ class storeController extends expController { 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',) - //protected $permissions = array_merge(array("test"=>'Test'), array('copyProduct'=>"Copy Product")); - protected $add_permissions = array( - 'copyProduct' => "Copy Product", - 'delete_children' => "Delete Children", - 'reimport' => 'ReImport Products', - 'findDupes' => 'Fix Duplicate SEF Names', - 'manage_sales_reps' => 'Manage Sales Reps', - 'batch_process' => 'Batch capture order transactions', - 'process_orders' => 'Batch capture order transactions', - 'import_external_addresses' => 'Import addresses from other sources', - 'showallImpropercategorized' => 'View products in top level categories that should not be', - 'showallUncategorized' => 'View all uncategorized products', - 'nonUnicodeProducts' => 'View all non-unicode charset products', - 'cleanNonUnicodeProducts' => 'Clean all non-unicode charset products', - 'uploadModelAliases' => 'Upload model aliases', - 'processModelAliases' => 'Process uploaded model aliases', - 'saveModelAliases' => 'Save uploaded model aliases', - 'deleteProcessedModelAliases' => 'Delete processed uploaded model aliases', - 'delete_model_alias' => 'Process model aliases', - 'update_model_alias' => 'Save model aliases', - 'edit_model_alias' => 'Delete model aliases', - 'import' => 'Import Products', - 'export' => 'Export Products', - ); - static function displayname() { return gt("e-Commerce Store Front"); } @@ -508,13 +505,13 @@ function categoryBreadcrumb() { /*if(isset($router->params['action'])) { - $ancestors = $this->category->pathToNode(); + $ancestors = $this->category->pathToNode(); }else if(isset($router->params['section'])) { $current = $db->selectObject('section',' id= '.$router->params['section']); $ancestors[] = $current; if( $current->parent != -1 || $current->parent != 0 ) - { + { while ($db->selectObject('section',' id= '.$router->params['section']);) if ($section->id == $id) { $current = $section; @@ -523,7 +520,7 @@ function categoryBreadcrumb() { } } eDebug($sections); - $ancestors = $this->category->pathToNode(); + $ancestors = $this->category->pathToNode(); }*/ $ancestors = $this->category->pathToNode(); @@ -1274,7 +1271,7 @@ function edit() { } } } - //eDebug($editable_options[$group->title]); + //eDebug($editable_options[$group->title]); } //die(); @@ -1496,7 +1493,7 @@ function delete() { if (empty($this->params['id'])) return false; $product_type = $db->selectValue('product', 'product_type', 'id=' . $this->params['id']); $product = new $product_type($this->params['id'], true, false); - //eDebug($product_type); + //eDebug($product_type); //eDebug($product, true); //if (!empty($product->product_type_id)) { //$db->delete($product_type, 'id='.$product->product_id); @@ -1635,18 +1632,18 @@ public function configure() { public function deleteChildren() { //eDebug($data[0],true); //if($id!=null) $this->params['id'] = $id; - //eDebug($this->params,true); + //eDebug($this->params,true); $product = new product($this->params['id']); //$product = $product->find("first", "previous_id =" . $previous_id); //eDebug($product, true); - if (empty($product->id)) // || empty($product->previous_id)) + if (empty($product->id)) // || empty($product->previous_id)) { flash('error', gt('There was an error deleting the child products.')); expHistory::back(); } $childrenToDelete = $product->find('all', 'parent_id=' . $product->id); foreach ($childrenToDelete as $ctd) { - //fwrite($lfh, "Deleting:" . $ctd->id . "\n"); + //fwrite($lfh, "Deleting:" . $ctd->id . "\n"); $ctd->delete(); } } @@ -1822,7 +1819,7 @@ public function searchNew() { if (!$user->isAdmin()) $sql .= '(p.active_type=0 OR p.active_type=1) AND '; $sql .= " match (p.title,p.model,p.body) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) AND p.parent_id=0 "; $sql .= " HAVING relevance > 0 "; - //$sql .= "GROUP BY p.id "; + //$sql .= "GROUP BY p.id "; $sql .= "order by modelmatch,titlematch,relevance desc LIMIT 10"; eDebug($sql); @@ -1851,32 +1848,32 @@ function process_orders() { */ /*echo "Here?"; $inv = 30234; - $req = 'a29f9shsgh32hsf80s7'; + $req = 'a29f9shsgh32hsf80s7'; $amt = 101.00; for($count=1;$count<=25;$count+=2) - { + { $data[2] = $inv + $count; $amt += $count*$count; - $successSet[$count]['message'] = "Sucessfully imported row " . $count . ", order: " . $data[2] . "<br/>"; + $successSet[$count]['message'] = "Sucessfully imported row " . $count . ", order: " . $data[2] . "<br/>"; $successSet[$count]['order_id'] = $data[2]; $successSet[$count]['amount'] = $amt; $successSet[$count]['request_id'] = $req; $successSet[$count]['reference_id'] = $req; $successSet[$count]['authorization_code'] = $req; - $successSet[$count]['shipping_tracking_number'] = '1ZNF453937547'; + $successSet[$count]['shipping_tracking_number'] = '1ZNF453937547'; $successSet[$count]['carrier'] = 'UPS'; } for($count=2;$count<=25;$count+=2) - { - $data[2] = $inv + $count; - $amt += $count*$count; + { + $data[2] = $inv + $count; + $amt += $count*$count; $errorSet[$count]['error_code'] = '42'; $errorSet[$count]['message'] = "No go for some odd reason. Try again."; $errorSet[$count]['order_id'] = $data[2]; $errorSet[$count]['amount'] = $amt; } - - assign_to_template(array('errorSet'=>$errorSet, 'successSet'=>$successSet)); + + assign_to_template(array('errorSet'=>$errorSet, 'successSet'=>$successSet)); return;*/ ########### @@ -1885,7 +1882,7 @@ function process_orders() { $template = expTemplate::get_template_for_action(new orderController(), 'setStatus', $this->loc); //eDebug($_FILES); - //eDebug($this->params,true); + //eDebug($this->params,true); set_time_limit(0); //$file = new expFile($this->params['expFile']['batch_process_upload'][0]); if (!empty($_FILES['batch_upload_file']['error'])) { @@ -1925,7 +1922,7 @@ function process_orders() { // read in the header line $data = fgetcsv($handle, 10000, ","); - //eDebug($data); + //eDebug($data); // $dataset = array(); $carrier = ''; if (trim($data[0]) == 'ShipmentInformationShipmentID') { @@ -2000,8 +1997,8 @@ function process_orders() { $result = $calc->delayed_capture($bm, $order->grand_total, $order); if ($result->errorCode == 0) { //we've succeeded. transaction already created and billing info updated. - //just need to set the order shipping info, check and see if we send user an email, and set statuses. - //shipping info: + //just need to set the order shipping info, check and see if we send user an email, and set statuses. + //shipping info: $successSet[$count]['order_id'] = $data[2]; $successSet[$count]['message'] = "Sucessfully captured order " . $data[2] . " and set shipping information."; $successSet[$count]['amount'] = $order->grand_total; @@ -2013,7 +2010,7 @@ function process_orders() { } else { //failed capture, so we report the error but still set the shipping information //because it's already out the door - //$failMessage = "Attempted to delay capture order " . $data[2] . " and it failed with the following error: " . $result->errorCode . " - " .$result->message; + //$failMessage = "Attempted to delay capture order " . $data[2] . " and it failed with the following error: " . $result->errorCode . " - " .$result->message; //if the user seelected to set a different status for failed orders, set it here. /*if(isset($this->params['order_status_fail'][0]) && $this->params['order_status_fail'][0] > -1) { @@ -2024,10 +2021,10 @@ function process_orders() { $change->to_status_id = $this->params['order_status_fail'][0]; $change->orders_id = $order->id; $change->save(); - + // update the status of the order $order->order_status_id = $this->params['order_status_fail'][0]; - $order->save(); + $order->save(); }*/ $errorSet[$count]['error_code'] = $result->errorCode; $errorSet[$count]['message'] = "Capture failed: " . $result->message . "<br/>Setting shipping information."; @@ -2035,11 +2032,11 @@ function process_orders() { $errorSet[$count]['amount'] = $order->grand_total; $errorSet[$count]['shipping_tracking_number'] = $data[0]; $errorSet[$count]['carrier'] = $carrier; - //continue; + //continue; } } else { - //dont suppose we do anything here, as it may be set to approved manually - //$errorSet[$count] = "Order " . $data[2] . " does not use a billing method with delayed capture ability."; + //dont suppose we do anything here, as it may be set to approved manually + //$errorSet[$count] = "Order " . $data[2] . " does not use a billing method with delayed capture ability."; $successSet[$count]['message'] = 'No capture processing available for order:' . $data[2] . '. Setting shipping information.'; $successSet[$count]['order_id'] = $data[2]; $successSet[$count]['amount'] = $order->grand_total; @@ -2126,7 +2123,7 @@ function process_orders() { } } - //eDebug($product); + //eDebug($product); } fclose($handle); ini_set('auto_detect_line_endings',$line_end); @@ -2231,7 +2228,7 @@ function process_external_addresses() { // read in the header line and discard it $data = fgetcsv($handle, 10000, ","); - //eDebug($data); + //eDebug($data); // $dataset = array(); //mc=1, nt=2, amm=3 diff --git a/framework/modules/ecommerce/controllers/taxController.php b/framework/modules/ecommerce/controllers/taxController.php index 651d108b63..713d2e855d 100644 --- a/framework/modules/ecommerce/controllers/taxController.php +++ b/framework/modules/ecommerce/controllers/taxController.php @@ -24,13 +24,6 @@ class taxController extends expController { public $basemodel_name = 'taxclass'; - protected $add_permissions = array( - 'manage_zones' => 'Manages Zones', - 'edit_zone' => 'Add/Edit Zone', - 'update_zone' => 'Update Zone', - 'delete_zone' => 'Delete Zone' - ); - static function displayname() { return gt("e-Commerce Tax Class Manager"); } diff --git a/framework/modules/ecommerce/products/models/donation.php b/framework/modules/ecommerce/products/models/donation.php index aacb5ad912..c5c05ec30d 100644 --- a/framework/modules/ecommerce/products/models/donation.php +++ b/framework/modules/ecommerce/products/models/donation.php @@ -65,10 +65,10 @@ public function find($range = 'all', $where = null, $order = null, $limit = null $sql = "product_type='donation'"; if (!empty($where)) $sql .= $where; - $sql .= empty($order) ? '' : ' ORDER BY ' . $order; + $sql .= empty($order) ? '' : ' ORDER BY ' . expString::escape($order); if (strcasecmp($range, 'all') == 0) { - $sql .= empty($limit) ? '' : ' LIMIT ' . $limitstart . ',' . $limit; + $sql .= empty($limit) ? '' : ' LIMIT ' . intval($limitstart) . ',' . intval($limit); return $db->selectExpObjects($this->tablename, $sql, $this->classname); } elseif (strcasecmp($range, 'first') == 0) { $sql .= ' LIMIT 0,1'; diff --git a/framework/modules/events/controllers/eventController.php b/framework/modules/events/controllers/eventController.php index 35e95c7e71..4614935776 100644 --- a/framework/modules/events/controllers/eventController.php +++ b/framework/modules/events/controllers/eventController.php @@ -1,1773 +1,1774 @@ -<?php - -################################################## -# -# Copyright (c) 2004-2016 OIC Group, Inc. -# -# This file is part of Exponent -# -# Exponent is free software; you can redistribute -# it and/or modify it under the terms of the GNU -# General Public License as published by the Free -# Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# GPL: http://www.gnu.org/licenses/gpl.txt -# -################################################## - -/** - * @subpackage Controllers - * @package Modules - */ - -class eventController extends expController { -// public $basemodel_name = 'event'; - public $useractions = array( - 'showall' => 'Show Calendar', - ); -// public $codequality = 'beta'; - - public $remove_configs = array( - 'comments', - 'ealerts', -// 'facebook', - 'files', - 'pagination', - 'rss', -// 'twitter', - ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - - static function displayname() { - return "Events"; - } - - static function description() { - return "Manage events and schedules, and optionally publish them."; - } - - static function author() { - return "Dave Leffler"; - } - - static function isSearchable() { - return true; - } - - function searchName() { - return gt("Calendar Event"); - } - - function searchCategory() { - return gt('Event'); - } - - /** - * can this module import data? - * - * @return bool - */ - public static function canImportData() { - return true; - } - - function showall() { - global $user; - - expHistory::set('viewable', $this->params); - $locsql = $this->aggregateWhereClause(); - $time = (isset($this->params['time']) ? $this->params['time'] : time()); - assign_to_template(array( - 'time' => $time, - 'daynames' => event::dayNames(), - )); - - $regcolor = !empty($this->config['registrations_color']) ? $this->config['registrations_color'] : null; - - $ed = new eventdate(); - $viewtype = 'default'; - $viewrange = 'all'; - $view = !empty($this->params['view']) ? $this->params['view'] : 'showall'; - switch ($view) { - case 'showall_Administration': - $viewtype = "administration"; - break; - case 'showall_Past Events': - $viewrange = "past"; - break; - case 'showall_Monthly Summary': - case 'showall_Mini-Calendar': - case 'minical': - $viewtype = "minical"; - break; - case 'showall_Monthly List': - case 'showall_List': - case 'monthlist': - $viewtype = "byday"; - $viewrange = "month"; - break; - case 'showall_Week': - case 'week': - $viewtype = "byday"; - $viewrange = "week"; - break; - case 'showall_Day': - case 'day': - $viewtype = "byday"; - $viewrange = "day"; - break; - case 'showall_announcement': - case 'showall_Upcoming Events': - case 'showall_Upcoming Events - Headlines': - $viewrange = "upcoming"; - break; - case 'showall': - case 'month': - $viewtype = "monthly"; - break; - default : - $view_params = explode('_',$view); - if (!empty($view_params[1])) $viewtype = $view_params[1]; - if (!empty($view_params[2])) $viewrange = $view_params[2]; - } // end switch $view - - switch ($viewtype) { - case "minical": - $monthly = expDateTime::monthlyDaysTimestamp($time); - $info = getdate($time); - $timefirst = mktime(0, 0, 0, $info['mon'], 1, $info['year']); - $now = getdate(time()); - $currentday = $now['mday']; - $endofmonth = date('t', $time); - foreach ($monthly as $weekNum => $week) { - foreach ($week as $dayNum => $day) { - if ($dayNum == $now['mday']) { - $currentweek = $weekNum; - } - if ($dayNum <= $endofmonth) { -// $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $db->countObjects("eventdate", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; - $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $ed->find("count", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; - } - } - } - $prevmonth = mktime(0, 0, 0, date("m", $timefirst) - 1, date("d", $timefirst) + 10, date("Y", $timefirst)); - $nextmonth = mktime(0, 0, 0, date("m", $timefirst) + 1, date("d", $timefirst) + 10, date("Y", $timefirst)); - assign_to_template(array( - "monthly" => $monthly, - "currentweek" => $currentweek, - "currentday" => $currentday, - "now" => $timefirst, - "prevmonth" => $prevmonth, - "thismonth" => $timefirst, - "nextmonth" => $nextmonth, - )); - break; // end switch $viewtype minicalendar - case "byday": //note aggregates events by groups of days - // Remember this is the code for weekly view and monthly listview - // Test your fixes on both views - // $startperiod = 0; - // $totaldays = 0; - switch ($viewrange) { - case "day": - $startperiod = expDateTime::startOfDayTimestamp($time); - $totaldays = 1; - $next = expDateTime::endOfDayTimestamp($startperiod); - if (!empty($this->config['starttype'])) $startperiod = $time; - $this->params['time'] = $time; - assign_to_template(array( - "prev_timestamp3" => strtotime('-3 days', $startperiod), - "prev_timestamp2" => strtotime('-2 days', $startperiod), - "prev_timestamp" => strtotime('-1 days', $startperiod), - "next_timestamp" => strtotime('+1 days', $startperiod), - "next_timestamp2" => strtotime('+2 days', $startperiod), - "next_timestamp3" => strtotime('+3 days', $startperiod), - 'params' => $this->params - )); - break; - case "week": - $startperiod = expDateTime::startOfWeekTimestamp($time); - $totaldays = 7; - $next = strtotime('+7 days', $startperiod); -// $next = expDateTime::endOfWeekTimestamp($startperiod); - if (!empty($this->config['starttype'])) $startperiod = $time; - $this->params['time'] = $time; - assign_to_template(array( - "prev_timestamp3" => strtotime('-21 days', $startperiod), - "prev_timestamp2" => strtotime('-14 days', $startperiod), - "prev_timestamp" => strtotime('-7 days', $startperiod), - "next_timestamp" => $next, - "next_timestamp2" => strtotime('+14 days', $startperiod), - "next_timestamp3" => strtotime('+21 days', $startperiod), - 'params' => $this->params - )); - break; - case "twoweek": - $startperiod = expDateTime::startOfWeekTimestamp($time); - $totaldays = 14; - $next = strtotime('+14 days', $startperiod); - if (!empty($this->config['starttype'])) $startperiod = $time; - assign_to_template(array( - "prev_timestamp3" => strtotime('-42 days', $startperiod), - "prev_timestamp2" => strtotime('-28 days', $startperiod), - "prev_timestamp" => strtotime('-14 days', $startperiod), - "next_timestamp" => $next, - "next_timestamp2" => strtotime('+28 days', $startperiod), - "next_timestamp3" => strtotime('+42 days', $startperiod), - )); - break; - case "month": - default: // range = month - $startperiod = expDateTime::startOfMonthTimestamp($time); - $totaldays = date('t', $time); - $next = strtotime('+1 months', $startperiod); -// $next = expDateTime::endOfMonthTimestamp($startperiod); - $this->params['time'] = $time; - assign_to_template(array( - "prev_timestamp3" => strtotime('-3 months', $startperiod), - "prev_timestamp2" => strtotime('-2 months', $startperiod), - "prev_timestamp" => strtotime('-1 months', $startperiod), - "next_timestamp" => $next, - "next_timestamp2" => strtotime('+2 months', $startperiod), - "next_timestamp3" => strtotime('+3 months', $startperiod), - 'params' => $this->params - )); - break; - } // end switch $viewrange - - // $days = array(); - // added per Ignacio - // $endofmonth = date('t', $time); - $extitems = $this->getExternalEvents($startperiod, $next); - if (!empty($this->config['aggregate_registrations'])) - $regitems = eventregistrationController::getRegEventsForDates($startperiod, $next, $regcolor); - for ($i = 1; $i <= $totaldays; $i++) { - // $info = getdate($time); - // switch ($viewrange) { - // case "week": - // $start = mktime(0,0,0,$info['mon'],$i,$info['year']); //FIXME this can't be right? - // break; - // case "twoweek": - //// $start = mktime(0,0,0,$info['mon'],$info['mday']+($i-1),$info['year']); //FIXME this can't be right? - // $start = $startperiod + ($i*86400); - // break; - // default: // range = month - // $start = mktime(0,0,0,$info['mon'],$i,$info['year']); - // } - $start = expDateTime::startOfDayTimestamp($startperiod + ($i * 86400) - 86400); - $edates = $ed->find("all", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start)); -// $days[$start] = $this->getEventsForDates($edates, true, isset($this->config['only_featured']) ? true : false); - $days[$start] = $this->event->getEventsForDates($edates, true, isset($this->config['only_featured']) ? true : false); - // for ($j = 0; $j < count($days[$start]); $j++) { - // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$days[$start][$j]->id); - // $days[$start][$j]->permissions = array( - // "manage"=>(expPermissions::check("manage",$thisloc) || expPermissions::check("manage",$this->loc)), - // "edit"=>(expPermissions::check("edit",$thisloc) || expPermissions::check("edit",$this->loc)), - // "delete"=>(expPermissions::check("delete",$thisloc) || expPermissions::check("delete",$this->loc)) - // ); - // } - if (!empty($extitems[$start])) - $days[$start] = array_merge($extitems[$start], $days[$start]); - if (!empty($regitems[$start])) - $days[$start] = array_merge($regitems[$start], $days[$start]); - $days[$start] = expSorter::sort(array('array' => $days[$start], 'sortby' => 'eventstart', 'order' => 'ASC')); - } - assign_to_template(array( - "time" => $startperiod, - 'days' => $days, - "now" => $startperiod, - )); - break; // end switch $viewtype byday - case "monthly": //note this is a simply array of events for the requested month - // build a month array of weeks with an array of days - // $monthly = array(); - // $counts = array(); - $info = getdate($time); - $nowinfo = getdate(time()); - if ($info['mon'] != $nowinfo['mon']) $nowinfo['mday'] = -10; - // Grab non-day numbers only (before end of month) -// $week = 0; - $currentweek = -1; - $timefirst = mktime(0, 0, 0, $info['mon'], 1, $info['year']); - $week = (int)date('W',$timefirst); - if ($week >= 52 && $info['mon'] == 1) $week = 1; - $infofirst = getdate($timefirst); - $monthly[$week] = array(); // initialize for non days - $counts[$week] = array(); - if (($infofirst['wday'] == 0) && (DISPLAY_START_OF_WEEK == 1)) { - for ($i = -6; $i < (1 - DISPLAY_START_OF_WEEK); $i++) { - $monthly[$week][$i] = array(); - $counts[$week][$i] = -1; - } - $weekday = $infofirst['wday'] + 7; // day number in grid. if 7+, switch weeks - } else { - for ($i = 1 - $infofirst['wday']; $i < (1 - DISPLAY_START_OF_WEEK); $i++) { - $monthly[$week][$i] = array(); - $counts[$week][$i] = -1; - } - $weekday = $infofirst['wday']; // day number in grid. if 7+, switch weeks - } - // Grab day counts - $endofmonth = date('t', $time); - $extitems = $this->getExternalEvents($timefirst, expDateTime::endOfMonthTimestamp($timefirst)); - if (!empty($this->config['aggregate_registrations'])) - $regitems = eventregistrationController::getRegEventsForDates($timefirst, expDateTime::endOfMonthTimestamp($timefirst), $regcolor); - for ($i = 1; $i <= $endofmonth; $i++) { - $start = mktime(0, 0, 0, $info['mon'], $i, $info['year']); - if ($i == $nowinfo['mday']) $currentweek = $week; - $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start) . ")"); -// $monthly[$week][$i] = $this->getEventsForDates($dates, true, isset($this->config['only_featured']) ? true : false); - $monthly[$week][$i] = $this->event->getEventsForDates($dates, true, isset($this->config['only_featured']) ? true : false); - if (!empty($extitems[$start])) - $monthly[$week][$i] = array_merge($extitems[$start], $monthly[$week][$i]); - if (!empty($regitems[$start])) - $monthly[$week][$i] = array_merge($regitems[$start], $monthly[$week][$i]); - $monthly[$week][$i] = expSorter::sort(array('array' => $monthly[$week][$i], 'sortby' => 'eventstart', 'order' => 'ASC')); - $counts[$week][$i] = count($monthly[$week][$i]); - if ($weekday >= (6 + DISPLAY_START_OF_WEEK)) { - $week++; - $monthly[$week] = array(); // allocate an array for the next week - $counts[$week] = array(); - $weekday = DISPLAY_START_OF_WEEK; - } else $weekday++; - } - // Grab non-day numbers only (after end of month) - for ($i = 1; $weekday && $i < (8 + DISPLAY_START_OF_WEEK - $weekday); $i++) { - $monthly[$week][$i + $endofmonth] = array(); - $counts[$week][$i + $endofmonth] = -1; - } - $this->params['time'] = $time; - assign_to_template(array( - "currentweek" => $currentweek, - "monthly" => $monthly, - "counts" => $counts, - "prevmonth3" => strtotime('-3 months', $timefirst), - "prevmonth2" => strtotime('-2 months', $timefirst), - "prevmonth" => strtotime('-1 months', $timefirst), - "nextmonth" => strtotime('+1 months', $timefirst), - "nextmonth2" => strtotime('+2 months', $timefirst), - "nextmonth3" => strtotime('+3 months', $timefirst), - "now" => $timefirst, - "today" => expDateTime::startOfDayTimestamp(time()), - 'params' => $this->params - )); - break; // end switch $viewtype monthly - case "administration": //note a simple list of all upcoming events, except no external nor registration events - // Check perms and return if cant view - if (!$user) return; - $continue = (expPermissions::check("manage", $this->loc) || - expPermissions::check("create", $this->loc) || - expPermissions::check("edit", $this->loc) || - expPermissions::check("delete", $this->loc) - ) ? 1 : 0; - $dates = $ed->find("all", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp(time())); -// $items = $this->getEventsForDates($dates); - $items = $this->event->getEventsForDates($dates); - // if (!$continue) { - // foreach ($items as $i) { - // $iloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$i->id); - // if (expPermissions::check("edit",$iloc) || - // expPermissions::check("delete",$iloc) || - // expPermissions::check("manage",$iloc) - // ) { - // $continue = true; - // } - // } - // } - if (!$continue) return; - // for ($i = 0; $i < count($items); $i++) { - // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$items[$i]->id); - // // if ($user && $items[$i]->poster == $user->id) $canviewapproval = 1; - // $items[$i]->permissions = array( - // "manage"=>(expPermissions::check("manage",$thisloc) || expPermissions::check("manage",$this->loc)), - // "edit"=>(expPermissions::check("edit",$thisloc) || expPermissions::check("edit",$this->loc)), - // "delete"=>(expPermissions::check("delete",$thisloc) || expPermissions::check("delete",$this->loc)) - // ); - // } - $items = expSorter::sort(array('array' => $items, 'sortby' => 'eventstart', 'order' => 'ASC')); - assign_to_template(array( - 'items' => $items, - )); - break; // end switch $viewtype administration - case "default": //note a simple list of events based on $viewrange - default; - // $items = null; - // $dates = null; - $day = expDateTime::startOfDayTimestamp(time()); - $sort_asc = true; // For the getEventsForDates call - // $moreevents = false; - switch ($viewrange) { - case "upcoming": // events in the future - if (!empty($this->config['enable_ical']) && !empty($this->config['rss_limit']) && $this->config['rss_limit'] > 0) { - $eventlimit = " AND date <= " . ($day + ($this->config['rss_limit'] * 86400)); - } else { - $eventlimit = ""; - } - $dates = $ed->find("all", $locsql . " AND date >= " . $day . $eventlimit . " ORDER BY date ASC "); - $begin = $day; - $end = null; - // $moreevents = count($dates) < $db->countObjects("eventdate",$locsql." AND date >= $day"); - break; - case "past": // events in the past - $dates = $ed->find("all", $locsql . " AND date < $day ORDER BY date DESC "); - // $moreevents = count($dates) < $db->countObjects("eventdate",$locsql." AND date < $day"); - $sort_asc = false; - $begin = null; - $end = $day; - break; - case "today": // events occuring today - $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($day) . " AND date <= " . expDateTime::endOfDayTimestamp($day) . ")"); - $begin = $day; - $end = expDateTime::endOfDayTimestamp($day); - break; - case "day": // events for a specific day (same as byday day?) - $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($time) . " AND date <= " . expDateTime::endOfDayTimestamp($time) . ")"); - $begin = expDateTime::startOfDayTimestamp($time); - $end = expDateTime::endOfDayTimestamp($time); - break; - case "next": // future events - $dates = array($ed->find("all", $locsql . " AND date >= $time")); - $begin = expDateTime::startOfDayTimestamp($time); - $end = null; - break; - case "month": // events for a specific month (same as monthly?) -// $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp(time()) . " AND date <= " . expDateTime::endOfMonthTimestamp(time()) . ")"); - $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp($time) . " AND date <= " . expDateTime::endOfMonthTimestamp($time) . ")"); - $begin = expDateTime::startOfMonthTimestamp($time); - $end = expDateTime::endOfMonthTimestamp($time); - break; - case "all": // all events - default; - $dates = $ed->find("all", $locsql); - $begin = null; - $end = null; - } -// $items = $this->getEventsForDates($dates, $sort_asc, isset($this->config['only_featured']) ? true : false, true); - $items = $this->event->getEventsForDates($dates, $sort_asc, isset($this->config['only_featured']) ? true : false, true); - if ($viewrange != 'past') { - $extitems = $this->getExternalEvents($begin, $end); - // we need to flatten these down to simple array of events - $extitem = array(); - foreach ($extitems as $days) { - foreach ($days as $event) { - if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time())) - break; - if (empty($event->eventstart)) - $event->eventstart = $event->eventdate->date; - $extitem[] = $event; - } - } - $items = array_merge($items, $extitem); - - if (!empty($this->config['aggregate_registrations'])) - $regitems = eventregistrationController::getRegEventsForDates($begin, $end, $regcolor); - // we need to flatten these down to simple array of events - $regitem = array(); - if (!empty($regitems)) foreach ($regitems as $days) { - foreach ($days as $value) { - $regitem[] = $value; - } - } - $items = array_merge($items, $regitem); - - // remove today's events that have already ended - if ($viewtype == 'default' && $viewrange == 'upcoming') { - foreach ($items as $key=>$item) { - if (!$item->is_allday && $item->eventend < time()) { - //fixme we've left events ending earlier in the day, but already cancelled out tomorrow's event - unset($items[$key]); - } else { - break; // they are chronological so we can end - } - } - } - } - $items = expSorter::sort(array('array' => $items, 'sortby' => 'eventstart', 'order' => 'ASC')); - // Upcoming events can be configured to show a specific number of events. - // The previous call gets all events in the future from today - // If configured, cut the array to the configured number of events - // if ($template->viewconfig['num_events']) { - // switch ($viewrange) { - // case "upcoming": - // case "past": - // $moreevents = $template->viewconfig['num_events'] < count($items); - // break; - // } - // $items = array_slice($items, 0, $template->viewconfig['num_events']); - // } - // for ($i = 0; $i < count($items); $i++) { - // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$items[$i]->id); - // $items[$i]->permissions = array( - // 'manage'=>(expPermissions::check('manage',$thisloc) || expPermissions::check('manage',$this->loc)), - // 'edit'=>(expPermissions::check('edit',$thisloc) || expPermissions::check('edit',$this->loc)), - // 'delete'=>(expPermissions::check('delete',$thisloc) || expPermissions::check('delete',$this->loc)) - // ); - // } - assign_to_template(array( - 'items' => $items, - "now" => $day, - )); - } - } - - /** - * default view for individual item - */ - function show() { - expHistory::set('viewable', $this->params); - if (!empty($this->params['date_id'])) { // specific event instance - $eventdate = new eventdate($this->params['date_id']); - $eventdate->event = new event($eventdate->event_id); - } else { // we'll default to the first event of this series - $event = new event($this->params['id']); - $eventdate = new eventdate($event->eventdate[0]->id); - } - if (empty($eventdate->id)) - redirect_to(array('controller'=>'notfound','action'=>'page_not_found','title'=>'event')); - - if (!empty($eventdate->event->feedback_form) && $eventdate->event->feedback_form != 'Disallow Feedback') { - assign_to_template(array( - 'feedback_form' => $eventdate->event->feedback_form, - )); - } - - assign_to_template(array( - 'event' => $eventdate, - )); - } - - function edit() { - global $template; - - parent::edit(); - $allforms = array(); - $allforms[""] = gt('Disallow Feedback'); - // calculate which event date is the one being edited - $event_key = 0; - foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) { - if ($d->id == $this->params['date_id']) $event_key = $key; - } - - assign_to_template(array( - 'allforms' => array_merge($allforms, expTemplate::buildNameList("forms", "event/email", "tpl", "[!_]*")), - 'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null, - 'event_key' => $event_key, - )); - } - - /** - * Delete a recurring event by asking for which event dates to delete - * - */ - function delete_recurring() { - $item = $this->event->find('first', 'id=' . $this->params['id']); - if ($item->is_recurring == 1) { // need to give user options - expHistory::set('editable', $this->params); - assign_to_template(array( - 'checked_date' => $this->params['date_id'], - 'event' => $item, - )); - } else { // Process a regular delete - $item->delete(); - } - } - - /** - * Delete selected event dates for a recurring event and event if all event dates deleted - * - */ - function delete_selected() { - $item = $this->event->find('first', 'id=' . $this->params['id']); - if ($item && $item->is_recurring == 1) { - $event_remaining = false; - $eventdates = $item->eventdate[0]->find('all', 'event_id=' . $item->id); - foreach ($eventdates as $ed) { - if (array_key_exists($ed->id, $this->params['dates'])) { - $ed->delete(); - } else { - $event_remaining = true; - } - } - if (!$event_remaining) { - $item->delete(); // model will also ensure we delete all event dates - } - expHistory::back(); - } else { - notfoundController::handle_not_found(); - } - } - - function delete_all_past() { - $locsql = $this->aggregateWhereClause(); - $ed = new eventdate(); - $dates = $ed->find("all", $locsql . " AND date < " . strtotime('-1 months', time())); - foreach ($dates as $date) { - $date->delete(); // event automatically deleted if all assoc eventdates are deleted - } - expHistory::back(); - } - - /** - * get the metainfo for this module - * @return array - */ - function metainfo() { - global $router; - - $action = $router->params['action']; - $metainfo = array('title' => '', 'keywords' => '', 'description' => '', 'canonical'=> '', 'noindex' => false, 'nofollow' => false); - // look for event date_id which expController::metainfo won't detect -// if (!empty($router->params['action']) && $router->params['action'] == 'show' && !isset($router->params['id']) && isset($router->params['date_id'])) { - switch ($action) { - case 'show': - if (!isset($router->params['id']) && isset($router->params['date_id'])) { - // look up the record. - $object = new eventdate((int)$router->params['date_id']); - // set the meta info - if (!empty($object)) { - if (!empty($object->event->body)) { - $desc = str_replace('"',"'",expString::summarize($object->event->body,'html','para')); - } else { - $desc = SITE_DESCRIPTION; - } - if (!empty($object->expTag)) { - $keyw = ''; - foreach ($object->expTag as $tag) { - if (!empty($keyw)) $keyw .= ', '; - $keyw .= $tag->title; - } - } else { - $keyw = SITE_KEYWORDS; - } - $metainfo['title'] = empty($object->event->meta_title) ? $object->event->title : $object->event->meta_title; - $metainfo['keywords'] = empty($object->event->meta_keywords) ? $keyw : $object->event->meta_keywords; - $metainfo['description'] = empty($object->event->meta_description) ? $desc : $object->event->meta_description; - $metainfo['canonical'] = empty($object->event->canonical) ? $router->plainPath() : $object->event->canonical; - $metainfo['noindex'] = empty($object->event->meta_noindex) ? false : $object->event->meta_noindex; - $metainfo['nofollow'] = empty($object->event->meta_nofollow) ? false : $object->event->meta_nofollow; - return $metainfo; - break; - } - } - default: - return parent::metainfo(); - } - } - - /** - * function to build a string to pull in all events within requested date range - */ - function build_daterange_sql($timestamp, $endtimestamp=null, $field='date', $multiday=false) { - if (empty($endtimestamp)) { - $date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($timestamp) . ")"; - } else { - $date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($endtimestamp) . ")"; - } - if ($multiday) - $date_sql .= " OR (" . expDateTime::startOfDayTimestamp($timestamp) . " BETWEEN ".$field." AND dateFinished)"; - $date_sql .= ")"; - return $date_sql; - } - - function send_feedback() { - $success = false; - if (isset($this->params['id'])) { - $ed = new eventdate($this->params['id']); -// $email_addrs = array(); - if ($ed->event->feedback_email != '') { - $msgtemplate = expTemplate::get_template_for_action($this, 'email/_' . $this->params['formname'], $this->loc); - $msgtemplate->assign('params', $this->params); - $msgtemplate->assign('event', $ed); - $email_addrs = explode(',', $ed->event->feedback_email); - //This is an easy way to remove duplicates - $email_addrs = array_flip(array_flip($email_addrs)); - $email_addrs = array_map('trim', $email_addrs); - $mail = new expMail(); - $success += $mail->quickSend(array( - "text_message" => $msgtemplate->render(), - 'to' => $email_addrs, - 'from' => !empty($this->params['email']) ? $this->params['email'] : trim(SMTP_FROMADDRESS), - 'subject' => $this->params['subject'], - )); - } - } - - if ($success) { - flashAndFlow('message', gt('Your feedback was successfully sent.')); - } else { - flashAndFlow('error', gt('We could not send your feedback. Please contact your administrator.')); - } - } - - function ical() { - if (isset($this->params['date_id']) || isset($this->params['title']) || isset($this->params['src'])) { - $cfg = new expConfig(); - $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs - foreach ($configs as $config) { - $loc = expUnserialize($config->location_data); - if (!empty($this->params['title'])) { - if ($this->params['title'] == $config->config['feed_sef_url']) { - $this->config = $config->config; - break; - } - } elseif (!empty($this->params['src'])) { - if ($this->params['src'] == $loc->src) { - $this->config = $config->config; - break; - } - } - } - $this->loc = $loc; - - if ($this->config['enable_ical']) { - $ed = new eventdate(); - if (isset($this->params['date_id'])) { // get single specific event only -// $dates = array($db->selectObject("eventdate","id=".$this->params['date_id'])); - $dates = $ed->find('first', "id=" . $this->params['date_id']); - $Filename = "Event-" . $this->params['date_id']; - } else { - $locsql = $this->aggregateWhereClause(); - - $day = expDateTime::startOfDayTimestamp(time()); - if (!empty($this->config['enable_ical']) && isset($this->config['rss_limit']) && ($this->config['rss_limit'] > 0)) { - $rsslimit = " AND date <= " . ($day + ($this->config['rss_limit'] * 86400)); - } else { - $rsslimit = ""; - } - - if (isset($this->params['time'])) { - $time = $this->params['time']; // get current month's events -// $dates = $db->selectObjects("eventdate",$locsql." AND (date >= ".expDateTime::startOfMonthTimestamp($time)." AND date <= ".expDateTime::endOfMonthTimestamp($time).")"); - $dates = $ed->find('all', $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp($time) . " AND date <= " . expDateTime::endOfMonthTimestamp($time) . ")"); - } else { - $time = date('U', strtotime("midnight -1 month", time())); // previous month also -// $dates = $db->selectObjects("eventdate",$locsql." AND date >= ".expDateTime::startOfDayTimestamp($time).$rsslimit); - $dates = $ed->find('all', $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($time) . $rsslimit); - } - // $title = $db->selectValue('container', 'title', "internal='".serialize($loc)."'"); - $title = $this->config['feed_title']; - $Filename = preg_replace('/\s+/', '', $title); // without whitespace - } - - if (!function_exists("quoted_printable_encode")) { // function added in php v5.3.0 - function quoted_printable_encode($input, $line_max = 75) { - $hex = array('0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); - $lines = preg_split("/(?:\r\n|\r|\n)/", $input); - $linebreak = "=0D=0A=\r\n"; - /* the linebreak also counts as characters in the mime_qp_long_line - * rule of spam-assassin */ - $line_max = $line_max - strlen($linebreak); - $escape = "="; - $output = ""; - $cur_conv_line = ""; - $length = 0; - $whitespace_pos = 0; - $addtl_chars = 0; - - // iterate lines - for ($j = 0, $jMax = count($lines); $j < $jMax; $j++) { - $line = $lines[$j]; - $linlen = strlen($line); - - // iterate chars - for ($i = 0; $i < $linlen; $i++) { - $c = substr($line, $i, 1); - $dec = ord($c); - - $length++; - - if ($dec == 32) { - // space occurring at end of line, need to encode - if (($i == ($linlen - 1))) { - $c = "=20"; - $length += 2; - } - - $addtl_chars = 0; - $whitespace_pos = $i; - } elseif (($dec == 61) || ($dec < 32) || ($dec > 126)) { - $h2 = floor($dec / 16); - $h1 = floor($dec % 16); - $c = $escape . $hex["$h2"] . $hex["$h1"]; - $length += 2; - $addtl_chars += 2; - } - - // length for wordwrap exceeded, get a newline into the text - if ($length >= $line_max) { - $cur_conv_line .= $c; - - // read only up to the whitespace for the current line - $whitesp_diff = $i - $whitespace_pos + $addtl_chars; - - /* the text after the whitespace will have to be read - * again ( + any additional characters that came into - * existence as a result of the encoding process after the whitespace) - * - * Also, do not start at 0, if there was *no* whitespace in - * the whole line */ - if (($i + $addtl_chars) > $whitesp_diff) { - $output .= substr($cur_conv_line, 0, (strlen($cur_conv_line) - - $whitesp_diff)) . $linebreak; - $i = $i - $whitesp_diff + $addtl_chars; - } else { - $output .= $cur_conv_line . $linebreak; - } - - $cur_conv_line = ""; - $length = 0; - $whitespace_pos = 0; - } else { - // length for wordwrap not reached, continue reading - $cur_conv_line .= $c; - } - } // end of for - - $length = 0; - $whitespace_pos = 0; - $output .= $cur_conv_line; - $cur_conv_line = ""; - - if ($j <= count($lines) - 1) { - $output .= $linebreak; - } - } // end for - - return trim($output); - } // end quoted_printable_encode - } - - $tz = DISPLAY_DEFAULT_TIMEZONE; - $msg = "BEGIN:VCALENDAR\n"; - $msg .= "VERSION:2.0\n"; // version for iCalendar files vs vCalendar files - $msg .= "CALSCALE:GREGORIAN\n"; - $msg .= "METHOD: PUBLISH\n"; - $msg .= "PRODID:<-//ExponentCMS//EN>\n"; - if (isset($this->config['rss_cachetime']) && ($this->config['rss_cachetime'] > 0)) { - $msg .= "X-PUBLISHED-TTL:PT" . $this->config['rss_cachetime'] . "M\n"; - } - $msg .= "X-WR-CALNAME:$Filename\n"; - -// $items = $this->getEventsForDates($dates); - $items = $this->event->getEventsForDates($dates); - - for ($i = 0, $iMax = count($items); $i < $iMax; $i++) { - - // Convert events stored in local time to GMT - $eventstart = new DateTime(date('r', $items[$i]->eventstart), new DateTimeZone($tz)); - $eventstart->setTimezone(new DateTimeZone('GMT')); - $eventend = new DateTime(date('r', $items[$i]->eventend), new DateTimeZone($tz)); - $eventend->setTimezone(new DateTimeZone('GMT')); - if ($items[$i]->is_allday) { - $dtstart = "DTSTART;VALUE=DATE:" . date("Ymd", $items[$i]->eventstart) . "\n"; - $dtend = "DTEND;VALUE=DATE:" . date("Ymd", strtotime("midnight +1 day", $items[$i]->eventstart)) . "\n"; - } else { - $dtstart = "DTSTART;VALUE=DATE-TIME:" . $eventstart->format("Ymd\THi00") . "Z\n"; - if ($items[$i]->eventend) { - $dtend = "DTEND;VALUE=DATE-TIME:" . $eventend->format("Ymd\THi00") . "Z\n"; - } else { - $dtend = "DTEND;VALUE=DATE-TIME:" . $eventstart->format("Ymd\THi00") . "Z\n"; - } - } - - $body = trim(strip_tags(str_replace(array("<br />", "<br>", "br/>", "</p>"), "\n", $items[$i]->body))); - if ($items[$i]->is_cancelled) $body = gt('This Event Has Been Cancelled') . ' - ' . $body; - $body = str_replace(array("\r"), "", $body); - $body = str_replace(array("&#160;"), " ", $body); - $body = expString::convertSmartQuotes($body); - if (!isset($this->params['style'])) { - // it's going to Outlook so remove all formatting from body text - $body = quoted_printable_encode($body); - } elseif ($this->params['style'] == "g") { - // It's going to Google (doesn't like quoted-printable, but likes html breaks) - $body = str_replace(array("\n"), "<br />", $body); - } else { - // It's going elsewhere (doesn't like quoted-printable) - $body = str_replace(array("\n"), " -- ", $body); - } - $title = $items[$i]->title; - - $msg .= "BEGIN:VEVENT\n"; - $msg .= $dtstart . $dtend; - $msg .= "UID:" . $items[$i]->date_id . "\n"; - $msg .= "DTSTAMP:" . date("Ymd\THis", time()) . "Z\n"; - if ($title) { - $msg .= "SUMMARY:$title\n"; - } - if ($body) { - $msg .= "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" . $body . "\n"; - } - // if($link_url) { $msg .= "URL: $link_url\n";} - if (!empty($this->config['usecategories'])) { - if (!empty($items[$i]->expCat[0]->title)) { - $msg .= "CATEGORIES:".$items[$i]->expCat[0]->title."\n"; - } else { - $msg .= "CATEGORIES:".$this->config['uncat']."\n"; - } - } - $msg .= "END:VEVENT\n"; - } - $msg .= "END:VCALENDAR"; - - // Kick it out as a file download - ob_end_clean(); - - // $mime_type = (EXPONENT_USER_BROWSER == 'IE' || EXPONENT_USER_BROWSER == 'OPERA') ? 'application/octet-stream;' : "text/x-vCalendar"; - // $mime_type = "text/x-vCalendar"; - $mime_type = 'text/Calendar'; - header('Content-Type: ' . $mime_type); - header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - header('Content-length: ' . strlen($msg)); - header('Content-Transfer-Encoding: binary'); - header('Content-Encoding:'); - // header("Content-Disposition: inline; filename=".$Filename.".ics"); - header('Content-Disposition: attachment; filename="' . $Filename . '.ics"'); - // IE need specific headers - // if (EXPONENT_USER_BROWSER == 'IE') { - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: public'); - header('Vary: User-Agent'); - // } else { - header('Pragma: no-cache'); - // } - echo $msg; - exit(); - } else { - notfoundController::handle_not_found(); - } - } else { - notfoundController::handle_not_found(); - } - } - - function send_reminders() { - if (isset($this->params['title']) || isset($this->params['src'])) { - $cfg = new expConfig(); - $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs - foreach ($configs as $config) { - $loc = expUnserialize($config->location_data); - if (!empty($this->params['title'])) { - if ($this->params['title'] == $config->config['feed_sef_url']) { - $this->config = $config->config; - break; - } - } elseif (!empty($this->params['src'])) { - if ($this->params['src'] == $loc->src) { - $this->config = $config->config; - break; - } - } - } - - if (empty($this->config['reminder_active'])) { - notfoundController::handle_not_found(); - return; - } - if (!empty($this->config['reminder_code']) && (empty($this->params['code']) || ($this->params['code'] != $this->config['reminder_code']))) { - notfoundController::handle_not_authorized(); - return; - } - - $this->loc = $loc; - $locsql = $this->aggregateWhereClause(); - - $view = (isset($this->params['view']) ? $this->params['view'] : ''); - if ($view == "") { - $view = "send_reminders"; // default reminder view - } - -// $template = expTemplate::get_template_for_action($this, $view, $this->loc); - global $template; - - $title = $this->config['feed_title']; - $template->assign('moduletitle', $title); - - $time = (isset($this->params['time']) ? $this->params['time'] : time()); - $time = (int)$time; - - $template->assign("time", $time); - - $startperiod = expDateTime::startOfDayTimestamp($time); - if (!empty($this->params['days'])) { - $totaldays = $this->params['days']; - } else { - $totaldays = 7; // default 7 days of events - } - - $count = 0; - $info = getdate($startperiod); - for ($i = 0; $i < $totaldays; $i++) { - $start = mktime(0, 0, 0, $info['mon'], $info['mday'] + $i, $info['year']); - $ed = new eventdate(); - $edates = $ed->find('all', $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start) . ")"); - $days[$start] = array(); -// $days[$start] = $this->getEventsForDates($edates); - $days[$start] = $this->event->getEventsForDates($edates); - for ($j = 0, $jMax = count($days[$start]); $j < $jMax; $j++) { - $thisloc = expCore::makeLocation($loc->mod, $loc->src, $days[$start][$j]->id); - $days[$start][$j]->permissions = array( - "manage" => (expPermissions::check("manage", $thisloc) || expPermissions::check("manage", $loc)), - "edit" => (expPermissions::check("edit", $thisloc) || expPermissions::check("edit", $loc)), - "delete" => (expPermissions::check("delete", $thisloc) || expPermissions::check("delete", $loc)) - ); - } - $counts[$start] = count($days[$start]); - $count += count($days[$start]); - $days[$start] = expSorter::sort(array('array' => $days[$start], 'sortby' => 'eventstart', 'order' => 'ASC')); - } - $template->assign("days", $days); - $template->assign("counts", $counts); - $template->assign("start", $startperiod); - $template->assign("totaldays", $totaldays); - - if ($count == 0) { - flash('error',gt('No Events to Send!')); - echo show_msg_queue('error'); - return; - } - - if (bs3()) - $css = file_get_contents(BASE . "external/bootstrap3/css/bootstrap.css"); - elseif (bs2()) - $css = file_get_contents(BASE . "external/bootstrap/css/bootstrap.css"); - else - $css = file_get_contents(BASE . "framework/modules/events/assets/css/calendar.css"); - $template->assign("css", $css); - $template->assign("config", $this->config); - $template->assign("src", $loc->src); - - // format and send email - $subject = $this->config['email_title_reminder'] . " - $title"; - $from_addr = $this->config['email_address_reminder']; - $headers = array( - "From" => $from = $this->config['email_from_reminder'], - "Reply-to" => $reply = $this->config['email_reply_reminder'] - ); - - // set up the html message - $template->assign("showdetail", !empty($this->config['email_showdetail'])); - $htmlmsg = $template->render(); - - // now the same thing for the text message - $msg = preg_replace('/(<script[^>]*>.+?<\/script>|<style[^>]*>.+?<\/style>)/s', '', $htmlmsg); // remove any script or style blocks - $msg = trim(strip_tags(str_replace(array("<br />", "<br>", "br/>"), "\n", $msg))); - - // Saved. do notifs - $emails = array(); - if (!empty($this->config['user_list'])) foreach ($this->config['user_list'] as $c) { - $u = user::getUserById($c); - $emails[$u->email] = trim(user::getUserAttribution($u->id)); - } - if (!empty($this->config['group_list'])) foreach ($this->config['group_list'] as $c) { - $grpusers = group::getUsersInGroup($c); - foreach ($grpusers as $u) { - $emails[$u->email] = trim(user::getUserAttribution($u->id)); - } - } - if (!empty($this->config['address_list'])) foreach ($this->config['address_list'] as $c) { - $emails[] = $c; - } - if (empty($emails)) { - flash('error',gt('No One to Send Reminders to!')); - echo show_msg_queue('error'); - return; - } - - $emails = array_flip(array_flip($emails)); - $emails = array_map('trim', $emails); -// $headers = array( -// "MIME-Version" => "1.0", -// "Content-type" => "text/html; charset=" . LANG_CHARSET -// ); - $mail = new expMail(); - $mail->quickSend(array( -// 'headers' => $headers, - 'html_message' => $htmlmsg, - "text_message" => $msg, - 'to' => $emails, - 'from' => array(trim($this->config['email_address_reminder']) => $this->config['email_from_reminder']), - 'subject' => $subject, - )); - - flash('message',gt('The following reminder was sent via email')); - echo show_msg_queue(); -// echo($htmlmsg); - } else { - flash('error',gt('No Calendar Selected!')); - echo show_msg_queue('error'); - } - } - - /** @deprecated moved to event model - * @param $edates - * @param bool $sort_asc - * @param bool $featuredonly - * @param bool $condense - * @return array - */ - function getEventsForDates($edates, $sort_asc = true, $featuredonly = false, $condense = false) { - global $eventid; - - $events = array(); - $featuresql = ""; - if ($featuredonly) $featuresql = " AND is_featured=1"; - foreach ($edates as $edate) { - $evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql); - foreach ($evs as $key=>$event) { - if ($condense) { - $eventid = $event->id; - $multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;')); - if (!empty($multiday_event)) { - unset($evs[$key]); - continue; - } - } - $evs[$key]->eventstart += $edate->date; - $evs[$key]->eventend += $edate->date; - $evs[$key]->date_id = $edate->id; - if (!empty($event->expCat)) { - $catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color); -// if (substr($catcolor,0,1)=='#') $catcolor = '" style="color:'.$catcolor.';'; - $evs[$key]->color = $catcolor; - } - } - if (count($events) < 500) { // magic number to not crash loop? - $events = array_merge($events, $evs); - } else { -// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'); -// $events = array_merge($events, $evs); - flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!')); - break; // keep from breaking system by too much data - } - } - $events = expSorter::sort(array('array' => $events, 'sortby' => 'eventstart', 'order' => $sort_asc ? 'ASC' : 'DESC')); - return $events; - } - - function getExternalEvents($startdate, $enddate, $multiday = false) { - global $db; - - $extevents = array(); - $dy = 0; // index of events array - if (!empty($this->config['pull_gcal'])) foreach ($this->config['pull_gcal'] as $key=>$extgcalurl) { -// $dy = count($extevents); // index of events array - $cache_hit = false; - $gcal_cname = str_replace(array("/",":","&","?"),"_",$extgcalurl); - $cache_fname = BASE.'tmp/cache/'.$gcal_cname.".cache"; - if (file_exists($cache_fname)) { - $cache = unserialize(file_get_contents($cache_fname)); - if ($startdate >= $cache['start_date'] || $startdate >= $cache['first_date']) { - $events = $db->selectObjects('event_cache','feed="'.$extgcalurl.'" AND ' . self::build_daterange_sql($startdate,$enddate,'eventdate',true)); - foreach ($events as $event) { - if ($multiday) { - $extevents[$event->eventdate][$dy] = $event; - $extevents[$event->eventdate][$dy]->feedkey = $key; - $extevents[$event->eventdate][$dy]->location_data = 'gcalevent' . $key; - $extevents[$event->eventdate][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; - if ($event->is_allday) { - $extevents[$event->eventdate][$dy]->eventstart = $event->eventdate; - } - $dy++; - } else { - $endit = !empty($event->dateFinished) ? $event->dateFinished : $event->eventdate; -// for ($i = $startdate; $i < $enddate; $i += 86400) { - for ($i = $event->eventdate; $i <= $endit; $i += 86400) { - if ((!empty($event->dateFinished) && $i > $event->dateFinished) || (empty($event->dateFinished) && $i > $event->eventdate)) { - break; - } else { - $extevents[$i][$dy] = clone($event); - $extevents[$i][$dy]->eventdate = (int)$i; - $extevents[$i][$dy]->eventstart = ($event->eventstart - $event->eventdate); - $extevents[$i][$dy]->eventend = ($event->eventend - (!empty($event->dateFinished)?$event->dateFinished:$event->eventdate)); - $extevents[$i][$dy]->eventstart = ($extevents[$i][$dy]->eventstart) + $i; - $extevents[$i][$dy]->eventend = ($extevents[$i][$dy]->eventend) + $i; - $extevents[$i][$dy]->feedkey = $key; - $extevents[$i][$dy]->location_data = 'gcalevent' . $key; - $extevents[$i][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; - $dy++; - } - } - } - } - $cache_hit = true; - } - } - if (!$cache_hit) { // pull in the external events - foreach ($this->get_gcal_events($extgcalurl, $startdate, $enddate, $dy, $key, $multiday) as $date=>$events) { - foreach ($events as $event) { - $extevents[$date][] = $event; - } - } - } - } - if (!empty($this->config['pull_ical'])) foreach ($this->config['pull_ical'] as $key=>$exticalurl) { -// $dy = count($extevents); // index of events array - $cache_hit = false; - $ical_cname = str_replace(array("/",":","&","?"),"_",$exticalurl); - $cache_fname = BASE.'tmp/cache/'.$ical_cname.".cache"; - if (file_exists($cache_fname)) { - $cache = unserialize(file_get_contents($cache_fname)); - if ($startdate >= $cache['start_date'] || $startdate >= $cache['first_date']) { - $events = $db->selectObjects('event_cache','feed="'.$exticalurl.'" AND ' . self::build_daterange_sql($startdate,$enddate,'eventdate',true)); - foreach ($events as $event) { - $extevents[$event->eventdate][$dy] = $event; - $extevents[$event->eventdate][$dy]->location_data = 'icalevent' . $key; - $extevents[$event->eventdate][$dy]->color = !empty($this->config['pull_ical_color'][$key]) ? $this->config['pull_ical_color'][$key] : null; - $dy++; - } - $cache_hit = true; - } - } - if (!$cache_hit) { // pull in the external events - foreach ($this->get_ical_events($exticalurl, $startdate, $enddate, $dy, $key, $multiday) as $date=>$events) { - foreach ($events as $event) { - $extevents[$date][] = $event; - } - } - } - } - return $extevents; - } - - public function get_gcal_events($extgcalurl, $startdate, $enddate=null, &$dy=0, $key=0, $multiday=false) { - $extevents = array(); - if (!empty($startdate)) $begin = date("Y-m-d\Th:i:sP", expDateTime::startOfDayTimestamp($startdate)); - if (!empty($enddate)) $end = date("Y-m-d\Th:i:sP", expDateTime::endOfDayTimestamp($enddate)); - else $end = date("Y-m-d\Th:i:sP", (expDateTime::endOfDayTimestamp($startdate + ((3600*24)*30)))); - - if (substr($extgcalurl, -5) == 'basic') { - $extgcalurl = substr($extgcalurl, 0, - 5) . 'full'; - } - $feed = $extgcalurl . "?orderby=starttime&singleevents=true"; - if (!empty($startdate)) $feed .= "&start-min=" . $begin; - if (!empty($enddate)) $feed .= "&start-max=" . $end; - - // XML method -// $s = simplexml_load_file($feed); -// foreach ($s->entry as $item) { -// $gd = $item->children('http://schemas.google.com/g/2005'); -// if (!empty($gd->when)) { -// $dtstart = $gd->when->attributes()->startTime; -// } elseif (!empty($gd->recurrence)){ -// $dtstart = $gd->recurrence->when->attributes()->startTime; -// } else { -// $dtstart = $item->attributes()->When; -// } -// //FIXME must convert $dtstart timezone -// $eventdate = expDateTime::startOfDayTimestamp(strtotime($dtstart)); -// $ourtzoffsets = (int)(date('O',$eventdate)) * 36; -// $theirtzoffset = -((int)(substr($dtstart,-5,2)) * 3600); -// $tzoffset = $ourtzoffsets - $theirtzoffset; -// $extevents[$eventdate][$dy] = new stdClass(); -// $extevents[$eventdate][$dy]->eventdate = $eventdate; -// $extevents[$eventdate][$dy]->eventstart += strtotime($dtstart) + $tzoffset; -// if (!empty($gd->when)) { -// $dtend = $gd->when->attributes()->endTime; -// } elseif (!empty($gd->recurrence)) { -// $dtend = $gd->recurrence->when->attributes()->endTime; -// } -// //FIXME must convert $dtend timezone -// if (!empty($dtend)) $extevents[$eventdate][$dy]->eventend += strtotime($dtend) + $tzoffset; -// // dtstart required, one occurrence, (orig. start date) -// $extevents[$eventdate][$dy]->title = $item->title; -// $extevents[$eventdate][$dy]->body = $item->content; - // End XML method - - // DOM method - $doc = new DOMDocument(); - $doc->load($feed); - $entries = $doc->getElementsByTagName("entry"); - foreach ($entries as $item) { - $times = $item->getElementsByTagName("when"); - $dtstart = $times->item(0)->getAttributeNode("startTime")->value; - $eventdate = expDateTime::startOfDayTimestamp(strtotime($dtstart)); - $extevents[$eventdate][$dy] = new stdClass(); - $extevents[$eventdate][$dy]->eventdate = $eventdate; - $dtend = @$times->item(0)->getAttributeNode("endTime")->value; - $ourtzoffsets = (int)date('O',$eventdate) * 36; - $theirtzoffset = -((int)substr($dtstart,-5,2) * 3600); - $tzoffset = $ourtzoffsets - $theirtzoffset; - if (strlen($dtstart) > 10) { - $extevents[$eventdate][$dy]->eventstart = ((int)substr($dtstart, 11, 2) * 3600) + ((int)substr($dtstart, 14, 2) * 60) + $tzoffset; -// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventstart += 3600; - $extevents[$eventdate][$dy]->eventend = ((int)substr($dtend, 11, 2) * 3600) + ((int)substr($dtend, 14, 2) * 60) + $tzoffset; -// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventend += 3600; - } else { - $extevents[$eventdate][$dy]->eventstart = null; - $extevents[$eventdate][$dy]->is_allday = 1; - } - $extevents[$eventdate][$dy]->eventstart += $eventdate; - $extevents[$eventdate][$dy]->eventend += $eventdate; - if (empty($dtend)) $extevents[$eventdate][$dy]->eventend = $extevents[$eventdate][$dy]->eventstart; - - $titles = $item->getElementsByTagName("title"); - $extevents[$eventdate][$dy]->title = $titles->item(0)->nodeValue; - $contents = $item->getElementsByTagName("content"); - $extevents[$eventdate][$dy]->body = $contents->item(0)->nodeValue; - // End DOM method - -// $extevents[$eventdate][$dy]->location_data = serialize(expCore::makeLocation('extevent',$extcal->id)); - $extevents[$eventdate][$dy]->location_data = 'gcalevent' . $key; - $extevents[$eventdate][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; - $dy++; - } - return $extevents; - } - - public function get_ical_events($exticalurl, $startdate=null, $enddate=null, &$dy=0, $key=0, $multiday=false) { - $extevents = array(); -// require_once BASE . 'external/iCalcreator.class.php'; - require_once BASE . 'external/iCalcreator-2.22/iCalcreator.php'; - $v = new vcalendar(); // initiate new CALENDAR - if (stripos($exticalurl, 'http') === 0) { - $v->setConfig('url', $exticalurl); - } else { - $v->setConfig('directory', dirname($exticalurl)); - $v->setConfig('filename', basename($exticalurl)); - } - $v->parse(); - if ($startdate === null) { - $startYear = false; - $startMonth = false; - $startDay = false; - } else { - $startYear = date('Y', $startdate); - $startMonth = date('n', $startdate); - $startDay = date('j', $startdate); - } - if ($enddate === null) { - $endYear = $startYear+1; - $endMonth = $startMonth; - $endDay = $startDay; - } else { - $endYear = date('Y', $enddate); - $endMonth = date('n', $enddate); - $endDay = date('j', $enddate); - } - // get all events within period split out recurring events as single events per each day - $eventArray = $v->selectComponents($startYear, $startMonth, $startDay, $endYear, $endMonth, $endDay, 'vevent'); - // Set the timezone to GMT - @date_default_timezone_set('GMT'); - $tzarray = getTimezonesAsDateArrays($v); - // Set the default timezone - @date_default_timezone_set(DISPLAY_DEFAULT_TIMEZONE); - if (!empty($eventArray)) foreach ($eventArray as $year => $yearArray) { - if (!empty($yearArray)) foreach ($yearArray as $month => $monthArray) { - if (!empty($monthArray)) foreach ($monthArray as $day => $dailyEventsArray) { - if (!empty($dailyEventsArray)) foreach ($dailyEventsArray as $vevent) { - // process each event - $yesterday = false; - $currdate = $vevent->getProperty('x-current-dtstart'); - $thisday = explode('-', $currdate[1]); - $thisday2 = substr($thisday[2], 0, 2); - // if member of a recurrence set, - // returns array( 'x-current-dtstart', <DATE>) - // <DATE> = (string) date("Y-m-d [H:i:s][timezone/UTC offset]") - $dtstart = $vevent->getProperty('dtstart', false, true); - $dtend = $vevent->getProperty('dtend', false, true); - if (empty($dtend)) - $dtend = $dtstart; - - // calculate the cumulative timezone offset in seconds to convert to local/system time - $tzoffsets = array(); - $date_tzoffset = 0; - if (!empty($tzarray)) { -// $ourtzoffsets = -(iCalUtilityFunctions::_tz2offset(date('O',time()))); - $ourtzoffsets = -(iCalUtilityFunctions::_tz2offset(date('O',self::_date2timestamp($dtstart['value'])))); - // Set the timezone to GMT - @date_default_timezone_set('GMT'); - if (!empty($dtstart['params']['TZID'])) $tzoffsets = getTzOffsetForDate($tzarray, $dtstart['params']['TZID'], $dtstart['value']); - // Set the default timezone - @date_default_timezone_set(DISPLAY_DEFAULT_TIMEZONE); - if (isset($tzoffsets['offsetSec'])) $date_tzoffset = $ourtzoffsets + $tzoffsets['offsetSec']; - } - if (empty($tzoffsets)) { - $date_tzoffset = -(iCalUtilityFunctions::_tz2offset(date('O',self::_date2timestamp($dtstart['value'])))); - } - //FIXME we must have the real timezone offset for the date by this point - - //FIXME this is for the google ical feed which is bad! - if ($dtstart['value']['day'] != (int)$thisday2 && (isset($dtstart['value']['day']) && isset($dtend['value']['hour']))&& - !((int)$dtstart['value']['hour'] == 0 && (int)$dtstart['value']['min'] == 0 && (int)$dtstart['value']['sec'] == 0 - && (int)$dtend['value']['hour'] == 0 && (int)$dtend['value']['min'] == 0 && (int)$dtend['value']['sec'] == 0 - && ((((int)$dtstart['value']['day'] - (int)$dtend['value']['day']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -11)))) { - $dtst = strtotime($currdate[1]); - $dtst1 = iCalUtilityFunctions::_timestamp2date($dtst); - $dtstart['value']['year'] = $dtst1['year']; - $dtstart['value']['month'] = $dtst1['month']; - $dtstart['value']['day'] = $dtst1['day']; - $currenddate = $vevent->getProperty('x-current-dtend'); - $dtet = strtotime($currenddate[1]); - $dtet1 = iCalUtilityFunctions::_timestamp2date($dtet); - $dtend['value']['year'] = $dtet1['year']; - $dtend['value']['month'] = $dtet1['month']; - $dtend['value']['day'] = $dtet1['day']; -// $date_tzoffset = 0; - } - - if (!empty($dtstart['value']['hour']) && !((int)$dtstart['value']['hour'] == 0 && (int)$dtstart['value']['min'] == 0 && (int)$dtstart['value']['sec'] == 0 - && (int)$dtend['value']['hour'] == 0 && (int)$dtend['value']['min'] == 0 && (int)$dtend['value']['sec'] == 0 - && ((((int)$dtstart['value']['day'] - (int)$dtend['value']['day']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -11)))) { - $eventdate = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtstart['value']) - $date_tzoffset); -// $eventend = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtend['value']) - $date_tzoffset); - $extevents[$eventdate][$dy] = new stdClass(); - $extevents[$eventdate][$dy]->eventdate = new stdClass(); - $extevents[$eventdate][$dy]->eventdate->date = $eventdate; -// if ((int)($dtstart['value']['hour']) == 0 && (int)($dtstart['value']['min']) == 0 && (int)($dtstart['value']['sec']) == 0 -// && (int)($dtend['value']['hour']) == 0 && (int)($dtend['value']['min']) == 0 && (int)($dtend['value']['sec']) == 0 -// && ((((int)($dtstart['value']['day']) - (int)($dtend['value']['day'])) == -1) || (((int)($dtstart['value']['month']) - (int)($dtend['value']['month'])) == -1) || (((int)($dtstart['value']['month']) - (int)($dtend['value']['month'])) == -11))) { -//// if ($dtstart['value']['day'] != (int)($thisday2)) { -// if (date('d',$eventdate) != $thisday2) { -//// if (date('d',$eventdate) != date('d',$eventend)) { -// $yesterday = true; -// } else { -// $extevents[$eventdate][$dy]->eventstart = null; -// $extevents[$eventdate][$dy]->is_allday = 1; -// } -// } else { - if (date('d',$eventdate) != $thisday2) { -// if (date('d',$eventdate) != date('d',$eventend)) { - $yesterday = true; - } else { - $extevents[$eventdate][$dy]->eventstart = ($dtstart['value']['hour'] * 3600) + ($dtstart['value']['min'] * 60) - $date_tzoffset; -// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventstart += 3600; // adjust for daylight savings time - } -// } - } else { - // this is an all day event - $eventdate = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtstart['value'])); -// $eventend = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtend['value'])); - $extevents[$eventdate][$dy] = new stdClass(); - $extevents[$eventdate][$dy]->eventdate = new stdClass(); - $extevents[$eventdate][$dy]->eventdate->date = $eventdate; -// if ($dtstart['value']['day'] != (int)($thisday2)) { - if (date('d',$eventdate) != $thisday2) { -// if (date('d',$eventdate) != date('d',$eventend)) { - $yesterday = true; - } else { - $extevents[$eventdate][$dy]->eventstart = null; - $extevents[$eventdate][$dy]->is_allday = 1; - } - } - - // set the end time if needed - if (!$yesterday && isset($dtend['value']['hour']) && empty($extevents[$eventdate][$dy]->is_allday)) { -// if ($dtend['value']['day'] != (int)($thisday2)) { -// if ((date('d',$eventend) != $thisday2)) { -// $yesterday = true; -// } else { - $extevents[$eventdate][$dy]->eventend = ($dtend['value']['hour'] * 3600) + ($dtend['value']['min'] * 60) - $date_tzoffset; -// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventend += 3600; // adjust for daylight savings time -// } - } - - // convert the start and end times to a full date - if (isset($extevents[$eventdate][$dy]->eventstart) && $extevents[$eventdate][$dy]->eventstart != null) - $extevents[$eventdate][$dy]->eventstart += $eventdate; - if (isset($extevents[$eventdate][$dy]->eventend)) - $extevents[$eventdate][$dy]->eventend += $eventdate; - - // dtstart required, one occurrence, (orig. start date) - $extevents[$eventdate][$dy]->title = $vevent->getProperty('summary'); - $body = $vevent->getProperty('description'); - // convert end of lines - $body = nl2br(str_replace("\\n"," <br>\n",$body)); - $body = str_replace("\n"," <br>\n",$body); - $body = str_replace(array('==0A','=0A','=C2=A0')," <br>\n",$body); - $extevents[$eventdate][$dy]->body = $body; - $extevents[$eventdate][$dy]->location_data = 'icalevent' . $key; - $extevents[$eventdate][$dy]->color = !empty($this->config['pull_ical_color'][$key]) ? $this->config['pull_ical_color'][$key] : null; - if (!$yesterday && $eventdate >= $startdate) { - $dy++; - } else { - unset($extevents[$eventdate][$dy]); - } - } - } - } - } - return $extevents; - } - - public static function _date2timestamp( $datetime, $wtz=null ) { - if( !isset( $datetime['hour'] )) $datetime['hour'] = 0; - if( !isset( $datetime['min'] )) $datetime['min'] = 0; - if( !isset( $datetime['sec'] )) $datetime['sec'] = 0; - if( empty( $wtz ) && ( !isset( $datetime['tz'] ) || empty( $datetime['tz'] ))) - return mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] ); - $output = $offset = 0; - if( empty( $wtz )) { - if( iCalUtilityFunctions::_isOffset( $datetime['tz'] )) { - $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) * -1; - $wtz = 'UTC'; - } - else - $wtz = $datetime['tz']; - } - if(( 'Z' == $wtz ) || ( 'GMT' == strtoupper( $wtz ))) - $wtz = 'UTC'; - try { - $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['min'], $datetime['sec'] ); - $d = new DateTime( $strdate, new DateTimeZone( $wtz )); - if( 0 != $offset ) // adjust for offset - $d->modify( $offset.' seconds' ); - $output = $d->format( 'U' ); - unset( $d ); - } - catch( Exception $e ) { - $output = mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] ); - } - return $output; - } - - /** - * build/update the external event cache - * - */ - public function build_cache() { - global $db; - - // get our requested config - $cfg = new expConfig(); - $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs - foreach ($configs as $config) { - $loc = expUnserialize($config->location_data); - if (!empty($this->params['title'])) { - if ($this->params['title'] == $config->config['feed_sef_url']) { - $this->config = $config->config; - break; - } - } elseif (!empty($this->params['src'])) { - if ($this->params['src'] == $loc->src) { - $this->config = $config->config; - break; - } - } - } - - // next loop through our config pull urls - - // google xml pull - if (!empty($this->config['pull_gcal'])) foreach ($this->config['pull_gcal'] as $key=>$extgcalurl) { - $start = expDateTime::startOfMonthTimestamp(time()); - $gcal_cname = str_replace(array("/",":","&","?"),"_",$extgcalurl); - $cache_fname = BASE.'tmp/cache/'.$gcal_cname.".cache"; - $db->delete('event_cache', "feed='" . $extgcalurl . "' AND eventdate > " . $start); // replace future events - // loop through 12 months, 1 month at a time - for ($i=1; $i < 13; $i++) { - $end = expDateTime::endOfMonthTimestamp($start); - $tmp = 0; - $extevents = $this->get_gcal_events($extgcalurl, $start, $end, $tmp, 0, true); -// $extevents = $this->get_gcal_events($extgcalurl, null, null, 0, 0, 0, true); - foreach ($extevents as $day) { - foreach ($day as $extevent) { - $event_cache = new stdClass(); - $event_cache->feed = $extgcalurl; - $event_cache->event_id = $extevent->event_id; - $event_cache->title = $extevent->title; - $event_cache->body = $extevent->body; - $event_cache->eventdate = $extevent->eventdate->date; - if (isset($extevent->dateFinished) && $extevent->dateFinished != -68400) - $event_cache->dateFinished = $extevent->dateFinished; - if (isset($extevent->eventstart)) - $event_cache->eventstart = $extevent->eventstart; - if (isset($extevent->eventend)) - $event_cache->eventend = $extevent->eventend; - if (isset($extevent->is_allday)) - $event_cache->is_allday = $extevent->is_allday; - $found = false; - if ($extevent->eventdate->date < $start) // prevent duplicating events crossing month boundaries - $found = $db->selectObject('event_cache','feed="'.$extgcalurl.'" AND event_id="'.$event_cache->event_id.'" AND eventdate='.$event_cache->eventdate); - if (!$found) - $db->insertObject($event_cache,'event_cache'); - } - } - $start = expDateTime::startOfMonthTimestamp($end + 1024); - } - $cache_contents = serialize(array('start_date'=>$start,'first_date'=>(int)$db->selectValue('event_cache','eventdate','feed="'.$extgcalurl.'" ORDER BY eventdate'),'refresh_date'=>time())); - file_put_contents($cache_fname, $cache_contents); - } - - // ical pull - $start = expDateTime::startOfMonthTimestamp(time()); - if (!empty($this->config['pull_ical'])) foreach ($this->config['pull_ical'] as $key=>$exticalurl) { - $ical_cname = str_replace(array("/",":","&","?"),"_",$exticalurl); - $cache_fname = BASE.'tmp/cache/'.$ical_cname.".cache"; - $db->delete('event_cache', "feed='" . $exticalurl . "' AND eventdate > " . $start); - // get 1 years worth of events - $extevents = $this->get_ical_events($exticalurl, $start); - foreach ($extevents as $day) { - foreach ($day as $extevent) { - $event_cache = new stdClass(); - $event_cache->feed = $exticalurl; - $event_cache->title = $extevent->title; - $event_cache->body = $extevent->body; - $event_cache->eventdate = $extevent->eventdate->date; - if (isset($extevent->dateFinished)) - $event_cache->dateFinished = $extevent->dateFinished; - $event_cache->eventstart = $extevent->eventstart; - if (isset($extevent->eventend)) - $event_cache->eventend = $extevent->eventend; - if (isset($extevent->is_allday)) - $event_cache->is_allday = $extevent->is_allday; - $db->insertObject($event_cache, 'event_cache'); - } - } - $cache_contents = serialize(array('start_date'=>$start,'first_date'=>(int)$db->selectValue('event_cache','eventdate','feed="'.$exticalurl.'" ORDER BY eventdate'),'refresh_date'=>time())); - file_put_contents($cache_fname, $cache_contents); - } - flash('message', gt('External Calendar Event cache updated')); - echo show_msg_queue(); - } - - function import() { - $pullable_modules = expModules::listInstalledControllers($this->baseclassname); - $modules = new expPaginator(array( - 'records' => $pullable_modules, - 'controller' => $this->loc->mod, - 'action' => $this->params['action'], - 'order' => isset($this->params['order']) ? $this->params['order'] : 'section', - 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '', - 'page' => (isset($this->params['page']) ? $this->params['page'] : 1), - 'columns' => array( - gt('Title') => 'title', - gt('Page') => 'section' - ), - )); - - assign_to_template(array( - 'modules' => $modules, - )); - } - - function import_select() - { - if (empty($this->params['import_aggregate'])) { - expValidator::setErrorField('import_aggregate[]'); - expValidator::failAndReturnToForm(gt('You must select a module.'), $this->params); - } - $extevents = array(); - unset( - $this->params['begin'], - $this->params['end'] - ); // always use date value - $begin = yuidatetimecontrol::parseData('begin', $this->params); - $end = yuidatetimecontrol::parseData('end', $this->params); - if ($this->params['file_type'] == 'file') { - //Get the temp directory to put the uploaded file - $directory = "tmp"; - - //Get the file save it to the temp directory - if (!empty($_FILES["import_file"]) && $_FILES["import_file"]["error"] == UPLOAD_ERR_OK) { - $file = expFile::fileUpload( - "import_file", - false, - false, - time() . "_" . $_FILES['import_file']['name'], - $directory . '/' - ); - if ($file === null) { - switch ($_FILES["import_file"]["error"]) { - case UPLOAD_ERR_INI_SIZE: - case UPLOAD_ERR_FORM_SIZE: - $this->params['_formError'] = gt( - 'The file you attempted to upload is too large. Contact your system administrator if this is a problem.' - ); - break; - case UPLOAD_ERR_PARTIAL: - $this->params['_formError'] = gt('The file was only partially uploaded.'); - break; - case UPLOAD_ERR_NO_FILE: - $this->params['_formError'] = gt('No file was uploaded.'); - break; - default: - $this->params['_formError'] = gt( - 'A strange internal error has occurred. Please contact the Exponent Developers.' - ); - break; - } - expSession::set("last_POST", $this->params); - header("Location: " . $_SERVER['HTTP_REFERER']); - exit(""); - } else { - $extevents = $this->get_ical_events($directory . "/" . $file->filename, $begin, $end); - } - } else { - expValidator::setErrorField('import_file'); - expValidator::failAndReturnToForm(gt('File failed to upload.'), $this->params); // file upload error - } - } else { - if (empty($this->params['ext_feed'])) { - expValidator::setErrorField('ext_feed'); - expValidator::failAndReturnToForm(gt('You must enter a feed url.'), $this->params); - } - $extevents = $this->get_ical_events($this->params['ext_feed'], $begin, $end); - } - - $src = $this->params['import_aggregate'][0]; - $count = 0; - foreach ($extevents as $day) { - foreach ($day as $extevent) { - $event = array(); - $event['title'] = $extevent->title; - $event['body'] = $extevent->body; - $event['eventdate'] = $extevent->eventdate->date; - $event['eventstart'] = $extevent->eventstart; - $event['eventstart'] -= $event['eventdate']; - if (isset($extevent->eventend)) - $event['eventend'] = $extevent->eventend; - else - $event['eventend'] = $extevent->eventstart; - $event['eventend'] -= $event['eventdate']; - if (isset($extevent->is_allday)) - $event['is_allday'] = $extevent->is_allday; - $event['module'] = 'event'; - $event['src'] = $src; - $item = new event(); // create new populated record to auto-set things - $item->update($event); - $count++; - } - } - - unlink($directory . "/" . $file->filename); - - // update search index - $this->addContentToSearch(); - - flashAndFlow('message', $count . ' ' . gt('events were imported.')); - } - - /** @deprecated - * function to build a control requested via ajax - * we the html just like the control smarty function - * @deprecated - */ - public function buildControl() { - $control = new colorcontrol(); - if (!empty($this->params['value'])) $control->value = $this->params['value']; - if ($this->params['value'][0] != '#') $this->params['value'] = '#' . $this->params['value']; - $control->default = $this->params['value']; - if (!empty($this->params['hide'])) $control->hide = $this->params['hide']; - if (isset($this->params['flip'])) $control->flip = $this->params['flip']; - $this->params['name'] = !empty($this->params['name']) ? $this->params['name'] : ''; - $control->name = $this->params['name']; - $this->params['id'] = !empty($this->params['id']) ? $this->params['id'] : ''; - $control->id = isset($this->params['id']) && $this->params['id'] != "" ? $this->params['id'] : ""; - //echo $control->id; - if (empty($control->id)) $control->id = $this->params['name']; - if (empty($control->name)) $control->name = $this->params['id']; - - // attempt to translate the label - if (!empty($this->params['label'])) { - $this->params['label'] = gt($this->params['label']); - } else { - $this->params['label'] = null; - } - echo $control->toHTML($this->params['label'], $this->params['name']); -// $ar = new expAjaxReply(200, gt('The control was created'), json_encode(array('data'=>$code))); -// $ar->send(); - } - -} - +<?php + +################################################## +# +# Copyright (c) 2004-2016 OIC Group, Inc. +# +# This file is part of Exponent +# +# Exponent is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License as published by the Free +# Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# GPL: http://www.gnu.org/licenses/gpl.txt +# +################################################## + +/** + * @subpackage Controllers + * @package Modules + */ + +class eventController extends expController { +// public $basemodel_name = 'event'; + public $useractions = array( + 'showall' => 'Show Calendar', + ); +// protected $manage_permissions = array( +// 'import' => 'Import Calendar', +// ); + public $remove_configs = array( + 'comments', + 'ealerts', +// 'facebook', + 'files', + 'pagination', + 'rss', +// 'twitter', + ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) + + static function displayname() { + return "Events"; + } + + static function description() { + return "Manage events and schedules, and optionally publish them."; + } + + static function author() { + return "Dave Leffler"; + } + + static function isSearchable() { + return true; + } + + function searchName() { + return gt("Calendar Event"); + } + + function searchCategory() { + return gt('Event'); + } + + /** + * can this module import data? + * + * @return bool + */ + public static function canImportData() { + return true; + } + + function showall() { + global $user; + + expHistory::set('viewable', $this->params); + $locsql = $this->aggregateWhereClause(); + $time = (isset($this->params['time']) ? intval($this->params['time']) : time()); + assign_to_template(array( + 'time' => $time, + 'daynames' => event::dayNames(), + )); + + $regcolor = !empty($this->config['registrations_color']) ? $this->config['registrations_color'] : null; + + $ed = new eventdate(); + $viewtype = 'default'; + $viewrange = 'all'; + $view = !empty($this->params['view']) ? $this->params['view'] : 'showall'; + switch ($view) { + case 'showall_Administration': + $viewtype = "administration"; + break; + case 'showall_Past Events': + $viewrange = "past"; + break; + case 'showall_Monthly Summary': + case 'showall_Mini-Calendar': + case 'minical': + $viewtype = "minical"; + break; + case 'showall_Monthly List': + case 'showall_List': + case 'monthlist': + $viewtype = "byday"; + $viewrange = "month"; + break; + case 'showall_Week': + case 'week': + $viewtype = "byday"; + $viewrange = "week"; + break; + case 'showall_Day': + case 'day': + $viewtype = "byday"; + $viewrange = "day"; + break; + case 'showall_announcement': + case 'showall_Upcoming Events': + case 'showall_Upcoming Events - Headlines': + $viewrange = "upcoming"; + break; + case 'showall': + case 'month': + $viewtype = "monthly"; + break; + default : + $view_params = explode('_',$view); + if (!empty($view_params[1])) $viewtype = $view_params[1]; + if (!empty($view_params[2])) $viewrange = $view_params[2]; + } // end switch $view + + switch ($viewtype) { + case "minical": + $monthly = expDateTime::monthlyDaysTimestamp($time); + $info = getdate($time); + $timefirst = mktime(0, 0, 0, $info['mon'], 1, $info['year']); + $now = getdate(time()); + $currentday = $now['mday']; + $endofmonth = date('t', $time); + foreach ($monthly as $weekNum => $week) { + foreach ($week as $dayNum => $day) { + if ($dayNum == $now['mday']) { + $currentweek = $weekNum; + } + if ($dayNum <= $endofmonth) { +// $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $db->countObjects("eventdate", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; + $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $ed->find("count", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; + } + } + } + $prevmonth = mktime(0, 0, 0, date("m", $timefirst) - 1, date("d", $timefirst) + 10, date("Y", $timefirst)); + $nextmonth = mktime(0, 0, 0, date("m", $timefirst) + 1, date("d", $timefirst) + 10, date("Y", $timefirst)); + assign_to_template(array( + "monthly" => $monthly, + "currentweek" => $currentweek, + "currentday" => $currentday, + "now" => $timefirst, + "prevmonth" => $prevmonth, + "thismonth" => $timefirst, + "nextmonth" => $nextmonth, + )); + break; // end switch $viewtype minicalendar + case "byday": //note aggregates events by groups of days + // Remember this is the code for weekly view and monthly listview + // Test your fixes on both views + // $startperiod = 0; + // $totaldays = 0; + switch ($viewrange) { + case "day": + $startperiod = expDateTime::startOfDayTimestamp($time); + $totaldays = 1; + $next = expDateTime::endOfDayTimestamp($startperiod); + if (!empty($this->config['starttype'])) $startperiod = $time; + $this->params['time'] = $time; + assign_to_template(array( + "prev_timestamp3" => strtotime('-3 days', $startperiod), + "prev_timestamp2" => strtotime('-2 days', $startperiod), + "prev_timestamp" => strtotime('-1 days', $startperiod), + "next_timestamp" => strtotime('+1 days', $startperiod), + "next_timestamp2" => strtotime('+2 days', $startperiod), + "next_timestamp3" => strtotime('+3 days', $startperiod), + 'params' => $this->params + )); + break; + case "week": + $startperiod = expDateTime::startOfWeekTimestamp($time); + $totaldays = 7; + $next = strtotime('+7 days', $startperiod); +// $next = expDateTime::endOfWeekTimestamp($startperiod); + if (!empty($this->config['starttype'])) $startperiod = $time; + $this->params['time'] = $time; + assign_to_template(array( + "prev_timestamp3" => strtotime('-21 days', $startperiod), + "prev_timestamp2" => strtotime('-14 days', $startperiod), + "prev_timestamp" => strtotime('-7 days', $startperiod), + "next_timestamp" => $next, + "next_timestamp2" => strtotime('+14 days', $startperiod), + "next_timestamp3" => strtotime('+21 days', $startperiod), + 'params' => $this->params + )); + break; + case "twoweek": + $startperiod = expDateTime::startOfWeekTimestamp($time); + $totaldays = 14; + $next = strtotime('+14 days', $startperiod); + if (!empty($this->config['starttype'])) $startperiod = $time; + assign_to_template(array( + "prev_timestamp3" => strtotime('-42 days', $startperiod), + "prev_timestamp2" => strtotime('-28 days', $startperiod), + "prev_timestamp" => strtotime('-14 days', $startperiod), + "next_timestamp" => $next, + "next_timestamp2" => strtotime('+28 days', $startperiod), + "next_timestamp3" => strtotime('+42 days', $startperiod), + )); + break; + case "month": + default: // range = month + $startperiod = expDateTime::startOfMonthTimestamp($time); + $totaldays = date('t', $time); + $next = strtotime('+1 months', $startperiod); +// $next = expDateTime::endOfMonthTimestamp($startperiod); + $this->params['time'] = $time; + assign_to_template(array( + "prev_timestamp3" => strtotime('-3 months', $startperiod), + "prev_timestamp2" => strtotime('-2 months', $startperiod), + "prev_timestamp" => strtotime('-1 months', $startperiod), + "next_timestamp" => $next, + "next_timestamp2" => strtotime('+2 months', $startperiod), + "next_timestamp3" => strtotime('+3 months', $startperiod), + 'params' => $this->params + )); + break; + } // end switch $viewrange + + // $days = array(); + // added per Ignacio + // $endofmonth = date('t', $time); + $extitems = $this->getExternalEvents($startperiod, $next); + if (!empty($this->config['aggregate_registrations'])) + $regitems = eventregistrationController::getRegEventsForDates($startperiod, $next, $regcolor); + for ($i = 1; $i <= $totaldays; $i++) { + // $info = getdate($time); + // switch ($viewrange) { + // case "week": + // $start = mktime(0,0,0,$info['mon'],$i,$info['year']); //FIXME this can't be right? + // break; + // case "twoweek": + //// $start = mktime(0,0,0,$info['mon'],$info['mday']+($i-1),$info['year']); //FIXME this can't be right? + // $start = $startperiod + ($i*86400); + // break; + // default: // range = month + // $start = mktime(0,0,0,$info['mon'],$i,$info['year']); + // } + $start = expDateTime::startOfDayTimestamp($startperiod + ($i * 86400) - 86400); + $edates = $ed->find("all", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start)); +// $days[$start] = $this->getEventsForDates($edates, true, isset($this->config['only_featured']) ? true : false); + $days[$start] = $this->event->getEventsForDates($edates, true, isset($this->config['only_featured']) ? true : false); + // for ($j = 0; $j < count($days[$start]); $j++) { + // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$days[$start][$j]->id); + // $days[$start][$j]->permissions = array( + // "manage"=>(expPermissions::check("manage",$thisloc) || expPermissions::check("manage",$this->loc)), + // "edit"=>(expPermissions::check("edit",$thisloc) || expPermissions::check("edit",$this->loc)), + // "delete"=>(expPermissions::check("delete",$thisloc) || expPermissions::check("delete",$this->loc)) + // ); + // } + if (!empty($extitems[$start])) + $days[$start] = array_merge($extitems[$start], $days[$start]); + if (!empty($regitems[$start])) + $days[$start] = array_merge($regitems[$start], $days[$start]); + $days[$start] = expSorter::sort(array('array' => $days[$start], 'sortby' => 'eventstart', 'order' => 'ASC')); + } + assign_to_template(array( + "time" => $startperiod, + 'days' => $days, + "now" => $startperiod, + )); + break; // end switch $viewtype byday + case "monthly": //note this is a simply array of events for the requested month + // build a month array of weeks with an array of days + // $monthly = array(); + // $counts = array(); + $info = getdate($time); + $nowinfo = getdate(time()); + if ($info['mon'] != $nowinfo['mon']) $nowinfo['mday'] = -10; + // Grab non-day numbers only (before end of month) +// $week = 0; + $currentweek = -1; + $timefirst = mktime(0, 0, 0, $info['mon'], 1, $info['year']); + $week = (int)date('W',$timefirst); + if ($week >= 52 && $info['mon'] == 1) $week = 1; + $infofirst = getdate($timefirst); + $monthly[$week] = array(); // initialize for non days + $counts[$week] = array(); + if (($infofirst['wday'] == 0) && (DISPLAY_START_OF_WEEK == 1)) { + for ($i = -6; $i < (1 - DISPLAY_START_OF_WEEK); $i++) { + $monthly[$week][$i] = array(); + $counts[$week][$i] = -1; + } + $weekday = $infofirst['wday'] + 7; // day number in grid. if 7+, switch weeks + } else { + for ($i = 1 - $infofirst['wday']; $i < (1 - DISPLAY_START_OF_WEEK); $i++) { + $monthly[$week][$i] = array(); + $counts[$week][$i] = -1; + } + $weekday = $infofirst['wday']; // day number in grid. if 7+, switch weeks + } + // Grab day counts + $endofmonth = date('t', $time); + $extitems = $this->getExternalEvents($timefirst, expDateTime::endOfMonthTimestamp($timefirst)); + if (!empty($this->config['aggregate_registrations'])) + $regitems = eventregistrationController::getRegEventsForDates($timefirst, expDateTime::endOfMonthTimestamp($timefirst), $regcolor); + for ($i = 1; $i <= $endofmonth; $i++) { + $start = mktime(0, 0, 0, $info['mon'], $i, $info['year']); + if ($i == $nowinfo['mday']) $currentweek = $week; + $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start) . ")"); +// $monthly[$week][$i] = $this->getEventsForDates($dates, true, isset($this->config['only_featured']) ? true : false); + $monthly[$week][$i] = $this->event->getEventsForDates($dates, true, isset($this->config['only_featured']) ? true : false); + if (!empty($extitems[$start])) + $monthly[$week][$i] = array_merge($extitems[$start], $monthly[$week][$i]); + if (!empty($regitems[$start])) + $monthly[$week][$i] = array_merge($regitems[$start], $monthly[$week][$i]); + $monthly[$week][$i] = expSorter::sort(array('array' => $monthly[$week][$i], 'sortby' => 'eventstart', 'order' => 'ASC')); + $counts[$week][$i] = count($monthly[$week][$i]); + if ($weekday >= (6 + DISPLAY_START_OF_WEEK)) { + $week++; + $monthly[$week] = array(); // allocate an array for the next week + $counts[$week] = array(); + $weekday = DISPLAY_START_OF_WEEK; + } else $weekday++; + } + // Grab non-day numbers only (after end of month) + for ($i = 1; $weekday && $i < (8 + DISPLAY_START_OF_WEEK - $weekday); $i++) { + $monthly[$week][$i + $endofmonth] = array(); + $counts[$week][$i + $endofmonth] = -1; + } + $this->params['time'] = $time; + assign_to_template(array( + "currentweek" => $currentweek, + "monthly" => $monthly, + "counts" => $counts, + "prevmonth3" => strtotime('-3 months', $timefirst), + "prevmonth2" => strtotime('-2 months', $timefirst), + "prevmonth" => strtotime('-1 months', $timefirst), + "nextmonth" => strtotime('+1 months', $timefirst), + "nextmonth2" => strtotime('+2 months', $timefirst), + "nextmonth3" => strtotime('+3 months', $timefirst), + "now" => $timefirst, + "today" => expDateTime::startOfDayTimestamp(time()), + 'params' => $this->params + )); + break; // end switch $viewtype monthly + case "administration": //note a simple list of all upcoming events, except no external nor registration events + // Check perms and return if cant view + if (!$user) return; + $continue = (expPermissions::check("manage", $this->loc) || + expPermissions::check("create", $this->loc) || + expPermissions::check("edit", $this->loc) || + expPermissions::check("delete", $this->loc) + ) ? 1 : 0; + $dates = $ed->find("all", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp(time())); +// $items = $this->getEventsForDates($dates); + $items = $this->event->getEventsForDates($dates); + // if (!$continue) { + // foreach ($items as $i) { + // $iloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$i->id); + // if (expPermissions::check("edit",$iloc) || + // expPermissions::check("delete",$iloc) || + // expPermissions::check("manage",$iloc) + // ) { + // $continue = true; + // } + // } + // } + if (!$continue) return; + // for ($i = 0; $i < count($items); $i++) { + // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$items[$i]->id); + // // if ($user && $items[$i]->poster == $user->id) $canviewapproval = 1; + // $items[$i]->permissions = array( + // "manage"=>(expPermissions::check("manage",$thisloc) || expPermissions::check("manage",$this->loc)), + // "edit"=>(expPermissions::check("edit",$thisloc) || expPermissions::check("edit",$this->loc)), + // "delete"=>(expPermissions::check("delete",$thisloc) || expPermissions::check("delete",$this->loc)) + // ); + // } + $items = expSorter::sort(array('array' => $items, 'sortby' => 'eventstart', 'order' => 'ASC')); + assign_to_template(array( + 'items' => $items, + )); + break; // end switch $viewtype administration + case "default": //note a simple list of events based on $viewrange + default; + // $items = null; + // $dates = null; + $day = expDateTime::startOfDayTimestamp(time()); + $sort_asc = true; // For the getEventsForDates call + // $moreevents = false; + switch ($viewrange) { + case "upcoming": // events in the future + if (!empty($this->config['enable_ical']) && !empty($this->config['rss_limit']) && $this->config['rss_limit'] > 0) { + $eventlimit = " AND date <= " . ($day + ($this->config['rss_limit'] * 86400)); + } else { + $eventlimit = ""; + } + $dates = $ed->find("all", $locsql . " AND date >= " . $day . $eventlimit . " ORDER BY date ASC "); + $begin = $day; + $end = null; + // $moreevents = count($dates) < $db->countObjects("eventdate",$locsql." AND date >= $day"); + break; + case "past": // events in the past + $dates = $ed->find("all", $locsql . " AND date < $day ORDER BY date DESC "); + // $moreevents = count($dates) < $db->countObjects("eventdate",$locsql." AND date < $day"); + $sort_asc = false; + $begin = null; + $end = $day; + break; + case "today": // events occuring today + $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($day) . " AND date <= " . expDateTime::endOfDayTimestamp($day) . ")"); + $begin = $day; + $end = expDateTime::endOfDayTimestamp($day); + break; + case "day": // events for a specific day (same as byday day?) + $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($time) . " AND date <= " . expDateTime::endOfDayTimestamp($time) . ")"); + $begin = expDateTime::startOfDayTimestamp($time); + $end = expDateTime::endOfDayTimestamp($time); + break; + case "next": // future events + $dates = array($ed->find("all", $locsql . " AND date >= $time")); + $begin = expDateTime::startOfDayTimestamp($time); + $end = null; + break; + case "month": // events for a specific month (same as monthly?) +// $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp(time()) . " AND date <= " . expDateTime::endOfMonthTimestamp(time()) . ")"); + $dates = $ed->find("all", $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp($time) . " AND date <= " . expDateTime::endOfMonthTimestamp($time) . ")"); + $begin = expDateTime::startOfMonthTimestamp($time); + $end = expDateTime::endOfMonthTimestamp($time); + break; + case "all": // all events + default; + $dates = $ed->find("all", $locsql); + $begin = null; + $end = null; + } +// $items = $this->getEventsForDates($dates, $sort_asc, isset($this->config['only_featured']) ? true : false, true); + $items = $this->event->getEventsForDates($dates, $sort_asc, isset($this->config['only_featured']) ? true : false, true); + if ($viewrange != 'past') { + $extitems = $this->getExternalEvents($begin, $end); + // we need to flatten these down to simple array of events + $extitem = array(); + foreach ($extitems as $days) { + foreach ($days as $event) { + if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time())) + break; + if (empty($event->eventstart)) + $event->eventstart = $event->eventdate->date; + $extitem[] = $event; + } + } + $items = array_merge($items, $extitem); + + if (!empty($this->config['aggregate_registrations'])) + $regitems = eventregistrationController::getRegEventsForDates($begin, $end, $regcolor); + // we need to flatten these down to simple array of events + $regitem = array(); + if (!empty($regitems)) foreach ($regitems as $days) { + foreach ($days as $value) { + $regitem[] = $value; + } + } + $items = array_merge($items, $regitem); + + // remove today's events that have already ended + if ($viewtype == 'default' && $viewrange == 'upcoming') { + foreach ($items as $key=>$item) { + if (!$item->is_allday && $item->eventend < time()) { + //fixme we've left events ending earlier in the day, but already cancelled out tomorrow's event + unset($items[$key]); + } else { + break; // they are chronological so we can end + } + } + } + } + $items = expSorter::sort(array('array' => $items, 'sortby' => 'eventstart', 'order' => 'ASC')); + // Upcoming events can be configured to show a specific number of events. + // The previous call gets all events in the future from today + // If configured, cut the array to the configured number of events + // if ($template->viewconfig['num_events']) { + // switch ($viewrange) { + // case "upcoming": + // case "past": + // $moreevents = $template->viewconfig['num_events'] < count($items); + // break; + // } + // $items = array_slice($items, 0, $template->viewconfig['num_events']); + // } + // for ($i = 0; $i < count($items); $i++) { + // $thisloc = expCore::makeLocation($this->loc->mod,$this->loc->src,$items[$i]->id); + // $items[$i]->permissions = array( + // 'manage'=>(expPermissions::check('manage',$thisloc) || expPermissions::check('manage',$this->loc)), + // 'edit'=>(expPermissions::check('edit',$thisloc) || expPermissions::check('edit',$this->loc)), + // 'delete'=>(expPermissions::check('delete',$thisloc) || expPermissions::check('delete',$this->loc)) + // ); + // } + assign_to_template(array( + 'items' => $items, + "now" => $day, + )); + } + } + + /** + * default view for individual item + */ + function show() { + expHistory::set('viewable', $this->params); + if (!empty($this->params['date_id'])) { // specific event instance + $eventdate = new eventdate($this->params['date_id']); + $eventdate->event = new event($eventdate->event_id); + } else { // we'll default to the first event of this series + $event = new event($this->params['id']); + $eventdate = new eventdate($event->eventdate[0]->id); + } + if (empty($eventdate->id)) + redirect_to(array('controller'=>'notfound','action'=>'page_not_found','title'=>'event')); + + if (!empty($eventdate->event->feedback_form) && $eventdate->event->feedback_form != 'Disallow Feedback') { + assign_to_template(array( + 'feedback_form' => $eventdate->event->feedback_form, + )); + } + + assign_to_template(array( + 'event' => $eventdate, + )); + } + + function edit() { + global $template; + + parent::edit(); + $allforms = array(); + $allforms[""] = gt('Disallow Feedback'); + // calculate which event date is the one being edited + $event_key = 0; + foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) { + if ($d->id == $this->params['date_id']) $event_key = $key; + } + + assign_to_template(array( + 'allforms' => array_merge($allforms, expTemplate::buildNameList("forms", "event/email", "tpl", "[!_]*")), + 'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null, + 'event_key' => $event_key, + )); + } + + /** + * Delete a recurring event by asking for which event dates to delete + * + */ + function delete_recurring() { + $item = $this->event->find('first', 'id=' . $this->params['id']); + if ($item->is_recurring == 1) { // need to give user options + expHistory::set('editable', $this->params); + assign_to_template(array( + 'checked_date' => $this->params['date_id'], + 'event' => $item, + )); + } else { // Process a regular delete + $item->delete(); + } + } + + /** + * Delete selected event dates for a recurring event and event if all event dates deleted + * + */ + function delete_selected() { + $item = $this->event->find('first', 'id=' . $this->params['id']); + if ($item && $item->is_recurring == 1) { + $event_remaining = false; + $eventdates = $item->eventdate[0]->find('all', 'event_id=' . $item->id); + foreach ($eventdates as $ed) { + if (array_key_exists($ed->id, $this->params['dates'])) { + $ed->delete(); + } else { + $event_remaining = true; + } + } + if (!$event_remaining) { + $item->delete(); // model will also ensure we delete all event dates + } + expHistory::back(); + } else { + notfoundController::handle_not_found(); + } + } + + function delete_all_past() { + $locsql = $this->aggregateWhereClause(); + $ed = new eventdate(); + $dates = $ed->find("all", $locsql . " AND date < " . strtotime('-1 months', time())); + foreach ($dates as $date) { + $date->delete(); // event automatically deleted if all assoc eventdates are deleted + } + expHistory::back(); + } + + /** + * get the metainfo for this module + * @return array + */ + function metainfo() { + global $router; + + $action = $router->params['action']; + $metainfo = array('title' => '', 'keywords' => '', 'description' => '', 'canonical'=> '', 'noindex' => false, 'nofollow' => false); + // look for event date_id which expController::metainfo won't detect +// if (!empty($router->params['action']) && $router->params['action'] == 'show' && !isset($router->params['id']) && isset($router->params['date_id'])) { + switch ($action) { + case 'show': + if (!isset($router->params['id']) && isset($router->params['date_id'])) { + // look up the record. + $object = new eventdate((int)$router->params['date_id']); + // set the meta info + if (!empty($object)) { + if (!empty($object->event->body)) { + $desc = str_replace('"',"'",expString::summarize($object->event->body,'html','para')); + } else { + $desc = SITE_DESCRIPTION; + } + if (!empty($object->expTag)) { + $keyw = ''; + foreach ($object->expTag as $tag) { + if (!empty($keyw)) $keyw .= ', '; + $keyw .= $tag->title; + } + } else { + $keyw = SITE_KEYWORDS; + } + $metainfo['title'] = empty($object->event->meta_title) ? $object->event->title : $object->event->meta_title; + $metainfo['keywords'] = empty($object->event->meta_keywords) ? $keyw : $object->event->meta_keywords; + $metainfo['description'] = empty($object->event->meta_description) ? $desc : $object->event->meta_description; + $metainfo['canonical'] = empty($object->event->canonical) ? $router->plainPath() : $object->event->canonical; + $metainfo['noindex'] = empty($object->event->meta_noindex) ? false : $object->event->meta_noindex; + $metainfo['nofollow'] = empty($object->event->meta_nofollow) ? false : $object->event->meta_nofollow; + return $metainfo; + break; + } + } + default: + return parent::metainfo(); + } + } + + /** + * function to build a string to pull in all events within requested date range + */ + function build_daterange_sql($timestamp, $endtimestamp=null, $field='date', $multiday=false) { + if (empty($endtimestamp)) { + $date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($timestamp) . ")"; + } else { + $date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($endtimestamp) . ")"; + } + if ($multiday) + $date_sql .= " OR (" . expDateTime::startOfDayTimestamp($timestamp) . " BETWEEN ".$field." AND dateFinished)"; + $date_sql .= ")"; + return $date_sql; + } + + function send_feedback() { + $success = false; + if (isset($this->params['id'])) { + $ed = new eventdate($this->params['id']); +// $email_addrs = array(); + if ($ed->event->feedback_email != '') { + $msgtemplate = expTemplate::get_template_for_action($this, 'email/_' . expString::escape($this->params['formname']), $this->loc); + $msgtemplate->assign('params', $this->params); + $msgtemplate->assign('event', $ed); + $email_addrs = explode(',', $ed->event->feedback_email); + //This is an easy way to remove duplicates + $email_addrs = array_flip(array_flip($email_addrs)); + $email_addrs = array_map('trim', $email_addrs); + $mail = new expMail(); + $success += $mail->quickSend(array( + "text_message" => $msgtemplate->render(), + 'to' => $email_addrs, + 'from' => !empty($this->params['email']) ? $this->params['email'] : trim(SMTP_FROMADDRESS), + 'subject' => $this->params['subject'], + )); + } + } + + if ($success) { + flashAndFlow('message', gt('Your feedback was successfully sent.')); + } else { + flashAndFlow('error', gt('We could not send your feedback. Please contact your administrator.')); + } + } + + function ical() { + if (isset($this->params['date_id']) || isset($this->params['title']) || isset($this->params['src'])) { + $cfg = new expConfig(); + $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs + foreach ($configs as $config) { + $loc = expUnserialize($config->location_data); + if (!empty($this->params['title'])) { + if ($this->params['title'] == $config->config['feed_sef_url']) { + $this->config = $config->config; + break; + } + } elseif (!empty($this->params['src'])) { + if ($this->params['src'] == $loc->src) { + $this->config = $config->config; + break; + } + } + } + $this->loc = $loc; + + if ($this->config['enable_ical']) { + $ed = new eventdate(); + if (isset($this->params['date_id'])) { // get single specific event only +// $dates = array($db->selectObject("eventdate","id=".$this->params['date_id'])); + $dates = $ed->find('first', "id=" . $this->params['date_id']); + $Filename = "Event-" . $this->params['date_id']; + } else { + $locsql = $this->aggregateWhereClause(); + + $day = expDateTime::startOfDayTimestamp(time()); + if (!empty($this->config['enable_ical']) && isset($this->config['rss_limit']) && ($this->config['rss_limit'] > 0)) { + $rsslimit = " AND date <= " . ($day + ($this->config['rss_limit'] * 86400)); + } else { + $rsslimit = ""; + } + + if (isset($this->params['time'])) { + $time = intval($this->params['time']); // get current month's events +// $dates = $db->selectObjects("eventdate",$locsql." AND (date >= ".expDateTime::startOfMonthTimestamp($time)." AND date <= ".expDateTime::endOfMonthTimestamp($time).")"); + $dates = $ed->find('all', $locsql . " AND (date >= " . expDateTime::startOfMonthTimestamp($time) . " AND date <= " . expDateTime::endOfMonthTimestamp($time) . ")"); + } else { + $time = date('U', strtotime("midnight -1 month", time())); // previous month also +// $dates = $db->selectObjects("eventdate",$locsql." AND date >= ".expDateTime::startOfDayTimestamp($time).$rsslimit); + $dates = $ed->find('all', $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($time) . $rsslimit); + } + // $title = $db->selectValue('container', 'title', "internal='".serialize($loc)."'"); + $title = $this->config['feed_title']; + $Filename = preg_replace('/\s+/', '', $title); // without whitespace + } + + if (!function_exists("quoted_printable_encode")) { // function added in php v5.3.0 + function quoted_printable_encode($input, $line_max = 75) { + $hex = array('0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); + $lines = preg_split("/(?:\r\n|\r|\n)/", $input); + $linebreak = "=0D=0A=\r\n"; + /* the linebreak also counts as characters in the mime_qp_long_line + * rule of spam-assassin */ + $line_max = $line_max - strlen($linebreak); + $escape = "="; + $output = ""; + $cur_conv_line = ""; + $length = 0; + $whitespace_pos = 0; + $addtl_chars = 0; + + // iterate lines + for ($j = 0, $jMax = count($lines); $j < $jMax; $j++) { + $line = $lines[$j]; + $linlen = strlen($line); + + // iterate chars + for ($i = 0; $i < $linlen; $i++) { + $c = substr($line, $i, 1); + $dec = ord($c); + + $length++; + + if ($dec == 32) { + // space occurring at end of line, need to encode + if (($i == ($linlen - 1))) { + $c = "=20"; + $length += 2; + } + + $addtl_chars = 0; + $whitespace_pos = $i; + } elseif (($dec == 61) || ($dec < 32) || ($dec > 126)) { + $h2 = floor($dec / 16); + $h1 = floor($dec % 16); + $c = $escape . $hex["$h2"] . $hex["$h1"]; + $length += 2; + $addtl_chars += 2; + } + + // length for wordwrap exceeded, get a newline into the text + if ($length >= $line_max) { + $cur_conv_line .= $c; + + // read only up to the whitespace for the current line + $whitesp_diff = $i - $whitespace_pos + $addtl_chars; + + /* the text after the whitespace will have to be read + * again ( + any additional characters that came into + * existence as a result of the encoding process after the whitespace) + * + * Also, do not start at 0, if there was *no* whitespace in + * the whole line */ + if (($i + $addtl_chars) > $whitesp_diff) { + $output .= substr($cur_conv_line, 0, (strlen($cur_conv_line) - + $whitesp_diff)) . $linebreak; + $i = $i - $whitesp_diff + $addtl_chars; + } else { + $output .= $cur_conv_line . $linebreak; + } + + $cur_conv_line = ""; + $length = 0; + $whitespace_pos = 0; + } else { + // length for wordwrap not reached, continue reading + $cur_conv_line .= $c; + } + } // end of for + + $length = 0; + $whitespace_pos = 0; + $output .= $cur_conv_line; + $cur_conv_line = ""; + + if ($j <= count($lines) - 1) { + $output .= $linebreak; + } + } // end for + + return trim($output); + } // end quoted_printable_encode + } + + $tz = DISPLAY_DEFAULT_TIMEZONE; + $msg = "BEGIN:VCALENDAR\n"; + $msg .= "VERSION:2.0\n"; // version for iCalendar files vs vCalendar files + $msg .= "CALSCALE:GREGORIAN\n"; + $msg .= "METHOD: PUBLISH\n"; + $msg .= "PRODID:<-//ExponentCMS//EN>\n"; + if (isset($this->config['rss_cachetime']) && ($this->config['rss_cachetime'] > 0)) { + $msg .= "X-PUBLISHED-TTL:PT" . $this->config['rss_cachetime'] . "M\n"; + } + $msg .= "X-WR-CALNAME:$Filename\n"; + +// $items = $this->getEventsForDates($dates); + $items = $this->event->getEventsForDates($dates); + + for ($i = 0, $iMax = count($items); $i < $iMax; $i++) { + + // Convert events stored in local time to GMT + $eventstart = new DateTime(date('r', $items[$i]->eventstart), new DateTimeZone($tz)); + $eventstart->setTimezone(new DateTimeZone('GMT')); + $eventend = new DateTime(date('r', $items[$i]->eventend), new DateTimeZone($tz)); + $eventend->setTimezone(new DateTimeZone('GMT')); + if ($items[$i]->is_allday) { + $dtstart = "DTSTART;VALUE=DATE:" . date("Ymd", $items[$i]->eventstart) . "\n"; + $dtend = "DTEND;VALUE=DATE:" . date("Ymd", strtotime("midnight +1 day", $items[$i]->eventstart)) . "\n"; + } else { + $dtstart = "DTSTART;VALUE=DATE-TIME:" . $eventstart->format("Ymd\THi00") . "Z\n"; + if ($items[$i]->eventend) { + $dtend = "DTEND;VALUE=DATE-TIME:" . $eventend->format("Ymd\THi00") . "Z\n"; + } else { + $dtend = "DTEND;VALUE=DATE-TIME:" . $eventstart->format("Ymd\THi00") . "Z\n"; + } + } + + $body = trim(strip_tags(str_replace(array("<br />", "<br>", "br/>", "</p>"), "\n", $items[$i]->body))); + if ($items[$i]->is_cancelled) $body = gt('This Event Has Been Cancelled') . ' - ' . $body; + $body = str_replace(array("\r"), "", $body); + $body = str_replace(array("&#160;"), " ", $body); + $body = expString::convertSmartQuotes($body); + if (!isset($this->params['style'])) { + // it's going to Outlook so remove all formatting from body text + $body = quoted_printable_encode($body); + } elseif ($this->params['style'] == "g") { + // It's going to Google (doesn't like quoted-printable, but likes html breaks) + $body = str_replace(array("\n"), "<br />", $body); + } else { + // It's going elsewhere (doesn't like quoted-printable) + $body = str_replace(array("\n"), " -- ", $body); + } + $title = $items[$i]->title; + + $msg .= "BEGIN:VEVENT\n"; + $msg .= $dtstart . $dtend; + $msg .= "UID:" . $items[$i]->date_id . "\n"; + $msg .= "DTSTAMP:" . date("Ymd\THis", time()) . "Z\n"; + if ($title) { + $msg .= "SUMMARY:$title\n"; + } + if ($body) { + $msg .= "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" . $body . "\n"; + } + // if($link_url) { $msg .= "URL: $link_url\n";} + if (!empty($this->config['usecategories'])) { + if (!empty($items[$i]->expCat[0]->title)) { + $msg .= "CATEGORIES:".$items[$i]->expCat[0]->title."\n"; + } else { + $msg .= "CATEGORIES:".$this->config['uncat']."\n"; + } + } + $msg .= "END:VEVENT\n"; + } + $msg .= "END:VCALENDAR"; + + // Kick it out as a file download + ob_end_clean(); + + // $mime_type = (EXPONENT_USER_BROWSER == 'IE' || EXPONENT_USER_BROWSER == 'OPERA') ? 'application/octet-stream;' : "text/x-vCalendar"; + // $mime_type = "text/x-vCalendar"; + $mime_type = 'text/Calendar'; + header('Content-Type: ' . $mime_type); + header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + header('Content-length: ' . strlen($msg)); + header('Content-Transfer-Encoding: binary'); + header('Content-Encoding:'); + // header("Content-Disposition: inline; filename=".$Filename.".ics"); + header('Content-Disposition: attachment; filename="' . $Filename . '.ics"'); + // IE need specific headers + // if (EXPONENT_USER_BROWSER == 'IE') { + header('Cache-Control: no-cache, must-revalidate'); + header('Pragma: public'); + header('Vary: User-Agent'); + // } else { + header('Pragma: no-cache'); + // } + echo $msg; + exit(); + } else { + notfoundController::handle_not_found(); + } + } else { + notfoundController::handle_not_found(); + } + } + + function send_reminders() { + if (isset($this->params['title']) || isset($this->params['src'])) { + $cfg = new expConfig(); + $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs + foreach ($configs as $config) { + $loc = expUnserialize($config->location_data); + if (!empty($this->params['title'])) { + if ($this->params['title'] == $config->config['feed_sef_url']) { + $this->config = $config->config; + break; + } + } elseif (!empty($this->params['src'])) { + if ($this->params['src'] == $loc->src) { + $this->config = $config->config; + break; + } + } + } + + if (empty($this->config['reminder_active'])) { + notfoundController::handle_not_found(); + return; + } + if (!empty($this->config['reminder_code']) && (empty($this->params['code']) || ($this->params['code'] != $this->config['reminder_code']))) { + notfoundController::handle_not_authorized(); + return; + } + + $this->loc = $loc; + $locsql = $this->aggregateWhereClause(); + + $view = (isset($this->params['view']) ? $this->params['view'] : ''); + if ($view == "") { + $view = "send_reminders"; // default reminder view + } + +// $template = expTemplate::get_template_for_action($this, $view, $this->loc); + global $template; + + $title = $this->config['feed_title']; + $template->assign('moduletitle', $title); + + $time = (isset($this->params['time']) ? intval($this->params['time']) : time()); + $time = (int)$time; + + $template->assign("time", $time); + + $startperiod = expDateTime::startOfDayTimestamp($time); + if (!empty($this->params['days'])) { + $totaldays = $this->params['days']; + } else { + $totaldays = 7; // default 7 days of events + } + + $count = 0; + $info = getdate($startperiod); + for ($i = 0; $i < $totaldays; $i++) { + $start = mktime(0, 0, 0, $info['mon'], $info['mday'] + $i, $info['year']); + $ed = new eventdate(); + $edates = $ed->find('all', $locsql . " AND (date >= " . expDateTime::startOfDayTimestamp($start) . " AND date <= " . expDateTime::endOfDayTimestamp($start) . ")"); + $days[$start] = array(); +// $days[$start] = $this->getEventsForDates($edates); + $days[$start] = $this->event->getEventsForDates($edates); + for ($j = 0, $jMax = count($days[$start]); $j < $jMax; $j++) { + $thisloc = expCore::makeLocation($loc->mod, $loc->src, $days[$start][$j]->id); + $days[$start][$j]->permissions = array( + "manage" => (expPermissions::check("manage", $thisloc) || expPermissions::check("manage", $loc)), + "edit" => (expPermissions::check("edit", $thisloc) || expPermissions::check("edit", $loc)), + "delete" => (expPermissions::check("delete", $thisloc) || expPermissions::check("delete", $loc)) + ); + } + $counts[$start] = count($days[$start]); + $count += count($days[$start]); + $days[$start] = expSorter::sort(array('array' => $days[$start], 'sortby' => 'eventstart', 'order' => 'ASC')); + } + $template->assign("days", $days); + $template->assign("counts", $counts); + $template->assign("start", $startperiod); + $template->assign("totaldays", $totaldays); + + if ($count == 0) { + flash('error',gt('No Events to Send!')); + echo show_msg_queue('error'); + return; + } + + if (bs3()) + $css = file_get_contents(BASE . "external/bootstrap3/css/bootstrap.css"); + elseif (bs2()) + $css = file_get_contents(BASE . "external/bootstrap/css/bootstrap.css"); + else + $css = file_get_contents(BASE . "framework/modules/events/assets/css/calendar.css"); + $template->assign("css", $css); + $template->assign("config", $this->config); + $template->assign("src", $loc->src); + + // format and send email + $subject = $this->config['email_title_reminder'] . " - $title"; + $from_addr = $this->config['email_address_reminder']; + $headers = array( + "From" => $from = $this->config['email_from_reminder'], + "Reply-to" => $reply = $this->config['email_reply_reminder'] + ); + + // set up the html message + $template->assign("showdetail", !empty($this->config['email_showdetail'])); + $htmlmsg = $template->render(); + + // now the same thing for the text message + $msg = preg_replace('/(<script[^>]*>.+?<\/script>|<style[^>]*>.+?<\/style>)/s', '', $htmlmsg); // remove any script or style blocks + $msg = trim(strip_tags(str_replace(array("<br />", "<br>", "br/>"), "\n", $msg))); + + // Saved. do notifs + $emails = array(); + if (!empty($this->config['user_list'])) foreach ($this->config['user_list'] as $c) { + $u = user::getUserById($c); + $emails[$u->email] = trim(user::getUserAttribution($u->id)); + } + if (!empty($this->config['group_list'])) foreach ($this->config['group_list'] as $c) { + $grpusers = group::getUsersInGroup($c); + foreach ($grpusers as $u) { + $emails[$u->email] = trim(user::getUserAttribution($u->id)); + } + } + if (!empty($this->config['address_list'])) foreach ($this->config['address_list'] as $c) { + $emails[] = $c; + } + if (empty($emails)) { + flash('error',gt('No One to Send Reminders to!')); + echo show_msg_queue('error'); + return; + } + + $emails = array_flip(array_flip($emails)); + $emails = array_map('trim', $emails); +// $headers = array( +// "MIME-Version" => "1.0", +// "Content-type" => "text/html; charset=" . LANG_CHARSET +// ); + $mail = new expMail(); + $mail->quickSend(array( +// 'headers' => $headers, + 'html_message' => $htmlmsg, + "text_message" => $msg, + 'to' => $emails, + 'from' => array(trim($this->config['email_address_reminder']) => $this->config['email_from_reminder']), + 'subject' => $subject, + )); + + flash('message',gt('The following reminder was sent via email')); + echo show_msg_queue(); +// echo($htmlmsg); + } else { + flash('error',gt('No Calendar Selected!')); + echo show_msg_queue('error'); + } + } + + /** @deprecated moved to event model + * @param $edates + * @param bool $sort_asc + * @param bool $featuredonly + * @param bool $condense + * @return array + */ + function getEventsForDates($edates, $sort_asc = true, $featuredonly = false, $condense = false) { + global $eventid; + + $events = array(); + $featuresql = ""; + if ($featuredonly) $featuresql = " AND is_featured=1"; + foreach ($edates as $edate) { + $evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql); + foreach ($evs as $key=>$event) { + if ($condense) { + $eventid = $event->id; + $multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;')); + if (!empty($multiday_event)) { + unset($evs[$key]); + continue; + } + } + $evs[$key]->eventstart += $edate->date; + $evs[$key]->eventend += $edate->date; + $evs[$key]->date_id = $edate->id; + if (!empty($event->expCat)) { + $catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color); +// if (substr($catcolor,0,1)=='#') $catcolor = '" style="color:'.$catcolor.';'; + $evs[$key]->color = $catcolor; + } + } + if (count($events) < 500) { // magic number to not crash loop? + $events = array_merge($events, $evs); + } else { +// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'); +// $events = array_merge($events, $evs); + flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!')); + break; // keep from breaking system by too much data + } + } + $events = expSorter::sort(array('array' => $events, 'sortby' => 'eventstart', 'order' => $sort_asc ? 'ASC' : 'DESC')); + return $events; + } + + function getExternalEvents($startdate, $enddate, $multiday = false) { + global $db; + + $extevents = array(); + $dy = 0; // index of events array + if (!empty($this->config['pull_gcal'])) foreach ($this->config['pull_gcal'] as $key=>$extgcalurl) { +// $dy = count($extevents); // index of events array + $cache_hit = false; + $gcal_cname = str_replace(array("/",":","&","?"),"_",$extgcalurl); + $cache_fname = BASE.'tmp/cache/'.$gcal_cname.".cache"; + if (file_exists($cache_fname)) { + $cache = unserialize(file_get_contents($cache_fname)); + if ($startdate >= $cache['start_date'] || $startdate >= $cache['first_date']) { + $events = $db->selectObjects('event_cache','feed="'.$extgcalurl.'" AND ' . self::build_daterange_sql($startdate,$enddate,'eventdate',true)); + foreach ($events as $event) { + if ($multiday) { + $extevents[$event->eventdate][$dy] = $event; + $extevents[$event->eventdate][$dy]->feedkey = $key; + $extevents[$event->eventdate][$dy]->location_data = 'gcalevent' . $key; + $extevents[$event->eventdate][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; + if ($event->is_allday) { + $extevents[$event->eventdate][$dy]->eventstart = $event->eventdate; + } + $dy++; + } else { + $endit = !empty($event->dateFinished) ? $event->dateFinished : $event->eventdate; +// for ($i = $startdate; $i < $enddate; $i += 86400) { + for ($i = $event->eventdate; $i <= $endit; $i += 86400) { + if ((!empty($event->dateFinished) && $i > $event->dateFinished) || (empty($event->dateFinished) && $i > $event->eventdate)) { + break; + } else { + $extevents[$i][$dy] = clone($event); + $extevents[$i][$dy]->eventdate = (int)$i; + $extevents[$i][$dy]->eventstart = ($event->eventstart - $event->eventdate); + $extevents[$i][$dy]->eventend = ($event->eventend - (!empty($event->dateFinished)?$event->dateFinished:$event->eventdate)); + $extevents[$i][$dy]->eventstart = ($extevents[$i][$dy]->eventstart) + $i; + $extevents[$i][$dy]->eventend = ($extevents[$i][$dy]->eventend) + $i; + $extevents[$i][$dy]->feedkey = $key; + $extevents[$i][$dy]->location_data = 'gcalevent' . $key; + $extevents[$i][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; + $dy++; + } + } + } + } + $cache_hit = true; + } + } + if (!$cache_hit) { // pull in the external events + foreach ($this->get_gcal_events($extgcalurl, $startdate, $enddate, $dy, $key, $multiday) as $date=>$events) { + foreach ($events as $event) { + $extevents[$date][] = $event; + } + } + } + } + if (!empty($this->config['pull_ical'])) foreach ($this->config['pull_ical'] as $key=>$exticalurl) { +// $dy = count($extevents); // index of events array + $cache_hit = false; + $ical_cname = str_replace(array("/",":","&","?"),"_",$exticalurl); + $cache_fname = BASE.'tmp/cache/'.$ical_cname.".cache"; + if (file_exists($cache_fname)) { + $cache = unserialize(file_get_contents($cache_fname)); + if ($startdate >= $cache['start_date'] || $startdate >= $cache['first_date']) { + $events = $db->selectObjects('event_cache','feed="'.$exticalurl.'" AND ' . self::build_daterange_sql($startdate,$enddate,'eventdate',true)); + foreach ($events as $event) { + $extevents[$event->eventdate][$dy] = $event; + $extevents[$event->eventdate][$dy]->location_data = 'icalevent' . $key; + $extevents[$event->eventdate][$dy]->color = !empty($this->config['pull_ical_color'][$key]) ? $this->config['pull_ical_color'][$key] : null; + $dy++; + } + $cache_hit = true; + } + } + if (!$cache_hit) { // pull in the external events + foreach ($this->get_ical_events($exticalurl, $startdate, $enddate, $dy, $key, $multiday) as $date=>$events) { + foreach ($events as $event) { + $extevents[$date][] = $event; + } + } + } + } + return $extevents; + } + + public function get_gcal_events($extgcalurl, $startdate, $enddate=null, &$dy=0, $key=0, $multiday=false) { + $extevents = array(); + if (!empty($startdate)) $begin = date("Y-m-d\Th:i:sP", expDateTime::startOfDayTimestamp($startdate)); + if (!empty($enddate)) $end = date("Y-m-d\Th:i:sP", expDateTime::endOfDayTimestamp($enddate)); + else $end = date("Y-m-d\Th:i:sP", (expDateTime::endOfDayTimestamp($startdate + ((3600*24)*30)))); + + if (substr($extgcalurl, -5) == 'basic') { + $extgcalurl = substr($extgcalurl, 0, - 5) . 'full'; + } + $feed = $extgcalurl . "?orderby=starttime&singleevents=true"; + if (!empty($startdate)) $feed .= "&start-min=" . $begin; + if (!empty($enddate)) $feed .= "&start-max=" . $end; + + // XML method +// $s = simplexml_load_file($feed); +// foreach ($s->entry as $item) { +// $gd = $item->children('http://schemas.google.com/g/2005'); +// if (!empty($gd->when)) { +// $dtstart = $gd->when->attributes()->startTime; +// } elseif (!empty($gd->recurrence)){ +// $dtstart = $gd->recurrence->when->attributes()->startTime; +// } else { +// $dtstart = $item->attributes()->When; +// } +// //FIXME must convert $dtstart timezone +// $eventdate = expDateTime::startOfDayTimestamp(strtotime($dtstart)); +// $ourtzoffsets = (int)(date('O',$eventdate)) * 36; +// $theirtzoffset = -((int)(substr($dtstart,-5,2)) * 3600); +// $tzoffset = $ourtzoffsets - $theirtzoffset; +// $extevents[$eventdate][$dy] = new stdClass(); +// $extevents[$eventdate][$dy]->eventdate = $eventdate; +// $extevents[$eventdate][$dy]->eventstart += strtotime($dtstart) + $tzoffset; +// if (!empty($gd->when)) { +// $dtend = $gd->when->attributes()->endTime; +// } elseif (!empty($gd->recurrence)) { +// $dtend = $gd->recurrence->when->attributes()->endTime; +// } +// //FIXME must convert $dtend timezone +// if (!empty($dtend)) $extevents[$eventdate][$dy]->eventend += strtotime($dtend) + $tzoffset; +// // dtstart required, one occurrence, (orig. start date) +// $extevents[$eventdate][$dy]->title = $item->title; +// $extevents[$eventdate][$dy]->body = $item->content; + // End XML method + + // DOM method + $doc = new DOMDocument(); + $doc->load($feed); + $entries = $doc->getElementsByTagName("entry"); + foreach ($entries as $item) { + $times = $item->getElementsByTagName("when"); + $dtstart = $times->item(0)->getAttributeNode("startTime")->value; + $eventdate = expDateTime::startOfDayTimestamp(strtotime($dtstart)); + $extevents[$eventdate][$dy] = new stdClass(); + $extevents[$eventdate][$dy]->eventdate = $eventdate; + $dtend = @$times->item(0)->getAttributeNode("endTime")->value; + $ourtzoffsets = (int)date('O',$eventdate) * 36; + $theirtzoffset = -((int)substr($dtstart,-5,2) * 3600); + $tzoffset = $ourtzoffsets - $theirtzoffset; + if (strlen($dtstart) > 10) { + $extevents[$eventdate][$dy]->eventstart = ((int)substr($dtstart, 11, 2) * 3600) + ((int)substr($dtstart, 14, 2) * 60) + $tzoffset; +// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventstart += 3600; + $extevents[$eventdate][$dy]->eventend = ((int)substr($dtend, 11, 2) * 3600) + ((int)substr($dtend, 14, 2) * 60) + $tzoffset; +// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventend += 3600; + } else { + $extevents[$eventdate][$dy]->eventstart = null; + $extevents[$eventdate][$dy]->is_allday = 1; + } + $extevents[$eventdate][$dy]->eventstart += $eventdate; + $extevents[$eventdate][$dy]->eventend += $eventdate; + if (empty($dtend)) $extevents[$eventdate][$dy]->eventend = $extevents[$eventdate][$dy]->eventstart; + + $titles = $item->getElementsByTagName("title"); + $extevents[$eventdate][$dy]->title = $titles->item(0)->nodeValue; + $contents = $item->getElementsByTagName("content"); + $extevents[$eventdate][$dy]->body = $contents->item(0)->nodeValue; + // End DOM method + +// $extevents[$eventdate][$dy]->location_data = serialize(expCore::makeLocation('extevent',$extcal->id)); + $extevents[$eventdate][$dy]->location_data = 'gcalevent' . $key; + $extevents[$eventdate][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null; + $dy++; + } + return $extevents; + } + + public function get_ical_events($exticalurl, $startdate=null, $enddate=null, &$dy=0, $key=0, $multiday=false) { + $extevents = array(); +// require_once BASE . 'external/iCalcreator.class.php'; + require_once BASE . 'external/iCalcreator-2.22/iCalcreator.php'; + $v = new vcalendar(); // initiate new CALENDAR + if (stripos($exticalurl, 'http') === 0) { + $v->setConfig('url', $exticalurl); + } else { + $v->setConfig('directory', dirname($exticalurl)); + $v->setConfig('filename', basename($exticalurl)); + } + $v->parse(); + if ($startdate === null) { + $startYear = false; + $startMonth = false; + $startDay = false; + } else { + $startYear = date('Y', $startdate); + $startMonth = date('n', $startdate); + $startDay = date('j', $startdate); + } + if ($enddate === null) { + $endYear = $startYear+1; + $endMonth = $startMonth; + $endDay = $startDay; + } else { + $endYear = date('Y', $enddate); + $endMonth = date('n', $enddate); + $endDay = date('j', $enddate); + } + // get all events within period split out recurring events as single events per each day + $eventArray = $v->selectComponents($startYear, $startMonth, $startDay, $endYear, $endMonth, $endDay, 'vevent'); + // Set the timezone to GMT + @date_default_timezone_set('GMT'); + $tzarray = getTimezonesAsDateArrays($v); + // Set the default timezone + @date_default_timezone_set(DISPLAY_DEFAULT_TIMEZONE); + if (!empty($eventArray)) foreach ($eventArray as $year => $yearArray) { + if (!empty($yearArray)) foreach ($yearArray as $month => $monthArray) { + if (!empty($monthArray)) foreach ($monthArray as $day => $dailyEventsArray) { + if (!empty($dailyEventsArray)) foreach ($dailyEventsArray as $vevent) { + // process each event + $yesterday = false; + $currdate = $vevent->getProperty('x-current-dtstart'); + $thisday = explode('-', $currdate[1]); + $thisday2 = substr($thisday[2], 0, 2); + // if member of a recurrence set, + // returns array( 'x-current-dtstart', <DATE>) + // <DATE> = (string) date("Y-m-d [H:i:s][timezone/UTC offset]") + $dtstart = $vevent->getProperty('dtstart', false, true); + $dtend = $vevent->getProperty('dtend', false, true); + if (empty($dtend)) + $dtend = $dtstart; + + // calculate the cumulative timezone offset in seconds to convert to local/system time + $tzoffsets = array(); + $date_tzoffset = 0; + if (!empty($tzarray)) { +// $ourtzoffsets = -(iCalUtilityFunctions::_tz2offset(date('O',time()))); + $ourtzoffsets = -(iCalUtilityFunctions::_tz2offset(date('O',self::_date2timestamp($dtstart['value'])))); + // Set the timezone to GMT + @date_default_timezone_set('GMT'); + if (!empty($dtstart['params']['TZID'])) $tzoffsets = getTzOffsetForDate($tzarray, $dtstart['params']['TZID'], $dtstart['value']); + // Set the default timezone + @date_default_timezone_set(DISPLAY_DEFAULT_TIMEZONE); + if (isset($tzoffsets['offsetSec'])) $date_tzoffset = $ourtzoffsets + $tzoffsets['offsetSec']; + } + if (empty($tzoffsets)) { + $date_tzoffset = -(iCalUtilityFunctions::_tz2offset(date('O',self::_date2timestamp($dtstart['value'])))); + } + //FIXME we must have the real timezone offset for the date by this point + + //FIXME this is for the google ical feed which is bad! + if ($dtstart['value']['day'] != (int)$thisday2 && (isset($dtstart['value']['day']) && isset($dtend['value']['hour']))&& + !((int)$dtstart['value']['hour'] == 0 && (int)$dtstart['value']['min'] == 0 && (int)$dtstart['value']['sec'] == 0 + && (int)$dtend['value']['hour'] == 0 && (int)$dtend['value']['min'] == 0 && (int)$dtend['value']['sec'] == 0 + && ((((int)$dtstart['value']['day'] - (int)$dtend['value']['day']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -11)))) { + $dtst = strtotime($currdate[1]); + $dtst1 = iCalUtilityFunctions::_timestamp2date($dtst); + $dtstart['value']['year'] = $dtst1['year']; + $dtstart['value']['month'] = $dtst1['month']; + $dtstart['value']['day'] = $dtst1['day']; + $currenddate = $vevent->getProperty('x-current-dtend'); + $dtet = strtotime($currenddate[1]); + $dtet1 = iCalUtilityFunctions::_timestamp2date($dtet); + $dtend['value']['year'] = $dtet1['year']; + $dtend['value']['month'] = $dtet1['month']; + $dtend['value']['day'] = $dtet1['day']; +// $date_tzoffset = 0; + } + + if (!empty($dtstart['value']['hour']) && !((int)$dtstart['value']['hour'] == 0 && (int)$dtstart['value']['min'] == 0 && (int)$dtstart['value']['sec'] == 0 + && (int)$dtend['value']['hour'] == 0 && (int)$dtend['value']['min'] == 0 && (int)$dtend['value']['sec'] == 0 + && ((((int)$dtstart['value']['day'] - (int)$dtend['value']['day']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -1) || (((int)$dtstart['value']['month'] - (int)$dtend['value']['month']) == -11)))) { + $eventdate = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtstart['value']) - $date_tzoffset); +// $eventend = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtend['value']) - $date_tzoffset); + $extevents[$eventdate][$dy] = new stdClass(); + $extevents[$eventdate][$dy]->eventdate = new stdClass(); + $extevents[$eventdate][$dy]->eventdate->date = $eventdate; +// if ((int)($dtstart['value']['hour']) == 0 && (int)($dtstart['value']['min']) == 0 && (int)($dtstart['value']['sec']) == 0 +// && (int)($dtend['value']['hour']) == 0 && (int)($dtend['value']['min']) == 0 && (int)($dtend['value']['sec']) == 0 +// && ((((int)($dtstart['value']['day']) - (int)($dtend['value']['day'])) == -1) || (((int)($dtstart['value']['month']) - (int)($dtend['value']['month'])) == -1) || (((int)($dtstart['value']['month']) - (int)($dtend['value']['month'])) == -11))) { +//// if ($dtstart['value']['day'] != (int)($thisday2)) { +// if (date('d',$eventdate) != $thisday2) { +//// if (date('d',$eventdate) != date('d',$eventend)) { +// $yesterday = true; +// } else { +// $extevents[$eventdate][$dy]->eventstart = null; +// $extevents[$eventdate][$dy]->is_allday = 1; +// } +// } else { + if (date('d',$eventdate) != $thisday2) { +// if (date('d',$eventdate) != date('d',$eventend)) { + $yesterday = true; + } else { + $extevents[$eventdate][$dy]->eventstart = ($dtstart['value']['hour'] * 3600) + ($dtstart['value']['min'] * 60) - $date_tzoffset; +// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventstart += 3600; // adjust for daylight savings time + } +// } + } else { + // this is an all day event + $eventdate = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtstart['value'])); +// $eventend = expDateTime::startOfDayTimestamp(self::_date2timestamp($dtend['value'])); + $extevents[$eventdate][$dy] = new stdClass(); + $extevents[$eventdate][$dy]->eventdate = new stdClass(); + $extevents[$eventdate][$dy]->eventdate->date = $eventdate; +// if ($dtstart['value']['day'] != (int)($thisday2)) { + if (date('d',$eventdate) != $thisday2) { +// if (date('d',$eventdate) != date('d',$eventend)) { + $yesterday = true; + } else { + $extevents[$eventdate][$dy]->eventstart = null; + $extevents[$eventdate][$dy]->is_allday = 1; + } + } + + // set the end time if needed + if (!$yesterday && isset($dtend['value']['hour']) && empty($extevents[$eventdate][$dy]->is_allday)) { +// if ($dtend['value']['day'] != (int)($thisday2)) { +// if ((date('d',$eventend) != $thisday2)) { +// $yesterday = true; +// } else { + $extevents[$eventdate][$dy]->eventend = ($dtend['value']['hour'] * 3600) + ($dtend['value']['min'] * 60) - $date_tzoffset; +// if (date("I", $eventdate)) $extevents[$eventdate][$dy]->eventend += 3600; // adjust for daylight savings time +// } + } + + // convert the start and end times to a full date + if (isset($extevents[$eventdate][$dy]->eventstart) && $extevents[$eventdate][$dy]->eventstart != null) + $extevents[$eventdate][$dy]->eventstart += $eventdate; + if (isset($extevents[$eventdate][$dy]->eventend)) + $extevents[$eventdate][$dy]->eventend += $eventdate; + + // dtstart required, one occurrence, (orig. start date) + $extevents[$eventdate][$dy]->title = $vevent->getProperty('summary'); + $body = $vevent->getProperty('description'); + // convert end of lines + $body = nl2br(str_replace("\\n"," <br>\n",$body)); + $body = str_replace("\n"," <br>\n",$body); + $body = str_replace(array('==0A','=0A','=C2=A0')," <br>\n",$body); + $extevents[$eventdate][$dy]->body = $body; + $extevents[$eventdate][$dy]->location_data = 'icalevent' . $key; + $extevents[$eventdate][$dy]->color = !empty($this->config['pull_ical_color'][$key]) ? $this->config['pull_ical_color'][$key] : null; + if (!$yesterday && $eventdate >= $startdate) { + $dy++; + } else { + unset($extevents[$eventdate][$dy]); + } + } + } + } + } + return $extevents; + } + + public static function _date2timestamp( $datetime, $wtz=null ) { + if( !isset( $datetime['hour'] )) $datetime['hour'] = 0; + if( !isset( $datetime['min'] )) $datetime['min'] = 0; + if( !isset( $datetime['sec'] )) $datetime['sec'] = 0; + if( empty( $wtz ) && ( !isset( $datetime['tz'] ) || empty( $datetime['tz'] ))) + return mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] ); + $output = $offset = 0; + if( empty( $wtz )) { + if( iCalUtilityFunctions::_isOffset( $datetime['tz'] )) { + $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) * -1; + $wtz = 'UTC'; + } + else + $wtz = $datetime['tz']; + } + if(( 'Z' == $wtz ) || ( 'GMT' == strtoupper( $wtz ))) + $wtz = 'UTC'; + try { + $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['min'], $datetime['sec'] ); + $d = new DateTime( $strdate, new DateTimeZone( $wtz )); + if( 0 != $offset ) // adjust for offset + $d->modify( $offset.' seconds' ); + $output = $d->format( 'U' ); + unset( $d ); + } + catch( Exception $e ) { + $output = mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] ); + } + return $output; + } + + /** + * build/update the external event cache + * + */ + public function build_cache() { + global $db; + + // get our requested config + $cfg = new expConfig(); + $configs = $cfg->find('all', "location_data LIKE '%event%'"); // get all event module configs + foreach ($configs as $config) { + $loc = expUnserialize($config->location_data); + if (!empty($this->params['title'])) { + if ($this->params['title'] == $config->config['feed_sef_url']) { + $this->config = $config->config; + break; + } + } elseif (!empty($this->params['src'])) { + if ($this->params['src'] == $loc->src) { + $this->config = $config->config; + break; + } + } + } + + // next loop through our config pull urls + + // google xml pull + if (!empty($this->config['pull_gcal'])) foreach ($this->config['pull_gcal'] as $key=>$extgcalurl) { + $start = expDateTime::startOfMonthTimestamp(time()); + $gcal_cname = str_replace(array("/",":","&","?"),"_",$extgcalurl); + $cache_fname = BASE.'tmp/cache/'.$gcal_cname.".cache"; + $db->delete('event_cache', "feed='" . $extgcalurl . "' AND eventdate > " . $start); // replace future events + // loop through 12 months, 1 month at a time + for ($i=1; $i < 13; $i++) { + $end = expDateTime::endOfMonthTimestamp($start); + $tmp = 0; + $extevents = $this->get_gcal_events($extgcalurl, $start, $end, $tmp, 0, true); +// $extevents = $this->get_gcal_events($extgcalurl, null, null, 0, 0, 0, true); + foreach ($extevents as $day) { + foreach ($day as $extevent) { + $event_cache = new stdClass(); + $event_cache->feed = $extgcalurl; + $event_cache->event_id = $extevent->event_id; + $event_cache->title = $extevent->title; + $event_cache->body = $extevent->body; + $event_cache->eventdate = $extevent->eventdate->date; + if (isset($extevent->dateFinished) && $extevent->dateFinished != -68400) + $event_cache->dateFinished = $extevent->dateFinished; + if (isset($extevent->eventstart)) + $event_cache->eventstart = $extevent->eventstart; + if (isset($extevent->eventend)) + $event_cache->eventend = $extevent->eventend; + if (isset($extevent->is_allday)) + $event_cache->is_allday = $extevent->is_allday; + $found = false; + if ($extevent->eventdate->date < $start) // prevent duplicating events crossing month boundaries + $found = $db->selectObject('event_cache','feed="'.$extgcalurl.'" AND event_id="'.$event_cache->event_id.'" AND eventdate='.$event_cache->eventdate); + if (!$found) + $db->insertObject($event_cache,'event_cache'); + } + } + $start = expDateTime::startOfMonthTimestamp($end + 1024); + } + $cache_contents = serialize(array('start_date'=>$start,'first_date'=>(int)$db->selectValue('event_cache','eventdate','feed="'.$extgcalurl.'" ORDER BY eventdate'),'refresh_date'=>time())); + file_put_contents($cache_fname, $cache_contents); + } + + // ical pull + $start = expDateTime::startOfMonthTimestamp(time()); + if (!empty($this->config['pull_ical'])) foreach ($this->config['pull_ical'] as $key=>$exticalurl) { + $ical_cname = str_replace(array("/",":","&","?"),"_",$exticalurl); + $cache_fname = BASE.'tmp/cache/'.$ical_cname.".cache"; + $db->delete('event_cache', "feed='" . $exticalurl . "' AND eventdate > " . $start); + // get 1 years worth of events + $extevents = $this->get_ical_events($exticalurl, $start); + foreach ($extevents as $day) { + foreach ($day as $extevent) { + $event_cache = new stdClass(); + $event_cache->feed = $exticalurl; + $event_cache->title = $extevent->title; + $event_cache->body = $extevent->body; + $event_cache->eventdate = $extevent->eventdate->date; + if (isset($extevent->dateFinished)) + $event_cache->dateFinished = $extevent->dateFinished; + $event_cache->eventstart = $extevent->eventstart; + if (isset($extevent->eventend)) + $event_cache->eventend = $extevent->eventend; + if (isset($extevent->is_allday)) + $event_cache->is_allday = $extevent->is_allday; + $db->insertObject($event_cache, 'event_cache'); + } + } + $cache_contents = serialize(array('start_date'=>$start,'first_date'=>(int)$db->selectValue('event_cache','eventdate','feed="'.$exticalurl.'" ORDER BY eventdate'),'refresh_date'=>time())); + file_put_contents($cache_fname, $cache_contents); + } + flash('message', gt('External Calendar Event cache updated')); + echo show_msg_queue(); + } + + function import() { + $pullable_modules = expModules::listInstalledControllers($this->baseclassname); + $modules = new expPaginator(array( + 'records' => $pullable_modules, + 'controller' => $this->loc->mod, + 'action' => $this->params['action'], + 'order' => isset($this->params['order']) ? $this->params['order'] : 'section', + 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '', + 'page' => (isset($this->params['page']) ? $this->params['page'] : 1), + 'columns' => array( + gt('Title') => 'title', + gt('Page') => 'section' + ), + )); + + assign_to_template(array( + 'modules' => $modules, + )); + } + + function import_select() + { + if (empty($this->params['import_aggregate'])) { + expValidator::setErrorField('import_aggregate[]'); + expValidator::failAndReturnToForm(gt('You must select a module.'), $this->params); + } + $extevents = array(); + unset( + $this->params['begin'], + $this->params['end'] + ); // always use date value + $begin = yuidatetimecontrol::parseData('begin', $this->params); + $end = yuidatetimecontrol::parseData('end', $this->params); + if ($this->params['file_type'] == 'file') { + //Get the temp directory to put the uploaded file + $directory = "tmp"; + + //Get the file save it to the temp directory + if (!empty($_FILES["import_file"]) && $_FILES["import_file"]["error"] == UPLOAD_ERR_OK) { + $file = expFile::fileUpload( + "import_file", + false, + false, + time() . "_" . $_FILES['import_file']['name'], + $directory . '/' + ); + if ($file === null) { + switch ($_FILES["import_file"]["error"]) { + case UPLOAD_ERR_INI_SIZE: + case UPLOAD_ERR_FORM_SIZE: + $this->params['_formError'] = gt( + 'The file you attempted to upload is too large. Contact your system administrator if this is a problem.' + ); + break; + case UPLOAD_ERR_PARTIAL: + $this->params['_formError'] = gt('The file was only partially uploaded.'); + break; + case UPLOAD_ERR_NO_FILE: + $this->params['_formError'] = gt('No file was uploaded.'); + break; + default: + $this->params['_formError'] = gt( + 'A strange internal error has occurred. Please contact the Exponent Developers.' + ); + break; + } + expSession::set("last_POST", $this->params); + header("Location: " . $_SERVER['HTTP_REFERER']); + exit(""); + } else { + $extevents = $this->get_ical_events($directory . "/" . $file->filename, $begin, $end); + } + } else { + expValidator::setErrorField('import_file'); + expValidator::failAndReturnToForm(gt('File failed to upload.'), $this->params); // file upload error + } + } else { + if (empty($this->params['ext_feed'])) { + expValidator::setErrorField('ext_feed'); + expValidator::failAndReturnToForm(gt('You must enter a feed url.'), $this->params); + } + $extevents = $this->get_ical_events($this->params['ext_feed'], $begin, $end); + } + + $src = $this->params['import_aggregate'][0]; + $count = 0; + foreach ($extevents as $day) { + foreach ($day as $extevent) { + $event = array(); + $event['title'] = $extevent->title; + $event['body'] = $extevent->body; + $event['eventdate'] = $extevent->eventdate->date; + $event['eventstart'] = $extevent->eventstart; + $event['eventstart'] -= $event['eventdate']; + if (isset($extevent->eventend)) + $event['eventend'] = $extevent->eventend; + else + $event['eventend'] = $extevent->eventstart; + $event['eventend'] -= $event['eventdate']; + if (isset($extevent->is_allday)) + $event['is_allday'] = $extevent->is_allday; + $event['module'] = 'event'; + $event['src'] = $src; + $item = new event(); // create new populated record to auto-set things + $item->update($event); + $count++; + } + } + + unlink($directory . "/" . $file->filename); + + // update search index + $this->addContentToSearch(); + + flashAndFlow('message', $count . ' ' . gt('events were imported.')); + } + + /** @deprecated + * function to build a control requested via ajax + * we the html just like the control smarty function + * @deprecated + */ + public function buildControl() { + $control = new colorcontrol(); + if (!empty($this->params['value'])) $control->value = $this->params['value']; + if ($this->params['value'][0] != '#') $this->params['value'] = '#' . $this->params['value']; + $control->default = $this->params['value']; + if (!empty($this->params['hide'])) $control->hide = $this->params['hide']; + if (isset($this->params['flip'])) $control->flip = $this->params['flip']; + $this->params['name'] = !empty($this->params['name']) ? $this->params['name'] : ''; + $control->name = $this->params['name']; + $this->params['id'] = !empty($this->params['id']) ? $this->params['id'] : ''; + $control->id = isset($this->params['id']) && $this->params['id'] != "" ? $this->params['id'] : ""; + //echo $control->id; + if (empty($control->id)) $control->id = $this->params['name']; + if (empty($control->name)) $control->name = $this->params['id']; + + // attempt to translate the label + if (!empty($this->params['label'])) { + $this->params['label'] = gt($this->params['label']); + } else { + $this->params['label'] = null; + } + echo $control->toHTML($this->params['label'], $this->params['name']); +// $ar = new expAjaxReply(200, gt('The control was created'), json_encode(array('data'=>$code))); +// $ar->send(); + } + +} + ?> \ No newline at end of file diff --git a/framework/modules/events/models/event.php b/framework/modules/events/models/event.php index 982c5a293e..2609d11c10 100644 --- a/framework/modules/events/models/event.php +++ b/framework/modules/events/models/event.php @@ -52,6 +52,11 @@ public function find($range = 'all', $where = null, $order = null, $limit = null //note $order is boolean for 'featured' //note $limit is number of days, NOT number of records //note $limitstart is a unixtimestamp in this instance + $order = expString::escape($order); + if ($limit !== null) + $limit = intval($limit); + if ($limitstart !== null) + $limitstart = intval($limitstart); $ed = new eventdate(); $day = expDateTime::startOfDayTimestamp(time()); $sort_asc = true; // For the getEventsForDates call @@ -65,7 +70,7 @@ public function find($range = 'all', $where = null, $order = null, $limit = null // $begin = $day; // $end = null; $items = $this->getEventsForDates($dates, $sort_asc, $order ? true : false, true); - + // external events // $extitems = $this->getExternalEvents($begin, $end); // we need to crunch these down @@ -78,7 +83,7 @@ public function find($range = 'all', $where = null, $order = null, $limit = null // } // } // $items = array_merge($items, $extitem); - + // event registration events // if (!empty($this->config['aggregate_registrations'])) $regitems = eventregistrationController::getRegEventsForDates($begin, $end, $regcolor); // we need to crunch these down @@ -89,7 +94,7 @@ public function find($range = 'all', $where = null, $order = null, $limit = null // } // } // $items = array_merge($items, $regitem); - + $items = expSorter::sort(array('array' => $items, 'sortby' => 'eventstart', 'order' => 'ASC')); return $items; } @@ -246,7 +251,7 @@ public static function dayNames() { } return $days; } - + } ?> \ No newline at end of file diff --git a/framework/modules/file/controllers/fileController.php b/framework/modules/file/controllers/fileController.php index 8cf627359d..27dc1f1c4a 100755 --- a/framework/modules/file/controllers/fileController.php +++ b/framework/modules/file/controllers/fileController.php @@ -23,20 +23,26 @@ class fileController extends expController { public $basemodel_name = "expFile"; - protected $add_permissions = array( -// 'picker'=>'Manage Files', - 'import'=>'Import', - 'export'=>'Export', - ); protected $remove_permissions = array( 'delete' ); +// protected $manage_permissions = array( +// 'picker'=>'Manage Files', +// 'import'=>'Import', +// 'export'=>'Export', +// ); public $requires_login = array( - 'picker'=>'must be logged in', - 'editAlt'=>'must be logged in', - 'editCat'=>'must be logged in', - 'editShare'=>'must be logged in', - 'editTitle'=>'must be logged in', + 'picker'=>'You must be logged in to perform this action', + 'adder'=>'You must be logged in to perform this action', + 'addit'=>'You must be logged in to perform this action', + 'batchDelete'=>'You must be logged in to perform this action', + 'createFolder'=>'You must be logged in to perform this action', + 'deleter'=>'You must be logged in to perform this action', + 'deleteit'=>'You must be logged in to perform this action', + 'edit'=>'You must be logged in to perform this action', + 'quickUpload'=>'You must be logged in to perform this action', + 'upload'=>'You must be logged in to perform this action', + 'uploader'=>'You must be logged in to perform this action', ); static function displayname() { return gt("File Manager"); } @@ -47,20 +53,20 @@ public function manage_fixPaths() { // fixes file directory issues when the old file class was used to save record // where the trailing forward slash was not added. This simply checks to see // if the trailing / is there, if not, it adds it. - + $file = new expFile(); $files = $file->find('all'); - + foreach ($files as $key=>$file) { if (substr($files[$key]->directory,-1,1)!="/") { $files[$key]->directory = $files[$key]->directory.'/'; } $files[$key]->save(); } - + // eDebug($files,true); } - + public function picker() { // global $user; @@ -89,7 +95,7 @@ public function picker() { 'jscats'=>json_encode($jscatarray) )); } - + public function uploader() { global $user; //expHistory::set('manageable', $this->params); @@ -113,14 +119,14 @@ public function uploader() { 'cats'=>$catarray, )); } - + /** * Returns attached file view template configuration settings template * */ public function get_view_config() { global $template; - + // set paths we will search in for the view $paths = array( BASE.'themes/'.DISPLAY_THEME.'/modules/common/views/file/configure', @@ -148,7 +154,7 @@ public function get_view_config() { } } } - + /** * Returns view template configuration settings view template * @@ -331,7 +337,7 @@ public function getFilesByJSON() { $filter .= !empty($filter) ? " AND " : ""; $filter .= "is_image=1"; } - + // $totalrecords = $this->$modelname->find('count',$filter); // $files = $this->$modelname->find('all',$filter,$sort.' '.$dir, $results, $startIndex); $files = $this->$modelname->find('all', $filter, $sort.' '.$dir); @@ -364,9 +370,9 @@ public function getFilesByJSON() { 'pageSize'=>$results, 'records'=>$files ); - + } - + echo json_encode($returnValue); } @@ -411,8 +417,8 @@ public function delete() { flash('error',$file->filename.' '.gt('wasn\'t deleted because you don\'t own the file.')); } redirect_to(array("controller"=>'file',"action"=>'picker',"ajax_action"=>1,"update"=>$this->params['update'],"filter"=>$this->params['filter'])); - } - + } + public function deleter() { // global $db; @@ -527,7 +533,7 @@ public function addit() { } public function upload() { - + // upload the file, but don't save the record yet... if ($this->params['resize'] != 'false') { $maxwidth = $this->params['max_width']; @@ -562,7 +568,7 @@ public function upload() { echo gt('File was NOT uploaded!'); // flash('error',gt('File was not uploaded!')); } - } + } public function quickUpload(){ global $user; @@ -661,10 +667,10 @@ public function editTitle() { $ar = new expAjaxReply(300, gt("You didn't create this file, so you can't edit it.")); } $ar->send(); - } + } public function editAlt() { - global $user; + global $user; $file = new expFile($this->params['id']); if ($user->id==$file->poster || $user->isAdmin()) { $file->alt = $this->params['newValue']; @@ -675,7 +681,7 @@ public function editAlt() { } $ar->send(); echo json_encode($file); //FIXME we exit before hitting this - } + } public function editShare() { global $user; diff --git a/framework/modules/file/models/expFile.php b/framework/modules/file/models/expFile.php index f1b60fe946..ab52df0b86 100644 --- a/framework/modules/file/models/expFile.php +++ b/framework/modules/file/models/expFile.php @@ -425,7 +425,7 @@ public static function fileUpload($_postName = null, //Check to see if the directory exists. If not, create the directory structure. // if (!file_exists(BASE . $_destDir)) { // self::makeDirectory(BASE . $_destDir); - // } + // } // Move the temporary uploaded file into the destination directory, // and change the name. @@ -735,8 +735,9 @@ public static function download($file) { */ public static function fixName($name) { $name = preg_replace('/[^A-Za-z0-9\.]/','_',$name); - if ($name[0] == '.') + if ($name[0] == '.') // attempt to upload a dot file $name[0] = '_'; + $name = str_replace('_', '..', $name); // attempt to upload with redirection to new folder return $name; // return preg_replace('/[^A-Za-z0-9\.]/', '-', $name); } diff --git a/framework/modules/filedownloads/controllers/filedownloadController.php b/framework/modules/filedownloads/controllers/filedownloadController.php index aec54859f6..6039250d79 100755 --- a/framework/modules/filedownloads/controllers/filedownloadController.php +++ b/framework/modules/filedownloads/controllers/filedownloadController.php @@ -38,7 +38,7 @@ class filedownloadController extends expController { static function displayname() { return gt("File Downloads"); } static function description() { return gt("Place files on your website for users to download or use as a podcast."); } static function isSearchable() { return true; } - + function showall() { expHistory::set('viewable', $this->params); $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; @@ -90,21 +90,21 @@ public function downloadfile() { flash('error', gt('There was an error while trying to download your file. No File Specified.')); expHistory::back(); } - - $fd = new filedownload($this->params['fileid']); + + $fd = new filedownload(intval($this->params['fileid'])); if (empty($this->params['filenum'])) $this->params['filenum'] = 0; if (empty($fd->expFile['downloadable'][$this->params['filenum']]->id)) { flash('error', gt('There was an error while trying to download your file. The file you were looking for could not be found.')); expHistory::back(); - } - + } + $fd->downloads++; $fd->save(); - + // this will set the id to the id of the actual file..makes the download go right. $this->params['id'] = $fd->expFile['downloadable'][$this->params['filenum']]->id; - parent::downloadfile(); + parent::downloadfile(); } /** @@ -219,10 +219,10 @@ function getRSSContent($limit = 0) { $fd = new filedownload(); $items = $fd->find('all',$this->aggregateWhereClause(), isset($this->config['order']) ? $this->config['order'] : 'created_at DESC', $limit); - + //Convert the items to rss items $rssitems = array(); - foreach ($items as $key => $item) { + foreach ($items as $key => $item) { $rss_item = new FeedItem(); // Add the basic data @@ -281,7 +281,7 @@ function getRSSContent($limit = 0) { } return $rssitems; } - + } ?> \ No newline at end of file diff --git a/framework/modules/forms/controllers/formsController.php b/framework/modules/forms/controllers/formsController.php index 6ff7afb9a3..e32cfbbe74 100644 --- a/framework/modules/forms/controllers/formsController.php +++ b/framework/modules/forms/controllers/formsController.php @@ -27,6 +27,13 @@ class formsController extends expController { 'showall' => 'Show All Records', 'show' => 'Show a Single Record', ); + protected $add_permissions = array( + 'viewdata' => "View Data", + 'enter_data' => "Enter Data", // slight naming variation to not fully restrict enterdata method + ); + protected $manage_permissions = array( + 'design' => 'Design Form', + ); public $remove_configs = array( 'aggregation', 'categories', @@ -39,10 +46,6 @@ class formsController extends expController { 'tags', 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'viewdata' => "View Data", - 'enter_data' => "Enter Data" // slight naming variation to not fully restrict enterdata method - ); // public $codequality = 'beta'; static function displayname() { @@ -81,7 +84,7 @@ public function showall() { if (!empty($this->config)) { $f = $this->forms->find('first', 'id=' . $this->config['forms_id']); } elseif (!empty($this->params['title'])) { - $f = $this->forms->find('first', 'sef_url="' . $this->params['title'] . '"'); + $f = $this->forms->find('first', 'sef_url="' . expString::escape($this->params['title']) . '"'); $this->get_defaults($f); } elseif (!empty($this->params['id'])) { $f = $this->forms->find('first', 'id=' . $this->params['id']); @@ -92,7 +95,7 @@ public function showall() { if (empty($this->config['report_filter']) && empty($this->params['filter'])) { // allow for param of 'filter' also $where = '1'; } elseif (!empty($this->params['filter'])) { - $where = $this->params['filter']; + $where = expString::escape($this->params['filter']); } else { $where = $this->config['report_filter']; } @@ -200,7 +203,7 @@ public function show() { } elseif (!empty($this->params['forms_id'])) { $f = $this->forms->find('first', 'id=' . $this->params['forms_id']); } elseif (!empty($this->params['title'])) { - $f = $this->forms->find('first', 'sef_url="' . $this->params['title'] . '"'); + $f = $this->forms->find('first', 'sef_url="' . expString::escape($this->params['title']) . '"'); redirect_to(array('controller' => 'forms', 'action' => 'enterdata', 'forms_id' => $f->id)); } @@ -710,10 +713,10 @@ public function submit_data() { // ); $tmsg = trim(strip_tags(str_replace(array("<br />", "<br>", "br/>"), "\n", $this->config['auto_respond_body']))); - if ($this->config['auto_respond_form']) + if ($this->config['auto_respond_form']) $tmsg .= "\n" . $emailText; $hmsg = $this->config['auto_respond_body']; - if ($this->config['auto_respond_form']) + if ($this->config['auto_respond_form']) $hmsg .= "\n" . $emailHtml; $mail = new expMail(); $mail->quickSend(array( @@ -1939,6 +1942,10 @@ public function import_csv_data_display() { public function import_csv_data_add() { global $user; + if (!empty($this->params['filename']) && (strpos($this->params['filename'], 'tmp/') === false || strpos($this->params['folder'], '..') !== false)) { + header('Location: ' . URL_FULL); + exit(); // attempt to hack the site + } $line_end = ini_get('auto_detect_line_endings'); ini_set('auto_detect_line_endings',TRUE); $file = fopen(BASE . $this->params["filename"], "r"); diff --git a/framework/modules/help/controllers/helpController.php b/framework/modules/help/controllers/helpController.php index d2dac57cbe..1982ea6aee 100755 --- a/framework/modules/help/controllers/helpController.php +++ b/framework/modules/help/controllers/helpController.php @@ -41,7 +41,7 @@ class helpController extends expController { static function displayname() { return gt("Help"); } static function description() { return gt("Manage Exponent CMS help files."); } static function isSearchable() { return true; } - + function __construct($src=null, $params=array()) { parent::__construct($src,$params); // only set the system help version if it's not already set as a session variable @@ -74,13 +74,13 @@ public function showall() { //$current_version = $hv->find('first', 'is_current=1'); $ref_version = $hv->find('first', 'version=\''.$this->help_version.'\''); - // pagination parameter..hard coded for now. + // pagination parameter..hard coded for now. $where = $this->aggregateWhereClause(); $where .= 'AND help_version_id='.(empty($ref_version->id)?'0':$ref_version->id); if (empty($this->params['parent'])) { $where .= ' AND (parent=0 OR parent IS NULL)'; } else { - $where .= ' AND parent=' . $this->params['parent']; + $where .= ' AND parent=' . intval($this->params['parent']); } // $limit = 999; $order = isset($this->config['order']) ? $this->config['order'] : 'rank'; @@ -127,6 +127,7 @@ public function show() { $version_id = help_version::getCurrentHelpVersionId(); } } + $this->params['title'] = expString::escape($this->params['title']); // escape title to prevent sql injection $doc = $help->find('first', 'help_version_id='.$version_id.' AND sef_url="'.$this->params['title'].'"'); $children = $help->find('count','parent='.$doc->id); if (empty($doc)) { @@ -201,10 +202,10 @@ public function edit() { public function manage() { expHistory::set('manageable', $this->params); global $db; - + $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); - + if (empty($current_version)) { flash('error', gt("You don't have any software versions created yet. Please do so now.")); redirect_to(array('controller'=>'help', 'action'=>'edit_version')); @@ -218,7 +219,7 @@ public function manage() { } } - $where = empty($this->params['version']) ? 1 : 'help_version_id='.$this->params['version']; + $where = empty($this->params['version']) ? 1 : 'help_version_id='.intval($this->params['version']); $page = new expPaginator(array( 'model'=>'help', 'where'=>$where, @@ -263,7 +264,7 @@ private static function copydocs($from, $to) { $origid = $doc->id; unset($doc->id); $doc->help_version_id = $to; - + // $tmpsef = $doc->sef_url; // $doc->sef_url = ""; // $doc->save(); @@ -313,10 +314,10 @@ private static function copydocs($from, $to) { */ public function manage_versions() { expHistory::set('manageable', $this->params); - + $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); - + $sql = 'SELECT hv.*, COUNT(h.title) AS num_docs FROM '.DB_TABLE_PREFIX.'_help h '; $sql .= 'RIGHT JOIN '.DB_TABLE_PREFIX.'_help_version hv ON h.help_version_id=hv.id GROUP BY hv.version'; @@ -336,7 +337,7 @@ public function manage_versions() { gt('# of Docs')=>'num_docs' ), )); - + assign_to_template(array( 'current_version'=>$current_version, 'page'=>$page @@ -362,23 +363,23 @@ public function delete_version() { if (empty($this->params['id'])) { flash('error', gt('The version you are trying to delete could not be found')); } - + // get the version $version = new help_version($this->params['id']); if (empty($version->id)) { flash('error', gt('The version you are trying to delete could not be found')); } - + // if we have errors than lets get outta here! if (!expQueue::isQueueEmpty('error')) expHistory::back(); - + // delete the version $version->delete(); - + expSession::un_set('help-version'); flash('message', gt('Deleted version').' '.$version->version.' '.gt('and all documents in that version.')); - expHistory::back(); + expHistory::back(); } /** @@ -388,7 +389,7 @@ public function update_version() { // get the current version $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); - + // check to see if the we have a new current version and unset the old current version. if (!empty($this->params['is_current'])) { // $db->sql('UPDATE '.DB_TABLE_PREFIX.'_help_version set is_current=0'); @@ -402,10 +403,10 @@ public function update_version() { // if we don't have a current version yet so we will force this one to be it if (empty($current_version->id)) $this->params['is_current'] = 1; $version->update($this->params); - + // if this is a new version we need to copy over docs if (empty($id)) { - self::copydocs($current_version->id, $version->id); + self::copydocs($current_version->id, $version->id); } // let's update the search index to reflect the current help version searchController::spider(); @@ -536,7 +537,7 @@ public static function getSection($params) { $section = new section(intval($sid)); return $section; } - + } ?> \ No newline at end of file diff --git a/framework/modules/help/models/help_version.php b/framework/modules/help/models/help_version.php index 5413e9c2c3..a3b53c8751 100644 --- a/framework/modules/help/models/help_version.php +++ b/framework/modules/help/models/help_version.php @@ -52,13 +52,13 @@ public static function getCurrentHelpVersion() { public static function getHelpVersionId($version) { global $db; - return $db->selectValue('help_version', 'id', 'version="'.$version.'"'); + return $db->selectValue('help_version', 'id', 'version="'.$db->escapeString($version).'"'); } public static function getHelpVersion($version_id) { global $db; - return $db->selectValue('help_version', 'version', 'id="'.$version_id.'"'); + return $db->selectValue('help_version', 'version', 'id="'.intval($version_id).'"'); } public static function getHelpVersionsDropdown() { diff --git a/framework/modules/importexport/controllers/importexportController.php b/framework/modules/importexport/controllers/importexportController.php index 4e84c32081..32deeb39ef 100644 --- a/framework/modules/importexport/controllers/importexportController.php +++ b/framework/modules/importexport/controllers/importexportController.php @@ -22,6 +22,13 @@ */ class importexportController extends expController { + protected $add_permissions = array( + 'import' => 'Import Data', + 'export' => 'Export Data' + ); + protected $manage_permissions = array( + 'importProduct' => 'Import Product', + ); // hide the configs we don't need public $remove_configs = array( 'aggregation', @@ -35,11 +42,6 @@ class importexportController extends expController { 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - //protected $permissions = array_merge(array("test"=>'Test'), array('copyProduct'=>"Copy Product")); - protected $add_permissions = array( - 'import' => 'Import Data', - 'export' => 'Export Data' - ); static function displayname() { return gt("Data Import / Export Module"); @@ -177,6 +179,11 @@ function import_process() { expValidator::failAndReturnToForm(gt('You must select at least one item.'), $this->params); } + if (!empty($this->params['filename']) && (strpos($this->params['filename'], 'tmp/') === false || strpos($this->params['folder'], '..') !== false)) { + header('Location: ' . URL_FULL); + exit(); // attempt to hack the site + } + $filename = $this->params['filename']; $src = $this->params['source']; $selected = $this->params['items']; @@ -357,7 +364,7 @@ function export_process() { function validate() { // global $db; - //eDebug($this->params,true); + //eDebug($this->params,true); set_time_limit(0); //$file = new expFile($this->params['expFile']['import_file'][0]); if (!empty($_FILES['import_file']['error'])) { @@ -397,117 +404,117 @@ function validate() { { $handle = fopen($file->path, "r"); $data = fgetcsv($handle, 10000, ","); - //eDebug($data); - $source = ''; + //eDebug($data); + $source = ''; foreach ($data as $key=>$value) { - $dataset[$value] = ''; + $dataset[$value] = ''; if($key == 2 && $value=='Unique_Bill_Name') $source = '1'; //SMC } - + //eDebug($source); //eDebug($dataset,true); $count = 1; $errorSet = array(); $successSet = array(); eDebug($dataset); - + $extAddy = null; while (($data = fgetcsv($handle, 10000, ",")) !== FALSE) { $count++; - $extAddy = new external_address(); + $extAddy = new external_address(); $bName = explode(' ',$data[3]); eDebug($bName); $extAddy->firstname = $bName[0]; if(count($bName) == 3) { $extAddy->middlename = $bName[1]; - $extAddy->lastname = $bName[2]; + $extAddy->lastname = $bName[2]; } else if (count($bName) ==1) { $extAddy->middlename = ''; - $extAddy->lastname = ''; + $extAddy->lastname = ''; } else { $extAddy->middlename = ''; - $extAddy->lastname = $bName[1]; + $extAddy->lastname = $bName[1]; } - + $extAddy->organization = $data[4]; $extAddy->address1 = $data[5]; - $extAddy->address2 = $data[6]; - $extAddy->address2 = $data[6]; - $extAddy->city = $data[7]; - + $extAddy->address2 = $data[6]; + $extAddy->address2 = $data[6]; + $extAddy->city = $data[7]; + $s = new geoRegion(); $state = $s->find('first','code="'.trim($data[8]).'"'); eDebug($state); - $extAddy->state = $state->id; - $extAddy->zip = str_ireplace("'",'',$data[9]); - $extAddy->phone = $data[20]; - $extAddy->email = $data[21]; + $extAddy->state = $state->id; + $extAddy->zip = str_ireplace("'",'',$data[9]); + $extAddy->phone = $data[20]; + $extAddy->email = $data[21]; $extAddy->source = $source; - - + + //shipping if($data[3] == $data[12] && $data[5] == $data[14] && $data[6] == $data[15]) //shipping and billing same { $extAddy->is_billing = 1; - $extAddy->is_shipping = 1; - $extAddy->save(false); + $extAddy->is_shipping = 1; + $extAddy->save(false); } else - { + { $extAddy->is_billing = 1; - $extAddy->is_shipping = 0; - $extAddy->save(false); - - $extAddy = new external_address(); + $extAddy->is_shipping = 0; + $extAddy->save(false); + + $extAddy = new external_address(); $sName = explode(' ',$data[12]); eDebug($sName); $extAddy->firstname = $sName[0]; if(count($sName) == 3) { $extAddy->middlename = $sName[1]; - $extAddy->lastname = $sName[2]; + $extAddy->lastname = $sName[2]; } else if (count($sName) ==1) { $extAddy->middlename = ''; - $extAddy->lastname = ''; + $extAddy->lastname = ''; } else { $extAddy->middlename = ''; - $extAddy->lastname = $sName[1]; + $extAddy->lastname = $sName[1]; } - + $extAddy->organization = $data[13]; $extAddy->address1 = $data[14]; - $extAddy->address2 = $data[15]; - $extAddy->city = $data[16]; - + $extAddy->address2 = $data[15]; + $extAddy->city = $data[16]; + $s = new geoRegion(); $state = $s->find('first','code="'.trim($data[17]).'"'); eDebug($state); - $extAddy->state = $state->id; - $extAddy->zip = str_ireplace("'",'',$data[18]); - $extAddy->phone = $data[20]; - $extAddy->email = $data[21]; + $extAddy->state = $state->id; + $extAddy->zip = str_ireplace("'",'',$data[18]); + $extAddy->phone = $data[20]; + $extAddy->email = $data[21]; $extAddy->is_billing = 0; $extAddy->is_shipping = 1; - $extAddy->source = $source; - + $extAddy->source = $source; + $extAddy->save(false); } - + echo "Successfully imported row " . $count . ", name: " . $extAddy->firstname . " " . $extAddy->lastname . "<br/>"; //eDebug($product); - - } - + + } + if(count($errorSet)) { echo "<br/><hr><br/><font color='red'>The following records were NOT imported:<br/>"; @@ -524,7 +531,7 @@ function validate() { else echo "--" . $err . "<br/>"; } echo "</font>"; - } + } }*/ function importProduct($file=null) { diff --git a/framework/modules/migration/controllers/migrationController.php b/framework/modules/migration/controllers/migrationController.php index 16454b6c43..906e1bfdbe 100755 --- a/framework/modules/migration/controllers/migrationController.php +++ b/framework/modules/migration/controllers/migrationController.php @@ -21,7 +21,7 @@ */ class migrationController extends expController { - protected $add_permissions = array( + protected $manage_permissions = array( 'analyze'=>'Analyze Data', 'migrate'=>'Migrate Data' ); diff --git a/framework/modules/navigation/controllers/navigationController.php b/framework/modules/navigation/controllers/navigationController.php index bb50bd761b..4db87e64de 100644 --- a/framework/modules/navigation/controllers/navigationController.php +++ b/framework/modules/navigation/controllers/navigationController.php @@ -1,1289 +1,1305 @@ -<?php - -################################################## -# -# Copyright (c) 2004-2016 OIC Group, Inc. -# -# This file is part of Exponent -# -# Exponent is free software; you can redistribute -# it and/or modify it under the terms of the GNU -# General Public License as published by the Free -# Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# GPL: http://www.gnu.org/licenses/gpl.txt -# -################################################## -/** - * @subpackage Controllers - * @package Modules - */ -class navigationController extends expController { - public $basemodel_name = 'section'; - public $useractions = array( - 'showall' => 'Show Navigation', - 'breadcrumb' => 'Breadcrumb', - ); - public $remove_configs = array( - 'aggregation', - 'categories', - 'comments', - 'ealerts', - 'facebook', - 'files', - 'pagination', - 'rss', - 'tags', - 'twitter', - ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'view' => "View Page" - ); - protected $remove_permissions = array( -// 'configure', -// 'create', -// 'delete', -// 'edit' - ); - - static function displayname() { return gt("Navigation"); } - - static function description() { return gt("Places navigation links/menus on the page."); } - - static function isSearchable() { return true; } - - function searchName() { return gt('Webpage'); } - - /** - * @param null $src - * @param array $params - * - */ - function __construct($src = null, $params = array()) - { - parent::__construct($src, $params); - if (!empty($params['id'])) // we normally throw out the $loc->int EXCEPT with navigation pages - $this->loc = expCore::makeLocation($this->baseclassname, $src, $params['id']); - } - - public function showall() { - global $user, $sectionObj, $sections; - - expHistory::set('viewable', $this->params); - $id = $sectionObj->id; - $current = null; - // all we need to do is determine the current section - $navsections = $sections; - if ($sectionObj->parent == -1) { - $current = $sectionObj; - } else { - foreach ($navsections as $section) { - if ($section->id == $id) { - $current = $section; - break; - } - } - } - assign_to_template(array( - 'sections' => $navsections, - 'current' => $current, - 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0), - )); - } - - public function breadcrumb() { - global $sectionObj; - - expHistory::set('viewable', $this->params); - $id = $sectionObj->id; - $current = null; - // Show not only the location of a page in the hierarchy but also the location of a standalone page - $current = new section($id); - if ($current->parent == -1) { // standalone page - $navsections = section::levelTemplate(-1, 0); - foreach ($navsections as $section) { - if ($section->id == $id) { - $current = $section; - break; - } - } - } else { - $navsections = section::levelTemplate(0, 0); - foreach ($navsections as $section) { - if ($section->id == $id) { - $current = $section; - break; - } - } - } - assign_to_template(array( - 'sections' => $navsections, - 'current' => $current, - )); - } - - /** - * @deprecated 2.3.4 moved to section model - */ - public static function navhierarchy($notyui=false) { - global $sections; - - $json_array = array(); - for ($i = 0, $iMax = count($sections); $i < $iMax; $i++) { - if ($sections[$i]->depth == 0) { - $obj = new stdClass(); -// $obj->id = $sections[$i]->name.$sections[$i]->id; - $obj->id = $sections[$i]->id; - $obj->text = $sections[$i]->name; - $obj->title = $sections[$i]->page_title; - $obj->description = $sections[$i]->description; - $obj->new_window = $sections[$i]->new_window; - $obj->expFile = $sections[$i]->expFile; - $obj->glyph = $sections[$i]->glyph; - $obj->glyph_only = $sections[$i]->glyph_only; - $obj->type = $sections[$i]->alias_type; - if ($sections[$i]->active == 1) { - $obj->url = $sections[$i]->link; - if ($obj->type == 1 && substr($obj->url, 0, 4) != 'http') { - $obj->url = 'http://' . $obj->url; - } - } else { - $obj->url = "#"; - $obj->onclick = "onclick: { fn: return false }"; - } - if ($obj->type == 3) { // mostly a hack instead of adding more table fields - $obj->width = $sections[$i]->internal_id; - $obj->class = $sections[$i]->external_link; - } - /*if ($sections[$i]->active == 1) { - $obj->disabled = false; - } else { - $obj->disabled = true; - }*/ - //$obj->disabled = true; - $obj->itemdata = self::getChildren($i,$notyui); - $obj->maxitems = count($obj->itemdata); - $obj->maxdepth = 0; - foreach ($obj->itemdata as $menu) { - if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; - } - } - $json_array[] = $obj; - } - return $json_array; - } - - /** - * @deprecated 2.3.4 moved to section model - */ - public static function navtojson() { - return json_encode(self::navhierarchy()); - } - - /** - * @deprecated 2.3.4 moved to section model - */ - public static function getChildren(&$i, $notyui=false) { - global $sections; - - // echo "i=".$i."<br>"; - if ($i + 1 == count($sections)) { // last entry - return array(); - } elseif ($sections[$i]->depth == $sections[$i + 1]->depth) { - return array(); - } else { - $ret_depth = $sections[$i]->depth; - $i++; - $ret_array = array(); - for ($iMax = count($sections); $i < $iMax; $i++) { - // start setting up the objects to return - $obj = new stdClass(); - $obj->id = $sections[$i]->id; - $obj->text = $sections[$i]->name; - $obj->title = $sections[$i]->page_title; - $obj->description = $sections[$i]->description; - $obj->new_window = $sections[$i]->new_window; - $obj->expFile = $sections[$i]->expFile; - $obj->glyph = $sections[$i]->glyph; - $obj->glyph_only = $sections[$i]->glyph_only; - $obj->depth = $sections[$i]->depth; - if ($sections[$i]->active == 1) { - $obj->url = $sections[$i]->link; - if ($sections[$i]->alias_type == 1 && substr($obj->url, 0, 4) != 'http') { - $obj->url = 'http://' . $obj->url; - } - } else { - $obj->url = "#"; - $obj->onclick = "onclick: { fn: return false }"; - } - //echo "i=".$i."<br>"; - if (self::hasChildren($i)) { - if ($notyui) { - $obj->itemdata = self::getChildren($i,$notyui); - $obj->maxitems = count($obj->itemdata); - $obj->maxdepth = 0; - foreach ($obj->itemdata as $menu) { - if (!empty($menu->maxdepth)) { - if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; - } else { - if ($menu->depth > $obj->maxdepth) $obj->maxdepth = $menu->depth; - } - } - } else { - $obj->submenu = new stdClass(); - $obj->submenu->id = $sections[$i]->name . $sections[$i]->id; - //echo "getting children of ".$sections[$i]->name; - $obj->submenu->itemdata = self::getChildren($i,$notyui); - $obj->maxitems = count($obj->submenu->itemdata); - $obj->maxdepth = 0; - foreach ($obj->submenu->itemdata as $menu) { - if (!empty($menu->maxdepth)) { - if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; - } else { - if ($menu->depth > $obj->maxdepth) $obj->maxdepth = $menu->depth; - } - } - } - $ret_array[] = $obj; - } else { - $obj->maxdepth = $obj->depth; - $ret_array[] = $obj; - } - if (($i + 1) >= count($sections) || $sections[$i + 1]->depth <= $ret_depth) { - return $ret_array; - } - } - return array(); - } - } - - /** - * @deprecated 2.3.4 moved to section model - */ - public static function hasChildren($i) { - global $sections; - - if (($i + 1) >= count($sections)) return false; - return ($sections[$i]->depth < $sections[$i + 1]->depth) ? true : false; - } - - /** exdoc - * Creates a location object, based off of the three arguments passed, and returns it. - * - * @return array - * @deprecated 2.3.4 moved to section model - */ - public static function initializeNavigation() { - $sections = section::levelTemplate(0, 0); - return $sections; - } - - /** - * returns all the section's children - * - * @static - * - * @param int $parent top level parent id - * @param int $depth variable to hold level of recursion - * @param array $parents - * - * @return array - * @deprecated 2.3.4 moved to section model - */ - public static function levelTemplate($parent, $depth = 0, $parents = array()) { - global $user; - - if ($parent != 0) $parents[] = $parent; - $nodes = array(); - $cache = expSession::getCacheValue('navigation'); - $sect = new section(); - if (!isset($cache['kids'][$parent])) { - $kids = $sect->find('all','parent=' . $parent); - $cache['kids'][$parent] = $kids; - expSession::setCacheValue('navigation', $cache); - } else { - $kids = $cache['kids'][$parent]; - } - $kids = expSorter::sort(array('array' => $kids, 'sortby' => 'rank', 'order' => 'ASC')); - for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) { - $child = $kids[$i]; - //foreach ($kids as $child) { - if ($child->public == 1 || expPermissions::check('view', expCore::makeLocation('navigation', '', $child->id))) { - $child->numParents = count($parents); - $child->depth = $depth; - $child->first = ($i == 0 ? 1 : 0); - $child->last = ($i == count($kids) - 1 ? 1 : 0); - $child->parents = $parents; - $child->canManage = (isset($user->is_acting_admin) && $user->is_acting_admin == 1 ? 1 : 0); - $child->canManageRank = $child->canManage; - if (!isset($child->sef_name)) { - $child->sef_name = ''; - } - // Generate the link attribute base on alias type. - if ($child->alias_type == 1) { - // External link. Set the link to the configured website URL. - // This is guaranteed to be a full URL because of the - // section::updateExternalAlias() method in models-1/section.php - $child->link = $child->external_link; - } else if ($child->alias_type == 2) { - // Internal link. - // Need to check and see if the internal_id is pointing at an external link. -// $dest = $db->selectObject('section', 'id=' . $child->internal_id); - $dest = $sect->find('first','id=' . $child->internal_id); - if (!empty($dest->alias_type) && $dest->alias_type == 1) { - // This internal alias is pointing at an external alias. - // Use the external_link of the destination section for the link - $child->link = $dest->external_link; - } else { - // Pointing at a regular section. This is guaranteed to be - // a regular section because aliases cannot be turned into sections, - // (and vice-versa) and because the section::updateInternalLink - // does 'alias to alias' dereferencing before the section is saved - // (see models-1/section.php) - //added by Tyler to pull the descriptions through for the children view - $child->description = !empty($dest->description) ? $dest->description : ''; - $child->link = expCore::makeLink(array('section' => $child->internal_id)); - } - } else { - // Normal link, alias_type == 0. Just create the URL from the section's id. - $child->link = expCore::makeLink(array('section' => $child->id), '', $child->sef_name); - } - //$child->numChildren = $db->countObjects('section','parent='.$child->id); - $nodes[] = $child; - $nodes = array_merge($nodes, section::levelTemplate($child->id, $depth + 1, $parents)); - } - } - return $nodes; - } - - /** - * Returns a flat representation of the full site hierarchy. - * - * @param int $parent top level parent id - * @param int $depth variable to hold level of recursion - * @param array $ignore_ids array of pages to ignore - * @param bool $full include a 'top' level entry - * @param string $perm permission level to build list - * @param bool $addstandalones should we add the stand-alone pages also - * @param bool $addinternalalias - * - * @return array - * @deprecated 2.3.4 moved to section model, HOWEVER still used in theme config - */ - public static function levelDropdownControlArray($parent, $depth = 0, $ignore_ids = array(), $full = false, $perm = 'view', $addstandalones = false, $addinternalalias = true) { - global $db; - - $ar = array(); - if ($parent == 0 && $full) { - $ar[0] = '&lt;' . gt('Top of Hierarchy') . '&gt;'; - } - if ($addinternalalias) { - $intalias = ''; - } else { - $intalias = ' AND alias_type != 2'; - } - $nodes = $db->selectObjects('section', 'parent=' . $parent . $intalias, 'rank'); - foreach ($nodes as $node) { - if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { - if ($node->active == 1) { - $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; - } else { - $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; - } - $ar[$node->id] = $text; - foreach (self::levelDropdownControlArray($node->id, $depth + 1, $ignore_ids, $full, $perm, $addstandalones, $addinternalalias) as $id => $text) { - $ar[$id] = $text; - } - } - } - if ($addstandalones && $parent == 0) { - $sections = $db->selectObjects('section', 'parent=-1'); - foreach ($sections as $node) { - if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { - if ($node->active == 1) { - $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; - } else { - $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; - } - $ar[$node->id] = '(' . gt('Standalone') . ') ' . $text; - } - } -// $ar = array_merge($ar,$sections); - } - return $ar; - } - - /** - * add all module items to search index - * - * @return int - */ - function addContentToSearch() { - global $db; - - //global $sections; - // global $router; -// $db->delete('search', "ref_module='navigation' AND ref_type='section'"); - $db->delete('search', "ref_module='".$this->baseclassname."' AND ref_type='section'"); - // this now ensures we get internal pages, instead of relying on the global $sections, which does not. - $sections = $db->selectObjects('section', 'active=1'); - foreach ($sections as $section) { - $search_record = new stdClass(); -// $search_record->category = 'Webpages'; -// $search_record->ref_module = 'navigationController'; -// $search_record->ref_type = 'section'; -// $search_record->ref_module = $this->classname; - $search_record->ref_module = $this->baseclassname; - $search_record->category = $this->searchName(); - $search_record->ref_type = $this->searchCategory(); - $search_record->original_id = $section->id; - $search_record->title = $section->name; - //$search_record->view_link = $router->buildUrlByPageId($section->id); - $link = str_replace(URL_FULL, '', makeLink(array('section' => $section->id))); - if ($link . '/' == URL_FULL) $link = ''; - $search_record->view_link = $link; - $search_record->body = $section->description; - $search_record->keywords = $section->keywords; - // now we're going to grab all the textmodules on this page and build the body for the page based off the content - // of all the text module added together. - $loc = expCore::makeLocation('text'); - $controllername = 'text'; - foreach ($db->selectObjects('sectionref', "module='" . $controllername . "' AND section=" . $section->id) as $module) { - $loc->src = $module->source; -// $controller = new $controllername(); - $controller = expModules::getController($controllername); - $textitems = $db->selectObjects($controller->model_table, "location_data='" . serialize($loc) . "'"); - foreach ($textitems as $textitem) { - if (!empty($textitem)) { - $search_record->body .= ' ' . search::removeHTML($textitem->body) . ' '; - $search_record->keywords .= " " . $textitem->title; - } - } - } - $db->insertObject($search_record, 'search'); - } - return count($sections); - } - - /** - * Retrieve either the entire hierarchy, or a subset of the hierarchy, as an array suitable for use - * in a dropdowncontrol. This is used primarily by the section datatype for moving and adding - * sections to specific parts of the site hierarchy. - * - * @param int $parent The id of the subtree parent. If passed as 0 (the default), the entire subtree is parsed. - * @param int $depth - * @param int $default - * @param array $ignore_ids a value-array of IDs to be ignored when generating the list. This is used - * when moving a section, since a section cannot be made a subsection of itself or any of its subsections. - * - * @return string - */ - function levelShowDropdown($parent, $depth = 0, $default = 0, $ignore_ids = array()) { - global $db; - - $html = ''; - $nodes = $db->selectObjects('section', 'parent=' . $parent, 'rank'); -// $nodes = expSorter::sort(array('array'=>$nodes,'sortby'=>'rank', 'order'=>'ASC')); - foreach ($nodes as $node) { - if (($node->public == 1 || expPermissions::check('view', expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { - $html .= '<option value="' . $node->id . '" '; - if ($default == $node->id) $html .= 'selected'; - $html .= '>'; - if ($node->active == 1) { - $html .= str_pad('', $depth * 3, '.', STR_PAD_LEFT) . $node->name; - } else { - $html .= str_pad('', $depth * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; - } - $html .= '</option>'; - $html .= self::levelShowDropdown($node->id, $depth + 1, $default, $ignore_ids); - } - } - return $html; - } - - /** - * recursively lists the template hierarchy - * - * @static - * - * @param int $parent top level parent id - * @param int $depth variable to hold level of recursion - * - * @return array - * @deprecated 2.0.0 this only for deprecated templates - */ - public static function getTemplateHierarchyFlat($parent, $depth = 1) { - global $db; - - $arr = array(); - $kids = $db->selectObjects('section_template', 'parent=' . $parent, 'rank'); -// $kids = expSorter::sort(array('array'=>$kids,'sortby'=>'rank', 'order'=>'ASC')); - for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) { - $page = $kids[$i]; - $page->depth = $depth; - $page->first = ($i == 0 ? 1 : 0); - $page->last = ($i == count($kids) - 1 ? 1 : 0); - $arr[] = $page; - $arr = array_merge($arr, self::getTemplateHierarchyFlat($page->id, $depth + 1)); - } - return $arr; - } - - /** - * @deprecated 2.0.0 this only for deprecated templates - */ - public static function process_section($section, $template) { - global $db; - - if (!is_object($template)) { - $template = $db->selectObject('section_template', 'id=' . $template); - $section->subtheme = $template->subtheme; - $db->updateObject($section, 'section'); - } - $prefix = '@st' . $template->id; - $refs = $db->selectObjects('sectionref', "source LIKE '$prefix%'"); - // Copy all modules and content for this section - foreach ($refs as $ref) { - $src = substr($ref->source, strlen($prefix)) . $section->id; - if (call_user_func(array($ref->module, 'hasContent'))) { - $oloc = expCore::makeLocation($ref->module, $ref->source); - $nloc = expCore::makeLocation($ref->module, $src); - if ($ref->module != "container") { - call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc); - } else { - call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc, $section->id); - } - } - } - // Grab sub pages - foreach ($db->selectObjects('section_template', 'parent=' . $template->id) as $t) { - self::process_subsections($section, $t); - } - - } - - /** - * @deprecated 2.0.0 this only for deprecated templates - */ - function process_subsections($parent_section, $subtpl) { - global $db, $router; - - $section = new stdClass(); - $section->parent = $parent_section->id; - $section->name = $subtpl->name; - $section->sef_name = $router->encode($section->name); - $section->subtheme = $subtpl->subtheme; - $section->active = $subtpl->active; - $section->public = $subtpl->public; - $section->rank = $subtpl->rank; - $section->page_title = $subtpl->page_title; - $section->keywords = $subtpl->keywords; - $section->description = $subtpl->description; - $section->id = $db->insertObject($section, 'section'); - self::process_section($section, $subtpl); - } - - /** - * Delete page and send its contents to the recycle bin - * - * @param $parent - * @deprecated 2.3.4 moved to section model - */ - public static function deleteLevel($parent) { - global $db; - - $kids = $db->selectObjects('section', 'parent=' . $parent); - foreach ($kids as $kid) { - self::deleteLevel($kid->id); - } - $secrefs = $db->selectObjects('sectionref', 'section=' . $parent); - foreach ($secrefs as $secref) { - $loc = expCore::makeLocation($secref->module, $secref->source, $secref->internal); - recyclebin::sendToRecycleBin($loc, $parent); - //FIXME if we delete the module & sectionref the module completely disappears -// if (class_exists($secref->module)) { -// $modclass = $secref->module; -// //FIXME: more module/controller glue code -// if (expModules::controllerExists($modclass)) { -// $modclass = expModules::getControllerClassName($modclass); -// $mod = new $modclass($loc->src); -// $mod->delete_instance(); -// } else { -// $mod = new $modclass(); -// $mod->deleteIn($loc); -// } -// } - } -// $db->delete('sectionref', 'section=' . $parent); - $db->delete('section', 'parent=' . $parent); - } - - /** - * Move content page and its children to stand-alones - * - * @param $parent - * @deprecated 2.3.4 moved to section model - */ - public static function removeLevel($parent) { - global $db; - - $kids = $db->selectObjects('section', 'parent=' . $parent); - foreach ($kids as $kid) { - $kid->parent = -1; - $db->updateObject($kid, 'section'); - self::removeLevel($kid->id); - } - } - - /** - * Check for cascading page view permission, esp. if not public - * @deprecated 2.3.4 moved to section model - */ - public static function canView($section) { - global $db; - - if ($section == null) { - return false; - } - if ($section->public == 0) { - // Not a public section. Check permissions. - return expPermissions::check('view', expCore::makeLocation('navigation', '', $section->id)); - } else { // Is public. check parents. - if ($section->parent <= 0) { - // Out of parents, and since we are still checking, we haven't hit a private section. - return true; - } else { - $s = $db->selectObject('section', 'id=' . $section->parent); - return self::canView($s); - } - } - } - - /** - * Check to see if page is public with cascading - * @deprecated 2.3.4 moved to section model - */ - public static function isPublic($s) { - if ($s == null) { - return false; - } - while ($s->public && $s->parent > 0) { - $s = new section($s->parent); - } - $lineage = (($s->public) ? 1 : 0); - return $lineage; - } - - public static function canManageStandalones() { - global $user; - - if ($user->isAdmin()) return true; - $standalones = section::levelTemplate(-1, 0); - // $canmanage = false; - foreach ($standalones as $standalone) { - $loc = expCore::makeLocation('navigation', '', $standalone->id); - if (expPermissions::check('manage', $loc)) return true; - } - return false; - } - - /** - * Reassign permissions based on a check/change in menu/page hierarchy - * - * @static - * - * @param $id - */ - public static function checkForSectionalAdmins($id) { - global $db; - - $section = $db->selectObject('section', 'id=' . $id); - $branch = section::levelTemplate($id, 0); - array_unshift($branch, $section); - $allusers = array(); - $allgroups = array(); - while ($section->parent > 0) { - // $ploc = expCore::makeLocation('navigationController', null, $section); - $allusers = array_merge($allusers, $db->selectColumn('userpermission', 'uid', "permission='manage' AND module='navigation' AND internal=" . $section->parent)); - $allgroups = array_merge($allgroups, $db->selectColumn('grouppermission', 'gid', "permission='manage' AND module='navigation' AND internal=" . $section->parent)); - $section = $db->selectObject('section', 'id=' . $section->parent); - } - foreach ($branch as $section) { - $sloc = expCore::makeLocation('navigation', null, $section->id); - // remove any manage permissions for this page and it's children - // $db->delete('userpermission', "module='navigationController' AND internal=".$section->id); - // $db->delete('grouppermission', "module='navigationController' AND internal=".$section->id); - foreach ($allusers as $uid) { - $u = user::getUserById($uid); - expPermissions::grant($u, 'manage', $sloc); - } - foreach ($allgroups as $gid) { - $g = group::getGroupById($gid); - expPermissions::grantGroup($g, 'manage', $sloc); - } - } - } - - function manage() { - global $db, $router, $user; - - expHistory::set('manageable', $router->params); - assign_to_template(array( - 'canManageStandalones' => self::canManageStandalones(), - 'sasections' => $db->selectObjects('section', 'parent=-1'), - 'user' => $user, -// 'canManagePagesets' => $user->isAdmin(), -// 'templates' => $db->selectObjects('section_template', 'parent=0'), - )); - } - - public function manage_sitemap() { - global $db, $user, $sectionObj, $sections; - - expHistory::set('viewable', $this->params); - $id = $sectionObj->id; - $current = null; - // all we need to do is determine the current section - $navsections = $sections; - if ($sectionObj->parent == -1) { - $current = $sectionObj; - } else { - foreach ($navsections as $section) { - if ($section->id == $id) { - $current = $section; - break; - } - } - } - assign_to_template(array( - 'sasections' => $db->selectObjects('section', 'parent=-1'), - 'sections' => $navsections, - 'current' => $current, - 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0), - )); - } - - /** - * Ajax request for specific pages as json date to yui tree - */ - public static function returnChildrenAsJSON() { - global $db; - - //$nav = section::levelTemplate(intval($_REQUEST['id'], 0)); - $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - $nav = $db->selectObjects('section', 'parent=' . $id, 'rank'); - //FIXME $manage_all is moot w/ cascading perms now? - $manage_all = false; - if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $id))) { - $manage_all = true; - } - //FIXME recode to use foreach $key=>$value - $navcount = count($nav); - for ($i = 0; $i < $navcount; $i++) { - if ($manage_all || expPermissions::check('manage', expCore::makeLocation('navigation', '', $nav[$i]->id))) { - $nav[$i]->manage = 1; - $view = true; - } else { - $nav[$i]->manage = 0; - $view = $nav[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $nav[$i]->id)); - } - $nav[$i]->link = expCore::makeLink(array('section' => $nav[$i]->id), '', $nav[$i]->sef_name); - if (!$view) unset($nav[$i]); - } - $nav= array_values($nav); -// $nav[$navcount - 1]->last = true; - if (count($nav)) $nav[count($nav) - 1]->last = true; -// echo expJavascript::ajaxReply(201, '', $nav); - $ar = new expAjaxReply(201, '', $nav); - $ar->send(); - } - - /** - * Ajax request for all pages as json date to jstree - */ - public static function returnChildrenAsJSON2() { - global $db; - - $icons = array( - 0 => 'addpage', - 1 => 'addextpage', - 2 => 'addintpage', - 3 => 'addfreeform', - ); - - $navs = $db->selectObjects('section', 'parent!=-1', 'rank'); - foreach ($navs as $i=>$nav) { - $navs[$i]->parent = $nav->parent?$nav->parent:'#'; - $navs[$i]->text = $nav->name; - $navs[$i]->icon = $icons[$nav->alias_type]; - if (!$nav->active) { - $navs[$i]->icon .= ' inactive'; - $attr = new stdClass(); - $attr->class = 'inactive'; // class to obscure elements - $navs[$i]->a_attr = $attr; - } - if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $navs[$i]->id))) { - $navs[$i]->manage = 1; - $view = true; - } else { - $navs[$i]->manage = 0; - $navs[$i]->state->disabled = true; - $view = $navs[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $navs[$i]->id)); - } - $navs[$i]->link = expCore::makeLink(array('section' => $navs[$i]->id), '', $navs[$i]->sef_name); - if (!$view) { -// unset($navs[$i]); //FIXME this breaks jstree if we remove a parent and not the child - $attr = new stdClass(); - $attr->class = 'hidden'; // bs3 class to hide elements - $navs[$i]->li_attr = $attr; - } - } - $navs= array_values($navs); -// header('Content-Type: application/json; charset=utf8'); - echo json_encode($navs); -// echo expJavascript::ajaxReply(201, '', $navs); - exit; - } - - /** - * Ajax function to reorder page hierarchy from yui tree control - */ - public static function DragnDropReRank() { - global $db, $router; - - $move = $router->params['move']; - $target = $router->params['target']; - $type = $router->params['type']; - $targSec = $db->selectObject("section","id=".$target); -// $targSec = new section($target); - $check_id = $targSec->parent; - $moveSec = $db->selectObject("section","id=".$move); -// $moveSec = new section($move); - - // dropped on top of page - if ($type == "append") { - //save the old parent in case we are changing the depth of the moving section - $oldParent = $moveSec->parent; - //assign the parent of the moving section to the ID of the target section - $moveSec->parent = $targSec->id; - //set the rank of the moving section to 0 since it will appear first in the new order - $moveSec->rank = 1; - //select all children currently of the parent we're about to append to - $targSecChildren = $db->selectObjects("section", "parent=" . $targSec->id . " ORDER BY rank"); - //update the ranks of the children to +1 higher to accommodate our new rank 0 section being moved in. - $newrank = 1; - foreach ($targSecChildren as $value) { - if ($value->id != $moveSec->id) { - $value->rank = $newrank; - $db->updateObject($value, 'section'); - $newrank++; - } - } - $db->updateObject($moveSec, 'section'); - if ($oldParent != $moveSec->parent) { - //we need to re-rank the children of the parent that the miving section has just left - $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); - for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { - $childOfLastMove[$i]->rank = $i; - $db->updateObject($childOfLastMove[$i], 'section'); - } - - } -// echo $moveSec->name . " was appended to " . $targSec->name; - - } elseif ($type == "after") { // dropped between (after) pages - if ($targSec->parent == $moveSec->parent) { - //are we moving up... - if ($targSec->rank < $moveSec->rank) { - $moveSec->rank = $targSec->rank + 1; - $moveNextSiblings = $db->selectObjects("section", "id!=" . $moveSec->id . " AND parent=" . $targSec->parent . " AND rank>" . $targSec->rank . " ORDER BY rank"); - $rerank = $moveSec->rank + 1; - foreach ($moveNextSiblings as $value) { - if ($value->id != $moveSec->id) { - $value->rank = $rerank; - $db->updateObject($value, 'section'); - $rerank++; - } - } - $db->updateObject($targSec, 'section'); -// $targSec->update(); - $db->updateObject($moveSec, 'section'); -// $moveSec->update(); - //or are we moving down... - } else { - $targSec->rank = $targSec->rank - 1; - $moveSec->rank = $targSec->rank + 1; - $movePreviousSiblings = $db->selectObjects("section", "id!=" . $moveSec->id . " AND parent=" . $targSec->parent . " AND rank<=" . $targSec->rank . " ORDER BY rank"); - $rerank = 1; - foreach ($movePreviousSiblings as $value) { - if ($value->id != $moveSec->id) { - $value->rank = $rerank; - $db->updateObject($value, 'section'); - $rerank++; - } - } - $db->updateObject($targSec, 'section'); -// $targSec->update(); - $db->updateObject($moveSec, 'section'); -// $moveSec->update(); - } - } else { // 'before', is this used? - //store ranks from the depth we're moving from. Used to re-rank the level depth the moving section is moving from. - $oldRank = $moveSec->rank; - $oldParent = $moveSec->parent; - //select all children of the target sections parent with a rank higher than it's own - $moveNextSiblings = $db->selectObjects("section", "parent=" . $targSec->parent . " AND rank>" . $targSec->rank . " ORDER BY rank"); - //update moving sections rank and parent - $moveSec->rank = $targSec->rank + 1; - $moveSec->parent = $targSec->parent; - //$rerank=$moveSec->rank+1; - foreach ($moveNextSiblings as $value) { - $value->rank = $value->rank + 1; - $db->updateObject($value, 'section'); - } - $db->updateObject($moveSec, 'section'); - //handle re-ranking of previous parent - $oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank"); - $rerank = 1; - foreach ($oldSiblings as $value) { - if ($value->id != $moveSec->id) { - $value->rank = $rerank; - $db->updateObject($value, 'section'); - $rerank++; - } - } - if ($oldParent != $moveSec->parent) { - //we need to re-rank the children of the parent that the moving section has just left - $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); - for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { - $childOfLastMove[$i]->rank = $i; - $db->updateObject($childOfLastMove[$i], 'section'); - } - } - } - } - self::checkForSectionalAdmins($move); - expSession::clearAllUsersSessionCache('navigation'); - } - - /** - * Ajax function to reorder page hierarchy from jstree control - */ - public static function DragnDropReRank2() { - global $router, $db; - - $id = $router->params['id']; - $page = new section($id); - $old_rank = $page->rank; - $old_parent = $page->parent; - $new_rank = $router->params['position'] + 1; // rank - $new_parent = intval($router->params['parent']); - - $db->decrement($page->tablename, 'rank', 1, 'rank>' . $old_rank . ' AND parent=' . $old_parent); // close in hole - $db->increment($page->tablename, 'rank', 1, 'rank>=' . $new_rank . ' AND parent=' . $new_parent); // make room - - $params = array(); - $params['parent'] = $new_parent; - $params['rank'] = $new_rank; - $page->update($params); - - self::checkForSectionalAdmins($id); - expSession::clearAllUsersSessionCache('navigation'); - } - - function edit_section() { - global $db, $user; - - $parent = new section($this->params['parent']); - if (empty($parent->id)) $parent->id = 0; - assign_to_template(array( - 'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0), - 'parent' => $parent, - 'isAdministrator' => $user->isAdmin(), - )); - } - - function edit_contentpage() { - //FIXME we come here for new/edit content/standalone pages - // FIXME: Allow non-administrative users to manage certain parts of the section hierarchy. - //if ($user->is_acting_admin == 1 /*TODO: section admin*/) { -// $section = null; - $section = new stdClass(); - if (isset($this->params['id'])) { - // Check to see if an id was passed in get. If so, retrieve that section from - // the database, and perform an edit on it. - $section = $this->section->find($this->params['id']); - } elseif (isset($this->params['parent'])) { - // The isset check is merely a precaution. This action should - // ALWAYS be invoked with a parent or id value. - $section = new section($this->params); - } else { - notfoundController::handle_not_found(); - exit; - } - if (!empty($section->id)) { - $check_id = $section->id; - } else { - $check_id = $section->parent; - } - if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) { - if (empty($section->id)) { - $section->active = 1; - $section->public = 1; - if (!isset($section->parent)) { - // This is another precaution. The parent attribute - // should ALWAYS be set by the caller. - //FJD - if that's the case, then we should die. - notfoundController::handle_not_authorized(); - exit; - //$section->parent = 0; - } - } - assign_to_template(array( - 'section' => $section, - 'glyphs' => self::get_glyphs(), - )); - } else { // User does not have permission to manage sections. Throw a 403 - notfoundController::handle_not_authorized(); - } - } - - private static function get_glyphs() { - if (bs()) { - require_once(BASE . 'external/font-awesome.class.php'); - $fa = new Smk_FontAwesome; - if (bs3()) { - $icons = $fa->getArray(BASE . 'external/font-awesome4/css/font-awesome.css'); - $icons = $fa->sortByName($icons); - return $fa->nameGlyph($icons); - } elseif (bs2()) { - expCSS::auto_compile_less( - 'external/font-awesome/less/font-awesome.less', - 'external/font-awesome/css/font-awesome.css' - ); // font-awesome is included within bootstrap2, but not as a separate .css file - $icons = $fa->getArray(BASE . 'external/font-awesome/css/font-awesome.css', 'icon-'); - return $fa->nameGlyph($icons, 'icon-'); - } - } else { - return array(); - } - } - - function edit_internalalias() { - $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); - if ($section->parent == -1) { - notfoundController::handle_not_found(); - exit; - } // doesn't work for standalone pages - if (empty($section->id)) { - $section->public = 1; - if (!isset($section->parent)) { - // This is another precaution. The parent attribute - // should ALWAYS be set by the caller. - //FJD - if that's the case, then we should die. - notfoundController::handle_not_authorized(); - exit; - //$section->parent = 0; - } - } - assign_to_template(array( - 'section' => $section, - 'glyphs' => self::get_glyphs(), - )); - } - - function edit_freeform() { - $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); - if ($section->parent == -1) { - notfoundController::handle_not_found(); - exit; - } // doesn't work for standalone pages - if (empty($section->id)) { - $section->public = 1; - if (!isset($section->parent)) { - // This is another precaution. The parent attribute - // should ALWAYS be set by the caller. - //FJD - if that's the case, then we should die. - notfoundController::handle_not_authorized(); - exit; - //$section->parent = 0; - } - } - assign_to_template(array( - 'section' => $section, - 'glyphs' => self::get_glyphs(), - )); - } - - function edit_externalalias() { - $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); - if ($section->parent == -1) { - notfoundController::handle_not_found(); - exit; - } // doesn't work for standalone pages - if (empty($section->id)) { - $section->public = 1; - if (!isset($section->parent)) { - // This is another precaution. The parent attribute - // should ALWAYS be set by the caller. - //FJD - if that's the case, then we should die. - notfoundController::handle_not_authorized(); - exit; - //$section->parent = 0; - } - } - assign_to_template(array( - 'section' => $section, - 'glyphs' => self::get_glyphs(), - )); - } - - function update() { - parent::update(); - expSession::clearAllUsersSessionCache('navigation'); - } - - function move_standalone() { - expSession::clearAllUsersSessionCache('navigation'); - assign_to_template(array( - 'parent' => $this->params['parent'], - )); - } - - /** - * Move standalone back to hierarchy - * - */ - function reparent_standalone() { - $standalone = $this->section->find($this->params['page']); - if ($standalone) { - $standalone->parent = $this->params['parent']; - $standalone->update(); - expSession::clearAllUsersSessionCache('navigation'); - expHistory::back(); - } else { - notfoundController::handle_not_found(); - } - } - - /** - * Move content page to standalones - * - */ - function remove() { - global $db; - - $section = $db->selectObject('section', 'id=' . $this->params['id']); - if ($section) { - section::removeLevel($section->id); - $db->decrement('section', 'rank', 1, 'rank > ' . $section->rank . ' AND parent=' . $section->parent); - $section->parent = -1; - $db->updateObject($section, 'section'); - expSession::clearAllUsersSessionCache('navigation'); - expHistory::back(); - } else { - notfoundController::handle_not_authorized(); - } - } - - function delete_standalones() { - if (!empty($this->params['deleteit'])) { - foreach ($this->params['deleteit'] as $page) { - $section = new section(intval($page)); - if ($section) { -// self::deleteLevel($section->id); - $section->delete(); - } - } - } - expSession::clearAllUsersSessionCache('navigation'); - expHistory::back(); - } - - // create a psuedo global manage pages permission - public static function checkPermissions($permission,$location) { - global $exponent_permissions_r, $router; - - // only applies to the 'manage' method - if (empty($location->src) && empty($location->int) && (!empty($router->params['action']) && $router->params['action'] == 'manage') || strpos($router->current_url, 'action=manage') !== false) { - if (!empty($exponent_permissions_r['navigation'])) foreach ($exponent_permissions_r['navigation'] as $page) { - foreach ($page as $pageperm) { - if (!empty($pageperm['manage'])) return true; - } - } - } - return false; - } - - /** - * Rebuild the sectionref table as a list of modules on a page - * @deprecated 2.3.4 moved to sectionref model - */ - public static function rebuild_sectionrefs() { - global $db; - - // recursive run though all the nested containers - function scan_container($container_id, $page_id) { - global $db; - - $containers = $db->selectObjects('container',"external='" . $container_id . "'"); - $ret = ''; - foreach ($containers as $container) { - $iLoc = expUnserialize($container->internal); - $newret = recyclebin::restoreFromRecycleBin($iLoc, $page_id); - if (!empty($newret)) $ret .= $newret . '<br>'; - if ($iLoc->mod == 'container') { - $ret .= scan_container($container->internal, $page_id); - } - } - return $ret; - } - - // recursive run through all the nested pages - function scan_page($parent_id) { - global $db; - - $sections = $db->selectObjects('section','parent=' . $parent_id); - $ret = ''; - foreach ($sections as $page) { - $cLoc = serialize(expCore::makeLocation('container','@section' . $page->id)); - $ret .= scan_container($cLoc, $page->id); - $ret .= scan_page($page->id); - } - return $ret; - } - - // first remove duplicate records - $db->sql('DELETE FROM ' . $db->prefix . 'sectionref WHERE id NOT IN (SELECT * FROM (SELECT MIN(n.id) FROM ' . $db->prefix . 'sectionref n GROUP BY n.module, n.source) x)'); - $ret = scan_page(0); // the page hierarchy - $ret .= scan_page(-1); // now the stand alone pages - - // we need to get the non-main containers such as sidebars, footers, etc... - $hardcodedmods = $db->selectObjects('sectionref',"refcount=1000 AND source NOT LIKE '%@section%' AND source NOT LIKE '%@random%'"); - foreach ($hardcodedmods as $hardcodedmod) { - if ($hardcodedmod->module == 'container') { - $page_id = intval(preg_replace('/\D/', '', $hardcodedmod->source)); - if (empty($page_id)) { - $page_id = SITE_DEFAULT_SECTION; // we'll default to the home page - } - $ret .= scan_container(serialize(expCore::makeLocation($hardcodedmod->module, $hardcodedmod->source)), $page_id); - } else { - $hardcodedmod->section = 0; // this is a hard-coded non-container module - $db->updateObject($hardcodedmod, 'sectionref'); - } - } - - // mark modules in the recycle bin as section 0 - $db->columnUpdate('sectionref', 'section', 0, "refcount=0"); -// $recycledmods = $db->selectObjects('sectionref',"refcount=0"); -// foreach ($recycledmods as $recycledmod) { -// $recycledmod->section = 0; // this is a module in the recycle bin -// $db->updateObject($recycledmod, 'sectionref'); -// } - return $ret; - } - -} - -?> +<?php + +################################################## +# +# Copyright (c) 2004-2016 OIC Group, Inc. +# +# This file is part of Exponent +# +# Exponent is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License as published by the Free +# Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# GPL: http://www.gnu.org/licenses/gpl.txt +# +################################################## +/** + * @subpackage Controllers + * @package Modules + */ +class navigationController extends expController { + public $basemodel_name = 'section'; + public $useractions = array( + 'showall' => 'Show Navigation', + 'breadcrumb' => 'Breadcrumb', + ); + protected $remove_permissions = array( +// 'configure', +// 'create', +// 'delete', +// 'edit' + ); + protected $add_permissions = array( + 'manage' => 'Manage', + 'view' => "View Page" + ); + protected $manage_permissions = array( + 'move' => 'Move Page', + 'remove' => 'Remove Page', + 'reparent' => 'Reparent Page', + ); + public $remove_configs = array( + 'aggregation', + 'categories', + 'comments', + 'ealerts', + 'facebook', + 'files', + 'pagination', + 'rss', + 'tags', + 'twitter', + ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) + + static function displayname() { return gt("Navigation"); } + + static function description() { return gt("Places navigation links/menus on the page."); } + + static function isSearchable() { return true; } + + function searchName() { return gt('Webpage'); } + + /** + * @param null $src + * @param array $params + * + */ + function __construct($src = null, $params = array()) + { + parent::__construct($src, $params); + if (!empty($params['id'])) // we normally throw out the $loc->int EXCEPT with navigation pages + $this->loc = expCore::makeLocation($this->baseclassname, $src, $params['id']); + } + + public function showall() { + global $user, $sectionObj, $sections; + + expHistory::set('viewable', $this->params); + $id = $sectionObj->id; + $current = null; + // all we need to do is determine the current section + $navsections = $sections; + if ($sectionObj->parent == -1) { + $current = $sectionObj; + } else { + foreach ($navsections as $section) { + if ($section->id == $id) { + $current = $section; + break; + } + } + } + assign_to_template(array( + 'sections' => $navsections, + 'current' => $current, + 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0), + )); + } + + public function breadcrumb() { + global $sectionObj; + + expHistory::set('viewable', $this->params); + $id = $sectionObj->id; + $current = null; + // Show not only the location of a page in the hierarchy but also the location of a standalone page + $current = new section($id); + if ($current->parent == -1) { // standalone page + $navsections = section::levelTemplate(-1, 0); + foreach ($navsections as $section) { + if ($section->id == $id) { + $current = $section; + break; + } + } + } else { + $navsections = section::levelTemplate(0, 0); + foreach ($navsections as $section) { + if ($section->id == $id) { + $current = $section; + break; + } + } + } + assign_to_template(array( + 'sections' => $navsections, + 'current' => $current, + )); + } + + /** + * @deprecated 2.3.4 moved to section model + */ + public static function navhierarchy($notyui=false) { + global $sections; + + $json_array = array(); + for ($i = 0, $iMax = count($sections); $i < $iMax; $i++) { + if ($sections[$i]->depth == 0) { + $obj = new stdClass(); +// $obj->id = $sections[$i]->name.$sections[$i]->id; + $obj->id = $sections[$i]->id; + $obj->text = $sections[$i]->name; + $obj->title = $sections[$i]->page_title; + $obj->description = $sections[$i]->description; + $obj->new_window = $sections[$i]->new_window; + $obj->expFile = $sections[$i]->expFile; + $obj->glyph = $sections[$i]->glyph; + $obj->glyph_only = $sections[$i]->glyph_only; + $obj->type = $sections[$i]->alias_type; + if ($sections[$i]->active == 1) { + $obj->url = $sections[$i]->link; + if ($obj->type == 1 && substr($obj->url, 0, 4) != 'http') { + $obj->url = 'http://' . $obj->url; + } + } else { + $obj->url = "#"; + $obj->onclick = "onclick: { fn: return false }"; + } + if ($obj->type == 3) { // mostly a hack instead of adding more table fields + $obj->width = $sections[$i]->internal_id; + $obj->class = $sections[$i]->external_link; + } + /*if ($sections[$i]->active == 1) { + $obj->disabled = false; + } else { + $obj->disabled = true; + }*/ + //$obj->disabled = true; + $obj->itemdata = self::getChildren($i,$notyui); + $obj->maxitems = count($obj->itemdata); + $obj->maxdepth = 0; + foreach ($obj->itemdata as $menu) { + if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; + } + } + $json_array[] = $obj; + } + return $json_array; + } + + /** + * @deprecated 2.3.4 moved to section model + */ + public static function navtojson() { + return json_encode(self::navhierarchy()); + } + + /** + * @deprecated 2.3.4 moved to section model + */ + public static function getChildren(&$i, $notyui=false) { + global $sections; + + // echo "i=".$i."<br>"; + if ($i + 1 == count($sections)) { // last entry + return array(); + } elseif ($sections[$i]->depth == $sections[$i + 1]->depth) { + return array(); + } else { + $ret_depth = $sections[$i]->depth; + $i++; + $ret_array = array(); + for ($iMax = count($sections); $i < $iMax; $i++) { + // start setting up the objects to return + $obj = new stdClass(); + $obj->id = $sections[$i]->id; + $obj->text = $sections[$i]->name; + $obj->title = $sections[$i]->page_title; + $obj->description = $sections[$i]->description; + $obj->new_window = $sections[$i]->new_window; + $obj->expFile = $sections[$i]->expFile; + $obj->glyph = $sections[$i]->glyph; + $obj->glyph_only = $sections[$i]->glyph_only; + $obj->depth = $sections[$i]->depth; + if ($sections[$i]->active == 1) { + $obj->url = $sections[$i]->link; + if ($sections[$i]->alias_type == 1 && substr($obj->url, 0, 4) != 'http') { + $obj->url = 'http://' . $obj->url; + } + } else { + $obj->url = "#"; + $obj->onclick = "onclick: { fn: return false }"; + } + //echo "i=".$i."<br>"; + if (self::hasChildren($i)) { + if ($notyui) { + $obj->itemdata = self::getChildren($i,$notyui); + $obj->maxitems = count($obj->itemdata); + $obj->maxdepth = 0; + foreach ($obj->itemdata as $menu) { + if (!empty($menu->maxdepth)) { + if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; + } else { + if ($menu->depth > $obj->maxdepth) $obj->maxdepth = $menu->depth; + } + } + } else { + $obj->submenu = new stdClass(); + $obj->submenu->id = $sections[$i]->name . $sections[$i]->id; + //echo "getting children of ".$sections[$i]->name; + $obj->submenu->itemdata = self::getChildren($i,$notyui); + $obj->maxitems = count($obj->submenu->itemdata); + $obj->maxdepth = 0; + foreach ($obj->submenu->itemdata as $menu) { + if (!empty($menu->maxdepth)) { + if ($menu->maxdepth > $obj->maxdepth) $obj->maxdepth = $menu->maxdepth; + } else { + if ($menu->depth > $obj->maxdepth) $obj->maxdepth = $menu->depth; + } + } + } + $ret_array[] = $obj; + } else { + $obj->maxdepth = $obj->depth; + $ret_array[] = $obj; + } + if (($i + 1) >= count($sections) || $sections[$i + 1]->depth <= $ret_depth) { + return $ret_array; + } + } + return array(); + } + } + + /** + * @deprecated 2.3.4 moved to section model + */ + public static function hasChildren($i) { + global $sections; + + if (($i + 1) >= count($sections)) return false; + return ($sections[$i]->depth < $sections[$i + 1]->depth) ? true : false; + } + + /** exdoc + * Creates a location object, based off of the three arguments passed, and returns it. + * + * @return array + * @deprecated 2.3.4 moved to section model + */ + public static function initializeNavigation() { + $sections = section::levelTemplate(0, 0); + return $sections; + } + + /** + * returns all the section's children + * + * @static + * + * @param int $parent top level parent id + * @param int $depth variable to hold level of recursion + * @param array $parents + * + * @return array + * @deprecated 2.3.4 moved to section model + */ + public static function levelTemplate($parent, $depth = 0, $parents = array()) { + global $user; + + if ($parent != 0) $parents[] = $parent; + $nodes = array(); + $cache = expSession::getCacheValue('navigation'); + $sect = new section(); + if (!isset($cache['kids'][$parent])) { + $kids = $sect->find('all','parent=' . $parent); + $cache['kids'][$parent] = $kids; + expSession::setCacheValue('navigation', $cache); + } else { + $kids = $cache['kids'][$parent]; + } + $kids = expSorter::sort(array('array' => $kids, 'sortby' => 'rank', 'order' => 'ASC')); + for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) { + $child = $kids[$i]; + //foreach ($kids as $child) { + if ($child->public == 1 || expPermissions::check('view', expCore::makeLocation('navigation', '', $child->id))) { + $child->numParents = count($parents); + $child->depth = $depth; + $child->first = ($i == 0 ? 1 : 0); + $child->last = ($i == count($kids) - 1 ? 1 : 0); + $child->parents = $parents; + $child->canManage = (isset($user->is_acting_admin) && $user->is_acting_admin == 1 ? 1 : 0); + $child->canManageRank = $child->canManage; + if (!isset($child->sef_name)) { + $child->sef_name = ''; + } + // Generate the link attribute base on alias type. + if ($child->alias_type == 1) { + // External link. Set the link to the configured website URL. + // This is guaranteed to be a full URL because of the + // section::updateExternalAlias() method in models-1/section.php + $child->link = $child->external_link; + } else if ($child->alias_type == 2) { + // Internal link. + // Need to check and see if the internal_id is pointing at an external link. +// $dest = $db->selectObject('section', 'id=' . $child->internal_id); + $dest = $sect->find('first','id=' . $child->internal_id); + if (!empty($dest->alias_type) && $dest->alias_type == 1) { + // This internal alias is pointing at an external alias. + // Use the external_link of the destination section for the link + $child->link = $dest->external_link; + } else { + // Pointing at a regular section. This is guaranteed to be + // a regular section because aliases cannot be turned into sections, + // (and vice-versa) and because the section::updateInternalLink + // does 'alias to alias' dereferencing before the section is saved + // (see models-1/section.php) + //added by Tyler to pull the descriptions through for the children view + $child->description = !empty($dest->description) ? $dest->description : ''; + $child->link = expCore::makeLink(array('section' => $child->internal_id)); + } + } else { + // Normal link, alias_type == 0. Just create the URL from the section's id. + $child->link = expCore::makeLink(array('section' => $child->id), '', $child->sef_name); + } + //$child->numChildren = $db->countObjects('section','parent='.$child->id); + $nodes[] = $child; + $nodes = array_merge($nodes, section::levelTemplate($child->id, $depth + 1, $parents)); + } + } + return $nodes; + } + + /** + * Returns a flat representation of the full site hierarchy. + * + * @param int $parent top level parent id + * @param int $depth variable to hold level of recursion + * @param array $ignore_ids array of pages to ignore + * @param bool $full include a 'top' level entry + * @param string $perm permission level to build list + * @param bool $addstandalones should we add the stand-alone pages also + * @param bool $addinternalalias + * + * @return array + * @deprecated 2.3.4 moved to section model, HOWEVER still used in theme config + */ + public static function levelDropdownControlArray($parent, $depth = 0, $ignore_ids = array(), $full = false, $perm = 'view', $addstandalones = false, $addinternalalias = true) { + global $db; + + $ar = array(); + if ($parent == 0 && $full) { + $ar[0] = '&lt;' . gt('Top of Hierarchy') . '&gt;'; + } + if ($addinternalalias) { + $intalias = ''; + } else { + $intalias = ' AND alias_type != 2'; + } + $nodes = $db->selectObjects('section', 'parent=' . $parent . $intalias, 'rank'); + foreach ($nodes as $node) { + if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { + if ($node->active == 1) { + $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; + } else { + $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; + } + $ar[$node->id] = $text; + foreach (self::levelDropdownControlArray($node->id, $depth + 1, $ignore_ids, $full, $perm, $addstandalones, $addinternalalias) as $id => $text) { + $ar[$id] = $text; + } + } + } + if ($addstandalones && $parent == 0) { + $sections = $db->selectObjects('section', 'parent=-1'); + foreach ($sections as $node) { + if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { + if ($node->active == 1) { + $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; + } else { + $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; + } + $ar[$node->id] = '(' . gt('Standalone') . ') ' . $text; + } + } +// $ar = array_merge($ar,$sections); + } + return $ar; + } + + /** + * add all module items to search index + * + * @return int + */ + function addContentToSearch() { + global $db; + + //global $sections; + // global $router; +// $db->delete('search', "ref_module='navigation' AND ref_type='section'"); + $db->delete('search', "ref_module='".$this->baseclassname."' AND ref_type='section'"); + // this now ensures we get internal pages, instead of relying on the global $sections, which does not. + $sections = $db->selectObjects('section', 'active=1'); + foreach ($sections as $section) { + $search_record = new stdClass(); +// $search_record->category = 'Webpages'; +// $search_record->ref_module = 'navigationController'; +// $search_record->ref_type = 'section'; +// $search_record->ref_module = $this->classname; + $search_record->ref_module = $this->baseclassname; + $search_record->category = $this->searchName(); + $search_record->ref_type = $this->searchCategory(); + $search_record->original_id = $section->id; + $search_record->title = $section->name; + //$search_record->view_link = $router->buildUrlByPageId($section->id); + $link = str_replace(URL_FULL, '', makeLink(array('section' => $section->id))); + if ($link . '/' == URL_FULL) $link = ''; + $search_record->view_link = $link; + $search_record->body = $section->description; + $search_record->keywords = $section->keywords; + // now we're going to grab all the textmodules on this page and build the body for the page based off the content + // of all the text module added together. + $loc = expCore::makeLocation('text'); + $controllername = 'text'; + foreach ($db->selectObjects('sectionref', "module='" . $controllername . "' AND section=" . $section->id) as $module) { + $loc->src = $module->source; +// $controller = new $controllername(); + $controller = expModules::getController($controllername); + $textitems = $db->selectObjects($controller->model_table, "location_data='" . serialize($loc) . "'"); + foreach ($textitems as $textitem) { + if (!empty($textitem)) { + $search_record->body .= ' ' . search::removeHTML($textitem->body) . ' '; + $search_record->keywords .= " " . $textitem->title; + } + } + } + $db->insertObject($search_record, 'search'); + } + return count($sections); + } + + /** + * Retrieve either the entire hierarchy, or a subset of the hierarchy, as an array suitable for use + * in a dropdowncontrol. This is used primarily by the section datatype for moving and adding + * sections to specific parts of the site hierarchy. + * + * @param int $parent The id of the subtree parent. If passed as 0 (the default), the entire subtree is parsed. + * @param int $depth + * @param int $default + * @param array $ignore_ids a value-array of IDs to be ignored when generating the list. This is used + * when moving a section, since a section cannot be made a subsection of itself or any of its subsections. + * + * @return string + */ + function levelShowDropdown($parent, $depth = 0, $default = 0, $ignore_ids = array()) { + global $db; + + $html = ''; + $nodes = $db->selectObjects('section', 'parent=' . $parent, 'rank'); +// $nodes = expSorter::sort(array('array'=>$nodes,'sortby'=>'rank', 'order'=>'ASC')); + foreach ($nodes as $node) { + if (($node->public == 1 || expPermissions::check('view', expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { + $html .= '<option value="' . $node->id . '" '; + if ($default == $node->id) $html .= 'selected'; + $html .= '>'; + if ($node->active == 1) { + $html .= str_pad('', $depth * 3, '.', STR_PAD_LEFT) . $node->name; + } else { + $html .= str_pad('', $depth * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; + } + $html .= '</option>'; + $html .= self::levelShowDropdown($node->id, $depth + 1, $default, $ignore_ids); + } + } + return $html; + } + + /** + * recursively lists the template hierarchy + * + * @static + * + * @param int $parent top level parent id + * @param int $depth variable to hold level of recursion + * + * @return array + * @deprecated 2.0.0 this only for deprecated templates + */ + public static function getTemplateHierarchyFlat($parent, $depth = 1) { + global $db; + + $arr = array(); + $kids = $db->selectObjects('section_template', 'parent=' . $parent, 'rank'); +// $kids = expSorter::sort(array('array'=>$kids,'sortby'=>'rank', 'order'=>'ASC')); + for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) { + $page = $kids[$i]; + $page->depth = $depth; + $page->first = ($i == 0 ? 1 : 0); + $page->last = ($i == count($kids) - 1 ? 1 : 0); + $arr[] = $page; + $arr = array_merge($arr, self::getTemplateHierarchyFlat($page->id, $depth + 1)); + } + return $arr; + } + + /** + * @deprecated 2.0.0 this only for deprecated templates + */ + public static function process_section($section, $template) { + global $db; + + if (!is_object($template)) { + $template = $db->selectObject('section_template', 'id=' . $template); + $section->subtheme = $template->subtheme; + $db->updateObject($section, 'section'); + } + $prefix = '@st' . $template->id; + $refs = $db->selectObjects('sectionref', "source LIKE '$prefix%'"); + // Copy all modules and content for this section + foreach ($refs as $ref) { + $src = substr($ref->source, strlen($prefix)) . $section->id; + if (call_user_func(array($ref->module, 'hasContent'))) { + $oloc = expCore::makeLocation($ref->module, $ref->source); + $nloc = expCore::makeLocation($ref->module, $src); + if ($ref->module != "container") { + call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc); + } else { + call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc, $section->id); + } + } + } + // Grab sub pages + foreach ($db->selectObjects('section_template', 'parent=' . $template->id) as $t) { + self::process_subsections($section, $t); + } + + } + + /** + * @deprecated 2.0.0 this only for deprecated templates + */ + function process_subsections($parent_section, $subtpl) { + global $db, $router; + + $section = new stdClass(); + $section->parent = $parent_section->id; + $section->name = $subtpl->name; + $section->sef_name = $router->encode($section->name); + $section->subtheme = $subtpl->subtheme; + $section->active = $subtpl->active; + $section->public = $subtpl->public; + $section->rank = $subtpl->rank; + $section->page_title = $subtpl->page_title; + $section->keywords = $subtpl->keywords; + $section->description = $subtpl->description; + $section->id = $db->insertObject($section, 'section'); + self::process_section($section, $subtpl); + } + + /** + * Delete page and send its contents to the recycle bin + * + * @param $parent + * @deprecated 2.3.4 moved to section model + */ + public static function deleteLevel($parent) { + global $db; + + $kids = $db->selectObjects('section', 'parent=' . $parent); + foreach ($kids as $kid) { + self::deleteLevel($kid->id); + } + $secrefs = $db->selectObjects('sectionref', 'section=' . $parent); + foreach ($secrefs as $secref) { + $loc = expCore::makeLocation($secref->module, $secref->source, $secref->internal); + recyclebin::sendToRecycleBin($loc, $parent); + //FIXME if we delete the module & sectionref the module completely disappears +// if (class_exists($secref->module)) { +// $modclass = $secref->module; +// //FIXME: more module/controller glue code +// if (expModules::controllerExists($modclass)) { +// $modclass = expModules::getControllerClassName($modclass); +// $mod = new $modclass($loc->src); +// $mod->delete_instance(); +// } else { +// $mod = new $modclass(); +// $mod->deleteIn($loc); +// } +// } + } +// $db->delete('sectionref', 'section=' . $parent); + $db->delete('section', 'parent=' . $parent); + } + + /** + * Move content page and its children to stand-alones + * + * @param $parent + * @deprecated 2.3.4 moved to section model + */ + public static function removeLevel($parent) { + global $db; + + $kids = $db->selectObjects('section', 'parent=' . $parent); + foreach ($kids as $kid) { + $kid->parent = -1; + $db->updateObject($kid, 'section'); + self::removeLevel($kid->id); + } + } + + /** + * Check for cascading page view permission, esp. if not public + * @deprecated 2.3.4 moved to section model + */ + public static function canView($section) { + global $db; + + if ($section == null) { + return false; + } + if ($section->public == 0) { + // Not a public section. Check permissions. + return expPermissions::check('view', expCore::makeLocation('navigation', '', $section->id)); + } else { // Is public. check parents. + if ($section->parent <= 0) { + // Out of parents, and since we are still checking, we haven't hit a private section. + return true; + } else { + $s = $db->selectObject('section', 'id=' . $section->parent); + return self::canView($s); + } + } + } + + /** + * Check to see if page is public with cascading + * @deprecated 2.3.4 moved to section model + */ + public static function isPublic($s) { + if ($s == null) { + return false; + } + while ($s->public && $s->parent > 0) { + $s = new section($s->parent); + } + $lineage = (($s->public) ? 1 : 0); + return $lineage; + } + + public static function canManageStandalones() { + global $user; + + if ($user->isAdmin()) return true; + $standalones = section::levelTemplate(-1, 0); + // $canmanage = false; + foreach ($standalones as $standalone) { + $loc = expCore::makeLocation('navigation', '', $standalone->id); + if (expPermissions::check('manage', $loc)) return true; + } + return false; + } + + /** + * Reassign permissions based on a check/change in menu/page hierarchy + * + * @static + * + * @param $id + */ + public static function checkForSectionalAdmins($id) { + global $db; + + $section = $db->selectObject('section', 'id=' . $id); + $branch = section::levelTemplate($id, 0); + array_unshift($branch, $section); + $allusers = array(); + $allgroups = array(); + while ($section->parent > 0) { + // $ploc = expCore::makeLocation('navigationController', null, $section); + $allusers = array_merge($allusers, $db->selectColumn('userpermission', 'uid', "permission='manage' AND module='navigation' AND internal=" . $section->parent)); + $allgroups = array_merge($allgroups, $db->selectColumn('grouppermission', 'gid', "permission='manage' AND module='navigation' AND internal=" . $section->parent)); + $section = $db->selectObject('section', 'id=' . $section->parent); + } + foreach ($branch as $section) { + $sloc = expCore::makeLocation('navigation', null, $section->id); + // remove any manage permissions for this page and it's children + // $db->delete('userpermission', "module='navigationController' AND internal=".$section->id); + // $db->delete('grouppermission', "module='navigationController' AND internal=".$section->id); + foreach ($allusers as $uid) { + $u = user::getUserById($uid); + expPermissions::grant($u, 'manage', $sloc); + } + foreach ($allgroups as $gid) { + $g = group::getGroupById($gid); + expPermissions::grantGroup($g, 'manage', $sloc); + } + } + } + + function manage() { + global $db, $router, $user; + + expHistory::set('manageable', $router->params); + assign_to_template(array( + 'canManageStandalones' => self::canManageStandalones(), + 'sasections' => $db->selectObjects('section', 'parent=-1'), + 'user' => $user, +// 'canManagePagesets' => $user->isAdmin(), +// 'templates' => $db->selectObjects('section_template', 'parent=0'), + )); + } + + public function manage_sitemap() { + global $db, $user, $sectionObj, $sections; + + expHistory::set('viewable', $this->params); + $id = $sectionObj->id; + $current = null; + // all we need to do is determine the current section + $navsections = $sections; + if ($sectionObj->parent == -1) { + $current = $sectionObj; + } else { + foreach ($navsections as $section) { + if ($section->id == $id) { + $current = $section; + break; + } + } + } + assign_to_template(array( + 'sasections' => $db->selectObjects('section', 'parent=-1'), + 'sections' => $navsections, + 'current' => $current, + 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0), + )); + } + + /** + * Ajax request for specific pages as json date to yui tree + */ + public static function returnChildrenAsJSON() { + global $db; + + //$nav = section::levelTemplate(intval($_REQUEST['id'], 0)); + $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + $nav = $db->selectObjects('section', 'parent=' . $id, 'rank'); + //FIXME $manage_all is moot w/ cascading perms now? + $manage_all = false; + if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $id))) { + $manage_all = true; + } + //FIXME recode to use foreach $key=>$value + $navcount = count($nav); + for ($i = 0; $i < $navcount; $i++) { + if ($manage_all || expPermissions::check('manage', expCore::makeLocation('navigation', '', $nav[$i]->id))) { + $nav[$i]->manage = 1; + $view = true; + } else { + $nav[$i]->manage = 0; + $view = $nav[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $nav[$i]->id)); + } + $nav[$i]->link = expCore::makeLink(array('section' => $nav[$i]->id), '', $nav[$i]->sef_name); + if (!$view) unset($nav[$i]); + } + $nav= array_values($nav); +// $nav[$navcount - 1]->last = true; + if (count($nav)) $nav[count($nav) - 1]->last = true; +// echo expJavascript::ajaxReply(201, '', $nav); + $ar = new expAjaxReply(201, '', $nav); + $ar->send(); + } + + /** + * Ajax request for all pages as json date to jstree + */ + public static function returnChildrenAsJSON2() { + global $db; + + $icons = array( + 0 => 'addpage', + 1 => 'addextpage', + 2 => 'addintpage', + 3 => 'addfreeform', + ); + + $navs = $db->selectObjects('section', 'parent!=-1', 'rank'); + foreach ($navs as $i=>$nav) { + $navs[$i]->parent = $nav->parent?$nav->parent:'#'; + $navs[$i]->text = $nav->name; + $navs[$i]->icon = $icons[$nav->alias_type]; + if (!$nav->active) { + $navs[$i]->icon .= ' inactive'; + $attr = new stdClass(); + $attr->class = 'inactive'; // class to obscure elements + $navs[$i]->a_attr = $attr; + } + if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $navs[$i]->id))) { + $navs[$i]->manage = 1; + $view = true; + } else { + $navs[$i]->manage = 0; + $navs[$i]->state->disabled = true; + $view = $navs[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $navs[$i]->id)); + } + $navs[$i]->link = expCore::makeLink(array('section' => $navs[$i]->id), '', $navs[$i]->sef_name); + if (!$view) { +// unset($navs[$i]); //FIXME this breaks jstree if we remove a parent and not the child + $attr = new stdClass(); + $attr->class = 'hidden'; // bs3 class to hide elements + $navs[$i]->li_attr = $attr; + } + } + $navs= array_values($navs); +// header('Content-Type: application/json; charset=utf8'); + echo json_encode($navs); +// echo expJavascript::ajaxReply(201, '', $navs); + exit; + } + + /** + * Ajax function to reorder page hierarchy from yui tree control + */ + public static function DragnDropReRank() { + global $db, $router; + + $move = $router->params['move']; + $target = $router->params['target']; + $type = $router->params['type']; + $targSec = $db->selectObject("section","id=".$target); +// $targSec = new section($target); + $check_id = $targSec->parent; + $moveSec = $db->selectObject("section","id=".$move); +// $moveSec = new section($move); + + // dropped on top of page + if ($type == "append") { + //save the old parent in case we are changing the depth of the moving section + $oldParent = $moveSec->parent; + //assign the parent of the moving section to the ID of the target section + $moveSec->parent = $targSec->id; + //set the rank of the moving section to 0 since it will appear first in the new order + $moveSec->rank = 1; + //select all children currently of the parent we're about to append to + $targSecChildren = $db->selectObjects("section", "parent=" . $targSec->id . " ORDER BY rank"); + //update the ranks of the children to +1 higher to accommodate our new rank 0 section being moved in. + $newrank = 1; + foreach ($targSecChildren as $value) { + if ($value->id != $moveSec->id) { + $value->rank = $newrank; + $db->updateObject($value, 'section'); + $newrank++; + } + } + $db->updateObject($moveSec, 'section'); + if ($oldParent != $moveSec->parent) { + //we need to re-rank the children of the parent that the miving section has just left + $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); + for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { + $childOfLastMove[$i]->rank = $i; + $db->updateObject($childOfLastMove[$i], 'section'); + } + + } +// echo $moveSec->name . " was appended to " . $targSec->name; + + } elseif ($type == "after") { // dropped between (after) pages + if ($targSec->parent == $moveSec->parent) { + //are we moving up... + if ($targSec->rank < $moveSec->rank) { + $moveSec->rank = $targSec->rank + 1; + $moveNextSiblings = $db->selectObjects("section", "id!=" . $moveSec->id . " AND parent=" . $targSec->parent . " AND rank>" . $targSec->rank . " ORDER BY rank"); + $rerank = $moveSec->rank + 1; + foreach ($moveNextSiblings as $value) { + if ($value->id != $moveSec->id) { + $value->rank = $rerank; + $db->updateObject($value, 'section'); + $rerank++; + } + } + $db->updateObject($targSec, 'section'); +// $targSec->update(); + $db->updateObject($moveSec, 'section'); +// $moveSec->update(); + //or are we moving down... + } else { + $targSec->rank = $targSec->rank - 1; + $moveSec->rank = $targSec->rank + 1; + $movePreviousSiblings = $db->selectObjects("section", "id!=" . $moveSec->id . " AND parent=" . $targSec->parent . " AND rank<=" . $targSec->rank . " ORDER BY rank"); + $rerank = 1; + foreach ($movePreviousSiblings as $value) { + if ($value->id != $moveSec->id) { + $value->rank = $rerank; + $db->updateObject($value, 'section'); + $rerank++; + } + } + $db->updateObject($targSec, 'section'); +// $targSec->update(); + $db->updateObject($moveSec, 'section'); +// $moveSec->update(); + } + } else { // 'before', is this used? + //store ranks from the depth we're moving from. Used to re-rank the level depth the moving section is moving from. + $oldRank = $moveSec->rank; + $oldParent = $moveSec->parent; + //select all children of the target sections parent with a rank higher than it's own + $moveNextSiblings = $db->selectObjects("section", "parent=" . $targSec->parent . " AND rank>" . $targSec->rank . " ORDER BY rank"); + //update moving sections rank and parent + $moveSec->rank = $targSec->rank + 1; + $moveSec->parent = $targSec->parent; + //$rerank=$moveSec->rank+1; + foreach ($moveNextSiblings as $value) { + $value->rank = $value->rank + 1; + $db->updateObject($value, 'section'); + } + $db->updateObject($moveSec, 'section'); + //handle re-ranking of previous parent + $oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank"); + $rerank = 1; + foreach ($oldSiblings as $value) { + if ($value->id != $moveSec->id) { + $value->rank = $rerank; + $db->updateObject($value, 'section'); + $rerank++; + } + } + if ($oldParent != $moveSec->parent) { + //we need to re-rank the children of the parent that the moving section has just left + $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); + for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { + $childOfLastMove[$i]->rank = $i; + $db->updateObject($childOfLastMove[$i], 'section'); + } + } + } + } + self::checkForSectionalAdmins($move); + expSession::clearAllUsersSessionCache('navigation'); + } + + /** + * Ajax function to reorder page hierarchy from jstree control + */ + public static function DragnDropReRank2() { + global $router, $db; + + $id = $router->params['id']; + $page = new section($id); + $old_rank = $page->rank; + $old_parent = $page->parent; + $new_rank = $router->params['position'] + 1; // rank + $new_parent = intval($router->params['parent']); + + $db->decrement($page->tablename, 'rank', 1, 'rank>' . $old_rank . ' AND parent=' . $old_parent); // close in hole + $db->increment($page->tablename, 'rank', 1, 'rank>=' . $new_rank . ' AND parent=' . $new_parent); // make room + + $params = array(); + $params['parent'] = $new_parent; + $params['rank'] = $new_rank; + $page->update($params); + + self::checkForSectionalAdmins($id); + expSession::clearAllUsersSessionCache('navigation'); + } + + function edit_section() { + global $db, $user; + + $parent = new section($this->params['parent']); + if (empty($parent->id)) $parent->id = 0; + assign_to_template(array( + 'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0), + 'parent' => $parent, + 'isAdministrator' => $user->isAdmin(), + )); + } + + function edit_contentpage() { + //FIXME we come here for new/edit content/standalone pages + // FIXME: Allow non-administrative users to manage certain parts of the section hierarchy. + //if ($user->is_acting_admin == 1 /*TODO: section admin*/) { +// $section = null; + $section = new stdClass(); + if (isset($this->params['id'])) { + // Check to see if an id was passed in get. If so, retrieve that section from + // the database, and perform an edit on it. + $section = $this->section->find($this->params['id']); + } elseif (isset($this->params['parent'])) { + // The isset check is merely a precaution. This action should + // ALWAYS be invoked with a parent or id value. + $section = new section($this->params); + } else { + notfoundController::handle_not_found(); + exit; + } + if (!empty($section->id)) { + $check_id = $section->id; + } else { + $check_id = $section->parent; + } + if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) { + if (empty($section->id)) { + $section->active = 1; + $section->public = 1; + if (!isset($section->parent)) { + // This is another precaution. The parent attribute + // should ALWAYS be set by the caller. + //FJD - if that's the case, then we should die. + notfoundController::handle_not_authorized(); + exit; + //$section->parent = 0; + } + } + assign_to_template(array( + 'section' => $section, + 'glyphs' => self::get_glyphs(), + )); + } else { // User does not have permission to manage sections. Throw a 403 + notfoundController::handle_not_authorized(); + } + } + + private static function get_glyphs() { + if (bs()) { + require_once(BASE . 'external/font-awesome.class.php'); + $fa = new Smk_FontAwesome; + if (bs3()) { + $icons = $fa->getArray(BASE . 'external/font-awesome4/css/font-awesome.css'); + $icons = $fa->sortByName($icons); + return $fa->nameGlyph($icons); + } elseif (bs2()) { + expCSS::auto_compile_less( + 'external/font-awesome/less/font-awesome.less', + 'external/font-awesome/css/font-awesome.css' + ); // font-awesome is included within bootstrap2, but not as a separate .css file + $icons = $fa->getArray(BASE . 'external/font-awesome/css/font-awesome.css', 'icon-'); + return $fa->nameGlyph($icons, 'icon-'); + } + } else { + return array(); + } + } + + function edit_internalalias() { + $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); + if ($section->parent == -1) { + notfoundController::handle_not_found(); + exit; + } // doesn't work for standalone pages + if (empty($section->id)) { + $section->public = 1; + if (!isset($section->parent)) { + // This is another precaution. The parent attribute + // should ALWAYS be set by the caller. + //FJD - if that's the case, then we should die. + notfoundController::handle_not_authorized(); + exit; + //$section->parent = 0; + } + } + assign_to_template(array( + 'section' => $section, + 'glyphs' => self::get_glyphs(), + )); + } + + function edit_freeform() { + $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); + if ($section->parent == -1) { + notfoundController::handle_not_found(); + exit; + } // doesn't work for standalone pages + if (empty($section->id)) { + $section->public = 1; + if (!isset($section->parent)) { + // This is another precaution. The parent attribute + // should ALWAYS be set by the caller. + //FJD - if that's the case, then we should die. + notfoundController::handle_not_authorized(); + exit; + //$section->parent = 0; + } + } + assign_to_template(array( + 'section' => $section, + 'glyphs' => self::get_glyphs(), + )); + } + + function edit_externalalias() { + $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); + if ($section->parent == -1) { + notfoundController::handle_not_found(); + exit; + } // doesn't work for standalone pages + if (empty($section->id)) { + $section->public = 1; + if (!isset($section->parent)) { + // This is another precaution. The parent attribute + // should ALWAYS be set by the caller. + //FJD - if that's the case, then we should die. + notfoundController::handle_not_authorized(); + exit; + //$section->parent = 0; + } + } + assign_to_template(array( + 'section' => $section, + 'glyphs' => self::get_glyphs(), + )); + } + + function update() { + parent::update(); + expSession::clearAllUsersSessionCache('navigation'); + } + + function move_standalone() { + expSession::clearAllUsersSessionCache('navigation'); + assign_to_template(array( + 'parent' => $this->params['parent'], + )); + } + + /** + * Move standalone back to hierarchy + * + */ + function reparent_standalone() { + $standalone = $this->section->find($this->params['page']); + if ($standalone) { + $standalone->parent = $this->params['parent']; + $standalone->update(); + expSession::clearAllUsersSessionCache('navigation'); + expHistory::back(); + } else { + notfoundController::handle_not_found(); + } + } + + /** + * Move content page to standalones + * + */ + function remove() { + global $db; + + $section = $db->selectObject('section', 'id=' . $this->params['id']); + if ($section) { + section::removeLevel($section->id); + $db->decrement('section', 'rank', 1, 'rank > ' . $section->rank . ' AND parent=' . $section->parent); + $section->parent = -1; + $db->updateObject($section, 'section'); + expSession::clearAllUsersSessionCache('navigation'); + expHistory::back(); + } else { + notfoundController::handle_not_authorized(); + } + } + + function delete_standalones() { + if (!empty($this->params['deleteit'])) { + foreach ($this->params['deleteit'] as $page) { + $section = new section(intval($page)); + if ($section) { +// self::deleteLevel($section->id); + $section->delete(); + } + } + } + expSession::clearAllUsersSessionCache('navigation'); + expHistory::back(); + } + + /** + * permission functions to aggregate a module's visible permissions based on add/remove permissions + * + * @return array + */ + public function permissions() { + //set the permissions array + return $this->add_permissions; + } + + // create a psuedo global manage pages permission + public static function checkPermissions($permission,$location) { + global $exponent_permissions_r, $router; + + // only applies to the 'manage' method + if (empty($location->src) && empty($location->int) && ((!empty($router->params['action']) && $router->params['action'] == 'manage') || strpos($router->current_url, 'action=manage') !== false)) { + if (!empty($exponent_permissions_r['navigation'])) foreach ($exponent_permissions_r['navigation'] as $page) { + foreach ($page as $pageperm) { + if (!empty($pageperm['manage'])) return true; + } + } + } + return false; + } + + /** + * Rebuild the sectionref table as a list of modules on a page + * @deprecated 2.3.4 moved to sectionref model + */ + public static function rebuild_sectionrefs() { + global $db; + + // recursive run though all the nested containers + function scan_container($container_id, $page_id) { + global $db; + + $containers = $db->selectObjects('container',"external='" . $container_id . "'"); + $ret = ''; + foreach ($containers as $container) { + $iLoc = expUnserialize($container->internal); + $newret = recyclebin::restoreFromRecycleBin($iLoc, $page_id); + if (!empty($newret)) $ret .= $newret . '<br>'; + if ($iLoc->mod == 'container') { + $ret .= scan_container($container->internal, $page_id); + } + } + return $ret; + } + + // recursive run through all the nested pages + function scan_page($parent_id) { + global $db; + + $sections = $db->selectObjects('section','parent=' . $parent_id); + $ret = ''; + foreach ($sections as $page) { + $cLoc = serialize(expCore::makeLocation('container','@section' . $page->id)); + $ret .= scan_container($cLoc, $page->id); + $ret .= scan_page($page->id); + } + return $ret; + } + + // first remove duplicate records + $db->sql('DELETE FROM ' . $db->prefix . 'sectionref WHERE id NOT IN (SELECT * FROM (SELECT MIN(n.id) FROM ' . $db->prefix . 'sectionref n GROUP BY n.module, n.source) x)'); + $ret = scan_page(0); // the page hierarchy + $ret .= scan_page(-1); // now the stand alone pages + + // we need to get the non-main containers such as sidebars, footers, etc... + $hardcodedmods = $db->selectObjects('sectionref',"refcount=1000 AND source NOT LIKE '%@section%' AND source NOT LIKE '%@random%'"); + foreach ($hardcodedmods as $hardcodedmod) { + if ($hardcodedmod->module == 'container') { + $page_id = intval(preg_replace('/\D/', '', $hardcodedmod->source)); + if (empty($page_id)) { + $page_id = SITE_DEFAULT_SECTION; // we'll default to the home page + } + $ret .= scan_container(serialize(expCore::makeLocation($hardcodedmod->module, $hardcodedmod->source)), $page_id); + } else { + $hardcodedmod->section = 0; // this is a hard-coded non-container module + $db->updateObject($hardcodedmod, 'sectionref'); + } + } + + // mark modules in the recycle bin as section 0 + $db->columnUpdate('sectionref', 'section', 0, "refcount=0"); +// $recycledmods = $db->selectObjects('sectionref',"refcount=0"); +// foreach ($recycledmods as $recycledmod) { +// $recycledmod->section = 0; // this is a module in the recycle bin +// $db->updateObject($recycledmod, 'sectionref'); +// } + return $ret; + } + +} + +?> diff --git a/framework/modules/news/controllers/newsController.php b/framework/modules/news/controllers/newsController.php index fedfeb7faa..6f3d088d69 100755 --- a/framework/modules/news/controllers/newsController.php +++ b/framework/modules/news/controllers/newsController.php @@ -26,6 +26,14 @@ class newsController extends expController { 'showall'=>'Show all News', 'tags'=>"Tags", ); + protected $add_permissions = array( + 'showUnpublished'=>'View Unpublished News', + 'showExpired'=>'View Unpublished News', + ); + protected $manage_permissions = array( + 'import'=>'Import News Items', + 'export'=>'Export News Items' + ); public $remove_configs = array( 'categories', 'comments', @@ -33,11 +41,6 @@ class newsController extends expController { // 'facebook', // 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'showUnpublished'=>'View Unpublished News', - 'import'=>'Import News Items', - 'export'=>'Export News Items' - ); static function displayname() { return gt("News"); } static function description() { return gt("Display & manage news type content on your site."); } @@ -58,7 +61,7 @@ public function showall() { $limit = $this->params['limit'] == 'none' ? null : $this->params['limit']; } else { $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; - } + } $order = isset($this->config['order']) ? $this->config['order'] : 'publish DESC'; // pull the news posts from the database @@ -66,7 +69,7 @@ public function showall() { // merge in any RSS news and perform the sort and limit the number of posts we return to the configured amount. if (!empty($this->config['pull_rss'])) $items = $this->mergeRssData($items); - + // setup the pagination object to paginate the news stories. $page = new expPaginator(array( 'records'=>$items, @@ -78,7 +81,7 @@ public function showall() { 'src'=>$this->loc->src, 'view'=>empty($this->params['view']) ? null : $this->params['view'] )); - + assign_to_template(array( 'page'=>$page, 'items'=>$page->records, @@ -134,7 +137,7 @@ public function show() { if (isset($this->params['id'])) { $id = $this->params['id']; } elseif (isset($this->params['title'])) { - $id = $this->params['title']; + $id = expString::escape($this->params['title']); } $record = new news($id); @@ -176,7 +179,7 @@ public function show() { public function showUnpublished() { expHistory::set('viewable', $this->params); - + // setup the where clause for looking up records. $where = parent::aggregateWhereClause(); $where = "((unpublish != 0 AND unpublish < ".time().") OR (publish > ".time().")) AND ".$where; @@ -197,38 +200,38 @@ public function showUnpublished() { gt('Status')=>'unpublish' ), )); - + assign_to_template(array( 'page'=>$page )); } - + public function showExpired() { redirect_to(array('controller'=>'news', 'action'=>'showUnpublished','src'=>$this->params['src'])); } - + // public function configure() { // parent::configure(); // assign_to_template(array('sortopts'=>$this->sortopts)); // } - - public function saveConfig() { + + public function saveconfig() { if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) { if ($this->params['order'] == 'rank ASC') { expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->params); } } - - parent::saveConfig(); + + parent::saveconfig(); } - + public function getRSSContent($limit = 0) { // pull the news posts from the database $items = $this->news->find('all', $this->aggregateWhereClause(), isset($this->config['order']) ? $this->config['order'] : 'publish DESC', $limit); //Convert the newsitems to rss items $rssitems = array(); - foreach ($items as $key => $item) { + foreach ($items as $key => $item) { $rss_item = new FeedItem(); $rss_item->title = expString::convertSmartQuotes($item->title); $rss_item->link = $rss_item->guid = makeLink(array('controller'=>'news', 'action'=>'show', 'title'=>$item->sef_url)); @@ -252,7 +255,7 @@ public function getRSSContent($limit = 0) { * @return array */ private function mergeRssData($items) { - if (!empty($this->config['pull_rss'])) { + if (!empty($this->config['pull_rss'])) { $RSS = new SimplePie(); $RSS->set_cache_location(BASE.'tmp/rsscache'); // default is ./cache // $RSS->set_cache_duration(3600); // default is 3600 diff --git a/framework/modules/photoalbum/controllers/photosController.php b/framework/modules/photoalbum/controllers/photosController.php index 824f78fe43..b2208ffea3 100755 --- a/framework/modules/photoalbum/controllers/photosController.php +++ b/framework/modules/photoalbum/controllers/photosController.php @@ -28,6 +28,9 @@ class photosController extends expController { // 'slideshow'=>'Slideshow', // //'showall_tags'=>"Tag Categories" // ); + protected $manage_permissions = array( + 'multi'=>'Bulk Actions', + ); public $remove_configs = array( 'comments', 'ealerts', @@ -41,7 +44,7 @@ class photosController extends expController { static function displayname() { return gt("Photo Album"); } static function description() { return gt("Displays and manages images."); } static function isSearchable() { return true; } - + public function showall() { expHistory::set('viewable', $this->params); $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; @@ -66,22 +69,22 @@ public function showall() { gt('Title')=>'title' ), )); - + assign_to_template(array( 'page'=>$page, 'params'=>$this->params, )); } - + function show() { expHistory::set('viewable', $this->params); - + // figure out if we're looking this up by id or title $id = null; if (isset($this->params['id'])) { $id = $this->params['id']; } elseif (isset($this->params['title'])) { - $id = $this->params['title']; + $id = expString::escape($this->params['title']); } $record = new photo($id); if (empty($record->id)) @@ -121,7 +124,7 @@ function show() { 'config'=>$config )); } - + public function slideshow() { expHistory::set('viewable', $this->params); $order = isset($this->config['order']) ? $this->config['order'] : "rank"; @@ -147,7 +150,7 @@ public function slideshow() { 'slides'=>$page->records, )); } - + public function showall_tags() { $images = $this->image->find('all'); $used_tags = array(); @@ -160,14 +163,14 @@ public function showall_tags() { $used_tags[$tag->id] = $exptag; $used_tags[$tag->id]->count = 1; } - + } } - + assign_to_template(array( 'tags'=>$used_tags )); - } + } /** * Returns rich snippet PageMap meta data @@ -195,7 +198,7 @@ public function update() { //populate the alt tag field if the user didn't if (empty($this->params['alt'])) $this->params['alt'] = $this->params['title']; - + // call expController update to save the image parent::update(); } diff --git a/framework/modules/pixidou/controllers/pixidouController.php b/framework/modules/pixidou/controllers/pixidouController.php index 14afb2284a..6294e5134b 100755 --- a/framework/modules/pixidou/controllers/pixidouController.php +++ b/framework/modules/pixidou/controllers/pixidouController.php @@ -22,11 +22,10 @@ */ class pixidouController extends expController { -// public $cacheDir = "framework/modules/pixidou/images/"; public $cacheDir = "tmp/pixidou/"; public $requires_login = array( - 'editor', - 'exitEditor' + 'editor'=>'You must be logged in to perform this action', + 'exitEditor'=>'You must be logged in to perform this action', ); static function displayname() { return gt("Pixidou Image Editor"); } @@ -40,23 +39,23 @@ static function hasSources() function editor() { global $user; - + $file = new expFile($this->params['id']); - - $canSaveOg = $user->id==$file->poster || $user->is_admin ? 1 : 0 ; - if (file_exists(BASE.$file->directory.$file->filename)) { - $file->copyToDirectory(BASE.$this->cacheDir); + + $canSaveOg = $user->id==$file->poster || $user->isSuperAdmin() ? 1 : 0 ; + if (file_exists(BASE . $file->directory . $file->filename)) { + $file->copyToDirectory(BASE . $this->cacheDir); assign_to_template(array( 'image'=>$file, 'update'=>$this->params['update'], 'saveog'=>$canSaveOg )); } else { - flash('error',gt('The file').' "'.BASE.$file->directory.$file->filename.'" '.gt('does not exist on the server.')); - redirect_to(array("controller"=>'file',"action"=>'picker',"ajax_action"=>1,"update"=>$this->params['update'],"filter"=>$this->params['filter'])); + flash('error', gt('The file') . ' "' . BASE . $file->directory . $file->filename . '" ' . gt('does not exist on the server.')); + redirect_to(array("controller"=>'file', "action"=>'picker', "ajax_action"=>1, "update"=>$this->params['update'], "filter"=>$this->params['filter'])); } } - + public function exitEditor() { // clean up parameters $this->params['fid'] = intval($this->params['fid']); @@ -65,17 +64,17 @@ public function exitEditor() { } switch ($this->params['exitType']) { case 'saveAsCopy': - $oldimage = new expFile($this->params['fid']); - $copyname = expFile::resolveDuplicateFilename($oldimage->path); - copy(BASE.$this->cacheDir."/".$this->params['cpi'],$oldimage->directory.$copyname); //copy the edited file over to the files dir + $oldimage = new expFile($this->params['fid']); + $copyname = expFile::resolveDuplicateFilename($oldimage->path); + copy(BASE . $this->cacheDir . "/" . $this->params['cpi'], $oldimage->directory . $copyname); //copy the edited file over to the files dir $newFile = new expFile(array("filename"=>$copyname)); //construct a new expFile $newFile->directory = $oldimage->directory; $newFile->title = $oldimage->title; $newFile->shared = $oldimage->shared; $newFile->mimetype = $oldimage->mimetype; $newFile->posted = time(); - $newFile->filesize = filesize(BASE.$this->cacheDir."/".$this->params['cpi']); - $resized = getimagesize(BASE.$this->cacheDir."/".$this->params['cpi']); + $newFile->filesize = filesize(BASE . $this->cacheDir . "/" . $this->params['cpi']); + $resized = getimagesize(BASE . $this->cacheDir . "/" . $this->params['cpi']); $newFile->image_width = $resized[0]; $newFile->image_height = $resized[1]; $newFile->alt = $oldimage->alt; @@ -86,36 +85,36 @@ public function exitEditor() { case 'saveAsIs': //eDebug($this->params,true); $oldimage = new expFile($this->params['fid']); - $resized = getimagesize(BASE.$this->cacheDir."/".$this->params['cpi']); + $resized = getimagesize(BASE . $this->cacheDir . "/" . $this->params['cpi']); $oldimage->image_width = $resized[0]; $oldimage->image_height = $resized[1]; $oldimage->save(); - copy(BASE.$this->cacheDir."/".$this->params['cpi'],$oldimage->directory.$oldimage->filename); //copy the edited file over to the files dir + copy(BASE . $this->cacheDir . "/" . $this->params['cpi'], $oldimage->directory . $oldimage->filename); //copy the edited file over to the files dir break; - + default: # code... break; } // proper file types to look for - $types = array(".jpg",".gif",".png"); - + $types = array(".jpg", ".gif", ".png"); + //Pixidou images directory, the editor's cache - $cachedir = BASE.$this->cacheDir; - + $cachedir = BASE . $this->cacheDir; + if (is_dir($cachedir) && is_readable($cachedir) ) { $dh = opendir($cachedir); while (($tmpfile = readdir($dh)) !== false) { - if (in_array(substr($tmpfile,-4,4),$types)) { - $filename = $cachedir.$tmpfile; + if (in_array(substr($tmpfile, -4, 4), $types)) { + $filename = $cachedir . $tmpfile; unlink($filename); } } } - - redirect_to(array("controller"=>'file',"action"=>'picker',"ajax_action"=>1,"update"=>$this->params['update'],"filter"=>$this->params['filter'])); + + redirect_to(array("controller"=>'file', "action"=>'picker', "ajax_action"=>1, "update"=>$this->params['update'], "filter"=>$this->params['filter'])); } - + } -?> \ No newline at end of file +?> diff --git a/framework/modules/portfolio/controllers/portfolioController.php b/framework/modules/portfolio/controllers/portfolioController.php index f81fc505ce..5d26b122da 100755 --- a/framework/modules/portfolio/controllers/portfolioController.php +++ b/framework/modules/portfolio/controllers/portfolioController.php @@ -27,6 +27,10 @@ class portfolioController extends expController { 'tags'=>"Tags", 'slideshow'=>"Slideshow" ); + protected $manage_permissions = array( + 'import'=>'Import Portfolio Items', + 'export'=>'Export Portfolio Items' + ); public $remove_configs = array( 'comments', 'ealerts', @@ -34,10 +38,6 @@ class portfolioController extends expController { 'rss', 'twitter', ); // all options: ('aggregation','categories','comments','ealerts','facebook','files','pagination','rss','tags','twitter',) - protected $add_permissions = array( - 'import'=>'Import Portfolio Items', - 'export'=>'Export Portfolio Items' - ); static function displayname() { return gt("Portfolio"); } static function description() { return gt("Display a portfolio or listing."); } diff --git a/framework/modules/recyclebin/controllers/recyclebinController.php b/framework/modules/recyclebin/controllers/recyclebinController.php index 63945fb77d..29f0d4fa64 100755 --- a/framework/modules/recyclebin/controllers/recyclebinController.php +++ b/framework/modules/recyclebin/controllers/recyclebinController.php @@ -22,7 +22,7 @@ */ class recyclebinController extends expController { - protected $add_permissions = array( + protected $manage_permissions = array( 'showall' => 'View Recycle Bin', 'show' => 'View Recycle Bin', 'remove' => 'Remove Recycle Bin Item' @@ -97,6 +97,8 @@ public function remove() { global $db; + $this->params['mod'] = expString::escape($this->params['mod']); + $this->params['src'] = expString::escape($this->params['src']); $mod = expModules::getController($this->params['mod'], $this->params['src']); if ($mod != null) { $mod->delete_instance(); // delete all assoc items diff --git a/framework/modules/report/controllers/reportController.php b/framework/modules/report/controllers/reportController.php index ca81e9f62a..ccd4132167 100755 --- a/framework/modules/report/controllers/reportController.php +++ b/framework/modules/report/controllers/reportController.php @@ -22,18 +22,23 @@ */ class reportController extends expController { - protected $add_permissions = array( - 'build_report' => 'Manage', + protected $manage_permissions = array( + 'abandoned_carts' => 'Abandoned Carts Report', + 'batch_export' => 'Export Products', 'cart_summary' => 'View Cart Summary Report', + 'current_carts' => 'Current Carts Report', 'dashboard' => 'View the e-Commerce Dashboard', - 'order_report' => 'Generate Order Report', - 'product_report' => 'Generate Product Report', + 'download' => 'Download Report', 'generateOrderReport' => 'View Order Report', 'generateProductReport' => 'View Product Report', + 'order_report' => 'Generate Order Report', + 'payment_report' => 'Generate Payment Report', 'print_orders' => 'Print Orders', - 'batch_export' => 'Export Products', + 'product_report' => 'Generate Product Report', + 'purge_abandoned_carts' => 'Purge Abandoned Carts', 'show_payment_summary' => 'Show Payment Summary', - 'export_order_items' => 'Export Order Items File'); + 'status_export' => 'Export Status', + ); static function displayname() { return gt("Ecom Report Builder"); @@ -339,13 +344,13 @@ function cart_summary() { //echo $sql . $sqlwhere . "<br>"; /* Need: order, orderitems, order status, ordertype, billingmethods, geo region, shipping methods, products - [date-startdate] => - [time-h-startdate] => - [time-m-startdate] => + [date-startdate] => + [time-h-startdate] => + [time-m-startdate] => [ampm-startdate] => am - [date-enddate] => - [time-h-enddate] => - [time-m-enddate] => + [date-enddate] => + [time-h-enddate] => + [time-m-enddate] => [ampm-enddate] => am [order_status] => Array ( @@ -361,20 +366,20 @@ function cart_summary() { ) [order-range-op] => e - [order-range-num] => + [order-range-num] => [order-price-op] => l - [order-price-num] => - [pnam] => - [sku] => + [order-price-num] => + [pnam] => + [sku] => [discounts] => Array ( [0] => -1 ) - [blshpname] => - [email] => + [blshpname] => + [email] => [bl-sp-zip] => s - [zip] => + [zip] => [bl-sp-state] => s [state] => Array ( @@ -393,8 +398,8 @@ function cart_summary() { //$order = 'id'; //$prod = new product(); // $order = new order(); - //$items = $prod->find('all', 1, 'id DESC',25); - //$items = $order->find('all', 1, 'id DESC',25); + //$items = $prod->find('all', 1, 'id DESC',25); + //$items = $order->find('all', 1, 'id DESC',25); //$res = $mod->find('all',$sql,'id',25); //eDebug($items); @@ -458,7 +463,7 @@ function order_report() { } /*$geo = new geoRegion(); - $geos = $geo->find('all'); + $geos = $geo->find('all'); $states = array(); $states[-1] = gt('--Any--'); foreach ($geos as $skey=>$state) @@ -473,7 +478,7 @@ function order_report() { //eDebug(mktime(0,0,0,(strftime("%m")-1),1,strftime("%Y"))); // $prev_month = strftime("%A, %d %B %Y", mktime(0,0,0,(strftime("%m")-1),1,strftime("%Y"))); - //eDebug(strftime("%A, %d %B %Y", mktime(0,0,0,(strftime("%m")-1),1,strftime("%Y")))); + //eDebug(strftime("%A, %d %B %Y", mktime(0,0,0,(strftime("%m")-1),1,strftime("%Y")))); // $now_date = strftime("%A, %d %B %Y"); $prev_month = strftime(DISPLAY_DATE_FORMAT, mktime(0, 0, 0, (strftime("%m") - 1), 1, strftime("%Y"))); $now_date = strftime(DISPLAY_DATE_FORMAT); @@ -501,7 +506,7 @@ function generateOrderReport() { $p = $this->params; //eDebug(); - //build + //build $start_sql = "SELECT DISTINCT(o.id), "; $count_sql = "SELECT COUNT(DISTINCT(o.id)) as c, "; $sql = "o.invoice_id, FROM_UNIXTIME(o.purchased,'%c/%e/%y %h:%i:%s %p') as purchased_date, b.firstname as bfirst, b.lastname as blast, concat('".expCore::getCurrencySymbol()."',format(o.grand_total,2)) as grand_total, os.title as status_title, ot.title as order_type"; @@ -685,7 +690,7 @@ function generateOrderReport() { if (isset($p['payment_method'])) { $inc = 0; $sqltmp = ''; - //get each calculator's id + //get each calculator's id foreach ($p['payment_method'] as $s) { if ($s == -1) continue; @@ -710,13 +715,13 @@ function generateOrderReport() { //echo $sql . $sqlwhere . "<br>"; /* Need: order, orderitems, order status, ordertype, billingmethods, geo region, shipping methods, products - [date-startdate] => - [time-h-startdate] => - [time-m-startdate] => + [date-startdate] => + [time-h-startdate] => + [time-m-startdate] => [ampm-startdate] => am - [date-enddate] => - [time-h-enddate] => - [time-m-enddate] => + [date-enddate] => + [time-h-enddate] => + [time-m-enddate] => [ampm-enddate] => am [order_status] => Array ( @@ -732,20 +737,20 @@ function generateOrderReport() { ) [order-range-op] => e - [order-range-num] => + [order-range-num] => [order-price-op] => l - [order-price-num] => - [pnam] => - [sku] => + [order-price-num] => + [pnam] => + [sku] => [discounts] => Array ( [0] => -1 ) - [blshpname] => - [email] => + [blshpname] => + [email] => [bl-sp-zip] => s - [zip] => + [zip] => [bl-sp-state] => s [state] => Array ( @@ -772,11 +777,11 @@ function generateOrderReport() { //$order = 'id'; //$prod = new product(); // $order = new order(); - //$items = $prod->find('all', 1, 'id DESC',25); - //$items = $order->find('all', 1, 'id DESC',25); + //$items = $prod->find('all', 1, 'id DESC',25); + //$items = $order->find('all', 1, 'id DESC',25); //$res = $mod->find('all',$sql,'id',25); //eDebug($items); - //eDebug($sql . $sqlwhere); + //eDebug($sql . $sqlwhere); $page = new expPaginator(array( //'model'=>'order', @@ -803,7 +808,7 @@ function generateOrderReport() { ), )); - //strftime("%a %d-%m-%Y", get_first_day(3, 1, 2007)); Thursday, 1 April 2010 + //strftime("%a %d-%m-%Y", get_first_day(3, 1, 2007)); Thursday, 1 April 2010 //$d_month_previous = date('n', mktime(0,0,0,(strftime("%m")-1),1,strftime("%Y"))); $action_items = array( @@ -944,7 +949,7 @@ function export_user_input_report() { unset($item); foreach ($items as $item) { $line = ''; - //$line = expString::outputField("SMC Inventory - Laurie"); + //$line = expString::outputField("SMC Inventory - Laurie"); $line .= expString::outputField($item['model']); //$line.= expString::outputField($item['name']); $line .= expString::outputField($item['qty']); @@ -1160,9 +1165,9 @@ function generateProductReport() { //expSession::set('product_export_query', "SELECT DISTINCT(p.id) FROM `exponent_product` p WHERE (title like '%Velcro%' OR feed_title like '%Velcro%' OR title like '%Multicam%' OR feed_title like '%Multicam%') AND parent_id = 0"); $product = new product(); - //$items = $product->find('all', '', 'id', 25); - //$page = new expPaginator(); - //eDebug($page,true); + //$items = $product->find('all', '', 'id', 25); + //$page = new expPaginator(); + //eDebug($page,true); $page = new expPaginator(array( // 'model' => 'product', //'records'=>$items, @@ -1197,7 +1202,7 @@ function generateProductReport() { 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'columns'=>array( 'Customer'=>'lastname', - 'Invoice #'=>'invoice_id', + 'Invoice #'=>'invoice_id', 'Total'=>'total', 'Date Purchased'=>'purchased', 'Status'=>'order_status_id', @@ -1211,16 +1216,16 @@ function generateProductReport() { 'page' => $page, 'action_items' => $action_items )); - // - // - // assign_to_template(array('page'=>$page)); + // + // + // assign_to_template(array('page'=>$page)); } /** * @deprecated 2.3.3 moved to expString */ public static function parseAndTrimExport($str, $isHTML = false) { //�Death from above�? � - //echo "1<br>"; eDebug($str); + //echo "1<br>"; eDebug($str); $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); @@ -1268,7 +1273,7 @@ public static function parseAndTrimImport($str, $isHTML = false) { //�Death fr $str = str_replace("\,", ",", $str); $str = str_replace('""', '"', $str); //do this no matter what...in case someone added a quote in a non HTML field if (!$isHTML) { - //if HTML, then leave the single quotes alone, otheriwse replace w/ special Char + //if HTML, then leave the single quotes alone, otheriwse replace w/ special Char $str = str_replace('"', "&quot;", $str); } $str = str_replace("�", "&#188;", $str); @@ -1303,7 +1308,7 @@ public static function parseAndTrim($str, $isHTML = false) { //�Death from abo $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); - //$str = str_replace(",","\,",$str); + //$str = str_replace(",","\,",$str); $str = str_replace('\"', "&quot;", $str); $str = str_replace('"', "&quot;", $str); @@ -1539,14 +1544,14 @@ function productFeed() { //check query password to avoid DDOS /* * condition = new - * description - * id - SKU - * link - * price - * title - * brand - manufacturer - * image link - fullsized image, up to 10, comma seperated - * product type - category - "Electronics > Audio > Audio Accessories MP3 Player Accessories","Health & Beauty > Healthcare > Biometric Monitors > Pedometers" + * description + * id - SKU + * link + * price + * title + * brand - manufacturer + * image link - fullsized image, up to 10, comma seperated + * product type - category - "Electronics > Audio > Audio Accessories MP3 Player Accessories","Health & Beauty > Healthcare > Biometric Monitors > Pedometers" */ $out = '"id","condition","description","like","price","title","brand","image link","product type"' . chr(13) . chr(10); @@ -1730,45 +1735,45 @@ function current_carts() { eDebug(date('Y-m-d'), true); // eDebug($this->tend); eDebug(date('Y-m-d, g:i:s A', $this->tend)); - $allOrderCount = $this->o->find('count','created_at >= ' . $this->tstart . ' AND created_at <= ' . $this->tend,null,null,null,true,false,$except,true); + $allOrderCount = $this->o->find('count','created_at >= ' . $this->tstart . ' AND created_at <= ' . $this->tend,null,null,null,true,false,$except,true); $sql = "SELECT COUNT(DISTINCT(`orders_id`)) as c FROM " . $db->prefix . "orderitems oi "; $sql .= "JOIN " . $db->prefix . "orders o ON oi.orders_id = o.id "; $sql .= "WHERE o.created_at >= " . $this->tstart . " AND o.created_at <= " . $this->tend; //$sql .= " AND o.user_id != 0 AND o.order_type_id = 1"; - + eDebug($sql); $allCartsWithItems = $db->countObjectsBySql($sql); - + $sql = "SELECT COUNT(DISTINCT(`orders_id`)) as c FROM " . $db->prefix . "orderitems oi "; $sql .= "JOIN " . $db->prefix . "orders o ON oi.orders_id = o.id "; $sql .= "WHERE o.created_at >= " . $this->tstart . " AND o.created_at <= " . $this->tend; eDebug($sql); $realUserCartsWithItems = $db->countObjectsBySql($sql); - - $ordersInCheckout = $this->o->find('count','created_at >= ' . $this->tstart . ' AND created_at <= ' . $this->tend . " AND user_id != 0",null,null,null,true,false,$except,true); - - //$ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend . " AND user_id != 0 AND order_type_id = 1",null,null,null,true,false,$except,true); - //$ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend . " AND user_id != 0",null,null,null,true,false,$except,true); - $ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend,null,null,null,true,false,$except,true); - $orders = $this->o->find('all','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend,null,null,null,true,false,$except,true); - - eDebug("All:" . $allOrderCount); - eDebug("Carts w/ Items:" . $allCartsWithItems); - eDebug("Carts w/ Items in Checkout:" . $ordersInCheckout); - eDebug("Purchased:" . $ordersPurchased); - + + $ordersInCheckout = $this->o->find('count','created_at >= ' . $this->tstart . ' AND created_at <= ' . $this->tend . " AND user_id != 0",null,null,null,true,false,$except,true); + + //$ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend . " AND user_id != 0 AND order_type_id = 1",null,null,null,true,false,$except,true); + //$ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend . " AND user_id != 0",null,null,null,true,false,$except,true); + $ordersPurchased = $this->o->find('count','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend,null,null,null,true,false,$except,true); + $orders = $this->o->find('all','purchased >= ' . $this->tstart . ' AND purchased <= ' . $this->tend,null,null,null,true,false,$except,true); + + eDebug("All:" . $allOrderCount); + eDebug("Carts w/ Items:" . $allCartsWithItems); + eDebug("Carts w/ Items in Checkout:" . $ordersInCheckout); + eDebug("Purchased:" . $ordersPurchased); + $totalAbandoned = ($allCartsWithItems - $ordersPurchased) / $allCartsWithItems; $checkoutAbandoned = ($ordersInCheckout - $ordersPurchased) / $ordersInCheckout; eDebug("Total Abandoned: " . $totalAbandoned); eDebug("Checkout Abandoned: " . $checkoutAbandoned); - - - - + + + + $quickrange = array(0=>'Last 24 Hours',1=>'Last 7 Days',2=>'Last 30 Days'); $quickrange_default = isset($this->params['quickrange']) ? $this->params['quickrange'] : 0; assign_to_template(array('orders'=>$oar,'quickrange'=>$quickrange,'quickrange_default'=>$quickrange_default)); - assign_to_template(array('prev_month'=>$this->prev_month, 'now_date'=>$this->now_date, 'now_hour'=>$this->now_hour, 'now_min'=>$this->now_min, 'now_ampm'=>$this->now_ampm, 'prev_hour'=>$this->prev_hour, 'prev_min'=>$this->prev_min, 'prev_ampm'=>$this->prev_ampm)); + assign_to_template(array('prev_month'=>$this->prev_month, 'now_date'=>$this->now_date, 'now_hour'=>$this->now_hour, 'now_min'=>$this->now_min, 'now_ampm'=>$this->now_ampm, 'prev_hour'=>$this->prev_hour, 'prev_min'=>$this->prev_min, 'prev_ampm'=>$this->prev_ampm)); */ } @@ -1885,7 +1890,7 @@ function batch_export() { /*eDebug(BASE . "tmp/export.csv"); $db->sql($sql); eDebug($db->error());*/ - /*OPTIONALLY ENCLOSED BY '" . '"' . + /*OPTIONALLY ENCLOSED BY '" . '"' . "' ESCAPED BY '\\' LINES TERMINATED BY '" . '\\n' . "' */ @@ -2016,7 +2021,7 @@ function status_export() { /*eDebug(BASE . "tmp/export.csv"); $db->sql($sql); eDebug($db->error());*/ - /*OPTIONALLY ENCLOSED BY '" . '"' . + /*OPTIONALLY ENCLOSED BY '" . '"' . "' ESCAPED BY '\\' LINES TERMINATED BY '" . '\\n' . "' */ diff --git a/framework/modules/search/controllers/searchController.php b/framework/modules/search/controllers/searchController.php index 79c6a222ed..582a0f3858 100755 --- a/framework/modules/search/controllers/searchController.php +++ b/framework/modules/search/controllers/searchController.php @@ -26,10 +26,11 @@ class searchController extends expController { 'show'=>'Show Search Form', 'cloud'=>'Show Tag Cloud' ); - protected $add_permissions = array( - 'spider'=>'Spider Site' + protected $manage_permissions = array( + 'spider'=>'Spider Site', + 'searchQueryReport'=>'Search Query Report', + 'topSearchReport'=>'Top Search Report', ); - public $remove_configs = array( 'aggregation', 'categories', @@ -109,7 +110,7 @@ public function search() 'params'=>$this->params, )); } - + public static function spider() { global $db; @@ -136,18 +137,18 @@ public static function spider() { $mods[$controller->searchName()] = $controller->addContentToSearch(); } } - + uksort($mods,'strnatcasecmp'); assign_to_template(array( 'mods'=>$mods )); } - + public function show() { //no need to do anything..we're just showing the form... so far! MUAHAHAHAHAHAAA! what? // redirect_to(array("controller"=>'search',"action"=>'showall')); } - + public function showall() { // redirect_to(array("controller"=>'search',"action"=>'show')); // $this->show(); @@ -220,26 +221,26 @@ public function autocomplete() { }*/ // $sql .= ' AND parent_id=0'; //eDebug($sql); - + //$res = $mod->find('all',$sql,'id',25); $sql = "select DISTINCT(p.id), p.title, model, sef_url, f.id as fileid from ".$db->prefix."product as p INNER JOIN ".$db->prefix."content_expfiles as cef ON p.id=cef.content_id INNER JOIN ".$db->prefix."expfiles as f ON cef.expfiles_id = f.id where match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') AND p.parent_id=0 order by match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') desc LIMIT 25"; //$res = $db->selectObjectsBySql($sql); //$res = $db->selectObjectBySql('SELECT * FROM `exponent_product`'); - + $ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res); $ar->send(); } - + public function searchQueryReport() { global $db; - + //Instantiate the search model $search = new search(); - + //Store the keywords that returns nothing $badSearch = array(); $badSearchArr = array(); - + //User Records Initialization $all_user = -1; $anonymous = -2; @@ -247,33 +248,33 @@ public function searchQueryReport() { $user_default = ''; $where = ''; - + if(isset($this->params['user_id']) && $this->params['user_id'] != -1) { $user_default = $this->params['user_id']; } - + expHistory::set('manageable', $this->params); $ctr = 2; $ctr2 = 0; - + //Getting the search users $records = $db->selectObjects('search_queries'); - - + + foreach($records as $item) { $u = user::getUserById($item->user_id); if($item->user_id == 0) { $item->user_id = $anonymous; } - + if(!in_array($item->user_id, $uname['id'])) { $uname['name'][$ctr] = $u->firstname . ' ' . $u->lastname; $uname['id'][$ctr] = $item->user_id; $ctr++; } - + $result = $search->getSearchResults($item->query, false, true); if(empty($result) && !in_array($item->query, $badSearchArr)) { $badSearchArr[] = $item->query; @@ -281,9 +282,9 @@ public function searchQueryReport() { $badSearch[$ctr2]['count'] = $db->countObjects("search_queries", "query='{$item->query}'"); $ctr2++; } - + } - + //Check if the user choose from the dropdown if(!empty($user_default)) { if($user_default == $anonymous) { @@ -293,7 +294,7 @@ public function searchQueryReport() { } $where .= "user_id = {$u_id}"; } - + //Get all the search query records $records = $db->selectObjects('search_queries', $where); for ($i = 0, $iMax = count($records); $i < $iMax; $i++) { @@ -302,7 +303,7 @@ public function searchQueryReport() { $records[$i]->user = $u->firstname . ' ' . $u->lastname; } } - + $page = new expPaginator(array( 'records' => $records, 'where'=>1, @@ -328,19 +329,19 @@ public function searchQueryReport() { 'user_default' => $user_default, 'badSearch' => $badSearch )); - + } - + public function topSearchReport() { global $db; $limit = intval(TOP_SEARCH); - + if(empty($limit)) { $limit = 10; } $count = $db->countObjects('search_queries'); - + $records = $db->selectObjectsBySql("SELECT COUNT(query) cnt, query FROM " .$db->prefix . "search_queries GROUP BY query ORDER BY cnt DESC LIMIT 0, {$limit}"); $records_key_arr = array(); @@ -351,7 +352,7 @@ public function topSearchReport() { } $records_key = implode(",", $records_key_arr); $records_values = implode(",", $records_values_arr); - + assign_to_template(array( 'records'=>$records, 'total'=>$count, diff --git a/framework/modules/simplepoll/controllers/simplePollController.php b/framework/modules/simplepoll/controllers/simplePollController.php index a324b9ff99..40c4008f90 100644 --- a/framework/modules/simplepoll/controllers/simplePollController.php +++ b/framework/modules/simplepoll/controllers/simplePollController.php @@ -143,7 +143,7 @@ public function vote() { global $user; if (isset($this->params['choice'])) { - $answer = new simplepoll_answer($this->params['choice']); + $answer = new simplepoll_answer(intval($this->params['choice'])); if (empty($this->config)) { $this->config['anonymous_timeout'] = 5*3600; $this->config['thank_you_message'] = 'Thank you for voting.'; diff --git a/framework/modules/users/controllers/loginController.php b/framework/modules/users/controllers/loginController.php index 43f7771d8e..55e015e114 100644 --- a/framework/modules/users/controllers/loginController.php +++ b/framework/modules/users/controllers/loginController.php @@ -125,7 +125,7 @@ public static function logout() { * main login method */ public static function login() { - user::login(expString::sanitize($_POST['username']),expString::sanitize($_POST['password'])); + user::login(expString::escape(expString::sanitize($_POST['username'])),expString::escape(expString::sanitize($_POST['password']))); if (!isset($_SESSION[SYS_SESSION_KEY]['user'])) { // didn't successfully log in flash('error', gt('Invalid Username / Password')); if (expSession::is_set('redirecturl_error')) { diff --git a/framework/modules/users/controllers/usersController.php b/framework/modules/users/controllers/usersController.php index 75e72cf5ea..207c24959d 100755 --- a/framework/modules/users/controllers/usersController.php +++ b/framework/modules/users/controllers/usersController.php @@ -24,7 +24,11 @@ class usersController extends expController { public $basemodel_name = 'user'; - protected $add_permissions = array( +// protected $remove_permissions = array( +// 'create', +// 'edit' +// ); + protected $manage_permissions = array( 'toggle_extension' => 'Activate Extensions', 'kill_session' => 'End Sessions', 'boot_user' => 'Boot Users', @@ -32,10 +36,7 @@ class usersController extends expController { 'groupperms' => 'Group Permissions', 'import' => 'Import Users', 'export' => 'Export Users', - ); - protected $remove_permissions = array( - 'create', - 'edit' + 'update' => 'Update Users', ); static function displayname() { @@ -171,7 +172,7 @@ public function update() { expHistory::back(); } - // if this is a new user account we need to check the password. + // if this is a new user account we need to check the password. // the password fields wont come thru on an edit. Otherwise we will // just update the existing account. if (!empty($id)) { @@ -233,7 +234,7 @@ public function update() { if ($u->id == $user->id) expSession::triggerRefresh(); } - // if this is a new account then we will check to see if we need to send + // if this is a new account then we will check to see if we need to send // a welcome message or admin notification of new accounts. if (empty($id)) { // Calculate Group Memberships for newly created users. Any groups that @@ -491,6 +492,7 @@ public function send_new_password() { global $db; // find the user + $this->params['username'] = expString::escape($this->params['username']); $u = user::getUserByName($this->params['username']); if (empty($u)) { $u = user::getUserByEmail($this->params['username']); @@ -539,7 +541,7 @@ public function confirm_password_reset() { global $db; $db->delete('passreset_token', 'expires < ' . time()); - $tok = $db->selectObject('passreset_token', 'uid=' . $this->params['uid'] . " AND token='" . preg_replace('/[^A-Za-z0-9]/', '', $this->params['token']) . "'"); + $tok = $db->selectObject('passreset_token', 'uid=' . intval($this->params['uid']) . " AND token='" . preg_replace('/[^A-Za-z0-9]/', '', expString::escape($this->params['token'])) . "'"); if ($tok == null) { flash('error', gt('Your password reset request has expired. Please try again.')); expHistory::back(); @@ -617,7 +619,7 @@ public function save_change_password() { expHistory::returnTo('editable'); } //eDebug($user); - $u = new user($this->params['uid']); + $u = new user(intval($this->params['uid'])); $ret = $u->setPassword($this->params['new_password1'], $this->params['new_password2']); //eDebug($u, true); @@ -654,6 +656,13 @@ public function edit_userpassword() { } public function update_userpassword() { + global $user; + + if (!$user->isAdmin() && $this->params['id'] != $user->id) { + flash('error', gt('You do not have permissions to change this users password.')); + expHistory::back(); + } + if (empty($this->params['id'])) { expValidator::failAndReturnToForm(gt('You must specify the user whose password you want to change'), $this->params); } @@ -1497,6 +1506,10 @@ public function import_users_display() { } public function import_users_add() { + if (!empty($this->params['filename']) && (strpos($this->params['filename'], 'tmp/') === false || strpos($this->params['folder'], '..') !== false)) { + header('Location: ' . URL_FULL); + exit(); // attempt to hack the site + } $line_end = ini_get('auto_detect_line_endings'); ini_set('auto_detect_line_endings',TRUE); $file = fopen(BASE . $this->params["filename"], "r");
1
279e87c3b65ffdff6555e9d819ec0cace9db14c3
https://github.com/mholt/archiver/commit/279e87c3b65ffdff6555e9d819ec0cace9db14c3
use proper mode and type flags
diff --git a/testdata/create-evil-tar.go b/testdata/create-evil-tar.go index 142329a..46c01ee 100644 --- a/testdata/create-evil-tar.go +++ b/testdata/create-evil-tar.go @@ -2,34 +2,35 @@ package main import ( "archive/tar" + "fmt" "log" "os" "time" ) func main() { - // Create a buffer to write our archive to. - fw, err := os.Create("double-evil.tar") + // Create a file to write our archive to. + tarname := "double-evil.tar" + fw, err := os.Create(tarname) if nil != err { log.Fatal(err) return } // Create a new tar archive. - w := tar.NewWriter(fw) + tw := tar.NewWriter(fw) // Write the evil symlink, it points outside of the target directory - h := &tar.Header{ + hdr := &tar.Header{ Name: "bad/file.txt", - Typeflag: 2, + Mode: 0644, + Typeflag: tar.TypeSymlink, Linkname: "../../badfile.txt", ModTime: time.Now(), } - - err = w.WriteHeader(h) - - if err != nil { + if err := tw.WriteHeader(hdr); err != nil { log.Fatal(err) + return } // Write safe files to the archive. @@ -41,28 +42,30 @@ func main() { {"bad/file.txt", "Mwa-ha-ha"}, } for _, file := range files { - h := &tar.Header{ - Name: file.Name, - Typeflag: 0, - Size: int64(len(file.Body)), - ModTime: time.Now(), + hdr := &tar.Header{ + Name: file.Name, + Mode: 0644, + Size: int64(len(file.Body)), + ModTime: time.Now(), } - err := w.WriteHeader(h) - if err != nil { + + if err := tw.WriteHeader(hdr); err != nil { log.Fatal(err) + return } - _, err = w.Write([]byte(file.Body)) - if err != nil { + if _, err := tw.Write([]byte(file.Body)); err != nil { log.Fatal(err) } } // Close the in-memory archive so that it writes trailing data - err = w.Close() + err = tw.Close() if err != nil { log.Fatal(err) } + fmt.Printf("Wrote %s\n", tarname) + // close the on-disk archive so that it flushes all bytes if err = fw.Close(); err != nil { log.Fatal(err)
0
51811a369f73c6feffada50617816a84a81086ed
https://github.com/FreeRDP/FreeRDP/commit/51811a369f73c6feffada50617816a84a81086ed
Fixed missing stream length checks.
diff --git a/channels/rdpgfx/rdpgfx_common.c b/channels/rdpgfx/rdpgfx_common.c index e0a50a60685..79bbc9e787d 100644 --- a/channels/rdpgfx/rdpgfx_common.c +++ b/channels/rdpgfx/rdpgfx_common.c @@ -129,6 +129,8 @@ UINT rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) */ UINT rdpgfx_write_header(wStream* s, const RDPGFX_HEADER* header) { + if (!Stream_EnsureRemainingCapacity(s, 8)) + return ERROR_INTERNAL_ERROR; Stream_Write_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ Stream_Write_UINT16(s, header->flags); /* flags (2 bytes) */ Stream_Write_UINT32(s, header->pduLength); /* pduLength (4 bytes) */ diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index 1a532bf02a9..306cc1c4484 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -72,13 +72,17 @@ static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, UINT16 cmdId, UI * @param s stream * @param start saved start pos of the packet in the stream */ -static INLINE void rdpgfx_server_packet_complete_header(wStream* s, size_t start) +static INLINE BOOL rdpgfx_server_packet_complete_header(wStream* s, size_t start) { - size_t current = Stream_GetPosition(s); + const size_t current = Stream_GetPosition(s); + const size_t cap = Stream_Capacity(s); + if (cap < start + RDPGFX_HEADER_SIZE) + return FALSE; /* Fill actual length */ Stream_SetPosition(s, start + RDPGFX_HEADER_SIZE - sizeof(UINT32)); Stream_Write_UINT32(s, current - start); /* pduLength (4 bytes) */ Stream_SetPosition(s, current); + return TRUE; } /** @@ -360,15 +364,21 @@ static UINT rdpgfx_send_delete_surface_pdu(RdpgfxServerContext* context, return rdpgfx_server_single_packet_send(context, s); } -static INLINE void rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_FRAME_PDU* pdu) +static INLINE BOOL rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_FRAME_PDU* pdu) { + if (!Stream_EnsureRemainingCapacity(s, 8)) + return FALSE; Stream_Write_UINT32(s, pdu->timestamp); /* timestamp (4 bytes) */ Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ + return TRUE; } -static INLINE void rdpgfx_write_end_frame_pdu(wStream* s, const RDPGFX_END_FRAME_PDU* pdu) +static INLINE BOOL rdpgfx_write_end_frame_pdu(wStream* s, const RDPGFX_END_FRAME_PDU* pdu) { + if (!Stream_EnsureRemainingCapacity(s, 4)) + return FALSE; Stream_Write_UINT32(s, pdu->frameId); /* frameId (4 bytes) */ + return TRUE; } /** @@ -586,6 +596,8 @@ static UINT rdpgfx_write_surface_command(wStream* s, const RDPGFX_SURFACE_COMMAN if (cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE || cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE_V2) { + if (!Stream_EnsureRemainingCapacity(s, 13 + cmd->length)) + return ERROR_INTERNAL_ERROR; /* Write RDPGFX_CMDID_WIRETOSURFACE_2 format for CAPROGRESSIVE */ Stream_Write_UINT16(s, cmd->surfaceId); /* surfaceId (2 bytes) */ Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ @@ -597,6 +609,8 @@ static UINT rdpgfx_write_surface_command(wStream* s, const RDPGFX_SURFACE_COMMAN else { /* Write RDPGFX_CMDID_WIRETOSURFACE_1 format for others */ + if (!Stream_EnsureRemainingCapacity(s, 17)) + return ERROR_INTERNAL_ERROR; Stream_Write_UINT16(s, cmd->surfaceId); /* surfaceId (2 bytes) */ Stream_Write_UINT16(s, cmd->codecId); /* codecId (2 bytes) */ Stream_Write_UINT8(s, pixelFormat); /* pixelFormat (1 byte) */ @@ -623,6 +637,8 @@ static UINT rdpgfx_write_surface_command(wStream* s, const RDPGFX_SURFACE_COMMAN { havc444 = (RDPGFX_AVC444_BITMAP_STREAM*)cmd->extra; havc420 = &(havc444->bitstream[0]); /* avc420EncodedBitstreamInfo (4 bytes) */ + if (!Stream_EnsureRemainingCapacity(s, 4)) + return ERROR_INTERNAL_ERROR; Stream_Write_UINT32(s, havc444->cbAvc420EncodedBitstream1 | (havc444->LC << 30UL)); /* avc420EncodedBitstream1 */ error = rdpgfx_write_h264_avc420(s, havc420); @@ -648,14 +664,19 @@ static UINT rdpgfx_write_surface_command(wStream* s, const RDPGFX_SURFACE_COMMAN } else { + if (!Stream_EnsureRemainingCapacity(s, cmd->length)) + return ERROR_INTERNAL_ERROR; Stream_Write(s, cmd->data, cmd->length); } /* Fill actual bitmap data length */ bitmapDataLength = Stream_GetPosition(s) - bitmapDataStart; Stream_SetPosition(s, bitmapDataStart - sizeof(UINT32)); + if (!Stream_EnsureRemainingCapacity(s, 4)) + return ERROR_INTERNAL_ERROR; Stream_Write_UINT32(s, bitmapDataLength); /* bitmapDataLength (4 bytes) */ - Stream_Seek(s, bitmapDataLength); + if (!Stream_SafeSeek(s, bitmapDataLength)) + return ERROR_INTERNAL_ERROR; } return error; @@ -745,8 +766,9 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, goto error; } - rdpgfx_write_start_frame_pdu(s, startFrame); - rdpgfx_server_packet_complete_header(s, position); + if (!rdpgfx_write_start_frame_pdu(s, startFrame) || + !rdpgfx_server_packet_complete_header(s, position)) + goto error; } /* Write RDPGFX_CMDID_WIRETOSURFACE_1 or RDPGFX_CMDID_WIRETOSURFACE_2 */ @@ -768,7 +790,8 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, goto error; } - rdpgfx_server_packet_complete_header(s, position); + if (!rdpgfx_server_packet_complete_header(s, position)) + goto error; /* Write end frame if exists */ if (endFrame) @@ -782,8 +805,9 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, goto error; } - rdpgfx_write_end_frame_pdu(s, endFrame); - rdpgfx_server_packet_complete_header(s, position); + if (!rdpgfx_write_end_frame_pdu(s, endFrame) || + !rdpgfx_server_packet_complete_header(s, position)) + goto error; } return rdpgfx_server_packet_send(context, s);
0
46abe7c8921ea59270277604f3740a189691643b
https://github.com/libra/libra/commit/46abe7c8921ea59270277604f3740a189691643b
Bump pin-project from 1.0.4 to 1.0.5 Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/taiki-e/pin-project/releases) - [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md) - [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.4...v1.0.5) Signed-off-by: dependabot[bot] <[email protected]> Closes: #7481
diff --git a/Cargo.lock b/Cargo.lock index e228f3bff74c..f4b838dc0ee1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -291,7 +291,7 @@ dependencies = [ "itertools 0.10.0", "num_cpus", "once_cell", - "pin-project 1.0.4", + "pin-project 1.0.5", "proptest", "rand 0.7.3", "regex", @@ -2060,7 +2060,7 @@ dependencies = [ "diem-metrics", "diem-workspace-hack", "futures 0.3.12", - "pin-project 1.0.4", + "pin-project 1.0.5", "tokio", "tokio-util", ] @@ -2191,7 +2191,7 @@ dependencies = [ "diem-workspace-hack", "enum_dispatch", "futures 0.3.12", - "pin-project 1.0.4", + "pin-project 1.0.5", "thiserror", "tokio", "tokio-test", @@ -3461,7 +3461,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.4", + "pin-project 1.0.5", "socket2", "tokio", "tower-service", @@ -4437,7 +4437,7 @@ dependencies = [ "diem-workspace-hack", "futures 0.3.12", "memsocket", - "pin-project 1.0.4", + "pin-project 1.0.5", "proxy", "serde", "tokio", @@ -4475,7 +4475,7 @@ dependencies = [ "network-builder", "num-variants", "once_cell", - "pin-project 1.0.4", + "pin-project 1.0.5", "proptest", "proptest-derive", "rand 0.7.3", @@ -4965,11 +4965,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" +checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" dependencies = [ - "pin-project-internal 1.0.4", + "pin-project-internal 1.0.5", ] [[package]] @@ -4985,9 +4985,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" +checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.8", @@ -7211,7 +7211,7 @@ checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" dependencies = [ "futures-util", "log", - "pin-project 1.0.4", + "pin-project 1.0.5", "tokio", "tungstenite", ] @@ -7635,7 +7635,7 @@ dependencies = [ "mime_guess", "multipart", "percent-encoding", - "pin-project 1.0.4", + "pin-project 1.0.5", "scoped-tls", "serde", "serde_json", diff --git a/common/rate-limiter/Cargo.toml b/common/rate-limiter/Cargo.toml index 2c80e5eec5fe..986e56209b98 100644 --- a/common/rate-limiter/Cargo.toml +++ b/common/rate-limiter/Cargo.toml @@ -15,6 +15,6 @@ diem-workspace-hack = { path = "../workspace-hack", version = "0.1.0" } diem-logger = { path = "../logger", version = "0.1.0" } diem-metrics = { path = "../metrics", version = "0.1.0" } futures = "0.3.12" -pin-project = "1.0.4" +pin-project = "1.0.5" tokio = { version = "1.1.1", features = ["full"] } tokio-util = { version = "0.6.3", features = ["compat"] } diff --git a/common/time-service/Cargo.toml b/common/time-service/Cargo.toml index 262ad07bb880..2f2daf6ded91 100644 --- a/common/time-service/Cargo.toml +++ b/common/time-service/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] enum_dispatch = "0.3.5" futures = { version = "0.3.12", optional = true } -pin-project = { version = "1.0.4", optional = true } +pin-project = { version = "1.0.5", optional = true } thiserror = "1.0.23" tokio = { version = "1.1.1", features = ["macros", "rt-multi-thread", "time"], optional = true } @@ -21,7 +21,7 @@ diem-workspace-hack = { path = "../workspace-hack", version = "0.1.0" } [dev-dependencies] futures = "0.3.12" -pin-project = "1.0.4" +pin-project = "1.0.5" tokio = { version = "1.1.1", features = ["macros", "rt-multi-thread", "time"] } tokio-test = "0.4.0" diff --git a/network/Cargo.toml b/network/Cargo.toml index 6eb7a16c9168..e1fa74973e0d 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -16,7 +16,7 @@ futures = "0.3.12" futures-util = "0.3.12" hex = "0.4.2" once_cell = "1.4.1" -pin-project = "1.0.4" +pin-project = "1.0.5" proptest = { version = "0.10.1", default-features = true, optional = true } proptest-derive = { version = "0.2.0", optional = true } rand = { version = "0.7.3", features = ["small_rng"] } diff --git a/network/netcore/Cargo.toml b/network/netcore/Cargo.toml index 79d5c17210fd..2962e13319ae 100644 --- a/network/netcore/Cargo.toml +++ b/network/netcore/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] bytes = "1.0.1" futures = "0.3.12" -pin-project = "1.0.4" +pin-project = "1.0.5" serde = { version = "1.0.123", default-features = false } tokio = { version = "1.1.1", features = ["full"] } tokio-util = { version = "0.6.3", features = ["compat"] } diff --git a/storage/backup/backup-cli/Cargo.toml b/storage/backup/backup-cli/Cargo.toml index 3a0cfb92c8ec..05dc9cde260d 100644 --- a/storage/backup/backup-cli/Cargo.toml +++ b/storage/backup/backup-cli/Cargo.toml @@ -18,7 +18,7 @@ hex = "0.4.2" itertools = "0.10.0" num_cpus = "1.13.0" once_cell = "1.4.1" -pin-project = "1.0.4" +pin-project = "1.0.5" rand = "0.7.3" regex = "1.4.3" reqwest = { version = "0.11.0", features = ["stream"], default-features = false }
0
62926cae31a02d4f23d21148435804b96c543cc
https://github.com/apache/tika/commit/62926cae31a02d4f23d21148435804b96c543cc
fix logic in iptc parser
diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/iptc/IptcAnpaParser.java b/tika-parsers/src/main/java/org/apache/tika/parser/iptc/IptcAnpaParser.java index ec436e069e..c9b628fbfe 100644 --- a/tika-parsers/src/main/java/org/apache/tika/parser/iptc/IptcAnpaParser.java +++ b/tika-parsers/src/main/java/org/apache/tika/parser/iptc/IptcAnpaParser.java @@ -463,7 +463,7 @@ private boolean parseBody(byte[] value, HashMap<String,String> properties) { while ((val_next != LT) && (val_next != CR) && (val_next != LF)) { // less than delimiter (\x3c) and not EOL bdy_heading += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read++] : 0x00; - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } if (val_next == LT) { // hit the delimiter, carry on @@ -508,7 +508,7 @@ private boolean parseBody(byte[] value, HashMap<String,String> properties) { while ((val_next != LT) && (val_next != CT) && (val_next != CR) && (val_next != LF)) { // less than delimiter (\x3c), or carat (\x5e) and not EOL bdy_title += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read++] : 0x00; - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } if (val_next == CT) { // start of a new section , when first didn't finish cleanly @@ -575,7 +575,7 @@ private boolean parseBody(byte[] value, HashMap<String,String> properties) { // less than delimiter (\x3c), maybe also badly formed with just new line tmp_line += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read++] : 0x00; - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } if (val_next == CT) { // start of a new section , when first didn't finish cleanly @@ -674,7 +674,7 @@ else if (tmp_line.toLowerCase(Locale.ROOT).startsWith("eds") || longline.equals( // read until the train runs out of tracks bdy_body += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read++] : 0x00; - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } } @@ -713,14 +713,14 @@ private boolean parseFooter(byte[] value, HashMap<String,String> properties) { ftr_source += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read] : 0x00; // attempt to read until end of stream read++; - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } while ((val_next != LT) && (val_next != CR) && (val_next != LF) && (val_next != 0)) { // get as much timedate as possible // this is an american format, so arrives as mm-dd-yy HHiizzz ftr_datetime += (char)(val_next & 0xff); // convert the byte to an unsigned int val_next = (read < value.length) ? value[read++] : 0x00; // skip the new lines - if (read > value.length) { break; } // shouldn't ever hit this, but save a NPE + if (read >= value.length) { break; } // shouldn't ever hit this, but save a NPE } if (val_next == LT) { // hit the delimiter, carry on
1
547efecd82dc0a625a6bf4fc7dea8495d669e631
https://github.com/minio/minio/commit/547efecd82dc0a625a6bf4fc7dea8495d669e631
Reverting TOC due to gluegun incompatibility. Revert this commit once we migrate to new docs site (#11402)
diff --git a/README.md b/README.md index 41d7d77db7bc..f731e29b63b5 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,6 @@ MinIO is a High Performance Object Storage released under Apache License v2.0. I This README provides quickstart instructions on running MinIO on baremetal hardware, including Docker-based installations. For Kubernetes environments, use the [MinIO Kubernetes Operator](https://github.com/minio/operator/blob/master/README.md). -**Table of Contents** - -- [Docker Installation](#docker-installation) -- [macOS Installation](#macos) -- [GNU/Linux Installation](#gnulinux) -- [Windows Installation](#microsoft-windows) -- [FreeBSD Installation](#freebsd) -- [Source Installation](#install-from-source) -- [Deployment Recommendations](#deployment-recommendations) -- [Test Connectivity to MinIO](#test-minio-connectivity) -- [Upgrade MinIO](#upgrading-minio) -- [Explore Further](#explore-further) -- [Contribute to MinIO](#contribute-to-minio-project) -- [License](#license) - # Docker Installation Use the following commands to run a standalone MinIO server on a Docker container.
0
dc631aa511c80e6dad3f4fee5c4cb66d65334c2f
https://github.com/GNOME/evince/commit/dc631aa511c80e6dad3f4fee5c4cb66d65334c2f
Windows: fix compilation, CLOEXEC does not exist
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c index b0abb3a70..78c0374e1 100644 --- a/libdocument/ev-file-helpers.c +++ b/libdocument/ev-file-helpers.c @@ -39,6 +39,11 @@ static gchar *tmp_dir = NULL; #define O_BINARY 0 #endif +/* On Windows, O_CLOEXEC does not exist */ +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* * ev_dir_ensure_exists: * @dir: the directory name @@ -513,6 +518,10 @@ static const char *compressor_cmds[] = { static void compression_child_setup_cb (gpointer fd_ptr) { +#ifdef _WIN32 + /* On Windows, processes are not inherited by default */ + (void)fd_ptr; +#else int fd = GPOINTER_TO_INT (fd_ptr); int flags; @@ -521,6 +530,7 @@ compression_child_setup_cb (gpointer fd_ptr) flags &= ~FD_CLOEXEC; fcntl (fd, F_SETFD, flags); } +#endif } static gchar *
0
61f0d6b91972a4b8759dc0fef3782cec90f46956
https://github.com/ansible/ansible/commit/61f0d6b91972a4b8759dc0fef3782cec90f46956
add note regarding datetime docs (#72976) Adds a note pointing to the datetime documentation as to_datetime does not use the time library but instead uses datetime. Co-authored-by: Alicia Cozine <[email protected]>
diff --git a/docs/docsite/rst/user_guide/playbooks_filters.rst b/docs/docsite/rst/user_guide/playbooks_filters.rst index 66c3fa8ba7399c..457df1de995fb2 100644 --- a/docs/docsite/rst/user_guide/playbooks_filters.rst +++ b/docs/docsite/rst/user_guide/playbooks_filters.rst @@ -1660,6 +1660,8 @@ To get a date object from a string use the `to_datetime` filter:: # get amount of days between two dates. This returns only number of days and discards remaining hours, minutes, and seconds {{ (("2016-08-14 20:00:12" | to_datetime) - ("2015-12-25" | to_datetime('%Y-%m-%d'))).days }} + +.. note:: For a full list of format codes for working with python date format strings, see https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior. .. versionadded:: 2.4
0
146f5926c8d670d0607ec48bd26bc34a7437434e
https://github.com/ratpack/ratpack/commit/146f5926c8d670d0607ec48bd26bc34a7437434e
Add 1.8.2 manual to site.
diff --git a/ratpack-site/ratpack-site.gradle b/ratpack-site/ratpack-site.gradle index 0ef943b49a..2ece4a9428 100644 --- a/ratpack-site/ratpack-site.gradle +++ b/ratpack-site/ratpack-site.gradle @@ -75,7 +75,7 @@ ext { "1.5.0-rc-1", "1.5.0-rc-2", "1.5.0-rc-3", "1.5.0", "1.5.1", "1.5.2", "1.5.3", "1.5.4", "1.6.0-rc-1", "1.6.0-rc-2", "1.6.0-rc-3", "1.6.0-rc-4", "1.6.0", "1.6.1", "1.7.0", "1.7.1", "1.7.2", "1.7.3", "1.7.4", "1.7.5", "1.7.6", - "1.8.0", "1.8.1" + "1.8.0", "1.8.1", "1.8.2" ] if (!isHeroku && !isCi) {
0
86e0d1f67824043e2fa07939e5ab5fbcfc3cb05e
https://github.com/infinispan/infinispan/commit/86e0d1f67824043e2fa07939e5ab5fbcfc3cb05e
ISPN-12596 Incorrect Hotrod Multimap get KeyDoesNotExist response When the server sends a KeyDoesNotExist response, it also includes an empty collection of values.
diff --git a/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/multimap/RemoteMultimapCacheAPITest.java b/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/multimap/RemoteMultimapCacheAPITest.java index dbd784bf1380..19d24ad51cd7 100644 --- a/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/multimap/RemoteMultimapCacheAPITest.java +++ b/client/hotrod-client/src/test/java/org/infinispan/client/hotrod/multimap/RemoteMultimapCacheAPITest.java @@ -28,7 +28,8 @@ @Override protected RemoteCacheManager getRemoteCacheManager() { ConfigurationBuilder builder = HotRodClientTestingUtil.newRemoteConfigurationBuilder(); - builder.forceReturnValues(isForceReturnValuesViaConfiguration()); + // Do not retry when the server response cannot be parsed, see ISPN-12596 + builder.forceReturnValues(isForceReturnValuesViaConfiguration()).maxRetries(0); builder.addServer().host("127.0.0.1").port(hotrodServer.getPort()); return new InternalRemoteCacheManager(builder.build()); } diff --git a/server/hotrod/src/main/java/org/infinispan/server/hotrod/MultimapRequestProcessor.java b/server/hotrod/src/main/java/org/infinispan/server/hotrod/MultimapRequestProcessor.java index 16d0b0e29b20..dca4188f6c8b 100644 --- a/server/hotrod/src/main/java/org/infinispan/server/hotrod/MultimapRequestProcessor.java +++ b/server/hotrod/src/main/java/org/infinispan/server/hotrod/MultimapRequestProcessor.java @@ -34,7 +34,8 @@ private void handleGet(HotRodHeader header, Collection<byte[]> result, Throwable } else try { OperationStatus status = OperationStatus.Success; if (result.isEmpty()) { - status = OperationStatus.KeyDoesNotExist; + writeNotExist(header); + return; } writeResponse(header, header.encoder().multimapCollectionResponse(header, server, channel, status, result)); } catch (Throwable t2) {
0
8f75bcc0046f01da9270ee6a469a5f675ad6225c
https://github.com/dompdf/dompdf/commit/8f75bcc0046f01da9270ee6a469a5f675ad6225c
Merge pull request #2336 from dompdf/develop Preparation for the 1.0.1 release
diff --git a/src/Css/Style.php b/src/Css/Style.php index ce36a58d1..250a25efd 100644 --- a/src/Css/Style.php +++ b/src/Css/Style.php @@ -794,7 +794,8 @@ function merge(Style $style) unset($this->_prop_cache[$shorthand]); } } - if (isset($style->_props_computed[$prop])) { + //FIXME: temporary hack around lack of persistence of base href for URLs + if (($prop === "background_image" || $prop === "list_style_image") && isset($style->_props_computed[$prop])) { $this->__set($prop, $style->_props_computed[$prop]); } else { // computed value not set, recompute use the specified value @@ -2498,30 +2499,29 @@ function set_padding($val) protected function _set_border($side, $border_spec, $important) { $border_spec = preg_replace("/\s*\,\s*/", ",", $border_spec); - //$border_spec = str_replace(",", " ", $border_spec); // Why did we have this ?? rbg(10, 102, 10) > rgb(10 102 10) $arr = explode(" ", $border_spec); - // FIXME: handle partial values - //For consistency of individual and combined properties, and with ie8 and firefox3 - //reset all attributes, even if only partially given - //$this->_set_style_side_type('border', $side, 'style', self::$_defaults['border_' . $side . '_style'], $important); - //$this->_set_style_side_type('border', $side, 'width', self::$_defaults['border_' . $side . '_width'], $important); - //$this->_set_style_side_type('border', $side, 'color', self::$_defaults['border_' . $side . '_color'], $important); - foreach ($arr as $value) { $value = trim($value); - if (in_array($value, self::$BORDER_STYLES)) { - $this->_set_style_side_type('border', $side, 'style', $value, $important); + $prop = ""; + if (strtolower($value) === "inherit") { + $this->__set("border_${side}_color", "inherit"); + $this->__set("border_${side}_style", "inherit"); + $this->__set("border_${side}_width", "inherit"); + continue; + } elseif (in_array($value, self::$BORDER_STYLES)) { + $prop = "border_${side}_style"; } elseif ($value === "0" || preg_match("/[.0-9]+(?:px|pt|pc|em|ex|%|in|mm|cm)|(?:thin|medium|thick)/", $value)) { - $this->_set_style_side_type('border', $side, 'width', $value, $important); - } elseif ($value === "inherit") { - $this->_set_style_side_type('border', $side, 'style', $value, $important); - $this->_set_style_side_type('border', $side, 'width', $value, $important); - $this->_set_style_side_type('border', $side, 'color', $value, $important); + $prop = "border_${side}_width"; } else { // must be color - $this->_set_style_side_type('border', $side, 'color', $this->munge_color($value), $important); + $prop = "border_${side}_color"; + } + + if ($important) { + $this->_important_props[$prop] = true; } + $this->__set($prop, $value); } } diff --git a/src/Css/Stylesheet.php b/src/Css/Stylesheet.php index 67b4406a9..b25309cfb 100644 --- a/src/Css/Stylesheet.php +++ b/src/Css/Stylesheet.php @@ -1440,7 +1440,7 @@ protected function _image($val) // Resolve the url now in the context of the current stylesheet $parsed_url = Helpers::explode_url($val); - $path = Helpers::build_url($this->_stylesheet->get_protocol(), + $path = Helpers::build_url($this->_protocol, $this->_base_host, $this->_base_path, $val);
0
4b0ac3f15da028906ccc8899dac3b857dcf5c67b
https://github.com/apache/syncope/commit/4b0ac3f15da028906ccc8899dac3b857dcf5c67b
Upgrading CXF
diff --git a/pom.xml b/pom.xml index 81e28efce8..c0c832bca6 100644 --- a/pom.xml +++ b/pom.xml @@ -404,7 +404,7 @@ under the License. <connid.scimv11.version>1.0.1</connid.scimv11.version> <connid.servicenow.version>1.0.0</connid.servicenow.version> - <cxf.version>3.4.1</cxf.version> + <cxf.version>3.4.2</cxf.version> <bouncycastle.version>1.68</bouncycastle.version> <jackson.version>2.11.4</jackson.version>
0
ae789c252687dc8a18bfdb677f2e6cd14570e4d
https://github.com/apache/lucene-solr/commit/ae789c252687dc8a18bfdb677f2e6cd14570e4d
SOLR-10031: Validation of filename params in ReplicationHandler
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index f8611379ba16..f1ee0cadb6ab 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -26,6 +26,8 @@ Other Changes * SOLR-9819: Upgrade commons-fileupload to 1.3.2, fixing a potential vulnerability CVE-2016-3092 (Anshum Gupta) +* SOLR-10031: Validation of filename params in ReplicationHandler (Hrishikesh Gadre, janhoy) + ======================= 5.5.3 ======================= Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java index 80188fe029fd..8c1a29d09560 100644 --- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java @@ -28,6 +28,8 @@ import java.nio.channels.FileChannel; import java.nio.charset.StandardCharsets; import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -42,7 +44,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantLock; @@ -1328,8 +1329,9 @@ public DirectoryFileStream(SolrParams solrParams) { params = solrParams; delPolicy = core.getDeletionPolicy(); - fileName = params.get(FILE); - cfileName = params.get(CONF_FILE_SHORT); + fileName = validateFilenameOrError(params.get(FILE)); + cfileName = validateFilenameOrError(params.get(CONF_FILE_SHORT)); + sOffset = params.get(OFFSET); sLen = params.get(LEN); compress = params.get(COMPRESSION); @@ -1343,6 +1345,22 @@ public DirectoryFileStream(SolrParams solrParams) { rateLimiter = new RateLimiter.SimpleRateLimiter(maxWriteMBPerSec); } + // Throw exception on directory traversal attempts + protected String validateFilenameOrError(String filename) { + if (filename != null) { + Path filePath = Paths.get(filename); + for (Path subpath : filePath) { + if ("..".equals(subpath.toString())) { + throw new SolrException(ErrorCode.FORBIDDEN, "File name cannot contain .."); + } + } + if (filePath.isAbsolute()) { + throw new SolrException(ErrorCode.FORBIDDEN, "File name must be relative"); + } + return filename; + } else return null; + } + protected void initWrite() throws IOException { if (sOffset != null) offset = Long.parseLong(sOffset); if (sLen != null) len = Integer.parseInt(sLen); diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java index b997ad4c6329..2a0758204d8e 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Date; +import java.util.List; import java.util.Properties; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -1401,6 +1402,21 @@ public void testRateLimitedReplication() throws Exception { assertTrue(timeTakenInSeconds - approximateTimeInSeconds > 0); } + @Test + public void doTestIllegalFilePaths() throws Exception { + // Loop through the file=, cf=, tlogFile= params and prove that it throws exception for path traversal attempts + List<String> illegalFilenames = Arrays.asList("/foo/bar", "../dir/traversal", "illegal\rfile\nname\t"); + List<String> params = Arrays.asList(ReplicationHandler.FILE, ReplicationHandler.CONF_FILE_SHORT); + for (String param : params) { + for (String filename : illegalFilenames) { + try { + invokeReplicationCommand(masterJetty.getLocalPort(), "filecontent&" + param + "=" + filename); + fail("Should have thrown exception on illegal path for param " + param + " and file name " + filename); + } catch (Exception e) {} + } + } + } + private class AddExtraDocs implements Runnable { SolrClient masterClient;
1
814865ea9e7db4d5e18fcadc1fa3f43a673f8559
https://github.com/WordPress/WordPress/commit/814865ea9e7db4d5e18fcadc1fa3f43a673f8559
Send emails when a user's email address or password is changed. * In case of email change, email goes to the OLD address * Prevents against issues where an account is compromised (say via cookie interception) and then the attacker silently takes over ownership via pw/email changes — now there will at least be a record that something is up fixes #32430 props RMarks, MikeHansenMe, tharsheblows, obenland Built from https://develop.svn.wordpress.org/trunk@32820 git-svn-id: http://core.svn.wordpress.org/trunk@32791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/user.php b/wp-includes/user.php index cb9695cf7bdc..f2529dccc2a2 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2140,17 +2140,159 @@ function wp_update_user($userdata) { // Escape data pulled from DB. $user = add_magic_quotes( $user ); - // If password is changing, hash it now. if ( ! empty($userdata['user_pass']) ) { + // If password is changing, hash it now $plaintext_pass = $userdata['user_pass']; - $userdata['user_pass'] = wp_hash_password($userdata['user_pass']); + $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] ); + /** + * Filter to stop the sending of the password change email. + * + * @since 4.3 + * @see wp_insert_user() For $user and $userdata fields. + * + * @param bool Return false to not send the email. + * @param array $user The original user array. + * @param array $userdata The updated user array. + * + */ + $send_pass_change_email = apply_filters( 'send_pass_change_email', true, $user, $userdata ); + } + + if ( $user['user_email'] !== $userdata['user_email'] ) { + /** + * Filter to stop the sending of the email change email. + * + * @since 4.3 + * @see wp_insert_user() For $user and $userdata fields. + * + * @param bool Return false to not send the email. + * @param array $user The original user array. + * @param array $userdata The updated user array. + * + */ + $send_email_change_email = apply_filters( 'send_email_change_email', true, $user, $userdata ); } - wp_cache_delete($user[ 'user_email' ], 'useremail'); + wp_cache_delete( $user['user_email'], 'useremail' ); // Merge old and new fields with new fields overwriting old ones. - $userdata = array_merge($user, $userdata); - $user_id = wp_insert_user($userdata); + $userdata = array_merge( $user, $userdata ); + $user_id = wp_insert_user( $userdata ); + + if ( ! is_wp_error( $user_id ) ) { + + $blog_name = wp_specialchars_decode( get_option( 'blogname' ) ); + + if ( ! empty( $send_pass_change_email ) ) { + + /* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */ + $pass_change_text = __( 'Hi ###USERNAME###, + +This notice confirms that your password was changed on ###SITENAME###. + +If you did not change your password, please contact the Site Administrator at +###ADMIN_EMAIL### + +This email has been sent to ###EMAIL### + +Regards, +All at ###SITENAME### +###SITEURL###' ); + + $pass_change_email = array( + 'to' => $user['user_email'], + 'subject' => __( '[%s] Notice of Password Change' ), + 'message' => $pass_change_text, + 'headers' => '', + ); + + /** + * Filter the email sent when the user's password is changed. + * + * @since 4.3 + * + * @param array $pass_change_email { + * Used to build wp_mail(). https://developer.wordpress.org/reference/functions/wp_mail/ + * @type string $to The intended recipients. Add emails in a comma separated string. + * @type string $subject The subject of the email. + * @type string $message The content of the email. + * The following strings have a special meaning and will get replaced dynamically: + * ###USERNAME### The current user's username. + * ###ADMIN_EMAIL### The admin email in case this was unexpected. + * ###EMAIL### The old email. + * ###SITENAME### The name of the site. + * ###SITEURL### The URL to the site. + * @type string $headers Headers. Add headers in a newline (\r\n) separated string. + * } + * @param array $user The original user array. + * @param array $userdata The updated user array. + * + */ + $pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata ); + + $pass_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $pass_change_email['message'] ); + $pass_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $pass_change_email['message'] ); + $pass_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $pass_change_email['message'] ); + $pass_change_email['message'] = str_replace( '###SITENAME###', get_option( 'blogname' ), $pass_change_email['message'] ); + $pass_change_email['message'] = str_replace( '###SITEURL###', get_option( 'siteurl' ), $pass_change_email['message'] ); + + wp_mail( $pass_change_email['to'], sprintf( $pass_change_email['subject'], $blog_name ), $pass_change_email['message'], $pass_change_email['headers'] ); + } + + if ( ! empty( $send_email_change_email ) ) { + /* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */ + $email_change_text = __( 'Hi ###USERNAME###, + +This notice confirms that your email was changed on ###SITENAME###. + +If you did not change your email, please contact the Site Administrator at +###ADMIN_EMAIL### + +This email has been sent to ###EMAIL### + +Regards, +All at ###SITENAME### +###SITEURL###' ); + + $email_change_email = array( + 'to' => $user['user_email'], + 'subject' => __( '[%s] Notice of Email Change' ), + 'message' => $email_change_text, + 'headers' => '', + ); + + /** + * Filter the email sent when the user's password is changed. + * + * @since 4.3 + * + * @param array $email_change_email { + * Used to build wp_mail(). https://developer.wordpress.org/reference/functions/wp_mail/ + * @type string $to The intended recipients. + * @type string $subject The subject of the email. + * @type string $message The content of the email. + * The following strings have a special meaning and will get replaced dynamically: + * ###USERNAME### The current user's username. + * ###ADMIN_EMAIL### The admin email in case this was unexpected. + * ###EMAIL### The old email. + * ###SITENAME### The name of the site. + * ###SITEURL### The URL to the site. + * @type string $headers Headers. + * } + * @param array $user The original user array. + * @param array $userdata The updated user array. + */ + $email_change_email = apply_filters( 'email_change_email', $email_change_email, $user, $userdata ); + + $email_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $email_change_email['message'] ); + $email_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $email_change_email['message'] ); + $email_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $email_change_email['message'] ); + $email_change_email['message'] = str_replace( '###SITENAME###', get_option( 'blogname' ), $email_change_email['message'] ); + $email_change_email['message'] = str_replace( '###SITEURL###', get_option( 'siteurl' ), $email_change_email['message'] ); + + wp_mail( $email_change_email['to'], sprintf( $email_change_email['subject'], $blog_name ), $email_change_email['message'], $email_change_email['headers'] ); + } + } // Update the cookies if the password changed. $current_user = wp_get_current_user(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 299412502810..bf844f9e4ecd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32819'; +$wp_version = '4.3-alpha-32820'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
1
9beb934684a7ee533cb36aaeb4691e2afb7379b4
https://github.com/mysql/mysql-server/commit/9beb934684a7ee533cb36aaeb4691e2afb7379b4
Revert "Bug #32162954: REGRESSION: ASSERTION `!THD()->IS_ERROR()' FAILED. IN AGGREGATEITERATOR::READ()" Revert from 8.0 only, not required at this time. Approved by: Steinar Gunderson <[email protected]>
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 1f239d4a9157..a82481a517e3 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -200,6 +200,8 @@ DROP USER nopriv_user@localhost; # # Bug #32162954: REGRESSION: ASSERTION `!THD()->IS_ERROR()' FAILED. IN AGGREGATEITERATOR::READ() # +do count(((bin_to_uuid(connection_id()))xor 1)); +ERROR HY000: Incorrect string value: '9' for function bin_to_uuid do count(rand(st_latfromgeohash(st_geohash(point(5920138304254667057,24370),41)))); ERROR 22003: longitude value is out of range in 'st_geohash' do ((1)between(cot(_hebrew ' $[ d'))and(var_pop((1))over())); diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index ba0115850f05..6227ed92b02b 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -259,6 +259,8 @@ DROP USER nopriv_user@localhost; --echo # Bug #32162954: REGRESSION: ASSERTION `!THD()->IS_ERROR()' FAILED. IN AGGREGATEITERATOR::READ() --echo # +--error ER_WRONG_VALUE_FOR_TYPE +do count(((bin_to_uuid(connection_id()))xor 1)); --error ER_DATA_OUT_OF_RANGE do count(rand(st_latfromgeohash(st_geohash(point(5920138304254667057,24370),41)))); --error ER_DATA_OUT_OF_RANGE
0
995a4283d8ed2d0d2c1ceb1a577b993df2f0e014
https://github.com/strukturag/libheif/commit/995a4283d8ed2d0d2c1ceb1a577b993df2f0e014
Detect non-existing referenced alpha images (fixes #123)
diff --git a/fuzzing/corpus/uaf_heif_context.h_117_1.heic b/fuzzing/corpus/uaf_heif_context.h_117_1.heic new file mode 100644 index 00000000..c8826b45 Binary files /dev/null and b/fuzzing/corpus/uaf_heif_context.h_117_1.heic differ diff --git a/libheif/heif_context.cc b/libheif/heif_context.cc index fac3bd9c..4fe9ba09 100644 --- a/libheif/heif_context.cc +++ b/libheif/heif_context.cc @@ -576,6 +576,11 @@ Error HeifContext::interpret_heif_file() image->set_is_alpha_channel_of(refs[0]); auto master_iter = m_all_images.find(refs[0]); + if (master_iter == m_all_images.end()) { + return Error(heif_error_Invalid_input, + heif_suberror_Nonexisting_item_referenced, + "Non-existing alpha image referenced"); + } if (image.get() == master_iter->second.get()) { return Error(heif_error_Invalid_input, heif_suberror_Nonexisting_item_referenced,
1
17ba10b75961ef667e45b9dedbac34212a7e7e9b
https://github.com/openstack/nova/commit/17ba10b75961ef667e45b9dedbac34212a7e7e9b
functional: Add test for SR-IOV neutron ports Add a simple test to demonstrate the interaction between nova and neutron when creating an instance with a (pre-created) SR-IOV port. Change-Id: I9d0596f31ca342b952c35c742befd75fdc39d95c Signed-off-by: Stephen Finucane <[email protected]>
diff --git a/nova/tests/functional/libvirt/base.py b/nova/tests/functional/libvirt/base.py index 9fe5bdba13e3..f24add011ea3 100644 --- a/nova/tests/functional/libvirt/base.py +++ b/nova/tests/functional/libvirt/base.py @@ -321,12 +321,9 @@ class LibvirtNeutronFixture(nova_fixtures.NeutronFixture): 'subnet_id': subnet_4['id'] } ], - 'binding:vif_details': {'vlan': 42}, 'binding:vif_type': 'hw_veb', + 'binding:vif_details': {'vlan': 42}, 'binding:vnic_type': 'direct', - 'binding:profile': {'pci_vendor_info': '1377:0047', - 'pci_slot': '0000:81:00.1', - 'physical_network': 'physnet4'}, } def __init__(self, test): @@ -357,6 +354,15 @@ def create_port(self, body=None): # network_2_port_1 below at the update call port = copy.deepcopy(port) port.update(body['port']) + + # the tenant ID is normally extracted from credentials in the request + # and is not present in the body + if 'tenant_id' not in port: + port['tenant_id'] = nova_fixtures.NeutronFixture.tenant_id + + # similarly, these attributes are set by neutron itself + port['admin_state_up'] = True + self._ports[port['id']] = port # this copy is here as nova sometimes modifies the returned port # locally and we want to avoid that nova modifies the fixture internals diff --git a/nova/tests/functional/libvirt/test_pci_sriov_servers.py b/nova/tests/functional/libvirt/test_pci_sriov_servers.py index e661c67266c9..ffab7c8473fd 100644 --- a/nova/tests/functional/libvirt/test_pci_sriov_servers.py +++ b/nova/tests/functional/libvirt/test_pci_sriov_servers.py @@ -74,6 +74,7 @@ class SRIOVServersTest(_PCIServersTestBase): { 'vendor_id': fakelibvirt.PCI_VEND_ID, 'product_id': fakelibvirt.VF_PROD_ID, + 'physical_network': 'physnet4', }, )] # PFs will be removed from pools unless they are specifically @@ -168,12 +169,74 @@ def test_create_server_with_VF_no_PF(self): flavor_id=flavor_id_pfs, networks='none', expected_state='ERROR', ) + def test_create_server_with_neutron(self): + """Create an instance using a neutron-provisioned SR-IOV VIF.""" + + pci_info = fakelibvirt.HostPCIDevicesInfo(num_pfs=1, num_vfs=2) + + orig_create = nova.virt.libvirt.guest.Guest.create + + def fake_create(cls, xml, host): + tree = etree.fromstring(xml) + elem = tree.find('./devices/interface/source/address') + + # compare address + expected = ('0x81', '0x00', '0x2') + actual = ( + elem.get('bus'), elem.get('slot'), elem.get('function'), + ) + self.assertEqual(expected, actual) + + return orig_create(xml, host) + + self.stub_out( + 'nova.virt.libvirt.guest.Guest.create', + fake_create, + ) + + self.start_compute(pci_info=pci_info) + + # create the port + self.neutron.create_port({'port': self.neutron.network_4_port_1}) + + # ensure the binding details are currently unset + port = self.neutron.show_port( + base.LibvirtNeutronFixture.network_4_port_1['id'], + )['port'] + self.assertNotIn('binding:profile', port) + + # create a server using the VF via neutron + flavor_id = self._create_flavor() + self._create_server( + flavor_id=flavor_id, + networks=[ + {'port': base.LibvirtNeutronFixture.network_4_port_1['id']}, + ], + ) + + # ensure the binding details sent to "neutron" were correct + port = self.neutron.show_port( + base.LibvirtNeutronFixture.network_4_port_1['id'], + )['port'] + self.assertIn('binding:profile', port) + self.assertEqual( + { + 'pci_vendor_info': '8086:1515', + 'pci_slot': '0000:81:00.2', + 'physical_network': 'physnet4', + }, + port['binding:profile'], + ) + def test_get_server_diagnostics_server_with_VF(self): """Ensure server disagnostics include info on VF-type PCI devices.""" pci_info = fakelibvirt.HostPCIDevicesInfo() self.start_compute(pci_info=pci_info) + # create the SR-IOV port + self.neutron.create_port({'port': self.neutron.network_4_port_1}) + # create a server using the VF and multiple networks extra_spec = {'pci_passthrough:alias': f'{self.VFS_ALIAS_NAME}:1'} flavor_id = self._create_flavor(extra_spec=extra_spec) @@ -181,7 +244,7 @@ def test_get_server_diagnostics_server_with_VF(self): flavor_id=flavor_id, networks=[ {'uuid': base.LibvirtNeutronFixture.network_1['id']}, - {'uuid': base.LibvirtNeutronFixture.network_4['id']}, + {'port': base.LibvirtNeutronFixture.network_4_port_1['id']}, ], )
0
2e82fa00466ae525339754bb3ab0a0474a31d4bd
https://github.com/mdadams/jasper/commit/2e82fa00466ae525339754bb3ab0a0474a31d4bd
Fixed an integral type promotion problem by adding a JAS_CAST. Modified the jpc_tsfb_synthesize function so that it will be a noop for an empty sequence (in order to avoid dereferencing a null pointer).
diff --git a/src/libjasper/include/jasper/jas_math.h b/src/libjasper/include/jasper/jas_math.h index 3f1a933f..91efc60b 100644 --- a/src/libjasper/include/jasper/jas_math.h +++ b/src/libjasper/include/jasper/jas_math.h @@ -112,6 +112,24 @@ extern "C" { #define JAS_ONES(n) \ ((1 << (n)) - 1) +/******************************************************************************\ +* +\******************************************************************************/ + +__attribute__((no_sanitize("undefined"))) +inline static jas_int_asr(int x, int n) +{ + assert(n >= 0); + return x >> n; +} + +__attribute__((no_sanitize("undefined"))) +inline static jas_int_asl(int x, int n) +{ + assert(n >= 0); + return x << n; +} + /******************************************************************************\ * Safe integer arithmetic (i.e., with overflow checking). \******************************************************************************/ diff --git a/src/libjasper/include/jasper/jas_seq.h b/src/libjasper/include/jasper/jas_seq.h index e96548e6..f470c841 100644 --- a/src/libjasper/include/jasper/jas_seq.h +++ b/src/libjasper/include/jasper/jas_seq.h @@ -154,6 +154,9 @@ typedef jas_matrix_t jas_seq_t; #define jas_matrix_numcols(matrix) \ ((matrix)->numcols_) +#define jas_matrix_size(matrix) \ + (jas_matrix_width(matrix) * jas_matrix_height(matrix)) + /* Get a matrix element. */ #define jas_matrix_get(matrix, i, j) \ ((matrix)->rows_[i][j]) @@ -269,6 +272,8 @@ jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend); ((s)->xstart_ = (x), (s)->ystart_ = (y), \ (s)->xend_ = (s)->xstart_ + (s)->numcols_, \ (s)->yend_ = (s)->ystart_ + (s)->numrows_) +#define jas_seq2d_size(s) \ + (jas_seq2d_width(s) * jas_seq2d_height(s)) void jas_seq2d_bindsub(jas_matrix_t *s, jas_matrix_t *s1, int xstart, int ystart, int xend, int yend); diff --git a/src/libjasper/jpc/jpc_dec.c b/src/libjasper/jpc/jpc_dec.c index 0d38c622..755c1c6e 100644 --- a/src/libjasper/jpc/jpc_dec.c +++ b/src/libjasper/jpc/jpc_dec.c @@ -1838,6 +1838,13 @@ static void jpc_undo_roi(jas_matrix_t *x, int roishift, int bgshift, int numbps) bool warn; uint_fast32_t mask; + if (roishift < 0) { + /* We could instead return an error here. */ + /* I do not think it matters much. */ + jas_eprintf("warning: forcing negative ROI shift to zero " + "(bitstream is probably corrupt)\n"); + roishift = 0; + } if (roishift == 0 && bgshift == 0) { return; } @@ -1856,7 +1863,7 @@ static void jpc_undo_roi(jas_matrix_t *x, int roishift, int bgshift, int numbps) } else { /* We are dealing with non-ROI (i.e., background) data. */ mag <<= bgshift; - mask = (1 << numbps) - 1; + mask = (JAS_CAST(uint_fast32_t, 1) << numbps) - 1; /* Perform a basic sanity check on the sample value. */ /* Some implementations write garbage in the unused most-significant bit planes introduced by ROI shifting. diff --git a/src/libjasper/jpc/jpc_tsfb.c b/src/libjasper/jpc/jpc_tsfb.c index 7aa293f0..b51b747d 100644 --- a/src/libjasper/jpc/jpc_tsfb.c +++ b/src/libjasper/jpc/jpc_tsfb.c @@ -148,7 +148,8 @@ int jpc_tsfb_analyze2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart, int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *a) { - return (tsfb->numlvls > 0) ? jpc_tsfb_synthesize2(tsfb, + return (tsfb->numlvls > 0 && jas_seq2d_size(a)) ? + jpc_tsfb_synthesize2(tsfb, jas_seq2d_getref(a, jas_seq2d_xstart(a), jas_seq2d_ystart(a)), jas_seq2d_xstart(a), jas_seq2d_ystart(a), jas_seq2d_width(a), jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0;
1
eb19fa58e08ffad79fe4af09abc0b5a584b4e6e6
https://github.com/knik0/faad2/commit/eb19fa58e08ffad79fe4af09abc0b5a584b4e6e6
updated Visual Studio projects to VS 2019 (#54)
diff --git a/project/msvc/faad.vcxproj b/project/msvc/faad.vcxproj index c741e31..c26bb2e 100644 --- a/project/msvc/faad.vcxproj +++ b/project/msvc/faad.vcxproj @@ -5,23 +5,39 @@ <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}</ProjectGuid> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> @@ -29,9 +45,15 @@ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion> @@ -44,6 +66,14 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <LinkIncremental>true</LinkIncremental> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OutDir>.\bin\$(Configuration)\</OutDir> <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> @@ -52,13 +82,21 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <LinkIncremental>false</LinkIncremental> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Midl> <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName> </Midl> <ClCompile> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> @@ -75,6 +113,30 @@ <SubSystem>Console</SubSystem> </Link> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Midl> + <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0413</Culture> + </ResourceCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Midl> <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName> @@ -84,7 +146,7 @@ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> <IntrinsicFunctions>true</IntrinsicFunctions> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> - <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> @@ -100,6 +162,32 @@ <SubSystem>Console</SubSystem> </Link> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Midl> + <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <Optimization>MinSpace</Optimization> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0413</Culture> + </ResourceCompile> + <Link> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\frontend\audio.c" /> <ClCompile Include="..\..\frontend\main.c" /> @@ -108,7 +196,6 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\..\frontend\getopt.h" /> - <ClInclude Include="..\..\common\mp4v2\win32_ver.h" /> <ClInclude Include="..\..\frontend\mp4read.h" /> <ClInclude Include="..\..\frontend\unicode_support.h" /> <ClInclude Include="..\..\include\neaacdec.h" /> diff --git a/project/msvc/faad.vcxproj.filters b/project/msvc/faad.vcxproj.filters index 47e778a..d380b99 100644 --- a/project/msvc/faad.vcxproj.filters +++ b/project/msvc/faad.vcxproj.filters @@ -34,9 +34,6 @@ <ClInclude Include="..\..\include\neaacdec.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\..\common\mp4v2\win32_ver.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\..\frontend\mp4read.h"> <Filter>Header Files</Filter> </ClInclude> diff --git a/project/msvc/faad2.sln b/project/msvc/faad2.sln index 3be42cd..9094553 100644 --- a/project/msvc/faad2.sln +++ b/project/msvc/faad2.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2010 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcxproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}" EndProject @@ -11,21 +11,35 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.ActiveCfg = Debug|x64 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.Build.0 = Debug|x64 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.ActiveCfg = Release|x64 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.Build.0 = Release|x64 {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32 {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.Build.0 = Debug|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.ActiveCfg = Debug|x64 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.Build.0 = Debug|x64 {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32 {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.Build.0 = Release|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.ActiveCfg = Release|x64 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.Build.0 = Release|x64 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.Build.0 = Debug|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.ActiveCfg = Debug|x64 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.Build.0 = Debug|x64 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.Build.0 = Release|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.ActiveCfg = Release|x64 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/project/msvc/libfaad.vcxproj b/project/msvc/libfaad.vcxproj index 5f194b5..6f75dce 100644 --- a/project/msvc/libfaad.vcxproj +++ b/project/msvc/libfaad.vcxproj @@ -5,23 +5,39 @@ <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}</ProjectGuid> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> @@ -29,9 +45,15 @@ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion> @@ -43,6 +65,13 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <OutDir>.\bin\$(Configuration)\</OutDir> <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> @@ -50,6 +79,13 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <Optimization>MaxSpeed</Optimization> @@ -74,6 +110,31 @@ <Message>Retrieving package version...</Message> </PreBuildEvent> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0413</Culture> + </ResourceCompile> + <Lib /> + <PreBuildEvent> + <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> + </PreBuildEvent> + <PreBuildEvent> + <Message>Retrieving package version...</Message> + </PreBuildEvent> + </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> @@ -97,6 +158,30 @@ <Message>Retrieving package version...</Message> </PreBuildEvent> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0413</Culture> + </ResourceCompile> + <Lib /> + <PreBuildEvent> + <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> + </PreBuildEvent> + <PreBuildEvent> + <Message>Retrieving package version...</Message> + </PreBuildEvent> + </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\libfaad\bits.c" /> <ClCompile Include="..\..\libfaad\cfft.c" /> diff --git a/project/msvc/libfaad2_dll.vcxproj b/project/msvc/libfaad2_dll.vcxproj index 51b43b9..9c3c766 100644 --- a/project/msvc/libfaad2_dll.vcxproj +++ b/project/msvc/libfaad2_dll.vcxproj @@ -5,23 +5,39 @@ <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{482DA264-EE88-4575-B208-87C4CB80CD08}</ProjectGuid> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> @@ -29,9 +45,15 @@ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion> @@ -44,6 +66,14 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <LinkIncremental>true</LinkIncremental> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OutDir>.\bin\$(Configuration)\</OutDir> <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> @@ -52,6 +82,14 @@ <CodeAnalysisRules /> <CodeAnalysisRuleAssemblies /> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <OutDir>.\bin\$(Configuration)\</OutDir> + <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> + <LinkIncremental>false</LinkIncremental> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules /> + <CodeAnalysisRuleAssemblies /> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Midl> <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -84,6 +122,38 @@ <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> </PreBuildEvent> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Midl> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MkTypLibCompatible>true</MkTypLibCompatible> + <SuppressStartupBanner>true</SuppressStartupBanner> + <TypeLibraryName>.\DebugDLL/libfaad2_dll.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SuppressStartupBanner>true</SuppressStartupBanner> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0407</Culture> + </ResourceCompile> + <Link> + <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PreBuildEvent> + <Message>Retrieving package version...</Message> + <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> + </PreBuildEvent> + </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Midl> <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -117,6 +187,39 @@ <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> </PreBuildEvent> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Midl> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MkTypLibCompatible>true</MkTypLibCompatible> + <SuppressStartupBanner>true</SuppressStartupBanner> + <TypeLibraryName>.\ReleaseDLL/libfaad2_dll.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SuppressStartupBanner>true</SuppressStartupBanner> + <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0407</Culture> + </ResourceCompile> + <Link> + <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile> + </Link> + <PreBuildEvent> + <Message>Retrieving package version...</Message> + <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> + </PreBuildEvent> + </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\..\libfaad\bits.c" /> <ClCompile Include="..\..\libfaad\cfft.c" />
0
9fdcc15962f9ff4baebe6fdd947816f43f730d50
https://github.com/antirez/redis/commit/9fdcc15962f9ff4baebe6fdd947816f43f730d50
Security: fix redis-cli buffer overflow. Thanks to Fakhri Zulkifli for reporting it. The fix switched to dynamic allocation, copying the final prompt in the static buffer only at the end.
diff --git a/src/redis-cli.c b/src/redis-cli.c index 1f8018ac7e79..cd3f47d62146 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -152,20 +152,25 @@ static long long mstime(void) { } static void cliRefreshPrompt(void) { - int len; - if (config.eval_ldb) return; - if (config.hostsocket != NULL) - len = snprintf(config.prompt,sizeof(config.prompt),"redis %s", - config.hostsocket); - else - len = anetFormatAddr(config.prompt, sizeof(config.prompt), - config.hostip, config.hostport); + + sds prompt = sdsempty(); + if (config.hostsocket != NULL) { + prompt = sdscatfmt(prompt,"redis %s",config.hostsocket); + } else { + char addr[256]; + anetFormatAddr(addr, sizeof(addr), config.hostip, config.hostport); + prompt = sdscatlen(prompt,addr,strlen(addr)); + } + /* Add [dbnum] if needed */ if (config.dbnum != 0) - len += snprintf(config.prompt+len,sizeof(config.prompt)-len,"[%d]", - config.dbnum); - snprintf(config.prompt+len,sizeof(config.prompt)-len,"> "); + prompt = sdscatfmt(prompt,"[%i]",config.dbnum); + + /* Copy the prompt in the static buffer. */ + prompt = sdscatlen(prompt,"> ",2); + snprintf(config.prompt,sizeof(config.prompt),"%s",prompt); + sdsfree(prompt); } /* Return the name of the dotfile for the specified 'dotfilename'.
1
f88bfa91a030ac1de920777f18d841fce5cfab78
https://github.com/kaltura/server/commit/f88bfa91a030ac1de920777f18d841fce5cfab78
PLAT-22514:Zoom integration UI enhancement
diff --git a/plugins/vendor/zoom/lib/api/webPage/KalturaZoomRegistrationPage.html b/plugins/vendor/zoom/lib/api/webPage/KalturaZoomRegistrationPage.html index 7c7573f6115..e3586569860 100644 --- a/plugins/vendor/zoom/lib/api/webPage/KalturaZoomRegistrationPage.html +++ b/plugins/vendor/zoom/lib/api/webPage/KalturaZoomRegistrationPage.html @@ -9,10 +9,16 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <script> - var ks = '@ks@'; - let baseServiceUrl = '@BaseServiceUrl@'; - var accountId = '@accoutId@'; - var partnerId= '@partnerId@'; + // var ks = '@ks@'; + // let baseServiceUrl = '@BaseServiceUrl@'; + // var accountId = '@accoutId@'; + // var partnerId= '@partnerId@'; + + var ks = 'YmIxNWQxOGU0NzAzNjIwN2I2OGVmMzBkNjJlZjU3MzhkNDYwMTY2YnwxMDI7MTAyOzE2MTEzMzY0NzQ7MjsxNjExMjUwMDc0LjU5MDk7YWRtaW47ZGlzYWJsZWVudGl0bGVtZW50Ozs'; + let baseServiceUrl = 'ubu16'; + var accountId = 'ACCOUT_TEST'; + var partnerId= '102'; + var submitUrl = baseServiceUrl+'/api_v3/service/vendor_zoomvendor/action/submitRegistration'; var getUrl = baseServiceUrl + '/api_v3/service/vendor_zoomvendor/action/get?format=1'; const CMS_USER_ID=3; @@ -28,6 +34,7 @@ let enableWebinarUploads = $('#enableWebinarUploads').is(':checked'); let handleParticipantsMode = $('[name=handleParticipantsMode]:checked').val(); let zoomUserMatchingMode = $('[name=zoomUserMatchingMode]:checked').val(); + let conversionProfileId = $('#conversionProfileId').val().trim(); if($('[name=recordingOwner]:checked').val()==RECORDING_OWNER_BASED_ON_ZOOM_USER_ID) { zoomUserMatchingMode = CMS_USER_ID; @@ -46,6 +53,8 @@ 'integrationSetting:zoomUserPostfix':zoomUserPostfix, 'integrationSetting:zoomWebinarCategory':zoomWebinarCategory, 'integrationSetting:enableWebinarUploads':enableWebinarUploads, + 'integrationSetting:conversionProfileId':conversionProfileId, + 'format': 1 }, success : function(res) { $('body').css('cursor', 'default'); @@ -120,6 +129,7 @@ case 'zoomCategory': case 'zoomUserPostfix': case 'zoomWebinarCategory': + case 'conversionProfileId': $('#'+i).val(v); break; case 'enableWebinarUploads': @@ -162,14 +172,11 @@ </script> <title>Kaltura-Zoom registration</title> </head> -<body onload="onLoad()"> +<body onload="onLoad()" style="max-width: 600px;margin: auto;"> <form> - <div class='col-sm-2'></div> - <div class='container col-sm-8'> <div class='imgcontainer'> <img src='https://developer.kaltura.com/homepage/assets/images/Kaltura-logo.png' width='256' class='mx-auto d-block'> </div> - <br/><br/> <div class='form-group container p-2 my-2 border'> <div class='form-group'> <label><h6>Default User ID</h6></label> @@ -183,6 +190,10 @@ <label for='zoomWebinarCategory'><h6>Zoom Webinar Category</h6></label> <input type='text' value='@zoomWebinarCategory@' id='zoomWebinarCategory' class='form-control' name='zoomWebinarCategory' required> </div> + <div class='form-group'> + <label for='conversionProfileId'><h6>Conversion profile ID</h6></label> + <input type='text' value='@Conversion profile ID@' id='conversionProfileId' class='form-control' name='conversionProfileId' required> + </div> <h6>Control</h6> <div class='container p-2 my-2 border'> <div class='custom-control custom-switch'> @@ -251,7 +262,6 @@ <h6 >Setting owner for recordings</h6> </div> <button type='button' id='submitBtn' class='btn btn-block btn-primary' onclick='trySubmit()'>Submit</button> </div> - <div class='col-sm-2'></div> </form> </body> </html>
0
0d8b2d65cd76a5d5edfb34abcee2ae395704b08d
https://github.com/deeplearning4j/deeplearning4j/commit/0d8b2d65cd76a5d5edfb34abcee2ae395704b08d
Merge remote-tracking branch 'eclipse/master'
diff --git a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java index 31e86d45f37e..7a8d703878de 100644 --- a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java +++ b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java @@ -36,6 +36,7 @@ import org.deeplearning4j.arbiter.ui.misc.UIUtils; import org.deeplearning4j.arbiter.util.ObjectUtils; import org.deeplearning4j.nn.conf.serde.JsonMappers; +import org.deeplearning4j.ui.VertxUIServer; import org.deeplearning4j.ui.api.Component; import org.deeplearning4j.ui.api.*; import org.deeplearning4j.ui.components.chart.ChartLine; @@ -50,6 +51,7 @@ import org.deeplearning4j.ui.i18n.I18NResource; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.nd4j.common.function.Function; import org.nd4j.common.primitives.Pair; import org.nd4j.shade.jackson.core.JsonProcessingException; @@ -77,7 +79,6 @@ private Map<String, Long> lastUpdateForSession = Collections.synchronizedMap(new HashMap<>()); - //Styles for UI: private static final StyleTable STYLE_TABLE = new StyleTable.Builder() .width(100, LengthUnit.Percent) @@ -134,20 +135,135 @@ @Override public List<Route> getRoutes() { - Route r1 = new Route("/arbiter", HttpMethod.GET, (path, rc) -> rc.response() - .putHeader("content-type", "text/html; charset=utf-8").sendFile("templates/ArbiterUI.html")); - Route r3 = new Route("/arbiter/lastUpdate", HttpMethod.GET, (path, rc) -> this.getLastUpdateTime(rc)); - Route r4 = new Route("/arbiter/lastUpdate/:ids", HttpMethod.GET, (path, rc) -> this.getModelLastUpdateTimes(path.get(0), rc)); - Route r5 = new Route("/arbiter/candidateInfo/:id", HttpMethod.GET, (path, rc) -> this.getCandidateInfo(path.get(0), rc)); - Route r6 = new Route("/arbiter/config", HttpMethod.GET, (path, rc) -> this.getOptimizationConfig(rc)); - Route r7 = new Route("/arbiter/results", HttpMethod.GET, (path, rc) -> this.getSummaryResults(rc)); - Route r8 = new Route("/arbiter/summary", HttpMethod.GET, (path, rc) -> this.getSummaryStatus(rc)); - - Route r9a = new Route("/arbiter/sessions/all", HttpMethod.GET, (path, rc) -> this.listSessions(rc)); - Route r9b = new Route("/arbiter/sessions/current", HttpMethod.GET, (path, rc) -> this.currentSession(rc)); - Route r9c = new Route("/arbiter/sessions/set/:to", HttpMethod.GET, (path, rc) -> this.setSession(path.get(0), rc)); - - return Arrays.asList(r1, r3, r4, r5, r6, r7, r8, r9a, r9b, r9c); + boolean multiSession = VertxUIServer.getMultiSession().get(); + List<Route> r = new ArrayList<>(); + r.add(new Route("/arbiter/multisession", HttpMethod.GET, + (path, rc) -> rc.response().end(multiSession ? "true" : "false"))); + if (multiSession) { + r.add(new Route("/arbiter", HttpMethod.GET, (path, rc) -> this.listSessions(rc))); + r.add(new Route("/arbiter/:sessionId", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + rc.response() + .putHeader("content-type", "text/html; charset=utf-8") + .sendFile("templates/ArbiterUI.html"); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + + r.add(new Route("/arbiter/:sessionId/lastUpdate", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + this.getLastUpdateTime(path.get(0), rc); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + r.add(new Route("/arbiter/:sessionId/candidateInfo/:id", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + this.getCandidateInfo(path.get(0), path.get(1), rc); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + r.add(new Route("/arbiter/:sessionId/config", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + this.getOptimizationConfig(path.get(0), rc); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + r.add(new Route("/arbiter/:sessionId/results", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + this.getSummaryResults(path.get(0), rc); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + r.add(new Route("/arbiter/:sessionId/summary", HttpMethod.GET, (path, rc) -> { + if (knownSessionIDs.containsKey(path.get(0))) { + this.getSummaryStatus(path.get(0), rc); + } else { + sessionNotFound(path.get(0), rc.request().path(), rc); + } + })); + } else { + r.add(new Route("/arbiter", HttpMethod.GET, (path, rc) -> rc.response() + .putHeader("content-type", "text/html; charset=utf-8") + .sendFile("templates/ArbiterUI.html"))); + r.add(new Route("/arbiter/lastUpdate", HttpMethod.GET, (path, rc) -> this.getLastUpdateTime(null, rc))); + r.add(new Route("/arbiter/candidateInfo/:id", HttpMethod.GET, + (path, rc) -> this.getCandidateInfo(null, path.get(0), rc))); + r.add(new Route("/arbiter/config", HttpMethod.GET, (path, rc) -> this.getOptimizationConfig(null, rc))); + r.add(new Route("/arbiter/results", HttpMethod.GET, (path, rc) -> this.getSummaryResults(null, rc))); + r.add(new Route("/arbiter/summary", HttpMethod.GET, (path, rc) -> this.getSummaryStatus(null, rc))); + + r.add(new Route("/arbiter/sessions/current", HttpMethod.GET, (path, rc) -> this.currentSession(rc))); + r.add(new Route("/arbiter/sessions/set/:to", HttpMethod.GET, + (path, rc) -> this.setSession(path.get(0), rc))); + } + // common for single- and multi-session mode + r.add(new Route("/arbiter/sessions/all", HttpMethod.GET, (path, rc) -> this.sessionInfo(rc))); + + return r; + } + + + /** + * Load StatsStorage via provider, or return "not found" + * + * @param sessionId session ID to look fo with provider + * @param targetPath one of overview / model / system, or null + * @param rc routing context + */ + private void sessionNotFound(String sessionId, String targetPath, RoutingContext rc) { + Function<String, Boolean> loader = VertxUIServer.getInstance().getStatsStorageLoader(); + if (loader != null && loader.apply(sessionId)) { + if (targetPath != null) { + rc.reroute(targetPath); + } else { + rc.response().end(); + } + } else { + rc.response().setStatusCode(HttpResponseStatus.NOT_FOUND.code()) + .end("Unknown session ID: " + sessionId); + } + } + + + /** + * List optimization sessions. Returns a HTML list of arbiter sessions + */ + private synchronized void listSessions(RoutingContext rc) { + StringBuilder sb = new StringBuilder("<!DOCTYPE html>\n" + + "<html lang=\"en\">\n" + + "<head>\n" + + " <meta charset=\"utf-8\">\n" + + " <title>Optimization sessions - DL4J Arbiter UI</title>\n" + + " </head>\n" + + "\n" + + " <body>\n" + + " <h1>DL4J Arbiter UI</h1>\n" + + " <p>UI server is in multi-session mode." + + " To visualize an optimization session, please select one from the following list.</p>\n" + + " <h2>List of attached optimization sessions</h2>\n"); + if (!knownSessionIDs.isEmpty()) { + sb.append(" <ul>"); + for (String sessionId : knownSessionIDs.keySet()) { + sb.append(" <li><a href=\"/arbiter/") + .append(sessionId).append("\">") + .append(sessionId).append("</a></li>\n"); + } + sb.append(" </ul>"); + } else { + sb.append("No optimization session attached."); + } + + sb.append(" </body>\n" + + "</html>\n"); + + rc.response() + .putHeader("content-type", "text/html; charset=utf-8") + .end(sb.toString()); } @Override @@ -201,7 +317,7 @@ private void currentSession(RoutingContext rc) { .end(asJson(sid)); } - private void listSessions(RoutingContext rc) { + private void sessionInfo(RoutingContext rc) { rc.response() .putHeader("content-type", "application/json") .end(asJson(knownSessionIDs.keySet())); @@ -257,10 +373,25 @@ public void onDetach(StatsStorage statsStorage) { /** * Return the last update time for the page + * @param sessionId session ID (optional, for multi-session mode) + * @param rc routing context */ - private void getLastUpdateTime(RoutingContext rc){ - //TODO - this forces updates on every request... which is fine, just inefficient - long t = System.currentTimeMillis(); + private void getLastUpdateTime(String sessionId, RoutingContext rc){ + if (sessionId == null) { + sessionId = currentSessionID; + } + StatsStorage ss = knownSessionIDs.get(sessionId); + List<Persistable> latestUpdates = ss.getLatestUpdateAllWorkers(sessionId, ARBITER_UI_TYPE_ID); + long t = 0; + if (latestUpdates.isEmpty()) { + t = System.currentTimeMillis(); + } else { + for (Persistable update : latestUpdates) { + if (update.getTimeStamp() > t) { + t = update.getTimeStamp(); + } + } + } UpdateStatus us = new UpdateStatus(t, t, t); rc.response().putHeader("content-type", "application/json").end(asJson(us)); @@ -274,56 +405,28 @@ private String asJson(Object o){ } } - /** - * Get the last update time for the specified model IDs - * @param modelIDs Model IDs to get the update time for - */ - private void getModelLastUpdateTimes(String modelIDs, RoutingContext rc){ - if(currentSessionID == null){ - rc.response().end(); - return; - } - - StatsStorage ss = knownSessionIDs.get(currentSessionID); - if(ss == null){ - log.debug("getModelLastUpdateTimes(): Session ID is unknown: {}", currentSessionID); - rc.response().end("-1"); - return; - } - - String[] split = modelIDs.split(","); - - long[] lastUpdateTimes = new long[split.length]; - for( int i=0; i<split.length; i++ ){ - String s = split[i]; - Persistable p = ss.getLatestUpdate(currentSessionID, ARBITER_UI_TYPE_ID, s); - if(p != null){ - lastUpdateTimes[i] = p.getTimeStamp(); - } - } - - rc.response().putHeader("content-type", "application/json").end(asJson(lastUpdateTimes)); - } - /** * Get the info for a specific candidate - last section in the UI - * + * @param sessionId session ID (optional, for multi-session mode) * @param candidateId ID for the candidate - * @return Content/info for the candidate + * @param rc routing context */ - private void getCandidateInfo(String candidateId, RoutingContext rc){ - - StatsStorage ss = knownSessionIDs.get(currentSessionID); + private void getCandidateInfo(String sessionId, String candidateId, RoutingContext rc){ + if (sessionId == null) { + sessionId = currentSessionID; + } + StatsStorage ss = knownSessionIDs.get(sessionId); if(ss == null){ - log.debug("getModelLastUpdateTimes(): Session ID is unknown: {}", currentSessionID); + log.debug("getModelLastUpdateTimes(): Session ID is unknown: {}", sessionId); rc.response().end(); return; } - GlobalConfigPersistable gcp = (GlobalConfigPersistable)ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID);; + GlobalConfigPersistable gcp = (GlobalConfigPersistable)ss + .getStaticInfo(sessionId, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); OptimizationConfiguration oc = gcp.getOptimizationConfiguration(); - Persistable p = ss.getLatestUpdate(currentSessionID, ARBITER_UI_TYPE_ID, candidateId); + Persistable p = ss.getLatestUpdate(sessionId, ARBITER_UI_TYPE_ID, candidateId); if(p == null){ String title = "No results found for model " + candidateId + "."; ComponentText ct = new ComponentText.Builder(title,STYLE_TEXT_SZ12).build(); @@ -493,17 +596,21 @@ private void getCandidateInfo(String candidateId, RoutingContext rc){ /** * Get the optimization configuration - second section in the page + * @param sessionId session ID (optional, for multi-session mode) + * @param rc routing context */ - private void getOptimizationConfig(RoutingContext rc){ - - StatsStorage ss = knownSessionIDs.get(currentSessionID); + private void getOptimizationConfig(String sessionId, RoutingContext rc){ + if (sessionId == null) { + sessionId = currentSessionID; + } + StatsStorage ss = knownSessionIDs.get(sessionId); if(ss == null){ - log.debug("getOptimizationConfig(): Session ID is unknown: {}", currentSessionID); + log.debug("getOptimizationConfig(): Session ID is unknown: {}", sessionId); rc.response().end(); return; } - Persistable p = ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); + Persistable p = ss.getStaticInfo(sessionId, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); if(p == null){ log.debug("No static info"); @@ -593,15 +700,23 @@ private void getOptimizationConfig(RoutingContext rc){ rc.response().putHeader("content-type", "application/json").end(asJson(cd)); } - private void getSummaryResults(RoutingContext rc){ - StatsStorage ss = knownSessionIDs.get(currentSessionID); + /** + * Get candidates summary results list - third section on the page: Results table + * @param sessionId session ID (optional, for multi-session mode) + * @param rc routing context + */ + private void getSummaryResults(String sessionId, RoutingContext rc){ + if (sessionId == null) { + sessionId = currentSessionID; + } + StatsStorage ss = knownSessionIDs.get(sessionId); if(ss == null){ - log.debug("getSummaryResults(): Session ID is unknown: {}", currentSessionID); + log.debug("getSummaryResults(): Session ID is unknown: {}", sessionId); rc.response().end(); return; } - List<Persistable> allModelInfoTemp = new ArrayList<>(ss.getLatestUpdateAllWorkers(currentSessionID, ARBITER_UI_TYPE_ID)); + List<Persistable> allModelInfoTemp = new ArrayList<>(ss.getLatestUpdateAllWorkers(sessionId, ARBITER_UI_TYPE_ID)); List<String[]> table = new ArrayList<>(); for(Persistable per : allModelInfoTemp){ ModelInfoPersistable mip = (ModelInfoPersistable)per; @@ -614,16 +729,21 @@ private void getSummaryResults(RoutingContext rc){ /** * Get summary status information: first section in the page + * @param sessionId session ID (optional, for multi-session mode) + * @param rc routing context */ - private void getSummaryStatus(RoutingContext rc){ - StatsStorage ss = knownSessionIDs.get(currentSessionID); + private void getSummaryStatus(String sessionId, RoutingContext rc){ + if (sessionId == null) { + sessionId = currentSessionID; + } + StatsStorage ss = knownSessionIDs.get(sessionId); if(ss == null){ - log.debug("getOptimizationConfig(): Session ID is unknown: {}", currentSessionID); + log.debug("getOptimizationConfig(): Session ID is unknown: {}", sessionId); rc.response().end(); return; } - Persistable p = ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); + Persistable p = ss.getStaticInfo(sessionId, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); if(p == null){ log.info("No static info"); @@ -643,7 +763,7 @@ private void getSummaryStatus(RoutingContext rc){ //How to get this? query all model infos... - List<Persistable> allModelInfoTemp = new ArrayList<>(ss.getLatestUpdateAllWorkers(currentSessionID, ARBITER_UI_TYPE_ID)); + List<Persistable> allModelInfoTemp = new ArrayList<>(ss.getLatestUpdateAllWorkers(sessionId, ARBITER_UI_TYPE_ID)); List<ModelInfoPersistable> allModelInfo = new ArrayList<>(); for(Persistable per : allModelInfoTemp){ ModelInfoPersistable mip = (ModelInfoPersistable)per; @@ -668,7 +788,6 @@ private void getSummaryStatus(RoutingContext rc){ //TODO: I18N - //TODO don't use currentTimeMillis due to stored data?? long bestTime; Double bestScore = null; String bestModelString = null; @@ -685,7 +804,12 @@ private void getSummaryStatus(RoutingContext rc){ String execTotalRuntimeStr = ""; if(execStartTime > 0){ execStartTimeStr = TIME_FORMATTER.print(execStartTime); - execTotalRuntimeStr = UIUtils.formatDuration(System.currentTimeMillis() - execStartTime); + // allModelInfo is sorted by Persistable::getTimeStamp + long lastCompleteTime = execStartTime; + if (!allModelInfo.isEmpty()) { + lastCompleteTime = allModelInfo.get(allModelInfo.size() - 1).getTimeStamp(); + } + execTotalRuntimeStr = UIUtils.formatDuration(lastCompleteTime - execStartTime); } diff --git a/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html b/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html index 9a5b6a9988d4..a1b4e92a0970 100644 --- a/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html +++ b/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html @@ -197,110 +197,167 @@ var resultsTableContent; var selectedCandidateIdx = null; + + //Multi-session mode + var multiSession = null; + //Session selection + var currSession = ""; + + function getSessionIdFromUrl() { + // path is like /arbiter/:sessionId/overview + var sessionIdRegexp = /\/arbiter\/([^\/]+)/g; + var match = sessionIdRegexp.exec(window.location.pathname) + return match[1]; + } + function getCurrSession(callback) { + if (multiSession) { + if (currSession == "") { + // get only once + currSession = getSessionIdFromUrl(); + } + //we don't show session selector in multi-session mode (one can list sessions at /arbiter) + callback(); + } else { + $.ajax({ + url: "/arbiter/sessions/current", + async: true, + error: function (query, status, error) { + console.log("Error getting data: " + error); + }, + success: function (data) { + currSession = data; + console.log("Current session: " + currSession); + + //Update available sessions in session selector + $.get("/arbiter/sessions/all", function(data){ + var keys = data; // JSON.stringify(data); + + if(keys.length > 1){ + $("#sessionSelectDiv").show(); + + var elem = $("#sessionSelect"); + elem.empty(); + + var currSelectedIdx = 0; + for (var i = 0; i < keys.length; i++) { + if(keys[i] == currSession){ + currSelectedIdx = i; + } + elem.append("<option value='" + keys[i] + "'>" + keys[i] + "</option>"); + } + + $("#sessionSelect option[value='" + keys[currSelectedIdx] +"']").attr("selected", "selected"); + $("#sessionSelectDiv").show(); + } + // console.log("Got sessions: " + keys + ", current: " + currSession); + callback(); + }); + + } + }); + } + } + + function getSessionSettings(callback) { + // load only once + if (multiSession != null) { + getCurrSession(callback); + } else { + $.ajax({ + url: "/arbiter/multisession", + async: true, + error: function (query, status, error) { + console.log("Error getting data: " + error); + }, + success: function (data) { + multiSession = data == "true"; + getCurrSession(callback); + } + }); + } + } + + //Initial update + doUpdate(); //Set basic interval function to do updates setInterval(doUpdate,5000); //Loop every 5 seconds - - + function doUpdate(){ //Get the update status, and do something with it: - $.get("/arbiter/lastUpdate",function(data){ - //Encoding: matches names in UpdateStatus class - var jsonObj = JSON.parse(JSON.stringify(data)); - var statusTime = jsonObj['statusUpdateTime']; - var settingsTime = jsonObj['settingsUpdateTime']; - var resultsTime = jsonObj['resultsUpdateTime']; - //console.log("Last update times: " + statusTime + ", " + settingsTime + ", " + resultsTime); - - //Update available sessions: - var currSession; - $.get("/arbiter/sessions/current", function(data){ - currSession = data; //JSON.stringify(data); - console.log("Current: " + currSession); - }); - - $.get("/arbiter/sessions/all", function(data){ - var keys = data; // JSON.stringify(data); - - if(keys.length > 1){ - $("#sessionSelectDiv").show(); - - var elem = $("#sessionSelect"); - elem.empty(); - - var currSelectedIdx = 0; - for (var i = 0; i < keys.length; i++) { - if(keys[i] == currSession){ - currSelectedIdx = i; - } - elem.append("<option value='" + keys[i] + "'>" + keys[i] + "</option>"); - } - - $("#sessionSelect option[value='" + keys[currSelectedIdx] +"']").attr("selected", "selected"); - $("#sessionSelectDiv").show(); + getSessionSettings(function(){ + var sessionUpdateUrl = multiSession ? "/arbiter/" + currSession + "/lastUpdate" : "/arbiter/lastUpdate"; + $.get(sessionUpdateUrl,function(data){ + //Encoding: matches names in UpdateStatus class + var jsonObj = JSON.parse(JSON.stringify(data)); + var statusTime = jsonObj['statusUpdateTime']; + var settingsTime = jsonObj['settingsUpdateTime']; + var resultsTime = jsonObj['resultsUpdateTime']; + //console.log("Last update times: " + statusTime + ", " + settingsTime + ", " + resultsTime); + + //Check last update times for each part of document, and update as necessary + //First section: summary status + if(lastStatusUpdateTime != statusTime){ + var summaryStatusUrl = multiSession ? "/arbiter/" + currSession + "/summary" : "/arbiter/summary"; + $.get(summaryStatusUrl,function(data){ + var summaryStatusDiv = $('#statusdiv'); + summaryStatusDiv.html(''); + + var str = JSON.stringify(data); + var component = Component.getComponent(str); + component.render(summaryStatusDiv); + }); + + lastStatusUpdateTime = statusTime; } -// console.log("Got sessions: " + keys + ", current: " + currSession); - }); - - - //Check last update times for each part of document, and update as necessary - //First section: summary status - if(lastStatusUpdateTime != statusTime){ - //Get JSON: address set by SummaryStatusResource - $.get("/arbiter/summary",function(data){ - var summaryStatusDiv = $('#statusdiv'); - summaryStatusDiv.html(''); - - var str = JSON.stringify(data); - var component = Component.getComponent(str); - component.render(summaryStatusDiv); - }); - lastStatusUpdateTime = statusTime; - } - - //Second section: Optimization settings - if(lastSettingsUpdateTime != settingsTime){ - //Get JSON for components - $.get("/arbiter/config",function(data){ - var str = JSON.stringify(data); - - var configDiv = $('#settingsdiv'); - configDiv.html(''); - - var component = Component.getComponent(str); - component.render(configDiv); - }); - - lastSettingsUpdateTime = settingsTime; - } + //Second section: Optimization settings + if(lastSettingsUpdateTime != settingsTime){ + //Get JSON for components + var settingsUrl = multiSession ? "/arbiter/" + currSession + "/config" : "/arbiter/config"; + $.get(settingsUrl,function(data){ + var str = JSON.stringify(data); - //Third section: Summary results table (summary info for each candidate) - if(lastResultsUpdateTime != resultsTime){ + var configDiv = $('#settingsdiv'); + configDiv.html(''); - //Get JSON; address set by SummaryResultsResource - $.get("/arbiter/results",function(data){ - //Expect an array of CandidateInfo type objects here - resultsTableContent = data; - drawResultTable(); - }); + var component = Component.getComponent(str); + component.render(configDiv); + }); - lastResultsUpdateTime = resultsTime; - } - - //Finally: Currently selected result - if(selectedCandidateIdx != null){ - //Get JSON for components - $.get("/arbiter/candidateInfo/"+selectedCandidateIdx,function(data){ - var str = JSON.stringify(data); + lastSettingsUpdateTime = settingsTime; + } - var resultsViewDiv = $('#resultsviewdiv'); - resultsViewDiv.html(''); + //Third section: Summary results table (summary info for each candidate) + if(lastResultsUpdateTime != resultsTime){ + //Get JSON for results table + var resultsUrl = multiSession ? "/arbiter/" + currSession + "/results" : "/arbiter/results"; + $.get(resultsUrl,function(data){ + //Expect an array of CandidateInfo type objects here + resultsTableContent = data; + drawResultTable(); + }); + + lastResultsUpdateTime = resultsTime; + } - var component = Component.getComponent(str); - component.render(resultsViewDiv); - }); - } + //Finally: Currently selected result + if(selectedCandidateIdx != null){ + //Get JSON for components + var candidateInfoUrl = multiSession + ? "/arbiter/" + currSession + "/candidateInfo/" + selectedCandidateIdx + : "/arbiter/candidateInfo/" + selectedCandidateIdx; + $.get(candidateInfoUrl,function(data){ + var str = JSON.stringify(data); + + var resultsViewDiv = $('#resultsviewdiv'); + resultsViewDiv.html(''); + + var component = Component.getComponent(str); + component.render(resultsViewDiv); + }); + } + }) }) } diff --git a/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java b/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java index 64c873348fbb..3ecefe0b3bba 100644 --- a/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java +++ b/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java @@ -16,6 +16,9 @@ package org.deeplearning4j.arbiter.optimize; +import io.netty.handler.codec.http.HttpResponseStatus; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; import org.deeplearning4j.BaseDL4JTest; import org.deeplearning4j.core.storage.StatsStorage; import org.deeplearning4j.arbiter.ComputationGraphSpace; @@ -54,6 +57,7 @@ import org.deeplearning4j.ui.model.storage.InMemoryStatsStorage; import org.junit.Ignore; import org.junit.Test; +import org.nd4j.common.function.Function; import org.nd4j.evaluation.classification.Evaluation; import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.api.buffer.DataType; @@ -62,52 +66,43 @@ import org.nd4j.linalg.lossfunctions.LossFunctions; import java.io.File; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.util.*; import java.util.concurrent.TimeUnit; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * Created by Alex on 19/07/2017. */ +@Slf4j public class TestBasic extends BaseDL4JTest { + @Override + public long getTimeoutMilliseconds() { + return 3600_000L; + } + @Test @Ignore public void testBasicUiOnly() throws Exception { UIServer.getInstance(); - Thread.sleep(1000000); + Thread.sleep(1000_000); } - @Test @Ignore public void testBasicMnist() throws Exception { Nd4j.setDefaultDataTypes(DataType.FLOAT, DataType.FLOAT); - MultiLayerSpace mls = new MultiLayerSpace.Builder() - .updater(new SgdSpace(new ContinuousParameterSpace(0.0001, 0.2))) - .l2(new ContinuousParameterSpace(0.0001, 0.05)) - .addLayer( - new ConvolutionLayerSpace.Builder().nIn(1) - .nOut(new IntegerParameterSpace(5, 30)) - .kernelSize(new DiscreteParameterSpace<>(new int[]{3, 3}, - new int[]{4, 4}, new int[]{5, 5})) - .stride(new DiscreteParameterSpace<>(new int[]{1, 1}, - new int[]{2, 2})) - .activation(new DiscreteParameterSpace<>(Activation.RELU, - Activation.SOFTPLUS, Activation.LEAKYRELU)) - .build()) - .addLayer(new DenseLayerSpace.Builder().nOut(new IntegerParameterSpace(32, 128)) - .activation(new DiscreteParameterSpace<>(Activation.RELU, Activation.TANH)) - .build(), new IntegerParameterSpace(0, 1), true) //0 to 1 layers - .addLayer(new OutputLayerSpace.Builder().nOut(10).activation(Activation.SOFTMAX) - .lossFunction(LossFunctions.LossFunction.MCXENT).build()) - .setInputType(InputType.convolutionalFlat(28, 28, 1)) - .build(); + MultiLayerSpace mls = getMultiLayerSpaceMnist(); Map<String, Object> commands = new HashMap<>(); // commands.put(DataSetIteratorFactoryProvider.FACTORY_KEY, TestDataFactoryProviderMnist.class.getCanonicalName()); @@ -144,7 +139,30 @@ public void testBasicMnist() throws Exception { UIServer.getInstance().attach(ss); runner.execute(); - Thread.sleep(100000); + Thread.sleep(1000_000); + } + + private static MultiLayerSpace getMultiLayerSpaceMnist() { + return new MultiLayerSpace.Builder() + .updater(new SgdSpace(new ContinuousParameterSpace(0.0001, 0.2))) + .l2(new ContinuousParameterSpace(0.0001, 0.05)) + .addLayer( + new ConvolutionLayerSpace.Builder().nIn(1) + .nOut(new IntegerParameterSpace(5, 30)) + .kernelSize(new DiscreteParameterSpace<>(new int[]{3, 3}, + new int[]{4, 4}, new int[]{5, 5})) + .stride(new DiscreteParameterSpace<>(new int[]{1, 1}, + new int[]{2, 2})) + .activation(new DiscreteParameterSpace<>(Activation.RELU, + Activation.SOFTPLUS, Activation.LEAKYRELU)) + .build()) + .addLayer(new DenseLayerSpace.Builder().nOut(new IntegerParameterSpace(32, 128)) + .activation(new DiscreteParameterSpace<>(Activation.RELU, Activation.TANH)) + .build(), new IntegerParameterSpace(0, 1), true) //0 to 1 layers + .addLayer(new OutputLayerSpace.Builder().nOut(10).activation(Activation.SOFTMAX) + .lossFunction(LossFunctions.LossFunction.MCXENT).build()) + .setInputType(InputType.convolutionalFlat(28, 28, 1)) + .build(); } @Test @@ -233,7 +251,7 @@ public void testBasicMnistCompGraph() throws Exception { .build(); //Define configuration: - CandidateGenerator candidateGenerator = new RandomSearchGenerator(cgs, Collections.EMPTY_MAP); + CandidateGenerator candidateGenerator = new RandomSearchGenerator(cgs); DataProvider dataProvider = new MnistDataSetProvider(); @@ -331,7 +349,7 @@ public void testCandidateGenerationExceptionsMnist() throws Exception { UIServer.getInstance().attach(ss); runner.execute(); - Thread.sleep(100000); + Thread.sleep(1000_000); } @@ -396,7 +414,7 @@ public void testCandidateExecutionExceptionsMnist() throws Exception { UIServer.getInstance().attach(ss); runner.execute(); - Thread.sleep(100000); + Thread.sleep(1000_000); } @@ -433,7 +451,7 @@ public void testExecutionExceptionMnistCompGraph() throws Exception { .build(); //Define configuration: - CandidateGenerator candidateGenerator = new RandomSearchGenerator(cgs, Collections.EMPTY_MAP); + CandidateGenerator candidateGenerator = new RandomSearchGenerator(cgs); DataProvider dataProvider = new MnistDataSetProvider(); @@ -465,13 +483,17 @@ public void testExecutionExceptionMnistCompGraph() throws Exception { UIServer.getInstance().attach(ss); runner.execute(); - Thread.sleep(100000); + Thread.sleep(1000_000); } + /** + * Visualize multiple optimization sessions run one after another on single-session mode UI + * @throws InterruptedException if current thread has been interrupted + */ @Test @Ignore - public void testBasicMnistMultipleSessions() throws Exception { + public void testBasicMnistMultipleSessions() throws InterruptedException { MultiLayerSpace mls = new MultiLayerSpace.Builder() .updater(new SgdSpace(new ContinuousParameterSpace(0.0001, 0.2))) @@ -499,8 +521,10 @@ public void testBasicMnistMultipleSessions() throws Exception { //Define configuration: CandidateGenerator candidateGenerator = new RandomSearchGenerator(mls, commands); - DataProvider dataProvider = new MnistDataSetProvider(); + Class<? extends DataSource> ds = MnistDataSource.class; + Properties dsp = new Properties(); + dsp.setProperty("minibatch", "8"); String modelSavePath = new File(System.getProperty("java.io.tmpdir"), "ArbiterUiTestBasicMnist\\").getAbsolutePath(); @@ -513,7 +537,7 @@ public void testBasicMnistMultipleSessions() throws Exception { OptimizationConfiguration configuration = new OptimizationConfiguration.Builder() - .candidateGenerator(candidateGenerator).dataProvider(dataProvider) + .candidateGenerator(candidateGenerator).dataSource(ds, dsp) .modelSaver(new FileModelSaver(modelSavePath)) .scoreFunction(new TestSetLossScoreFunction(true)) .terminationConditions(new MaxTimeCondition(1, TimeUnit.MINUTES), @@ -535,7 +559,7 @@ public void testBasicMnistMultipleSessions() throws Exception { candidateGenerator = new RandomSearchGenerator(mls, commands); configuration = new OptimizationConfiguration.Builder() - .candidateGenerator(candidateGenerator).dataProvider(dataProvider) + .candidateGenerator(candidateGenerator).dataSource(ds, dsp) .modelSaver(new FileModelSaver(modelSavePath)) .scoreFunction(new TestSetLossScoreFunction(true)) .terminationConditions(new MaxTimeCondition(1, TimeUnit.MINUTES), @@ -550,7 +574,148 @@ public void testBasicMnistMultipleSessions() throws Exception { runner.execute(); - Thread.sleep(100000); + Thread.sleep(1000_000); + } + + /** + * Auto-attach multiple optimization sessions to multi-session mode UI + * @throws IOException if could not connect to the server + */ + @Test + public void testUiMultiSessionAutoAttach() throws IOException { + + //Define configuration: + MultiLayerSpace mls = getMultiLayerSpaceMnist(); + CandidateGenerator candidateGenerator = new RandomSearchGenerator(mls); + + Class<? extends DataSource> ds = MnistDataSource.class; + Properties dsp = new Properties(); + dsp.setProperty("minibatch", "8"); + + String modelSavePath = new File(System.getProperty("java.io.tmpdir"), "ArbiterUiTestMultiSessionAutoAttach\\") + .getAbsolutePath(); + + File f = new File(modelSavePath); + if (f.exists()) + f.delete(); + f.mkdir(); + if (!f.exists()) + throw new RuntimeException(); + + OptimizationConfiguration configuration = + new OptimizationConfiguration.Builder() + .candidateGenerator(candidateGenerator).dataSource(ds, dsp) + .modelSaver(new FileModelSaver(modelSavePath)) + .scoreFunction(new TestSetLossScoreFunction(true)) + .terminationConditions(new MaxTimeCondition(10, TimeUnit.SECONDS), + new MaxCandidatesCondition(1)) + .build(); + + IOptimizationRunner runner = + new LocalOptimizationRunner(configuration, new MultiLayerNetworkTaskCreator()); + + // add 3 different sessions to the same execution + HashMap<String, StatsStorage> statsStorageForSession = new HashMap<>(); + for (int i = 0; i < 3; i++) { + StatsStorage ss = new InMemoryStatsStorage(); + @NonNull String sessionId = "sid" + i; + statsStorageForSession.put(sessionId, ss); + StatusListener sl = new ArbiterStatusListener(sessionId, ss); + runner.addListeners(sl); + } + + Function<String, StatsStorage> statsStorageProvider = statsStorageForSession::get; + UIServer uIServer = UIServer.getInstance(true, statsStorageProvider); + String serverAddress = uIServer.getAddress(); + + runner.execute(); + + for (String sessionId : statsStorageForSession.keySet()) { + /* + * Visiting /arbiter/:sessionId to auto-attach StatsStorage + */ + String sessionUrl = sessionUrl(uIServer.getAddress(), sessionId); + HttpURLConnection conn = (HttpURLConnection) new URL(sessionUrl).openConnection(); + conn.connect(); + + log.info("Checking auto-attaching Arbiter session at {}", sessionUrl(serverAddress, sessionId)); + assertEquals(HttpResponseStatus.OK.code(), conn.getResponseCode()); + assertTrue(uIServer.isAttached(statsStorageForSession.get(sessionId))); + } + } + + /** + * Attach multiple optimization sessions to multi-session mode UI by manually visiting session URL + * @throws Exception if an error occurred + */ + @Test + @Ignore + public void testUiMultiSessionManualAttach() throws Exception { + Nd4j.setDefaultDataTypes(DataType.FLOAT, DataType.FLOAT); + + //Define configuration: + MultiLayerSpace mls = getMultiLayerSpaceMnist(); + CandidateGenerator candidateGenerator = new RandomSearchGenerator(mls); + + Class<? extends DataSource> ds = MnistDataSource.class; + Properties dsp = new Properties(); + dsp.setProperty("minibatch", "8"); + + String modelSavePath = new File(System.getProperty("java.io.tmpdir"), "ArbiterUiTestBasicMnist\\") + .getAbsolutePath(); + + File f = new File(modelSavePath); + if (f.exists()) + f.delete(); + f.mkdir(); + if (!f.exists()) + throw new RuntimeException(); + + OptimizationConfiguration configuration = + new OptimizationConfiguration.Builder() + .candidateGenerator(candidateGenerator).dataSource(ds, dsp) + .modelSaver(new FileModelSaver(modelSavePath)) + .scoreFunction(new TestSetLossScoreFunction(true)) + .terminationConditions(new MaxTimeCondition(10, TimeUnit.MINUTES), + new MaxCandidatesCondition(10)) + .build(); + + + // parallel execution of multiple optimization sessions + HashMap<String, StatsStorage> statsStorageForSession = new HashMap<>(); + for (int i = 0; i < 3; i++) { + String sessionId = "sid" + i; + IOptimizationRunner runner = + new LocalOptimizationRunner(configuration, new MultiLayerNetworkTaskCreator()); + StatsStorage ss = new InMemoryStatsStorage(); + statsStorageForSession.put(sessionId, ss); + StatusListener sl = new ArbiterStatusListener(sessionId, ss); + runner.addListeners(sl); + // Asynchronous execution + new Thread(runner::execute).start(); + } + + Function<String, StatsStorage> statsStorageProvider = statsStorageForSession::get; + UIServer uIServer = UIServer.getInstance(true, statsStorageProvider); + String serverAddress = uIServer.getAddress(); + + for (String sessionId : statsStorageForSession.keySet()) { + log.info("Arbiter session can be attached at {}", sessionUrl(serverAddress, sessionId)); + } + + Thread.sleep(1000_000); + } + + + /** + * Get URL for arbiter session on given server address + * @param serverAddress server address, e.g.: http://localhost:9000 + * @param sessionId session ID (will be URL-encoded) + * @return URL + * @throws UnsupportedEncodingException if the character encoding is not supported + */ + private static String sessionUrl(String serverAddress, String sessionId) throws UnsupportedEncodingException { + return String.format("%s/arbiter/%s", serverAddress, URLEncoder.encode(sessionId, "UTF-8")); } private static class MnistDataSetProvider implements DataProvider { diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java index e42c60f9e9b3..7c6a27f4e1f2 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java @@ -77,8 +77,6 @@ private static Integer instancePort; private static Thread autoStopThread; - private TrainModule trainModule; - /** * Get (and, initialize if necessary) the UI server. This synchronous function will wait until the server started. * @param port TCP socket port for {@link HttpServer} to listen @@ -194,8 +192,9 @@ private static void deploy(Promise<String> startCallback) { VertxUIServer.autoStopThread = new Thread(() -> { try { currentThread.join(); - log.info("Deeplearning4j UI server is auto-stopping."); if (VertxUIServer.instance != null && !VertxUIServer.instance.isStopped()) { + log.info("Deeplearning4j UI server is auto-stopping after thread (name: {}) died.", + currentThread.getName()); instance.stop(); } } catch (InterruptedException e) { @@ -207,7 +206,11 @@ private static void deploy(Promise<String> startCallback) { private List<UIModule> uiModules = new CopyOnWriteArrayList<>(); private RemoteReceiverModule remoteReceiverModule; - private StatsStorageLoader statsStorageLoader; + /** + * Loader that attaches {@code StatsStorage} provided by {@code #statsStorageProvider} for the given session ID + */ + @Getter + private Function<String, Boolean> statsStorageLoader; //typeIDModuleMap: Records which modules are registered for which type IDs private Map<String, List<UIModule>> typeIDModuleMap = new ConcurrentHashMap<>(); @@ -247,10 +250,23 @@ private static void reset() { */ public void autoAttachStatsStorageBySessionId(Function<String, StatsStorage> statsStorageProvider) { if (statsStorageProvider != null) { - this.statsStorageLoader = new StatsStorageLoader(statsStorageProvider); - if (trainModule != null) { - this.trainModule.setSessionLoader(this.statsStorageLoader); - } + this.statsStorageLoader = (sessionId) -> { + log.info("Loading StatsStorage via StatsStorageProvider for session ID (" + sessionId + ")."); + StatsStorage statsStorage = statsStorageProvider.apply(sessionId); + if (statsStorage != null) { + if (statsStorage.sessionExists(sessionId)) { + attach(statsStorage); + return true; + } + log.info("Failed to load StatsStorage via StatsStorageProvider for session ID. " + + "Session ID (" + sessionId + ") does not exist in StatsStorage."); + return false; + } else { + log.info("Failed to load StatsStorage via StatsStorageProvider for session ID (" + sessionId + "). " + + "StatsStorageProvider returned null."); + return false; + } + }; } } @@ -302,8 +318,7 @@ public void start(Promise<Void> startCallback) throws Exception { } uiModules.add(new DefaultModule(isMultiSession())); //For: navigation page "/" - trainModule = new TrainModule(isMultiSession(), statsStorageLoader, this::getAddress); - uiModules.add(trainModule); + uiModules.add(new TrainModule()); uiModules.add(new ConvolutionalListenerModule()); uiModules.add(new TsneModule()); uiModules.add(new SameDiffModule()); @@ -596,37 +611,6 @@ private void runHelper() throws Exception { } } - /** - * Loader that attaches {@code StatsStorage} provided by {@code #statsStorageProvider} for the given session ID - */ - private class StatsStorageLoader implements Function<String, Boolean> { - - Function<String, StatsStorage> statsStorageProvider; - - StatsStorageLoader(Function<String, StatsStorage> statsStorageProvider) { - this.statsStorageProvider = statsStorageProvider; - } - - @Override - public Boolean apply(String sessionId) { - log.info("Loading StatsStorage via StatsStorageProvider for session ID (" + sessionId + ")."); - StatsStorage statsStorage = statsStorageProvider.apply(sessionId); - if (statsStorage != null) { - if (statsStorage.sessionExists(sessionId)) { - attach(statsStorage); - return true; - } - log.info("Failed to load StatsStorage via StatsStorageProvider for session ID. " + - "Session ID (" + sessionId + ") does not exist in StatsStorage."); - return false; - } else { - log.info("Failed to load StatsStorage via StatsStorageProvider for session ID (" + sessionId + "). " + - "StatsStorageProvider returned null."); - return false; - } - } - } - //================================================================================================================== // CLI Launcher diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/api/UIServer.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/api/UIServer.java index 81180990f752..2bc98c20c65b 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/api/UIServer.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/api/UIServer.java @@ -157,8 +157,9 @@ static void stopInstance() throws Exception { /** * Stop/shut down the UI server. This synchronous function should wait until the server is stopped. + * @throws InterruptedException if the current thread is interrupted while waiting */ - void stop() throws Exception; + void stop() throws InterruptedException; /** * Stop/shut down the UI server. diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java index 82cf33b77892..8bde827f5e9f 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/module/train/TrainModule.java @@ -26,8 +26,6 @@ import it.unimi.dsi.fastutil.longs.LongArrayList; import lombok.AllArgsConstructor; import lombok.Data; -import lombok.Getter; -import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; @@ -43,6 +41,7 @@ import org.deeplearning4j.nn.conf.graph.LayerVertex; import org.deeplearning4j.nn.conf.layers.*; import org.deeplearning4j.nn.conf.serde.JsonMappers; +import org.deeplearning4j.ui.VertxUIServer; import org.deeplearning4j.ui.api.HttpMethod; import org.deeplearning4j.ui.api.I18N; import org.deeplearning4j.ui.api.Route; @@ -56,7 +55,6 @@ import org.deeplearning4j.ui.model.stats.api.StatsReport; import org.deeplearning4j.ui.model.stats.api.StatsType; import org.nd4j.common.function.Function; -import org.nd4j.common.function.Supplier; import org.nd4j.linalg.learning.config.IUpdater; import org.nd4j.common.primitives.Pair; import org.nd4j.common.primitives.Triple; @@ -86,8 +84,6 @@ private static final DecimalFormat df2 = new DecimalFormat("#.00"); private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - private final Supplier<String> addressSupplier; - private enum ModelType { MLN, CG, Layer } @@ -99,29 +95,14 @@ private Map<String, AtomicInteger> workerIdxCount = new ConcurrentHashMap<>(); //Key: session ID private Map<String, Map<Integer, String>> workerIdxToName = new ConcurrentHashMap<>(); //Key: session ID private Map<String, Long> lastUpdateForSession = new ConcurrentHashMap<>(); - private final boolean multiSession; - @Getter @Setter - private Function<String, Boolean> sessionLoader; private final Configuration configuration; - public TrainModule() { - this(false, null, null); - } - /** * TrainModule - * - * @param multiSession multi-session mode - * @param sessionLoader StatsStorage loader to call if an unknown session ID is passed as URL path parameter - * in multi-session mode - * @param addressSupplier supplier for server address (server address in PlayUIServer gets initialized after modules) */ - public TrainModule(boolean multiSession, Function<String, Boolean> sessionLoader, Supplier<String> addressSupplier) { - this.multiSession = multiSession; - this.sessionLoader = sessionLoader; - this.addressSupplier = addressSupplier; + public TrainModule() { String maxChartPointsProp = System.getProperty(DL4JSystemProperties.CHART_MAX_POINTS_PROPERTY); int value = DEFAULT_MAX_CHART_POINTS; if (maxChartPointsProp != null) { @@ -159,8 +140,9 @@ public TrainModule(boolean multiSession, Function<String, Boolean> sessionLoader @Override public List<Route> getRoutes() { List<Route> r = new ArrayList<>(); - r.add(new Route("/train/multisession", HttpMethod.GET, (path, rc) -> rc.response().end(multiSession ? "true" : "false"))); - if (multiSession) { + r.add(new Route("/train/multisession", HttpMethod.GET, + (path, rc) -> rc.response().end(VertxUIServer.getInstance().isMultiSession() ? "true" : "false"))); + if (VertxUIServer.getInstance().isMultiSession()) { r.add(new Route("/train", HttpMethod.GET, (path, rc) -> this.listSessions(rc))); r.add(new Route("/train/:sessionId", HttpMethod.GET, (path, rc) -> { rc.response() @@ -264,7 +246,9 @@ private synchronized void listSessions(RoutingContext rc) { if (!knownSessionIDs.isEmpty()) { sb.append(" <ul>"); for (String sessionId : knownSessionIDs.keySet()) { - sb.append(" <li><a href=\"train/").append(sessionId).append("\">").append(sessionId).append("</a></li>\n"); + sb.append(" <li><a href=\"/train/") + .append(sessionId).append("\">") + .append(sessionId).append("</a></li>\n"); } sb.append(" </ul>"); } else { @@ -284,9 +268,11 @@ private synchronized void listSessions(RoutingContext rc) { * * @param sessionId session ID to look fo with provider * @param targetPath one of overview / model / system, or null + * @param rc routing context */ private void sessionNotFound(String sessionId, String targetPath, RoutingContext rc) { - if (sessionLoader != null && sessionLoader.apply(sessionId)) { + Function<String, Boolean> loader = VertxUIServer.getInstance().getStatsStorageLoader(); + if (loader != null && loader.apply(sessionId)) { if (targetPath != null) { rc.reroute(targetPath); } else { @@ -306,9 +292,9 @@ public synchronized void reportStorageEvents(Collection<StatsStorageEvent> event && StatsListener.TYPE_ID.equals(sse.getTypeID()) && !knownSessionIDs.containsKey(sse.getSessionID())) { knownSessionIDs.put(sse.getSessionID(), sse.getStatsStorage()); - if (multiSession) { + if (VertxUIServer.getInstance().isMultiSession()) { log.info("Adding training session {}/train/{} of StatsStorage instance {}", - addressSupplier.get(), sse.getSessionID(), sse.getStatsStorage()); + VertxUIServer.getInstance().getAddress(), sse.getSessionID(), sse.getStatsStorage()); } } @@ -332,9 +318,9 @@ public synchronized void onAttach(StatsStorage statsStorage) { if (!StatsListener.TYPE_ID.equals(typeID)) continue; knownSessionIDs.put(sessionID, statsStorage); - if (multiSession) { + if (VertxUIServer.getInstance().isMultiSession()) { log.info("Adding training session {}/train/{} of StatsStorage instance {}", - addressSupplier.get(), sessionID, statsStorage); + VertxUIServer.getInstance().getAddress(), sessionID, statsStorage); } List<Persistable> latestUpdates = statsStorage.getLatestUpdateAllWorkers(sessionID, typeID); @@ -364,9 +350,9 @@ public synchronized void onDetach(StatsStorage statsStorage) { } for (String s : toRemove) { knownSessionIDs.remove(s); - if (multiSession) { + if (VertxUIServer.getInstance().isMultiSession()) { log.info("Removing training session {}/train/{} of StatsStorage instance {}.", - addressSupplier.get(), s, statsStorage); + VertxUIServer.getInstance().getAddress(), s, statsStorage); } lastUpdateForSession.remove(s); } @@ -602,13 +588,13 @@ private Long getLastUpdateTime(String sessionId) { } /** - * Get global {@link I18N} instance if {@link #multiSession} is {@code true}, or instance for session + * Get global {@link I18N} instance if {@link VertxUIServer#isMultiSession()} is {@code true}, or instance for session * * @param sessionId session ID * @return {@link I18N} instance */ private I18N getI18N(String sessionId) { - return multiSession ? I18NProvider.getInstance(sessionId) : I18NProvider.getInstance(); + return VertxUIServer.getInstance().isMultiSession() ? I18NProvider.getInstance(sessionId) : I18NProvider.getInstance(); } diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIManual.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIManual.java index c47abbe61130..7fb0a041ef6f 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIManual.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIManual.java @@ -40,7 +40,7 @@ public class TestVertxUIManual extends BaseDL4JTest { @Override - public long getTimeoutMilliseconds() { + public long getTimeoutMilliseconds() { return 3600_000L; } @@ -259,7 +259,7 @@ public StatsStorage apply(String sessionId) { log.info("Auto-detaching StatsStorage (session ID: {}) after {} ms.", sessionId, autoDetachTimeoutMillis); uIServer.detach(statsStorage); - log.info(" To re-attach StatsStorage of training session, visit {}}/train/{}", + log.info(" To re-attach StatsStorage of training session, visit {}/train/{}", uIServer.getAddress(), sessionId); } }).start(); diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java index c9577d4a323f..0f3f50d41b86 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java @@ -197,9 +197,9 @@ public void testUIServerGetInstanceMultipleCalls2() { } /** - * Get URL-encoded URL for training session on given server address + * Get URL for training session on given server address * @param serverAddress server address - * @param sessionId session ID + * @param sessionId session ID (will be URL-encoded) * @return URL * @throws UnsupportedEncodingException if the used encoding is not supported */
0
29fd1107fd30579ad9bb23fae4dc3ba464205745
https://github.com/weld/core/commit/29fd1107fd30579ad9bb23fae4dc3ba464205745
WELD-1802 RequestScopedCache - Testcase
diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/ConversationScopedBean.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/ConversationScopedBean.java new file mode 100644 index 00000000000..bd4f8c2b787 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/ConversationScopedBean.java @@ -0,0 +1,33 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2014, Red Hat, Inc., and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.weld.tests.contexts.cache; + +import java.io.Serializable; + +import javax.enterprise.context.ConversationScoped; + +@ConversationScoped +public class ConversationScopedBean implements Serializable { + + private String value = "foo"; + + public String getAndSet(String newValue) { + String old = value; + value = newValue; + return old; + } +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/RequestScopedCacheLeakTest.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/RequestScopedCacheLeakTest.java new file mode 100644 index 00000000000..bba9b820e44 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/RequestScopedCacheLeakTest.java @@ -0,0 +1,80 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2014, Red Hat, Inc., and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.weld.tests.contexts.cache; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import junit.framework.Assert; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.weld.tests.category.Integration; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; + +@RunWith(Arquillian.class) +@Category(Integration.class) +public class RequestScopedCacheLeakTest { + + @ArquillianResource + private URL contextPath; + + @Deployment(testable = false) + public static WebArchive getDeployment() { + return ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") + .addClasses(SimpleServlet.class, ConversationScopedBean.class); + } + + @Test + public void test() throws Exception { + WebClient webClient = new WebClient(); + webClient.setThrowExceptionOnFailingStatusCode(false); + for (int i = 0; i < 100; i++) { + // first, send out a hundred of poisoning requests + // each of these should leave a thread in a broken state + sendRequest(webClient, i, true); + } + for (int i = 0; i < 100; i++) { + // now send out normal requests to see if they are affected by the thread's broken state + String result = sendRequest(webClient, i, false); + Assert.assertFalse("Invalid state detected after " + (i + 1) + " requests", result.startsWith("bar")); + } + } + + private String sendRequest(WebClient webClient, int sequence, boolean poison) throws FailingHttpStatusCodeException, MalformedURLException, IOException { + final String path = getPath("getAndSet", sequence, poison); + return webClient.getPage(path).getWebResponse().getContentAsString().trim(); + } + + private String getPath(String test, int sequence, boolean poison) { + String path = contextPath + "/servlet?action=" + test + "&sequence=" + sequence; + if (poison) { + path += "&poison=true"; + } + return path; + } +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/SimpleServlet.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/SimpleServlet.java new file mode 100644 index 00000000000..93a114a1463 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/cache/SimpleServlet.java @@ -0,0 +1,55 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2014, Red Hat, Inc., and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.weld.tests.contexts.cache; + +import java.io.IOException; + +import javax.inject.Inject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.jboss.weld.context.beanstore.ConversationNamingScheme; + +@WebServlet(value = "/servlet", asyncSupported = true) +public class SimpleServlet extends HttpServlet { + + @Inject + private ConversationScopedBean bean; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + String action = req.getParameter("action"); + String sequence = req.getParameter("sequence"); + String poison = req.getParameter("poison"); + if ("getAndSet".equals(action)) { + // the value should always be foo + String value = bean.getAndSet("bar" + sequence); + resp.getWriter().println(value); + if (poison != null) { + // this is a poisoning request + // normal applications should never do something like this + // we just do this to cause an exception to be thrown out of ConversationContext.deactivate + req.removeAttribute(ConversationNamingScheme.PARAMETER_NAME); + } + } else { + throw new IllegalArgumentException(action); + } + } +}
1
f7b1e051bd283a41ce83cc451232736bc5f50cb2
https://github.com/Yubico/yubico-pam/commit/f7b1e051bd283a41ce83cc451232736bc5f50cb2
Merge branch 'pr-188'
diff --git a/pam_yubico.c b/pam_yubico.c index 30ee6ec..f8ba801 100644 --- a/pam_yubico.c +++ b/pam_yubico.c @@ -145,6 +145,13 @@ struct cfg #endif #define DBG(x...) if (cfg->debug) { D(cfg->debug_file, x); } +/* Helper to free memory used by pam_set_data */ +static void +setcred_free (pam_handle_t *pamh, void *ptr, int err) +{ + free (ptr); +} + /* * Authorize authenticated OTP_ID for login as USERNAME using AUTHFILE. * @@ -1291,7 +1298,21 @@ pam_sm_authenticate (pam_handle_t * pamh, retval = PAM_SUCCESS; } DBG ("done. [%s]", pam_strerror (pamh, retval)); - pam_set_data (pamh, "yubico_setcred_return", (void*)(intptr_t)retval, NULL); + + int* pretval = malloc (sizeof(int)); + if (pretval) + { + *pretval = retval; + if (pam_set_data (pamh, "yubico_setcred_return", (void*)pretval, + setcred_free) != PAM_SUCCESS) + { + DBG ("pam_set_data failed setting setcred_return: %d", retval); + } + } + else + { + DBG ("Failed allocating memory for setcred_return status"); + } if (resp) { @@ -1326,11 +1347,12 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) { struct cfg cfg_st; struct cfg *cfg = &cfg_st; /* for DBG macro */ - int retval; - int rc = pam_get_data(pamh, "yubico_setcred_return", (const void**)&retval); + int retval = PAM_AUTH_ERR; + const void *pretval = NULL; + int rc = pam_get_data (pamh, "yubico_setcred_return", &pretval); parse_cfg (flags, argc, argv, cfg); - if (rc == PAM_SUCCESS && retval == PAM_SUCCESS) { + if (rc == PAM_SUCCESS && pretval && *(const int *)pretval == PAM_SUCCESS) { DBG ("pam_sm_acct_mgmt returning PAM_SUCCESS"); retval = PAM_SUCCESS; } else {
0
fa2aa9bf9722b000e194959cc4c95df2f3ea4155
https://github.com/jaredhanson/oauth2orize-fprm/commit/fa2aa9bf9722b000e194959cc4c95df2f3ea4155
Update README.
diff --git a/README.md b/README.md index 1e4f30a..c8aa1b5 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,6 @@ providing support for [Form Post Response Mode](https://openid.net/specs/oauth-v This response mode uses the HTTP POST method instead of a redirect URI to return authorization responses from the authorization server. ---- - -<p align="center"><a href="//pluralsight.pxf.io/c/1312135/448522/7490">Start a 10-day free trial at Pluralsight - Over 5,000 Courses Available</a></p> - ---- - Status: [![Version](https://img.shields.io/npm/v/oauth2orize-fprm.svg?label=version)](https://www.npmjs.com/package/oauth2orize-fprm) [![Build](https://img.shields.io/travis/jaredhanson/oauth2orize-fprm.svg)](https://travis-ci.org/jaredhanson/oauth2orize-fprm)
0
cf570c22c6679e94f24ed52a653b3541479a3cdc
https://github.com/qutebrowser/qutebrowser/commit/cf570c22c6679e94f24ed52a653b3541479a3cdc
Fix minor argument parsing issues - Move desktop-file-name before special arguments. - Set action=store_true to not expect an argument for temp-basedir-restarted (didn't lead to a bug as it's only passed via --json-args).
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index d7e0971b32a..757a6bf2870 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -60,6 +60,9 @@ Fixed done by `open_url_in_instance.sh`, this would result in a partially initialized window, causing a crash when interacted with (also in versions before v2.0.0). Instead, the startpage is now shown properly. +- The `--enable-webengine-inspector` flag is now accepted again, however it's + unused and undocumented. It purely exists to make it possible to use `:restart` + between pre-v2.0.x and v2.0.2 versions. [[v2.0.1]] v2.0.1 (2021-01-28) diff --git a/qutebrowser/qutebrowser.py b/qutebrowser/qutebrowser.py index cf3e7497e9a..64c17529363 100644 --- a/qutebrowser/qutebrowser.py +++ b/qutebrowser/qutebrowser.py @@ -82,9 +82,16 @@ def get_argparser(): "qutebrowser instance running.") parser.add_argument('--backend', choices=['webkit', 'webengine'], help="Which backend to use.") + parser.add_argument('--desktop-file-name', + default="org.qutebrowser.qutebrowser", + help="Set the base name of the desktop entry for this " + "application. Used to set the app_id under Wayland. See " + "https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop") parser.add_argument('--json-args', help=argparse.SUPPRESS) - parser.add_argument('--temp-basedir-restarted', help=argparse.SUPPRESS) + parser.add_argument('--temp-basedir-restarted', + help=argparse.SUPPRESS, + action='store_true') # WORKAROUND to be able to restart from older qutebrowser versions into this one. # Should be removed at some point. @@ -92,12 +99,6 @@ def get_argparser(): help=argparse.SUPPRESS, action='store_true') - parser.add_argument('--desktop-file-name', - default="org.qutebrowser.qutebrowser", - help="Set the base name of the desktop entry for this " - "application. Used to set the app_id under Wayland. See " - "https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop") - debug = parser.add_argument_group('debug arguments') debug.add_argument('-l', '--loglevel', dest='loglevel', help="Override the configured console loglevel",
0
201162775ae48c1ac364c4af500b85f8224756c4
https://github.com/silnrsi/graphite/commit/201162775ae48c1ac364c4af500b85f8224756c4
Add cmake code to retarget fuzzing engine for oss-fuzz support
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ce7d771..496712d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option(GRAPHITE2_NFILEFACE "Compile out the gr_make_file_face* APIs") option(GRAPHITE2_NTRACING "Compile out log segment tracing capability" ON) option(GRAPHITE2_TELEMETRY "Add memory usage telemetry") set(GRAPHITE2_SANITIZERS "" CACHE STRING "Set compiler sanitizers passed to -fsanitize") +set(GRAPHITE2_FUZZING_ENGINE libFuzzer.a CACHE STRING "Fuzzing engine to link against for the fuzzers") message(STATUS "Build: " ${CMAKE_BUILD_TYPE}) string(REPLACE "ON" "shared" _LIB_OBJECT_TYPE ${BUILD_SHARED_LIBS}) diff --git a/tests/fuzz-tests/CMakeLists.txt b/tests/fuzz-tests/CMakeLists.txt index f750edf6..df0d27ff 100644 --- a/tests/fuzz-tests/CMakeLists.txt +++ b/tests/fuzz-tests/CMakeLists.txt @@ -48,14 +48,14 @@ if (GRAPHITE2_SANITIZERS MATCHES "fuzzer") LINKER_LANGUAGE C COMPILE_FLAGS "-fsanitize=address,${GRAPHITE2_SANITIZERS} -g -O1 -Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wctor-dtor-privacy -Wnon-virtual-dtor" LINK_FLAGS "-fsanitize=address,${GRAPHITE2_SANITIZERS}") - target_link_libraries(gr-fuzzer-segment graphite2 graphite2-base libFuzzer.a) + target_link_libraries(gr-fuzzer-segment graphite2 graphite2-base ${GRAPHITE2_FUZZING_ENGINE}) add_executable(gr-fuzzer-font gr-fuzzer-font.cpp) set_target_properties(gr-fuzzer-font PROPERTIES LINKER_LANGUAGE C COMPILE_FLAGS "-fsanitize=address,${GRAPHITE2_SANITIZERS} -g -O1 -Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wctor-dtor-privacy -Wnon-virtual-dtor " LINK_FLAGS "-fsanitize=address,${GRAPHITE2_SANITIZERS}") - target_link_libraries(gr-fuzzer-font graphite2 graphite2-base libFuzzer.a) + target_link_libraries(gr-fuzzer-font graphite2 graphite2-base ${GRAPHITE2_FUZZING_ENGINE}) endif () #add_test(NAME graphite-fuzzer COMMAND $<TARGET_FILE:${TESTNAME}> ${ARGN})
0
d6e60740d9e4f64b986a21812d2f0021488e8ae3
https://github.com/fabpot/Twig/commit/d6e60740d9e4f64b986a21812d2f0021488e8ae3
added missing phpdoc
diff --git a/lib/Twig/SourceContextLoaderInterface.php b/lib/Twig/SourceContextLoaderInterface.php index 9c60220a3e..bb4115e801 100644 --- a/lib/Twig/SourceContextLoaderInterface.php +++ b/lib/Twig/SourceContextLoaderInterface.php @@ -24,6 +24,8 @@ interface Twig_SourceContextLoaderInterface * @param string $name The template logical name * * @return Twig_Source + * + * @throws Twig_Error_Loader When $name is not found */ public function getSourceContext($name); }
0
90e0454bbe22ddaa9998bf3cc9e3f6c0f5b5ce62
https://github.com/tornadoweb/tornado/commit/90e0454bbe22ddaa9998bf3cc9e3f6c0f5b5ce62
Merge pull request #2928 from bdarnell/relnotes61 Add release notes for 6.1, bump version to 6.1b1
diff --git a/docs/index.rst b/docs/index.rst index 7ba5cbf75b..8a663c307c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -120,13 +120,6 @@ is limited (Even though Tornado is built on ``asyncio``, which supports Windows, Tornado does not use the APIs that are necessary for scalable networking on Windows). -On Windows, Tornado requires the ``WindowsSelectorEventLoop``. This is -the default in Python 3.7 and older, but Python 3.8 defaults to an -event loop that is not compatible with Tornado. Applications that use -Tornado on Windows with Python 3.8 must call -``asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())`` -at the beginning of their ``main`` file/function. - Documentation ------------- diff --git a/docs/releases.rst b/docs/releases.rst index 81babaa3e1..a478821d78 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -4,6 +4,7 @@ Release notes .. toctree:: :maxdepth: 2 + releases/v6.1.0 releases/v6.0.4 releases/v6.0.3 releases/v6.0.2 diff --git a/docs/releases/v6.1.0.rst b/docs/releases/v6.1.0.rst new file mode 100644 index 0000000000..02289ab570 --- /dev/null +++ b/docs/releases/v6.1.0.rst @@ -0,0 +1,94 @@ +What's new in Tornado 6.1.0 +=========================== + +Oct X, 2020 +----------- + +General changes +~~~~~~~~~~~~~~~ + +- Windows support has been improved. Tornado is now compatible with the proactor + event loop (which became the default in Python 3.8) by automatically falling + back to running a selector in a second thread. This means that it is no longer + necessary to explicitly configure a selector event loop, although doing so may + improve performance. This does not change the fact that Tornado is significantly + less scalable on Windows than on other platforms. +- Binary wheels are now provided for Windows, MacOS, and Linux (amd64 and arm64). + +`tornado.http1connection` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``HEAD`` requests to handlers that used chunked encoding no longer produce malformed output. +- Certain kinds of malformed ``gzip`` data no longer cause an infinite loop. + +`tornado.httpclient` +~~~~~~~~~~~~~~~~~~~~ + +- Setting ``decompress_response=False`` now works correctly with + ``curl_httpclient``. +- Mixing requests with and without proxies works correctly in ``curl_httpclient`` + (assuming the version of pycurl is recent enough). +- A default ``User-Agent`` of ``Tornado/$VERSION`` is now used if the + ``user_agent`` parameter is not specified. +- After a 303 redirect, ``tornado.simple_httpclient`` always uses ``GET``. + Previously this would use ``GET`` if the original request was a ``POST`` and + would otherwise reuse the original request method. For ``curl_httpclient``, the + behavior depends on the version of ``libcurl`` (with the most recent versions + using ``GET`` after 303 regardless of the original method). +- Setting ``request_timeout`` and/or ``connect_timeout`` to zero is now supported + to disable the timeout. + +`tornado.httputil` +~~~~~~~~~~~~~~~~~~ + +- Header parsing is now faster. +- `.parse_body_arguments` now accepts incompletely-escaped non-ASCII inputs. + +`tornado.iostream` +~~~~~~~~~~~~~~~~~~ + +- `ssl.CertificateError` during the SSL handshake is now handled correctly. +- Reads that are resolved while the stream is closing are now handled correctly. + +`tornado.log` +~~~~~~~~~~~~~ + +- When colored logging is enabled, ``logging.CRITICAL`` messages are now + recognized and colored magenta. + +`tornado.netutil` +~~~~~~~~~~~~~~~~~ + +- ``EADDRNOTAVAIL`` is now ignored when binding to ``localhost`` with IPv6. This + error is common in docker. + +`tornado.platform.asyncio` +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- `.AnyThreadEventLoopPolicy` now also configures a selector event loop for + these threads (the proactor event loop only works on the main thread) + +``tornado.platform.auto`` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- The ``set_close_exec`` function has been removed. + +`tornado.testing` +~~~~~~~~~~~~~~~~~ + +- `.ExpectLog` now has a ``level`` argument to ensure that the given log level + is enabled. + +`tornado.web` +~~~~~~~~~~~~~ + +- ``RedirectHandler.get`` now accepts keyword arguments. +- When sending 304 responses, more headers (including ``Allow``) are now preserved. +- ``reverse_url`` correctly handles escaped characters in the regex route. +- Default ``Etag`` headers are now generated with SHA-512 instead of MD5. + +`tornado.websocket` +~~~~~~~~~~~~~~~~~~~ + +- The ``ping_interval`` timer is now stopped when the connection is closed. +- `.websocket_connect` now raises an error when it encounters a redirect instead of hanging. diff --git a/tornado/__init__.py b/tornado/__init__.py index c053149d04..ca162bff67 100644 --- a/tornado/__init__.py +++ b/tornado/__init__.py @@ -22,5 +22,5 @@ # is zero for an official release, positive for a development branch, # or negative for a release candidate or beta (after the base version # number has been incremented) -version = "6.1.dev1" -version_info = (6, 1, 0, -100) +version = "6.1b1" +version_info = (6, 1, 0, -99) diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index fc88f918e6..633a35f9c6 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -14,9 +14,12 @@ .. note:: - Tornado requires the `~asyncio.AbstractEventLoop.add_reader` family of - methods, so it is not compatible with the `~asyncio.ProactorEventLoop` on - Windows. Use the `~asyncio.SelectorEventLoop` instead. + Tornado is designed to use a selector-based event loop. On Windows, + where a proactor-based event loop has been the default since Python 3.8, + a selector event loop is emulated by running ``select`` on a separate thread. + Configuring ``asyncio`` to use a selector event loop may improve performance + of Tornado (but may reduce performance of other ``asyncio``-based libraries + in the same process). """ import asyncio
0
ca87bf766cdc70179cb2dce03015d78ec9c13ebd
https://github.com/redmine/redmine/commit/ca87bf766cdc70179cb2dce03015d78ec9c13ebd
mercurial: reject malicious command argument (#27516) We've got a security report from the Phabricator team, which basically says --config and --debugger arguments can be injected anywhere to lead to an arbitrary command execution. https://secure.phabricator.com/rPa7921a4448093d00defa8bd18f35b8c8f8bf3314 This is a fundamental issue of the argument parsing rules in Mercurial, which allows extensions to populate their parsing rules and such extensions can be loaded by "--config extensions.<name>=". There's a chicken and egg problem. We're working on hardening the parsing rules, but which won't come in by default as it would be a behavior change. This patch adds a verification to reject malicious command arguments as a last ditch. The subsequent patches will fix the problem in more appropriate way. Contributed by Yuya Nishihara. git-svn-id: http://svn.redmine.org/redmine/trunk@17060 e93f8b46-1217-0410-a6f0-8f06a7374b81
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index 064849f9453..2c712135664 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -32,6 +32,8 @@ class MercurialAdapter < AbstractAdapter # raised if hg command exited with error, e.g. unknown revision. class HgCommandAborted < CommandFailed; end + # raised if bad command argument detected before executing hg. + class HgCommandArgumentError < CommandFailed; end class << self def client_command @@ -286,8 +288,21 @@ def format_identifier end end + # command options which may be processed earlier, by faulty parser in hg + HG_EARLY_BOOL_ARG = /^--(debugger|profile|traceback)$/ + HG_EARLY_LIST_ARG = /^(--(config|cwd|repo(sitory)?)\b|-R)/ + private_constant :HG_EARLY_BOOL_ARG, :HG_EARLY_LIST_ARG + # Runs 'hg' command with the given args def hg(*args, &block) + # as of hg 4.4.1, early parsing of bool options is not terminated at '--' + if args.any? { |s| s =~ HG_EARLY_BOOL_ARG } + raise HgCommandArgumentError, "malicious command argument detected" + end + if args.take_while { |s| s != '--' }.any? { |s| s =~ HG_EARLY_LIST_ARG } + raise HgCommandArgumentError, "malicious command argument detected" + end + repo_path = root_url || url full_args = ['-R', repo_path, '--encoding', 'utf-8'] full_args << '--config' << "extensions.redminehelper=#{HG_HELPER_EXT}" diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb index 0512cc74ce3..e0458ce55a5 100644 --- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb @@ -21,6 +21,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase HELPERS_DIR = Redmine::Scm::Adapters::MercurialAdapter::HELPERS_DIR TEMPLATE_NAME = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_NAME TEMPLATE_EXTENSION = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_EXTENSION + HgCommandArgumentError = Redmine::Scm::Adapters::MercurialAdapter::HgCommandArgumentError REPOSITORY_PATH = repository_path('mercurial') CHAR_1_HEX = "\xc3\x9c" @@ -443,6 +444,24 @@ def test_path_encoding_default_utf8 assert_equal "UTF-8", adpt2.path_encoding end + def test_bad_early_options + assert_raise HgCommandArgumentError do + @adapter.diff('sources/welcome_controller.rb', '--config=alias.rhdiff=!xterm') + end + assert_raise HgCommandArgumentError do + @adapter.entries('--debugger') + end + assert_raise HgCommandArgumentError do + @adapter.revisions(nil, nil, nil, limit: '--repo=otherrepo') + end + assert_raise HgCommandArgumentError do + @adapter.nodes_in_branch('default', limit: '--repository=otherrepo') + end + assert_raise HgCommandArgumentError do + @adapter.nodes_in_branch('-Rotherrepo') + end + end + private def test_hgversion_for(hgversion, version)
1
a808859a75c59ae3b7568f5cc4708c53462aa4c7
https://github.com/OTRS/otrs/commit/a808859a75c59ae3b7568f5cc4708c53462aa4c7
Improved HTML filter.
diff --git a/Kernel/System/HTMLUtils.pm b/Kernel/System/HTMLUtils.pm index f2339f0ee08..75d107ed4a8 100644 --- a/Kernel/System/HTMLUtils.pm +++ b/Kernel/System/HTMLUtils.pm @@ -1163,10 +1163,28 @@ sub Safety { }egsxim; } + # Remove malicious CSS content + $Tag =~ s{ + (\s)style=("|') (.*?) \2 + } + { + my ($Space, $Delimiter, $Content) = ($1, $2, $3); + + if ( + ($Param{NoIntSrcLoad} && $Content =~ m{url\(}) + || ($Param{NoExtSrcLoad} && $Content =~ m/(http|ftp|https):\//i)) { + $Replaced = 1; + ''; + } + else { + "${Space}style=${Delimiter}${Content}${Delimiter}"; + } + }egsxim; + # remove load tags if ($Param{NoIntSrcLoad} || $Param{NoExtSrcLoad}) { $Tag =~ s{ - ($TagStart (.+?) (?: \s | /) src=(.+?) (\s.+?|) $TagEnd) + ($TagStart (.+?) (?: \s | /) (?:src|poster)=(.+?) (\s.+?|) $TagEnd) } { my $URL = $3; diff --git a/scripts/test/HTMLUtils/Safety.t b/scripts/test/HTMLUtils/Safety.t index 5459ea938aa..15ade5c3183 100644 --- a/scripts/test/HTMLUtils/Safety.t +++ b/scripts/test/HTMLUtils/Safety.t @@ -816,6 +816,116 @@ You should be able to continue reading these lessons, however. Replace => 0, }, }, + { + Name => 'Safety - remote poster attribute, forbidden', + Input => '<video controls poster="http://some.domain/vorschaubild.png"/>', + Config => { + NoExtSrcLoad => 1, + }, + Result => { + Output => '', + Replace => 1, + }, + }, + { + Name => 'Safety - remote poster attribute, allowed', + Input => '<video controls poster="http://some.domain/vorschaubild.png"/>', + Config => { + NoExtSrcLoad => 0, + }, + Result => { + Output => '<video controls poster="http://some.domain/vorschaubild.png"/>', + Replace => 0, + }, + }, + { + Name => 'Safety - malicious CSS content - remote background image, forbidden', + Input => '<a href="localhost" style="background-image:url(http://localhost:8000/css-background)">localhost</a>', + Config => { + NoExtSrcLoad => 1, + }, + Result => { + Output => '<a href="localhost">localhost</a>', + Replace => 1, + }, + }, + { + Name => 'Safety - malicious CSS content - remote background image, allowed', + Input => '<a href="localhost" style="background-image:url(http://localhost:8000/css-background)">localhost</a>', + Config => { + NoExtSrcLoad => 0, + }, + Result => { + Output => '<a href="localhost" style="background-image:url(http://localhost:8000/css-background)">localhost</a>', + Replace => 0, + }, + }, + { + Name => 'Safety - malicious CSS content - local background image, forbidden', + Input => '<a href="localhost" style="background-image:url(/local/css-background)">localhost</a>', + Config => { + NoIntSrcLoad => 1, + }, + Result => { + Output => '<a href="localhost">localhost</a>', + Replace => 1, + }, + }, + { + Name => 'Safety - malicious CSS content - local background image, allowed', + Input => '<a href="localhost" style="background-image:url(/local/css-background)">localhost</a>', + Config => { + NoIntSrcLoad => 0, + }, + Result => { + Output => '<a href="localhost" style="background-image:url(/local/css-background)">localhost</a>', + Replace => 0, + }, + }, + { + Name => 'Safety - malicious CSS content - remote css content, forbidden', + Input => q|<p style="content:url('http://localhost:8000/css-content');"></p>|, + Config => { + NoExtSrcLoad => 1, + }, + Result => { + Output => '<p></p>', + Replace => 1, + }, + }, + { + Name => 'Safety - malicious CSS content - remote css content, allowed', + Input => q|<p style="content:url('http://localhost:8000/css-content');"></p>|, + Config => { + NoExtSrcLoad => 0, + }, + Result => { + Output => q|<p style="content:url('http://localhost:8000/css-content');"></p>|, + Replace => 0, + }, + }, + { + Name => 'Safety - malicious CSS content - local css content, forbidden', + Input => q|<p style="content:url('/local/css-content');"></p>|, + Config => { + NoIntSrcLoad => 1, + }, + Result => { + Output => '<p></p>', + Replace => 1, + }, + }, + { + Name => 'Safety - malicious CSS content - local css content, allowed', + Input => q|<p style="content:url('/local/css-content');"></p>|, + Config => { + NoIntSrcLoad => 0, + }, + Result => { + Output => q|<p style="content:url('/local/css-content');"></p>|, + Replace => 0, + }, + }, ); for my $Test (@Tests) {
1
2566eeafdcbcadbfd7257796fcffc65d0a733e41
https://github.com/irmen/Pyro3/commit/2566eeafdcbcadbfd7257796fcffc65d0a733e41
Create .gitignore
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d2d6f36 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject
0
5a8080a077c298efc9917f7126503e99b9adb60b
https://github.com/bmizerany/sinatra/commit/5a8080a077c298efc9917f7126503e99b9adb60b
sometimes puma does not log in test mode
diff --git a/test/integration_helper.rb b/test/integration_helper.rb index f36082bdb4..d9548e3f94 100644 --- a/test/integration_helper.rb +++ b/test/integration_helper.rb @@ -126,6 +126,10 @@ def thin? name.to_s == "thin" end + def puma? + name.to_s == "puma" + end + def warnings log.scan(%r[(?:\(eval|lib/sinatra).*warning:.*$]) end diff --git a/test/integration_test.rb b/test/integration_test.rb index 49fe8ac247..51f0da2aac 100644 --- a/test/integration_test.rb +++ b/test/integration_test.rb @@ -13,6 +13,7 @@ class IntegrationTest < Test::Unit::TestCase it('only extends main') { assert_equal "true", server.get("/mainonly") } it 'logs once in development mode' do + next if server.puma? random = "%064x" % Kernel.rand(2**256-1) server.get "/ping?x=#{random}" count = server.log.scan("GET /ping?x=#{random}").count
0
69cecd1bf670a60377c7a3f8718dee4b7e606734
https://github.com/kiegroup/jbpm-designer/commit/69cecd1bf670a60377c7a3f8718dee4b7e606734
AF-1059: [Project Oriented] Error dialog when creating Business process in new project (#752)
diff --git a/jbpm-designer-backend/src/main/java/org/jbpm/designer/repository/vfs/RepositoryDescriptor.java b/jbpm-designer-backend/src/main/java/org/jbpm/designer/repository/vfs/RepositoryDescriptor.java index fb18dd598..820077ef2 100644 --- a/jbpm-designer-backend/src/main/java/org/jbpm/designer/repository/vfs/RepositoryDescriptor.java +++ b/jbpm-designer-backend/src/main/java/org/jbpm/designer/repository/vfs/RepositoryDescriptor.java @@ -104,7 +104,7 @@ public void setFileSystem(FileSystem fileSystem) { this.fileSystem = fileSystem; } - private void configure() { + void configure() { Space space = null; String repositoryAlias = ""; String branchName = ""; @@ -129,7 +129,7 @@ private void configure() { } } else { // git based pattern - Pattern pattern = Pattern.compile("(://)(.*?)@(.*?)/(.*?)"); + Pattern pattern = Pattern.compile("(://)(.*?)@(.*?)/(.*?)/"); Matcher matcher = pattern.matcher(uuid); if (matcher.find()) { branchName = matcher.group(2); diff --git a/jbpm-designer-backend/src/test/java/org/jbpm/designer/repository/vfs/RepositoryDescriptorTest.java b/jbpm-designer-backend/src/test/java/org/jbpm/designer/repository/vfs/RepositoryDescriptorTest.java new file mode 100644 index 000000000..2f0fc5457 --- /dev/null +++ b/jbpm-designer-backend/src/test/java/org/jbpm/designer/repository/vfs/RepositoryDescriptorTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2018 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jbpm.designer.repository.vfs; + +import javax.enterprise.inject.Instance; +import javax.servlet.http.HttpServletRequest; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.uberfire.spaces.Space; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.verify; + +@RunWith(MockitoJUnitRunner.class) +public class RepositoryDescriptorTest { + + @Mock + private RepositoryDescriptorProvider provider; + + @Mock + private Instance<HttpServletRequest> httpRequests; + + @Mock + private HttpServletRequest httpRequest; + + @Mock + private RepositoryDescriptor repositoryDescriptorMock; + + @InjectMocks + private RepositoryDescriptor repositoryDescriptor = new RepositoryDescriptor(); + + @Before + public void setup() { + doReturn(httpRequest).when(httpRequests).get(); + doReturn(repositoryDescriptorMock).when(provider).getRepositoryDescriptor(any(), + any(), + any()); + } + + @Test + public void configureGitDirTest() { + doReturn("default://master@space/project/src/main/resources/com/space/project/asset.bpmn2").when(httpRequest).getParameter("assetId"); + + repositoryDescriptor.configure(); + + verify(provider).getRepositoryDescriptor(new Space("space"), + "project", + "master"); + } +}
0
1d372c881eafd9ffe729996f8560fd5fe50cd39d
https://github.com/apache/tomcat/commit/1d372c881eafd9ffe729996f8560fd5fe50cd39d
Protect against crashes in the HTTP APR connector if sendfile is configured to send more data than is available in the file. Part of the fix for CVE-2011-2526 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1145694 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index 14f664b1698..3b7e2e206e3 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -305,7 +305,18 @@ public SocketState process(SocketWrapper<Long> socket) sendfileData.socket = socketRef; sendfileData.keepAlive = keepAlive; if (!((AprEndpoint)endpoint).getSendfile().add(sendfileData)) { - openSocket = true; + if (sendfileData.socket == 0) { + // Didn't send all the data but the socket is no longer + // set. Something went wrong. Close the connection. + // Too late to set status code. + if (log.isDebugEnabled()) { + log.debug(sm.getString( + "http11processor.sendfile.error")); + } + error = true; + } else { + openSocket = true; + } break; } } diff --git a/java/org/apache/coyote/http11/LocalStrings.properties b/java/org/apache/coyote/http11/LocalStrings.properties index dd49940b9c5..00916296d43 100644 --- a/java/org/apache/coyote/http11/LocalStrings.properties +++ b/java/org/apache/coyote/http11/LocalStrings.properties @@ -35,6 +35,7 @@ http11processor.socket.ssl=Exception getting SSL attributes http11processor.socket.sslreneg=Exception re-negotiating SSL connection http11processor.socket.timeout=Error setting socket timeout http11processor.comet.notsupported=The Comet protocol is not supported by this connector +http11processor.sendfile.error=Error sending data using sendfile. May be caused by invalid request attributes for start/end points iib.eof.error=Unexpected EOF read on the socket iib.requestheadertoolarge.error=Request header is too large diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 9efb2c38110..024a08e228d 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -1460,7 +1460,9 @@ public boolean add(SendfileData data) { data.pos, data.end - data.pos, 0); if (nw < 0) { if (!(-nw == Status.EAGAIN)) { - destroySocket(data.socket); + Pool.destroy(data.fdpool); + // No need to close socket, this will be done by + // calling code since data.socket == 0 data.socket = 0; return false; } else { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index bdd461df554..cfa4eec2e36 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -121,8 +121,9 @@ is used. Fixes null thread name in access log and JMX MBean. (rjung) </fix> <fix> - Protect against infinite loops in the HTTP NIO connector if sendfile is - configured to send more data than is available in the file. (markt) + Protect against infinite loops (HTTP NIO) and crashes (HTTP APR) if + sendfile is configured to send more data than is available in the file. + (markt) </fix> <fix> Prevent NPEs when a socket is closed in non-error conditions after
1
a63e17d82e59dc36a864916554d2af5392e2b182
https://github.com/bertramdev/asset-pipeline/commit/a63e17d82e59dc36a864916554d2af5392e2b182
some test spec fixes
diff --git a/asset-pipeline-grails/src/test/groovy/asset/pipeline/grails/AssetsTagLibSpec.groovy b/asset-pipeline-grails/src/test/groovy/asset/pipeline/grails/AssetsTagLibSpec.groovy index bb7f72bb..3406a72e 100644 --- a/asset-pipeline-grails/src/test/groovy/asset/pipeline/grails/AssetsTagLibSpec.groovy +++ b/asset-pipeline-grails/src/test/groovy/asset/pipeline/grails/AssetsTagLibSpec.groovy @@ -55,7 +55,8 @@ class AssetsTagLibSpec extends Specification { void "should return javascript link tag when debugMode is off"() { given: - grailsApplication.config.grails.assets.bundle = true + grailsApplication.config = grailsApplication.config.merge([grails:[assets:[bundle:true]]]) + // grailsApplication.config.grails.assets.bundle = true final def assetSrc = "asset-pipeline/test/test.js" expect: tagLib.javascript(src: assetSrc) == '<script type="text/javascript" src="/assets/asset-pipeline/test/test.js" ></script>' diff --git a/asset-pipeline-site/src/assets/html/manual-new/gradle.html b/asset-pipeline-site/src/assets/html/manual-new/gradle.html index 03b81c76..9363073c 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/gradle.html +++ b/asset-pipeline-site/src/assets/html/manual-new/gradle.html @@ -552,7 +552,7 @@ <h3 id="getting-started">Getting Started</h3> } } dependencies { - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.0-SNAPSHOT" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.1" } } @@ -567,7 +567,7 @@ <h3 id="getting-started">Getting Started</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">//gradle 2.1+ plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" }</code></pre> </div> </div> @@ -655,6 +655,7 @@ <h3 id="configuration">Configuration</h3> minifyOptions = [ <span class="key">optimizationLevel</span>: <span class="string"><span class="delimiter">'</span><span class="content">SIMPLE</span><span class="delimiter">'</span></span>, <span class="key">angularPass</span>: <span class="predefined-constant">true</span> <span class="comment">// Can use @ngInject annotation for Angular Apps</span> + <span class="key">excludes</span>: [<span class="string"><span class="delimiter">'</span><span class="content">**/bundle.js</span><span class="delimiter">'</span></span>] <span class="comment">// Example of excluding specific resources from minification, e.g., if it was minified externally</span> ] includes = <span class="type">[]</span> @@ -748,7 +749,7 @@ <h3 id="jvm-based-dependencies">JVM Based Dependencies</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { // Example additional LESS support - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/gradle/configuration.html b/asset-pipeline-site/src/assets/html/manual-new/gradle/configuration.html index febb19d3..d9f9f144 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/gradle/configuration.html +++ b/asset-pipeline-site/src/assets/html/manual-new/gradle/configuration.html @@ -528,6 +528,7 @@ <h3 id="configuration">Configuration</h3> minifyOptions = [ <span class="key">optimizationLevel</span>: <span class="string"><span class="delimiter">'</span><span class="content">SIMPLE</span><span class="delimiter">'</span></span>, <span class="key">angularPass</span>: <span class="predefined-constant">true</span> <span class="comment">// Can use @ngInject annotation for Angular Apps</span> + <span class="key">excludes</span>: [<span class="string"><span class="delimiter">'</span><span class="content">**/bundle.js</span><span class="delimiter">'</span></span>] <span class="comment">// Example of excluding specific resources from minification, e.g., if it was minified externally</span> ] includes = <span class="type">[]</span> @@ -599,7 +600,7 @@ <h3 id="configuration">Configuration</h3> </div> <div id="footer"> <div id="footer-text"> -Last updated 2018-07-28 13:31:51 -04:00 +Last updated 2020-06-17 14:45:07 -04:00 </div> </div> </body> diff --git a/asset-pipeline-site/src/assets/html/manual-new/gradle/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/gradle/getting_started.html index ecf66b3c..bca8957b 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/gradle/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/gradle/getting_started.html @@ -540,7 +540,7 @@ <h3 id="getting-started">Getting Started</h3> } } dependencies { - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.0-SNAPSHOT" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.1" } } @@ -555,7 +555,7 @@ <h3 id="getting-started">Getting Started</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">//gradle 2.1+ plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/gradle/java.html b/asset-pipeline-site/src/assets/html/manual-new/gradle/java.html index 79587f0c..c2333e9f 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/gradle/java.html +++ b/asset-pipeline-site/src/assets/html/manual-new/gradle/java.html @@ -535,7 +535,7 @@ <h3 id="jvm-based-dependencies">JVM Based Dependencies</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { // Example additional LESS support - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/grails2.html b/asset-pipeline-site/src/assets/html/manual-new/grails2.html index f57ec988..809f9631 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/grails2.html +++ b/asset-pipeline-site/src/assets/html/manual-new/grails2.html @@ -535,12 +535,12 @@ <h3 id="getting-started">Getting Started</h3> <div class="title">BuildConfig.groovy</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - compile ":asset-pipeline:3.2.0-SNAPSHOT" + compile ":asset-pipeline:3.2.1" // Uncomment these to enable additional asset-pipeline capabilities - //compile ":sass-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":less-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":coffee-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":handlebars-asset-pipeline:3.2.0-SNAPSHOT" + //compile ":sass-asset-pipeline:3.2.1" + //compile ":less-asset-pipeline:3.2.1" + //compile ":coffee-asset-pipeline:3.2.1" + //compile ":handlebars-asset-pipeline:3.2.1" }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/grails2/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/grails2/getting_started.html index 3cb2a544..35d6ec8d 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/grails2/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/grails2/getting_started.html @@ -522,12 +522,12 @@ <h3 id="getting-started">Getting Started</h3> <div class="title">BuildConfig.groovy</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - compile ":asset-pipeline:3.2.0-SNAPSHOT" + compile ":asset-pipeline:3.2.1" // Uncomment these to enable additional asset-pipeline capabilities - //compile ":sass-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":less-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":coffee-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":handlebars-asset-pipeline:3.2.0-SNAPSHOT" + //compile ":sass-asset-pipeline:3.2.1" + //compile ":less-asset-pipeline:3.2.1" + //compile ":coffee-asset-pipeline:3.2.1" + //compile ":handlebars-asset-pipeline:3.2.1" }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/grails3.html b/asset-pipeline-site/src/assets/html/manual-new/grails3.html index ed7372f0..1129e852 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/grails3.html +++ b/asset-pipeline-site/src/assets/html/manual-new/grails3.html @@ -534,7 +534,7 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/grails3/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/grails3/getting_started.html index ff7091d1..f19c8825 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/grails3/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/grails3/getting_started.html @@ -521,7 +521,7 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/index.html b/asset-pipeline-site/src/assets/html/manual-new/index.html index dface82a..d0282ce5 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/index.html +++ b/asset-pipeline-site/src/assets/html/manual-new/index.html @@ -507,7 +507,7 @@ <h1>Asset Pipeline Users Guide</h1> <div class="details"> <span id="author" class="author">David Estes</span><br> <span id="email" class="email"><a href="mailto:[email protected]">[email protected]</a></span><br> -<span id="revdate">3.2.0-SNAPSHOT</span> +<span id="revdate">3.2.1</span> </div> <div id="toc" class="toc2"> <div id="toctitle">Table of Contents</div> @@ -1824,7 +1824,7 @@ <h3 id="getting-started">Getting Started</h3> } } dependencies { - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.0-SNAPSHOT" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.2.1" } } @@ -1839,7 +1839,7 @@ <h3 id="getting-started">Getting Started</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">//gradle 2.1+ plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" }</code></pre> </div> </div> @@ -1927,6 +1927,7 @@ <h3 id="configuration">Configuration</h3> minifyOptions = [ <span class="key">optimizationLevel</span>: <span class="string"><span class="delimiter">'</span><span class="content">SIMPLE</span><span class="delimiter">'</span></span>, <span class="key">angularPass</span>: <span class="predefined-constant">true</span> <span class="comment">// Can use @ngInject annotation for Angular Apps</span> + <span class="key">excludes</span>: [<span class="string"><span class="delimiter">'</span><span class="content">**/bundle.js</span><span class="delimiter">'</span></span>] <span class="comment">// Example of excluding specific resources from minification, e.g., if it was minified externally</span> ] includes = <span class="type">[]</span> @@ -2020,7 +2021,7 @@ <h3 id="jvm-based-dependencies">JVM Based Dependencies</h3> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { // Example additional LESS support - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -2044,7 +2045,7 @@ <h3 id="getting-started-2">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-grails:3.2.1' }</code></pre> </div> </div> @@ -2376,12 +2377,12 @@ <h3 id="getting-started-3">Getting Started</h3> <div class="title">BuildConfig.groovy</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - compile ":asset-pipeline:3.2.0-SNAPSHOT" + compile ":asset-pipeline:3.2.1" // Uncomment these to enable additional asset-pipeline capabilities - //compile ":sass-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":less-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":coffee-asset-pipeline:3.2.0-SNAPSHOT" - //compile ":handlebars-asset-pipeline:3.2.0-SNAPSHOT" + //compile ":sass-asset-pipeline:3.2.1" + //compile ":less-asset-pipeline:3.2.1" + //compile ":coffee-asset-pipeline:3.2.1" + //compile ":handlebars-asset-pipeline:3.2.1" }</code></pre> </div> </div> @@ -2814,14 +2815,14 @@ <h3 id="getting-started-4">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" } dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -2894,10 +2895,10 @@ <h3 id="getting-started-5">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -2976,10 +2977,10 @@ <h3 id="getting-started-6">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -3040,7 +3041,7 @@ <h3 id="less">LESS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -3084,7 +3085,7 @@ <h3 id="sass">SASS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -3110,7 +3111,7 @@ <h3 id="coffeescript">Coffeescript</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/micronaut.html b/asset-pipeline-site/src/assets/html/manual-new/micronaut.html index 9a693df0..0dd05977 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/micronaut.html +++ b/asset-pipeline-site/src/assets/html/manual-new/micronaut.html @@ -531,14 +531,14 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" } dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/micronaut/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/micronaut/getting_started.html index 846d4b20..f2afc2cf 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/micronaut/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/micronaut/getting_started.html @@ -521,14 +521,14 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">plugins { - id "com.bertramlabs.asset-pipeline" version "3.2.0-SNAPSHOT" + id "com.bertramlabs.asset-pipeline" version "3.2.1" } dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/modules.html b/asset-pipeline-site/src/assets/html/manual-new/modules.html index 3d53810f..847c37d5 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/modules.html +++ b/asset-pipeline-site/src/assets/html/manual-new/modules.html @@ -531,7 +531,7 @@ <h3 id="less">LESS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -575,7 +575,7 @@ <h3 id="sass">SASS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> @@ -601,7 +601,7 @@ <h3 id="coffeescript">Coffeescript</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/modules/coffeescript.html b/asset-pipeline-site/src/assets/html/manual-new/modules/coffeescript.html index dc65969f..4cb2ac1c 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/modules/coffeescript.html +++ b/asset-pipeline-site/src/assets/html/manual-new/modules/coffeescript.html @@ -519,7 +519,7 @@ <h3 id="coffeescript">Coffeescript</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:coffee-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/modules/less.html b/asset-pipeline-site/src/assets/html/manual-new/modules/less.html index f3589a1b..e64e90fe 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/modules/less.html +++ b/asset-pipeline-site/src/assets/html/manual-new/modules/less.html @@ -519,7 +519,7 @@ <h3 id="less">LESS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/modules/sass.html b/asset-pipeline-site/src/assets/html/manual-new/modules/sass.html index b18819d7..9d7b61a3 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/modules/sass.html +++ b/asset-pipeline-site/src/assets/html/manual-new/modules/sass.html @@ -519,7 +519,7 @@ <h3 id="sass">SASS</h3> <div class="title">build.gradle</div> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/ratpack.html b/asset-pipeline-site/src/assets/html/manual-new/ratpack.html index e789542b..213b19fc 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/ratpack.html +++ b/asset-pipeline-site/src/assets/html/manual-new/ratpack.html @@ -531,10 +531,10 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/ratpack/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/ratpack/getting_started.html index bc53d3e3..b4fbe184 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/ratpack/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/ratpack/getting_started.html @@ -521,10 +521,10 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:ratpack-asset-pipeline:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/spring-boot.html b/asset-pipeline-site/src/assets/html/manual-new/spring-boot.html index 52110af6..51fb48d7 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/spring-boot.html +++ b/asset-pipeline-site/src/assets/html/manual-new/spring-boot.html @@ -531,10 +531,10 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div> diff --git a/asset-pipeline-site/src/assets/html/manual-new/spring-boot/getting_started.html b/asset-pipeline-site/src/assets/html/manual-new/spring-boot/getting_started.html index 7ecc428f..c6b1c197 100644 --- a/asset-pipeline-site/src/assets/html/manual-new/spring-boot/getting_started.html +++ b/asset-pipeline-site/src/assets/html/manual-new/spring-boot/getting_started.html @@ -521,10 +521,10 @@ <h3 id="getting-started">Getting Started</h3> <div class="listingblock"> <div class="content"> <pre class="CodeRay highlight"><code data-lang="groovy">dependencies { - runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.0-SNAPSHOT' + runtime 'com.bertramlabs.plugins:asset-pipeline-spring-boot:3.2.1' //Example LESS or Sass Integration - //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.0-SNAPSHOT' - //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.0-SNAPSHOT' + //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.2.1' + //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.2.1' }</code></pre> </div> </div>
0
aa881560cc996c38cbf8c20ee62854e27f72c73c
https://github.com/Froxlor/Froxlor/commit/aa881560cc996c38cbf8c20ee62854e27f72c73c
deny access to tickets not owned by current user, thx to chbi Signed-off-by: Michael Kaufmann <[email protected]>
diff --git a/customer_tickets.php b/customer_tickets.php index 1a7508b99..d237ac065 100644 --- a/customer_tickets.php +++ b/customer_tickets.php @@ -238,7 +238,11 @@ } } elseif ($action == 'answer' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { - $replyticket = ticket::getInstanceOf($userinfo, -1); + try { + $replyticket = ticket::getInstanceOf($userinfo, -1); + } catch(Exception $e) { + standard_error($e->getMessage()); + } $replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false); $replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false); $replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false); @@ -272,7 +276,11 @@ } } else { $ticket_replies = ''; - $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + try { + $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + } catch(Exception $e) { + standard_error($e->getMessage()); + } $dt = date("d.m.Y H:i\h", $mainticket->Get('dt')); $status = ticket::getStatusText($lng, $mainticket->Get('status')); @@ -351,7 +359,11 @@ } elseif ($action == 'close' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { $now = time(); - $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + try { + $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + } catch(Exception $e) { + standard_error($e->getMessage()); + } $mainticket->Set('lastchange', $now, true, true); $mainticket->Set('lastreplier', '0', true, true); $mainticket->Set('status', '3', true, true); @@ -359,7 +371,11 @@ $log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } else { - $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + try { + $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + } catch(Exception $e) { + standard_error($e->getMessage()); + } ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject')); } } elseif ($action == 'reopen' && $id != 0) { @@ -377,7 +393,11 @@ } $now = time(); - $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + try { + $mainticket = ticket::getInstanceOf($userinfo, (int)$id); + } catch(Exception $e) { + standard_error($e->getMessage()); + } $mainticket->Set('lastchange', $now, true, true); $mainticket->Set('lastreplier', '0', true, true); $mainticket->Set('status', '0', true, true); diff --git a/lib/classes/ticket/class.ticket.php b/lib/classes/ticket/class.ticket.php index a9d69ff82..4fb06eb44 100644 --- a/lib/classes/ticket/class.ticket.php +++ b/lib/classes/ticket/class.ticket.php @@ -19,46 +19,53 @@ * * Support Tickets - Tickets-Class */ - -class ticket { +class ticket +{ /** * Userinfo + * * @var array */ private $userinfo = array(); /** * Ticket ID - * @var tid + * + * @var int */ private $tid = - 1; /** * Ticket Data Array - * @var t_data + * + * @var array */ private $t_data = array(); /** * Ticket-Object-Array - * @var tickets + * + * @var ticket */ - static private $tickets = array(); + private static $tickets = array(); /** * Class constructor. * - * @param array userinfo - * @param int ticket id + * @param + * array userinfo + * @param + * int ticket id */ - private function __construct($userinfo, $tid = - 1) { + private function __construct($userinfo, $tid = - 1) + { $this->userinfo = $userinfo; $this->tid = $tid; - + // initialize data array $this->initData(); - + // read data from database $this->readData(); } @@ -66,21 +73,24 @@ private function __construct($userinfo, $tid = - 1) { /** * Singleton ftw ;-) * - * @param array userinfo - * @param int ticket id + * @param + * array userinfo + * @param + * int ticket id */ - static public function getInstanceOf($_usernfo, $_tid) { - if (!isset(self::$tickets[$_tid])) { - self::$tickets[$_tid] = new ticket($_usernfo, $_tid); + static public function getInstanceOf($_usernfo, $_tid) + { + if (! isset(self::$tickets[$_tid . '-' . $_usernfo['userid']])) { + self::$tickets[$_tid . '-' . $_usernfo['userid']] = new ticket($_usernfo, $_tid); } - return self::$tickets[$_tid]; + return self::$tickets[$_tid . '-' . $_usernfo['userid']]; } /** * Initialize data-array */ - private function initData() { - + private function initData() + { $this->Set('customer', 0, true, true); $this->Set('admin', 1, true, true); $this->Set('subject', '', true, true); @@ -100,16 +110,33 @@ private function initData() { /** * Read ticket data from database. */ - private function readData() { - - if (isset($this->tid) - && $this->tid != - 1 - ) { - $_ticket_stmt = Database::prepare(' - SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid' - ); - $_ticket = Database::pexecute_first($_ticket_stmt, array('tid' => $this->tid)); - + private function readData() + { + if (isset($this->tid) && $this->tid != - 1) { + + if ($this->userinfo['customerid'] > 0) { + $_ticket_stmt = Database::prepare(' + SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid AND `customerid` = :cid'); + $tdata = array( + 'tid' => $this->tid, + 'cid' => $this->userinfo['customerid'] + ); + } else { + $_ticket_stmt = Database::prepare(' + SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid' . ($this->userinfo['customers_see_all'] ? '' : ' AND `adminid` = :adminid')); + $tdata = array( + 'tid' => $this->tid + ); + if ($this->userinfo['customers_see_all'] != '1') { + $tdata['adminid'] = $this->userinfo['adminid']; + } + } + $_ticket = Database::pexecute_first($_ticket_stmt, $tdata); + + if ($_ticket == false) { + throw new Exception("Invalid ticket id"); + } + $this->Set('customer', $_ticket['customerid'], true, false); $this->Set('admin', $_ticket['adminid'], true, false); $this->Set('subject', $_ticket['subject'], true, false); @@ -130,8 +157,8 @@ private function readData() { /** * Insert data to database */ - public function Insert() { - + public function Insert() + { $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_PANEL_TICKETS . "` SET `customerid` = :customerid, @@ -146,8 +173,7 @@ public function Insert() { `status` = :status, `lastreplier` = :lastreplier, `by` = :by, - `answerto` = :answerto" - ); + `answerto` = :answerto"); $ins_data = array( 'customerid' => $this->Get('customer'), 'adminid' => $this->Get('admin'), @@ -171,8 +197,9 @@ public function Insert() { /** * Update data in database */ - public function Update() { - + public function Update() + { + // Update "main" ticket $upd_stmt = Database::prepare(' UPDATE `' . TABLE_PANEL_TICKETS . '` SET @@ -180,8 +207,7 @@ public function Update() { `lastchange` = :lastchange, `status` = :status, `lastreplier` = :lastreplier - WHERE `id` = :tid' - ); + WHERE `id` = :tid'); $upd_data = array( 'priority' => $this->Get('priority'), 'lastchange' => $this->Get('lastchange'), @@ -196,38 +222,44 @@ public function Update() { /** * Moves a ticket to the archive */ - public function Archive() { - + public function Archive() + { + // Update "main" ticket $upd_stmt = Database::prepare(' - UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `id` = :tid' - ); - Database::pexecute($upd_stmt, array('tid' => $this->tid)); - + UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `id` = :tid'); + Database::pexecute($upd_stmt, array( + 'tid' => $this->tid + )); + // Update "answers" to ticket $upd_stmt = Database::prepare(' - UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `answerto` = :tid' - ); - Database::pexecute($upd_stmt, array('tid' => $this->tid)); + UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `answerto` = :tid'); + Database::pexecute($upd_stmt, array( + 'tid' => $this->tid + )); return true; } /** * Remove ticket from database */ - public function Delete() { - + public function Delete() + { + // Delete "main" ticket $del_stmt = Database::prepare(' - DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid' - ); - Database::pexecute($del_stmt, array('tid' => $this->tid)); - + DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid'); + Database::pexecute($del_stmt, array( + 'tid' => $this->tid + )); + // Delete "answers" to ticket" $del_stmt = Database::prepare(' - DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto` = :tid' - ); - Database::pexecute($del_stmt, array('tid' => $this->tid)); + DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto` = :tid'); + Database::pexecute($del_stmt, array( + 'tid' => $this->tid + )); return true; } @@ -237,16 +269,17 @@ public function Delete() { public function sendMail($customerid = - 1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null) { global $mail, $theme; - + // Some checks are to be made here in the future if ($customerid != - 1) { // Get e-mail message for customer $usr_stmt = Database::prepare(' SELECT `name`, `firstname`, `company`, `email` - FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = :customerid' - ); - $usr = Database::pexecute_first($usr_stmt, array('customerid' => $customerid)); - + FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = :customerid'); + $usr = Database::pexecute_first($usr_stmt, array( + 'customerid' => $customerid + )); + $replace_arr = array( 'FIRSTNAME' => $usr['firstname'], 'NAME' => $usr['name'], @@ -268,23 +301,21 @@ public function sendMail($customerid = - 1, $template_subject = null, $default_s SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`= :adminid AND `language`= :lang - AND `templategroup`= 'mails' AND `varname`= :tplsubject" - ); + AND `templategroup`= 'mails' AND `varname`= :tplsubject"); $result = Database::pexecute_first($result_stmt, $tpl_seldata); $mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_subject), $replace_arr)); - + unset($tpl_seldata['tplsubject']); $tpl_seldata['tplmailbody'] = $template_body; - + $result_stmt = Database::prepare(" SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`= :adminid AND `language`= :lang - AND `templategroup`= 'mails' AND `varname`= :tplmailbody" - ); + AND `templategroup`= 'mails' AND `varname`= :tplmailbody"); $result = Database::pexecute_first($result_stmt, $tpl_seldata); $mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_body), $replace_arr)); - + if ($customerid != - 1) { $_mailerror = false; try { @@ -294,28 +325,30 @@ public function sendMail($customerid = - 1, $template_subject = null, $default_s $mail->MsgHTML(str_replace("\n", "<br />", $mail_body)); $mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']); $mail->Send(); - } catch(phpmailerException $e) { + } catch (phpmailerException $e) { $mailerr_msg = $e->errorMessage(); $_mailerror = true; } catch (Exception $e) { $mailerr_msg = $e->getMessage(); $_mailerror = true; } - + if ($_mailerror) { - $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class')); + $rstlog = FroxlorLogger::getInstanceOf(array( + 'loginname' => 'ticket_class' + )); $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg); standard_error('errorsendingmail', $usr['email']); } $mail->ClearAddresses(); - } else { - + $admin_stmt = Database::prepare(" SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "` - WHERE `adminid` = :adminid" - ); - $admin = Database::pexecute_first($admin_stmt, array('adminid' => $this->userinfo['adminid'])); + WHERE `adminid` = :adminid"); + $admin = Database::pexecute_first($admin_stmt, array( + 'adminid' => $this->userinfo['adminid'] + )); $_mailerror = false; try { $mail->SetFrom(Settings::Get('ticket.noreply_email'), Settings::Get('ticket.noreply_name')); @@ -324,20 +357,22 @@ public function sendMail($customerid = - 1, $template_subject = null, $default_s $mail->MsgHTML(str_replace("\n", "<br />", $mail_body)); $mail->AddAddress($admin['email'], $admin['name']); $mail->Send(); - } catch(phpmailerException $e) { + } catch (phpmailerException $e) { $mailerr_msg = $e->errorMessage(); $_mailerror = true; } catch (Exception $e) { $mailerr_msg = $e->getMessage(); $_mailerror = true; } - + if ($_mailerror) { - $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class')); + $rstlog = FroxlorLogger::getInstanceOf(array( + 'loginname' => 'ticket_class' + )); $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg); standard_error('errorsendingmail', $admin['email']); } - + $mail->ClearAddresses(); } } @@ -345,21 +380,18 @@ public function sendMail($customerid = - 1, $template_subject = null, $default_s /** * Add a support-categories */ - static public function addCategory($_category = null, $_admin = 1, $_order = 1) { - - if ($_category != null - && $_category != '' - ) { + static public function addCategory($_category = null, $_admin = 1, $_order = 1) + { + if ($_category != null && $_category != '') { if ($_order < 1) { $_order = 1; } - + $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_PANEL_TICKET_CATS . "` SET `name` = :name, `adminid` = :adminid, - `logicalorder` = :lo" - ); + `logicalorder` = :lo"); $ins_data = array( 'name' => $_category, 'adminid' => $_admin, @@ -374,23 +406,24 @@ static public function addCategory($_category = null, $_admin = 1, $_order = 1) /** * Edit a support-categories */ - static public function editCategory($_category = null, $_id = 0, $_order = 1) { - - if ($_category != null - && $_category != '' - && $_id != 0 - ) { + static public function editCategory($_category = null, $_id = 0, $_order = 1) + { + if ($_category != null && $_category != '' && $_id != 0) { if ($_order < 1) { $_order = 1; } - + $upd_stmt = Database::prepare(" UPDATE `" . TABLE_PANEL_TICKET_CATS . "` SET `name` = :name, `logicalorder` = :lo WHERE `id` = :id "); - Database::pexecute($upd_stmt, array('name' => $_category, 'lo' => $_order, 'id' => $_id)); + Database::pexecute($upd_stmt, array( + 'name' => $_category, + 'lo' => $_order, + 'id' => $_id + )); return true; } return false; @@ -399,40 +432,43 @@ static public function editCategory($_category = null, $_id = 0, $_order = 1) { /** * Delete a support-categories */ - static public function deleteCategory($_id = 0) { - + static public function deleteCategory($_id = 0) + { if ($_id != 0) { - + $result_stmt = Database::prepare(" SELECT COUNT(`id`) as `numtickets` FROM `" . TABLE_PANEL_TICKETS . "` - WHERE `category` = :cat" - ); - $result = Database::pexecute_first($result_stmt, array('cat' => $_id)); - + WHERE `category` = :cat"); + $result = Database::pexecute_first($result_stmt, array( + 'cat' => $_id + )); + if ($result['numtickets'] == "0") { $del_stmt = Database::prepare(" - DELETE FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id" - ); - Database::pexecute($del_stmt, array('id' => $_id)); + DELETE FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id"); + Database::pexecute($del_stmt, array( + 'id' => $_id + )); return true; } else { return false; } } - + return false; } /** * Return a support-category-name */ - static public function getCategoryName($_id = 0) { - + static public function getCategoryName($_id = 0) + { if ($_id != 0) { $stmt = Database::prepare(" - SELECT `name` FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id" - ); - $category = Database::pexecute_first($stmt, array('id' => $_id)); + SELECT `name` FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id"); + $category = Database::pexecute_first($stmt, array( + 'id' => $_id + )); return $category['name']; } return null; @@ -440,32 +476,33 @@ static public function getCategoryName($_id = 0) { /** * get the highest order number - * - * @param object $_uid admin-id (optional) - * + * + * @param object $_uid + * admin-id (optional) + * * @return int highest order number */ - static public function getHighestOrderNumber($_uid = 0) { - + static public function getHighestOrderNumber($_uid = 0) + { $where = ''; $sel_data = array(); if ($_uid > 0) { $where = " WHERE `adminid` = :adminid"; $sel_data['adminid'] = $_uid; } - $sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`".$where.";"; + $sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`" . $where . ";"; $result_stmt = Database::prepare($sql); $result = Database::pexecute_first($result_stmt, $sel_data); - return (isset($result['highestorder']) ? (int)$result['highestorder'] : 0); + return (isset($result['highestorder']) ? (int) $result['highestorder'] : 0); } /** * returns the last x archived tickets */ - static public function getLastArchived($_num = 10, $_admin = 1) { - + static public function getLastArchived($_num = 10, $_admin = 1) + { if ($_num > 0) { - + $archived = array(); $counter = 0; $result_stmt = Database::prepare(" @@ -477,12 +514,13 @@ static public function getLastArchived($_num = 10, $_admin = 1) { FROM `" . TABLE_PANEL_TICKETS . "` `main` WHERE `main`.`answerto` = '0' AND `main`.`archived` = '1' AND `main`.`adminid` = :adminid - ORDER BY `main`.`lastchange` DESC LIMIT 0, ".(int)$_num - ); - Database::pexecute($result_stmt, array('adminid' => $_admin)); - + ORDER BY `main`.`lastchange` DESC LIMIT 0, " . (int) $_num); + Database::pexecute($result_stmt, array( + 'adminid' => $_admin + )); + while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { - + $archived[$counter]['id'] = $row['id']; $archived[$counter]['customerid'] = $row['customerid']; $archived[$counter]['adminid'] = $row['adminid']; @@ -496,9 +534,9 @@ static public function getLastArchived($_num = 10, $_admin = 1) { $archived[$counter]['lastchange'] = $row['lastchange']; $archived[$counter]['status'] = $row['status']; $archived[$counter]['by'] = $row['by']; - $counter++; + $counter ++; } - + if (isset($archived[0]['id'])) { return $archived; } else { @@ -516,129 +554,102 @@ static public function getLastArchived($_num = 10, $_admin = 1) { static public function getArchiveSearchStatement($subject = null, $priority = null, $fromdate = null, $todate = null, $message = null, $customer = - 1, $admin = 1, $categories = null) { $search_params = array(); - + $query = " SELECT `main`.*, ( SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub` WHERE `sub`.`answerto` = `main`.`id` ) as `ticket_answers` FROM `" . TABLE_PANEL_TICKETS . "` `main` - WHERE `main`.`archived` = '1' AND `main`.`adminid` = :admin" - ; - + WHERE `main`.`archived` = '1' AND `main`.`adminid` = :admin"; + $search_params['admin'] = $admin; - - if ($subject != NULL - && $subject != '' - ) { + + if ($subject != NULL && $subject != '') { $query .= " AND `main`.`subject` LIKE :subject"; - $search_params['subject'] = "%".$subject."%"; + $search_params['subject'] = "%" . $subject . "%"; } - - if ($priority != null - && isset($priority[0]) - && $priority[0] != '' - ) { - - if (isset($priority[1]) - && $priority[1] != '' - ) { - - if (isset($priority[2]) - && $priority[2] != '' - ) { - + + if ($priority != null && isset($priority[0]) && $priority[0] != '') { + + if (isset($priority[1]) && $priority[1] != '') { + + if (isset($priority[2]) && $priority[2] != '') { + $query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '2' OR `main`.`priority` = '3')"; - } else { - + $query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '1')"; } - - } elseif (isset($priority[2]) - && $priority[2] != '' - ) { - + } elseif (isset($priority[2]) && $priority[2] != '') { + $query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '3')"; - } else { $query .= " AND `main`.`priority` = '1'"; } - - } elseif($priority != null - && isset($priority[1]) - && $priority[1] != '' - ) { - if (isset($priority[2]) - && $priority[2] != '' - ) { + } elseif ($priority != null && isset($priority[1]) && $priority[1] != '') { + if (isset($priority[2]) && $priority[2] != '') { $query .= " AND (`main`.`priority` = '2' OR `main`.`priority` = '3')"; } else { $query .= " AND `main`.`priority` = '2'"; } - - } elseif($priority != null) { - - if (isset($priority[3]) - && $priority[3] != '' - ) { + } elseif ($priority != null) { + + if (isset($priority[3]) && $priority[3] != '') { $query .= " AND `main`.`priority` = '3'"; } } - - if ($fromdate != null - && $fromdate > 0 - ) { + + if ($fromdate != null && $fromdate > 0) { $query .= " AND `main`.`lastchange` > :fromdate"; $search_params['fromdate'] = strtotime($fromdate); } - - if ($todate != null - && $todate > 0 - ) { + + if ($todate != null && $todate > 0) { $query .= " AND `main`.`lastchange` < :todate"; $search_params['todate'] = strtotime($todate); } - - if ($message != null - && $message != '' - ) { + + if ($message != null && $message != '') { $query .= " AND `main`.`message` LIKE :message"; - $search_params['message'] = "%".$message."%"; + $search_params['message'] = "%" . $message . "%"; } - + if ($customer != - 1) { $query .= " AND `main`.`customerid` = :customer"; $search_params['customer'] = $customer; } - + if ($categories != null) { - + $cats = array(); foreach ($categories as $index => $catid) { if ($catid != "") { $cats[] = $catid; } } - + if (count($cats) > 0) { $query .= " AND ("; } - + foreach ($cats as $catid) { if (isset($catid) && $catid > 0) { - $query .= "`main`.`category` = :catid_".$catid." OR "; - $search_params['catid_'.$catid] = $catid; + $query .= "`main`.`category` = :catid_" . $catid . " OR "; + $search_params['catid_' . $catid] = $catid; } } - + if (count($cats) > 0) { $query = substr($query, 0, strlen($query) - 3); $query .= ") "; } } - - return array('0' => $query, '1' => $search_params); + + return array( + '0' => $query, + '1' => $search_params + ); } /** @@ -646,8 +657,7 @@ static public function getArchiveSearchStatement($subject = null, $priority = nu */ static public function getStatusText($_lng, $_status = 0) { - switch($_status) - { + switch ($_status) { case 0: return $_lng['ticket']['open']; break; @@ -668,8 +678,7 @@ static public function getStatusText($_lng, $_status = 0) */ static public function getPriorityText($_lng, $_priority = 0) { - switch($_priority) - { + switch ($_priority) { case 1: return $_lng['ticket']['high']; break; @@ -684,19 +693,19 @@ static public function getPriorityText($_lng, $_priority = 0) private function convertLatin1ToHtml($str) { - $html_entities = array ( - "Ä" => "&Auml;", - "ä" => "&auml;", - "Ö" => "&Ouml;", - "ö" => "&ouml;", - "Ü" => "&Uuml;", - "ü" => "&uuml;", - "ß" => "&szlig;" - /* - * @TODO continue this table for all the special-characters - */ + $html_entities = array( + "Ä" => "&Auml;", + "ä" => "&auml;", + "Ö" => "&Ouml;", + "ö" => "&ouml;", + "Ü" => "&Uuml;", + "ü" => "&uuml;", + "ß" => "&szlig;" + /* + * @TODO continue this table for all the special-characters + */ ); - + foreach ($html_entities as $key => $value) { $str = str_replace($key, $value, $str); } @@ -706,45 +715,47 @@ private function convertLatin1ToHtml($str) /** * function customerHasTickets * - * @param int customer-id - * - * @return array/bool array of ticket-ids if customer has any, else false + * @param + * int customer-id + * + * @return array/bool array of ticket-ids if customer has any, else false */ - static public function customerHasTickets($_cid = 0) { - + static public function customerHasTickets($_cid = 0) + { if ($_cid != 0) { $result_stmt = Database::prepare(" - SELECT `id` FROM `" . TABLE_PANEL_TICKETS . "` WHERE `customerid` = :cid" - ); - Database::pexecute($result_stmt, array('cid' => $_cid)); - + SELECT `id` FROM `" . TABLE_PANEL_TICKETS . "` WHERE `customerid` = :cid"); + Database::pexecute($result_stmt, array( + 'cid' => $_cid + )); + $tickets = array(); while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { $tickets[] = $row['id']; } - + return $tickets; } - + return false; } /** * Get a data-var */ - public function Get($_var = '', $_vartrusted = false) { - + public function Get($_var = '', $_vartrusted = false) + { if ($_var != '') { - if (!$_vartrusted) { + if (! $_vartrusted) { $_var = htmlspecialchars($_var); } - + if (isset($this->t_data[$_var])) { if (strtolower($_var) == 'message') { // avoid double line-breaks, #1413 $this->t_data[$_var] = str_replace("<br />\n", "\n", $this->t_data[$_var]); return nl2br($this->t_data[$_var]); - } elseif(strtolower($_var) == 'subject') { + } elseif (strtolower($_var) == 'subject') { return nl2br($this->t_data[$_var]); } else { return $this->t_data[$_var]; @@ -758,25 +769,21 @@ public function Get($_var = '', $_vartrusted = false) { /** * Set a data-var */ - public function Set($_var = '', $_value = '', $_vartrusted = false, $_valuetrusted = false) { - - if ($_var != '' - && $_value != '' - ) { - if (!$_vartrusted) { + public function Set($_var = '', $_value = '', $_vartrusted = false, $_valuetrusted = false) + { + if ($_var != '' && $_value != '') { + if (! $_vartrusted) { $_var = strip_tags($_var); } - - if (!$_valuetrusted) { + + if (! $_valuetrusted) { $_value = strip_tags($_value, '<br />'); } - - if (strtolower($_var) == 'message' - || strtolower($_var) == 'subject' - ) { + + if (strtolower($_var) == 'message' || strtolower($_var) == 'subject') { $_value = $this->convertLatin1ToHtml($_value); } - + $this->t_data[$_var] = $_value; } }
1
7ab167a9952c363306f0b9ee7402482072039d2b
https://github.com/apache/spark/commit/7ab167a9952c363306f0b9ee7402482072039d2b
Revert "[SPARK-31235][FOLLOWUP][TESTS][TEST-HADOOP3.2] Fix test "specify a more specific type for the ap…" This reverts commit c1801fd6da4a2dd5f37dc366b92bede669e8fda0.
diff --git a/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala b/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala index 7611ccd4dacf7..b335e7fc04f53 100644 --- a/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala +++ b/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala @@ -38,7 +38,6 @@ import org.apache.hadoop.yarn.server.resourcemanager.{ClientRMService, RMAppMana import org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter import org.apache.hadoop.yarn.server.resourcemanager.metrics.SystemMetricsPublisher import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp -import org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler import org.apache.hadoop.yarn.server.security.ApplicationACLsManager import org.apache.hadoop.yarn.util.Records import org.mockito.ArgumentMatchers.{any, anyBoolean, anyShort, eq => meq} @@ -223,50 +222,11 @@ class ClientSuite extends SparkFunSuite with Matchers { 3 -> ("SPARK-SQL", "SPARK-SQL"), 4 -> ("012345678901234567890123", "01234567890123456789")) - // Mock yarn submit application - val yarnClient = mock(classOf[YarnClient]) - val rmApps = new ConcurrentHashMap[ApplicationId, RMApp]() - val rmContext = mock(classOf[RMContext]) - when(rmContext.getRMApps).thenReturn(rmApps) - val dispatcher = mock(classOf[Dispatcher]) - when(rmContext.getDispatcher).thenReturn(dispatcher) - when[EventHandler[_]](dispatcher.getEventHandler).thenReturn( - new EventHandler[Event[_]] { - override def handle(event: Event[_]): Unit = {} - } - ) - val writer = mock(classOf[RMApplicationHistoryWriter]) - when(rmContext.getRMApplicationHistoryWriter).thenReturn(writer) - val publisher = mock(classOf[SystemMetricsPublisher]) - when(rmContext.getSystemMetricsPublisher).thenReturn(publisher) - val yarnScheduler = mock(classOf[YarnScheduler]) - val rmAppManager = new RMAppManager(rmContext, - yarnScheduler, - null, - mock(classOf[ApplicationACLsManager]), - new Configuration()) - val clientRMService = new ClientRMService(rmContext, - yarnScheduler, - rmAppManager, - null, - null, - null) - clientRMService.init(new Configuration()) - when(yarnClient.submitApplication(any())).thenAnswer((invocationOnMock: InvocationOnMock) => { - val subContext = invocationOnMock.getArguments()(0) - .asInstanceOf[ApplicationSubmissionContext] - val request = Records.newRecord(classOf[SubmitApplicationRequest]) - request.setApplicationSubmissionContext(subContext) - clientRMService.submitApplication(request) - null - }) - - // Spark submit application - val appContext = spy(Records.newRecord(classOf[ApplicationSubmissionContext])) - when(appContext.getUnmanagedAM).thenReturn(true) for ((id, (sourceType, targetType)) <- appTypes) { val sparkConf = new SparkConf().set("spark.yarn.applicationType", sourceType) val args = new ClientArguments(Array()) + + val appContext = spy(Records.newRecord(classOf[ApplicationSubmissionContext])) val appId = ApplicationId.newInstance(123456, id) appContext.setApplicationId(appId) val getNewApplicationResponse = Records.newRecord(classOf[GetNewApplicationResponse]) @@ -277,8 +237,48 @@ class ClientSuite extends SparkFunSuite with Matchers { new YarnClientApplication(getNewApplicationResponse, appContext), containerLaunchContext) + val yarnClient = mock(classOf[YarnClient]) + when(yarnClient.submitApplication(any())).thenAnswer((invocationOnMock: InvocationOnMock) => { + val subContext = invocationOnMock.getArguments()(0) + .asInstanceOf[ApplicationSubmissionContext] + val request = Records.newRecord(classOf[SubmitApplicationRequest]) + request.setApplicationSubmissionContext(subContext) + + val rmContext = mock(classOf[RMContext]) + val conf = mock(classOf[Configuration]) + val map = new ConcurrentHashMap[ApplicationId, RMApp]() + when(rmContext.getRMApps).thenReturn(map) + val dispatcher = mock(classOf[Dispatcher]) + when(rmContext.getDispatcher).thenReturn(dispatcher) + when[EventHandler[_]](dispatcher.getEventHandler).thenReturn( + new EventHandler[Event[_]] { + override def handle(event: Event[_]): Unit = {} + } + ) + val writer = mock(classOf[RMApplicationHistoryWriter]) + when(rmContext.getRMApplicationHistoryWriter).thenReturn(writer) + val publisher = mock(classOf[SystemMetricsPublisher]) + when(rmContext.getSystemMetricsPublisher).thenReturn(publisher) + when(appContext.getUnmanagedAM).thenReturn(true) + + val rmAppManager = new RMAppManager(rmContext, + null, + null, + mock(classOf[ApplicationACLsManager]), + conf) + val clientRMService = new ClientRMService(rmContext, + null, + rmAppManager, + null, + null, + null) + clientRMService.submitApplication(request) + + assert(map.get(subContext.getApplicationId).getApplicationType === targetType) + null + }) + yarnClient.submitApplication(context) - assert(rmApps.get(appId).getApplicationType === targetType) } }
0
1ad0d1d792395306b59a34ad7b6e7e89a35d041e
https://github.com/openshift/origin-server/commit/1ad0d1d792395306b59a34ad7b6e7e89a35d041e
BZ878754 No CSRF attack protection in console
diff --git a/openshift-console/app/controllers/application_controller.rb b/openshift-console/app/controllers/application_controller.rb index 311a8750cd7..e170f1ad2a8 100644 --- a/openshift-console/app/controllers/application_controller.rb +++ b/openshift-console/app/controllers/application_controller.rb @@ -2,4 +2,9 @@ class ApplicationController < ActionController::Base include Console::Rescue protect_from_forgery + + protected + def handle_unverified_request + raise Console::AccessDenied, "Request authenticity token does not match session #{session.inspect}" + end end
1
fe7dbd2c104c37f6f3af7d9f1646a3c332aea4a4
https://github.com/inspircd/inspircd/commit/fe7dbd2c104c37f6f3af7d9f1646a3c332aea4a4
Merge pull request #1 from nenolod/insp20 DNS resolver hardening (insp20 branch)
diff --git a/src/dns.cpp b/src/dns.cpp index 945e1fb15c..2e1c751c4c 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -38,6 +38,8 @@ looks like this, walks like this or tastes like this. #include "configreader.h" #include "socket.h" +#define DN_COMP_BITMASK 0xC000 /* highest 6 bits in a DN label header */ + /** Masks to mask off the responses we get from the DNSRequest methods */ enum QueryInfo @@ -98,7 +100,7 @@ class DNSRequest DNSRequest(DNS* dns, int id, const std::string &original); ~DNSRequest(); - DNSInfo ResultIsReady(DNSHeader &h, int length); + DNSInfo ResultIsReady(DNSHeader &h, unsigned length); int SendRequests(const DNSHeader *header, const int length, QueryType qt); }; @@ -161,7 +163,10 @@ int CachedQuery::CalcTTLRemaining() /* Allocate the processing buffer */ DNSRequest::DNSRequest(DNS* dns, int rid, const std::string &original) : dnsobj(dns) { - res = new unsigned char[512]; + /* hardening against overflow here: make our work buffer twice the theoretical + * maximum size so that hostile input doesn't screw us over. + */ + res = new unsigned char[sizeof(DNSHeader) * 2]; *res = 0; orig = original; RequestTimeout* RT = new RequestTimeout(ServerInstance->Config->dns_timeout ? ServerInstance->Config->dns_timeout : 5, this, rid); @@ -688,11 +693,11 @@ DNSResult DNS::GetResult() } /** A result is ready, process it */ -DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length) +DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, unsigned length) { - int i = 0; + unsigned i = 0, o; int q = 0; - int curanswer, o; + int curanswer; ResourceRecord rr; unsigned short ptr; @@ -790,17 +795,31 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length) switch (rr.type) { + /* + * CNAME and PTR are compressed. We need to decompress them. + */ case DNS_QUERY_CNAME: - /* CNAME and PTR have the same processing code */ case DNS_QUERY_PTR: o = 0; q = 0; while (q == 0 && i < length && o + 256 < 1023) { + /* DN label found (byte over 63) */ if (header.payload[i] > 63) { memcpy(&ptr,&header.payload[i],2); - i = ntohs(ptr) - 0xC000 - 12; + + i = ntohs(ptr); + + /* check that highest two bits are set. if not, we've been had */ + if (!(i & DN_COMP_BITMASK)) + return std::make_pair((unsigned char *) NULL, "DN label decompression header is bogus"); + + /* mask away the two highest bits. */ + i &= ~DN_COMP_BITMASK; + + /* and decrease length by 12 bytes. */ + i =- 12; } else { @@ -813,7 +832,11 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length) res[o] = 0; if (o != 0) res[o++] = '.'; - memcpy(&res[o],&header.payload[i + 1],header.payload[i]); + + if (o + header.payload[i] > sizeof(DNSHeader)) + return std::make_pair((unsigned char *) NULL, "DN label decompression is impossible -- malformed/hostile packet?"); + + memcpy(&res[o], &header.payload[i + 1], header.payload[i]); o += header.payload[i]; i += header.payload[i] + 1; } @@ -822,16 +845,21 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length) res[o] = 0; break; case DNS_QUERY_AAAA: + if (rr.rdlength != sizeof(struct in6_addr)) + return std::make_pair((unsigned char *) NULL, "rr.rdlength is larger than 16 bytes for an ipv6 entry -- malformed/hostile packet?"); + memcpy(res,&header.payload[i],rr.rdlength); res[rr.rdlength] = 0; break; case DNS_QUERY_A: + if (rr.rdlength != sizeof(struct in_addr)) + return std::make_pair((unsigned char *) NULL, "rr.rdlength is larger than 4 bytes for an ipv4 entry -- malformed/hostile packet?"); + memcpy(res,&header.payload[i],rr.rdlength); res[rr.rdlength] = 0; break; default: - memcpy(res,&header.payload[i],rr.rdlength); - res[rr.rdlength] = 0; + return std::make_pair((unsigned char *) NULL, "don't know how to handle undefined type (" + ConvToStr(rr.type) + ") -- rejecting"); break; } return std::make_pair(res,"No error");
1
37a1710e2dab6ed91128ea648d654a22fbe2a6af
https://github.com/ImageMagick/ImageMagick/commit/37a1710e2dab6ed91128ea648d654a22fbe2a6af
https://github.com/ImageMagick/ImageMagick/issues/350
diff --git a/coders/psd.c b/coders/psd.c index 58496fd96d..14e375b9ed 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -2606,7 +2606,7 @@ static ssize_t WritePSDChannels(const PSDInfo *psd_info, compact_pixels=(unsigned char *) NULL; if (next_image->compression == RLECompression) { - compact_pixels=AcquireCompactPixels(image); + compact_pixels=AcquireCompactPixels(next_image); if (compact_pixels == (unsigned char *) NULL) return(0); }
1
b27f38a67573f4c989710c9bfb726dd4c1eeb929
https://github.com/fedora-infra/python-fedora/commit/b27f38a67573f4c989710c9bfb726dd4c1eeb929
Disable covert redirects and CSRF token leaking This disallows the url() function from returning any remote URLs. This prevents covert redirects, and also prevents us from leaking CSRF tokens to outside parties. Signed-off-by: Patrick Uiterwijk <[email protected]>
diff --git a/fedora/tg/utils.py b/fedora/tg/utils.py index 4f18f31..9913df7 100644 --- a/fedora/tg/utils.py +++ b/fedora/tg/utils.py @@ -81,6 +81,11 @@ def url(tgpath, tgparams=None, **kwargs): ''' if not isinstance(tgpath, six.string_types): tgpath = '/'.join(list(tgpath)) + if not tgpath.startswith('/'): + # Do not allow the url() function to be used for external urls. + # This function is primarily used in redirect() calls, so this prevents + # covert redirects and thus CSRF leaking. + tgpath = '/' if tgpath.startswith('/'): webpath = (config.get('server.webpath') or '').rstrip('/') if tg_util.request_available():
1
63bf4255b55ba5c0205414452d3b33ccb46cd692
https://github.com/ThomasDickey/lynx-snapshots/commit/63bf4255b55ba5c0205414452d3b33ccb46cd692
snapshot of project "lynx", label v2-9-0dev_5b
diff --git a/CHANGES b/CHANGES index cd207d29..09a4ce64 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@ --- $LynxId: CHANGES,v 1.1047 2020/03/01 13:59:22 tom Exp $ +-- $LynxId: CHANGES,v 1.1048 2020/03/03 11:46:07 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2020-02-27 (2.9.0dev.6) +2020-03-03 (2.9.0dev.6) +* add Windows-specific initialization in tidy_tls.c -GV * update eo.po from http://translationproject.org/latest/lynx diff --git a/src/tidy_tls.c b/src/tidy_tls.c index c9d78e45..b0288fb8 100644 --- a/src/tidy_tls.c +++ b/src/tidy_tls.c @@ -1,5 +1,5 @@ /* - * $LynxId: tidy_tls.c,v 1.40 2020/01/21 22:26:43 tom Exp $ + * $LynxId: tidy_tls.c,v 1.41 2020/03/03 11:46:07 Gisle.Vanem Exp $ * Copyright 2008-2019,2020 Thomas E. Dickey * with fix Copyright 2008 by Thomas Viehmann * @@ -499,12 +499,32 @@ int SSL_read(SSL * ssl, void *buffer, int length) return rc; } +#ifdef _WINDOWS +static int Lynx_gtls_push(void *s, const void *buf, size_t len) +{ + return NETWRITE((SOCKET) s, buf, len); +} + +/* This calls 'recv()' in a thread for every GnuTls pull. Maybe too much overhead? + */ +static int Lynx_gtls_pull(void *s, void *buf, size_t len) +{ + return NETREAD((SOCKET) s, buf, len); +} +#endif + /* * Connect the SSL object with a file descriptor. * This always returns 1 (success) since GNU TLS does not check for errors. */ int SSL_set_fd(SSL * ssl, int fd) { +#ifdef _WINDOWS + /* register callback functions to send and receive data. */ + gnutls_transport_set_push_function(ssl->gnutls_state, Lynx_gtls_push); + gnutls_transport_set_pull_function(ssl->gnutls_state, Lynx_gtls_pull); +#endif + gnutls_transport_set_ptr(ssl->gnutls_state, (gnutls_transport_ptr_t) (intptr_t) (fd)); return 1;
0
140ee8d2204b383279f854802b27bdb41c1d5d1a
https://github.com/miniupnp/miniupnp/commit/140ee8d2204b383279f854802b27bdb41c1d5d1a
minissdpd.c: Initialize pointers to NULL (fix)
diff --git a/minissdpd/minissdpd.c b/minissdpd/minissdpd.c index 2421a42e..5e79293e 100644 --- a/minissdpd/minissdpd.c +++ b/minissdpd/minissdpd.c @@ -658,6 +658,7 @@ void processRequest(struct reqelem * req) syslog(LOG_ERR, "cannot allocate memory"); goto error; } + memset(newserv, 0, sizeof(struct service)); /* set pointers to NULL */ if(containsForbiddenChars(p, l)) { syslog(LOG_ERR, "bad request (st contains forbidden chars)"); goto error;
1
ec30db9afada9cb52852082ce4d7d0095524f3b3
https://github.com/vmware/xenon/commit/ec30db9afada9cb52852082ce4d7d0095524f3b3
Add auth to UtilityService Extend auth check to UtiliyService endpoints: stats, config, subscription Issue: VRXEN-5 Change-Id: I52a4b4a42731c244a97f97610dcaddb6837e67fb
diff --git a/xenon-common/src/main/java/com/vmware/xenon/common/UtilityService.java b/xenon-common/src/main/java/com/vmware/xenon/common/UtilityService.java index 23c9f05e5..39378486a 100644 --- a/xenon-common/src/main/java/com/vmware/xenon/common/UtilityService.java +++ b/xenon-common/src/main/java/com/vmware/xenon/common/UtilityService.java @@ -144,7 +144,29 @@ public UtilityService setParent(Service parent) { @Override public void authorizeRequest(Operation op) { - op.complete(); + + String suffix = UriUtils.buildUriPath(UriUtils.URI_PATH_CHAR, UriUtils.getLastPathSegment(op.getUri())); + + // allow access to ui endpoint + if (ServiceHost.SERVICE_URI_SUFFIX_UI.equals(suffix)) { + op.complete(); + return; + } + + ServiceDocument doc = new ServiceDocument(); + if (this.parent.getOptions().contains(ServiceOption.FACTORY_ITEM)) { + doc.documentSelfLink = UriUtils.buildUriPath(UriUtils.getParentPath(this.parent.getSelfLink()), suffix); + } else { + doc.documentSelfLink = UriUtils.buildUriPath(this.parent.getSelfLink(), suffix); + } + + doc.documentKind = Utils.buildKind(this.parent.getStateType()); + if (getHost().isAuthorized(this.parent, doc, op)) { + op.complete(); + return; + } + + op.fail(Operation.STATUS_CODE_FORBIDDEN); } @Override diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestAuthorization.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestAuthorization.java index bfdaa2082..56b045b57 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestAuthorization.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestAuthorization.java @@ -462,16 +462,20 @@ public void guestAuthorization() throws Throwable { .setBody(state)); assertEquals(Operation.STATUS_CODE_UNAUTHORIZED, failureResponse.op.getStatusCode()); + OperationContext.setAuthorizationContext(this.host.getSystemAuthorizationContext()); Map<String, ServiceStats.ServiceStat> stat = this.host.getServiceStats( UriUtils.buildUri(this.host, ServiceUriPaths.CORE_MANAGEMENT)); double currentInsertCount = stat.get( ServiceHostManagementService.STAT_NAME_AUTHORIZATION_CACHE_INSERT_COUNT).latestValue; + OperationContext.setAuthorizationContext(null); // Make a second request and verify that the cache did not get updated, instead Xenon re-used // the cached Guest authorization context. sender.sendAndWait(Operation.createGet(this.host, ExampleService.FACTORY_LINK)); + OperationContext.setAuthorizationContext(this.host.getSystemAuthorizationContext()); stat = this.host.getServiceStats( UriUtils.buildUri(this.host, ServiceUriPaths.CORE_MANAGEMENT)); + OperationContext.setAuthorizationContext(null); double newInsertCount = stat.get( ServiceHostManagementService.STAT_NAME_AUTHORIZATION_CACHE_INSERT_COUNT).latestValue; assertTrue(currentInsertCount == newInsertCount); @@ -709,6 +713,16 @@ public void statefulServiceAuthorization() throws Throwable { })); this.host.testWait(ctx2); + // do GET on factory /stats, we should get 403 + Operation statsGet = Operation.createGet(this.host, + ExampleService.FACTORY_LINK + ServiceHost.SERVICE_URI_SUFFIX_STATS); + this.host.sendAndWaitExpectFailure(statsGet, Operation.STATUS_CODE_FORBIDDEN); + + // do GET on factory /config, we should get 403 + Operation configGet = Operation.createGet(this.host, + ExampleService.FACTORY_LINK + ServiceHost.SERVICE_URI_SUFFIX_CONFIG); + this.host.sendAndWaitExpectFailure(configGet, Operation.STATUS_CODE_FORBIDDEN); + // Assume Jane's identity this.host.assumeIdentity(this.userServicePath); // add docs accessible by jane @@ -750,9 +764,27 @@ public void statefulServiceAuthorization() throws Throwable { // reset the auth context OperationContext.setAuthorizationContext(null); + // do GET on utility suffixes in example child services, we should get 403 + for (URI childUri : exampleServices.keySet()) { + statsGet = Operation.createGet(this.host, + childUri.getPath() + ServiceHost.SERVICE_URI_SUFFIX_STATS); + this.host.sendAndWaitExpectFailure(statsGet, Operation.STATUS_CODE_FORBIDDEN); + configGet = Operation.createGet(this.host, + childUri.getPath() + ServiceHost.SERVICE_URI_SUFFIX_CONFIG); + this.host.sendAndWaitExpectFailure(configGet, Operation.STATUS_CODE_FORBIDDEN); + } + // Assume Jane's identity through header auth token String authToken = generateAuthToken(this.userServicePath); + // do GET on utility suffixes in example child services, we should get 200 + for (URI childUri : exampleServices.keySet()) { + statsGet = Operation.createGet(this.host, + childUri.getPath() + ServiceHost.SERVICE_URI_SUFFIX_STATS); + statsGet.addRequestHeader(Operation.REQUEST_AUTH_TOKEN_HEADER, authToken); + this.host.sendAndWaitExpectSuccess(statsGet); + } + verifyJaneAccess(exampleServices, authToken); // test user impersonation diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestExampleServiceHost.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestExampleServiceHost.java index 572d816cb..a3fd5a2c8 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestExampleServiceHost.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestExampleServiceHost.java @@ -81,10 +81,6 @@ public void createUsers() throws Throwable { * isn't created immediately, so this polls. */ private String loginUser(URI hostUri) throws Throwable { - URI usersLink = UriUtils.buildUri(hostUri, UserService.FACTORY_LINK); - // wait for factory availability - this.host.waitForReplicatedFactoryServiceAvailable(usersLink); - String basicAuth = BasicAuthenticationUtils.constructBasicAuth(adminUser, adminUser); URI loginUri = UriUtils.buildUri(hostUri, ServiceUriPaths.CORE_AUTHN_BASIC); AuthenticationRequest login = new AuthenticationRequest(); diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestServiceHost.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestServiceHost.java index ca1ad1a89..b78a7e850 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestServiceHost.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestServiceHost.java @@ -421,9 +421,13 @@ private void doRequestRateLimits() throws Throwable { ri.limit = limit; ri.options = EnumSet.of(RequestRateInfo.Option.PAUSE_PROCESSING); this.host.setRequestRateLimit(userPath, ri); - this.host.assumeIdentity(userPath); + this.host.setSystemAuthorizationContext(); ServiceStat rateLimitStatBefore = getRateLimitOpCountStat(); + this.host.resetSystemAuthorizationContext(); + + this.host.assumeIdentity(userPath); + if (rateLimitStatBefore == null) { rateLimitStatBefore = new ServiceStat(); rateLimitStatBefore.latestValue = 0.0; @@ -442,7 +446,10 @@ private void doRequestRateLimits() throws Throwable { } this.host.testWait(ctx2); ctx2.logAfter(); + + this.host.setSystemAuthorizationContext(); ServiceStat rateLimitStatAfter = getRateLimitOpCountStat(); + this.host.resetSystemAuthorizationContext(); assertTrue(rateLimitStatAfter.latestValue > rateLimitStatBefore.latestValue); this.host.setMaintenanceIntervalMicros( @@ -472,7 +479,9 @@ private void doRequestRateLimits() throws Throwable { ctx3.logAfter(); // verify rate limiting did not happen + this.host.setSystemAuthorizationContext(); ServiceStat rateLimitStatExpectSame = getRateLimitOpCountStat(); + this.host.resetSystemAuthorizationContext(); assertTrue(rateLimitStatAfter.latestValue == rateLimitStatExpectSame.latestValue); } @@ -2627,8 +2636,9 @@ private ServiceStat getODLStopCountStat() throws Throwable { private ServiceStat getRateLimitOpCountStat() throws Throwable { URI managementServiceUri = this.host.getManagementServiceUri(); - return this.host.getServiceStats(managementServiceUri) + ServiceStat stats = this.host.getServiceStats(managementServiceUri) .get(ServiceHostManagementService.STAT_NAME_RATE_LIMITED_OP_COUNT); + return stats; } @Test diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestSubscriptions.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestSubscriptions.java index 209d33e4b..66ab78170 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestSubscriptions.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestSubscriptions.java @@ -300,11 +300,14 @@ public void subscriptionsWithAuth() throws Throwable { } }; + + hostWithAuth.setSystemAuthorizationContext(); Operation subscribe = Operation.createPost(UriUtils.buildUri(hostWithAuth, minimalServiceUUID)); subscribe.setReferer(hostWithAuth.getReferer()); ServiceSubscriber subscriber = new ServiceSubscriber(); subscriber.replayState = true; hostWithAuth.startSubscriptionService(subscribe, notifyC, subscriber); + hostWithAuth.resetAuthorizationContext(); hostWithAuth.testWait(notifyContext); } finally { if (hostWithAuth != null) { diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestSynchronizationTaskService.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestSynchronizationTaskService.java index 02593c554..ee0af53a6 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestSynchronizationTaskService.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestSynchronizationTaskService.java @@ -387,6 +387,7 @@ public ExampleServiceState synchAfterOwnerRestartDo( } @Test + @Ignore public void synchAfterClusterRestart() throws Throwable { setUpMultiNode(); String factoryLink = ExampleService.FACTORY_LINK; diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/TestUtilityService.java b/xenon-common/src/test/java/com/vmware/xenon/common/TestUtilityService.java index a031bcb90..f281dc5db 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/TestUtilityService.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/TestUtilityService.java @@ -14,8 +14,12 @@ package com.vmware.xenon.common; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; +import static com.vmware.xenon.common.ServiceHost.SERVICE_URI_SUFFIX_TEMPLATE; +import static com.vmware.xenon.common.ServiceHost.SERVICE_URI_SUFFIX_UI; + import java.net.URI; import java.util.ArrayList; import java.util.EnumSet; @@ -34,10 +38,16 @@ import com.vmware.xenon.common.ServiceStats.TimeSeriesStats; import com.vmware.xenon.common.ServiceStats.TimeSeriesStats.AggregationType; import com.vmware.xenon.common.ServiceStats.TimeSeriesStats.TimeBin; +import com.vmware.xenon.common.test.AuthTestUtils; import com.vmware.xenon.common.test.TestContext; +import com.vmware.xenon.common.test.TestRequestSender; +import com.vmware.xenon.common.test.TestRequestSender.FailureResponse; +import com.vmware.xenon.common.test.VerificationHost; +import com.vmware.xenon.services.common.AuthorizationContextService; import com.vmware.xenon.services.common.ExampleService; import com.vmware.xenon.services.common.ExampleService.ExampleServiceState; import com.vmware.xenon.services.common.MinimalTestService; +import com.vmware.xenon.services.common.QueryTask.Query; import com.vmware.xenon.services.common.ServiceUriPaths; public class TestUtilityService extends BasicReusableHostTestCase { @@ -823,4 +833,144 @@ public void statsKeyOrder() { assertEquals("stat index 2", "keyCCC", statList.get(2)); } + @Test + public void endpointAuthorization() throws Throwable { + VerificationHost host = VerificationHost.create(0); + host.setAuthorizationService(new AuthorizationContextService()); + host.setAuthorizationEnabled(true); + host.setMaintenanceIntervalMicros(TimeUnit.MILLISECONDS.toMicros(100)); + host.start(); + + TestRequestSender sender = host.getTestRequestSender(); + + host.setSystemAuthorizationContext(); + host.waitForReplicatedFactoryServiceAvailable(UriUtils.buildUri(host, ExampleService.FACTORY_LINK)); + + String exampleUser = "[email protected]"; + String examplePass = "password"; + TestContext authCtx = host.testCreate(1); + AuthorizationSetupHelper.create() + .setHost(host) + .setUserEmail(exampleUser) + .setUserPassword(examplePass) + .setResourceQuery(Query.Builder.create() + .addFieldClause(ServiceDocument.FIELD_NAME_KIND, Utils.buildKind(ExampleServiceState.class)) + .build()) + .setCompletion(authCtx.getCompletion()) + .start(); + authCtx.await(); + + // create a sample service + ExampleServiceState doc = new ExampleServiceState(); + doc.name = "foo"; + doc.documentSelfLink = "foo"; + + Operation post = Operation.createPost(host, ExampleService.FACTORY_LINK).setBody(doc); + ExampleServiceState postResult = sender.sendAndWait(post, ExampleServiceState.class); + + host.resetAuthorizationContext(); + + URI factoryAvailableUri = UriUtils.buildAvailableUri(host, ExampleService.FACTORY_LINK); + URI factoryStatsUri = UriUtils.buildStatsUri(host, ExampleService.FACTORY_LINK); + URI factoryConfigUri = UriUtils.buildConfigUri(host, ExampleService.FACTORY_LINK); + URI factorySubscriptionUri = UriUtils.buildSubscriptionUri(host, ExampleService.FACTORY_LINK); + URI factoryTemplateUri = UriUtils.buildUri(host, UriUtils.buildUriPath(ExampleService.FACTORY_LINK, SERVICE_URI_SUFFIX_TEMPLATE)); + URI factoryUiUri = UriUtils.buildUri(host, UriUtils.buildUriPath(ExampleService.FACTORY_LINK, SERVICE_URI_SUFFIX_UI)); + + URI serviceAvailableUri = UriUtils.buildAvailableUri(host, postResult.documentSelfLink); + URI serviceStatsUri = UriUtils.buildStatsUri(host, postResult.documentSelfLink); + URI serviceConfigUri = UriUtils.buildConfigUri(host, postResult.documentSelfLink); + URI serviceSubscriptionUri = UriUtils.buildSubscriptionUri(host, postResult.documentSelfLink); + URI serviceTemplateUri = UriUtils.buildUri(host, UriUtils.buildUriPath(postResult.documentSelfLink, SERVICE_URI_SUFFIX_TEMPLATE)); + URI serviceUiUri = UriUtils.buildUri(host, UriUtils.buildUriPath(postResult.documentSelfLink, SERVICE_URI_SUFFIX_UI)); + + // check non-authenticated user receives forbidden response + FailureResponse failureResponse; + Operation uiOpResult; + + // check factory endpoints + failureResponse = sender.sendAndWaitFailure(Operation.createGet(factoryAvailableUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(factoryStatsUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(factoryConfigUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(factorySubscriptionUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(factoryTemplateUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + uiOpResult = sender.sendAndWait(Operation.createGet(factoryUiUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, uiOpResult.getStatusCode()); + + // check service endpoints + failureResponse = sender.sendAndWaitFailure(Operation.createGet(serviceAvailableUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(serviceStatsUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(serviceConfigUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(serviceSubscriptionUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + failureResponse = sender.sendAndWaitFailure(Operation.createGet(serviceTemplateUri)); + assertEquals(Operation.STATUS_CODE_FORBIDDEN, failureResponse.op.getStatusCode()); + + uiOpResult = sender.sendAndWait(Operation.createGet(serviceUiUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, uiOpResult.getStatusCode()); + + + // check authenticated user does NOT receive forbidden response + AuthTestUtils.login(host, exampleUser, examplePass); + + Operation response; + + // check factory endpoints + response = sender.sendAndWait(Operation.createGet(factoryAvailableUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(factoryStatsUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(factoryConfigUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(factorySubscriptionUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(factoryTemplateUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(factoryUiUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + + // check service endpoints + response = sender.sendAndWait(Operation.createGet(serviceAvailableUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(serviceStatsUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(serviceConfigUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(serviceSubscriptionUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(serviceTemplateUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + response = sender.sendAndWait(Operation.createGet(serviceUiUri)); + assertNotEquals(Operation.STATUS_CODE_FORBIDDEN, response.getStatusCode()); + + } + } diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/test/AuthorizationHelper.java b/xenon-common/src/test/java/com/vmware/xenon/common/test/AuthorizationHelper.java index e847ddb36..162051d6a 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/test/AuthorizationHelper.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/test/AuthorizationHelper.java @@ -30,6 +30,7 @@ import com.vmware.xenon.common.ServiceHost; import com.vmware.xenon.common.UriUtils; import com.vmware.xenon.common.Utils; +import com.vmware.xenon.services.common.ExampleService; import com.vmware.xenon.services.common.ExampleService.ExampleServiceState; import com.vmware.xenon.services.common.QueryTask; import com.vmware.xenon.services.common.QueryTask.Query; @@ -247,6 +248,22 @@ public String getUserGroupName(String email) { UriUtils.buildUriPath(ServiceUriPaths.CORE_AUTHZ_USERS, email)) .build()); + // Create resource group to allow access on utility paths + String statsResourceGroupLink = createResourceGroup(target, "stats-resource-group", + Builder.create() + .addFieldClause( + ServiceDocument.FIELD_NAME_SELF_LINK, + ExampleService.FACTORY_LINK + ServiceHost.SERVICE_URI_SUFFIX_STATS) + .build()); + + String subscriptionsResourceGroupLink = createResourceGroup(target, "subs-resource-group", + Builder.create() + .addFieldClause( + ServiceDocument.FIELD_NAME_SELF_LINK, + ServiceUriPaths.CORE_LOCAL_QUERY_TASKS + + ServiceHost.SERVICE_URI_SUFFIX_SUBSCRIPTIONS) + .build()); + Collection<String> paths = new HashSet<>(); // Create roles tying these together @@ -261,6 +278,16 @@ public String getUserGroupName(String email) { // Create role authorizing access to the user's own query tasks paths.add(createRole(target, userGroupLink, queryTaskResourceGroupLink, new HashSet<>(Arrays.asList(Action.GET, Action.POST, Action.PATCH, Action.DELETE)))); + + // Create role authorizing access to /stats + paths.add(createRole(target, userGroupLink, statsResourceGroupLink, + new HashSet<>( + Arrays.asList(Action.GET, Action.POST, Action.PATCH, Action.DELETE)))); + + // Create role authorizing access to /subscriptions of query tasks + paths.add(createRole(target, userGroupLink, subscriptionsResourceGroupLink, + new HashSet<>( + Arrays.asList(Action.GET, Action.POST, Action.PATCH, Action.DELETE)))); return paths; } diff --git a/xenon-common/src/test/java/com/vmware/xenon/common/test/VerificationHost.java b/xenon-common/src/test/java/com/vmware/xenon/common/test/VerificationHost.java index 0cb27957c..911756552 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/common/test/VerificationHost.java +++ b/xenon-common/src/test/java/com/vmware/xenon/common/test/VerificationHost.java @@ -83,6 +83,7 @@ import com.vmware.xenon.common.Operation; import com.vmware.xenon.common.Operation.AuthorizationContext; import com.vmware.xenon.common.Operation.CompletionHandler; +import com.vmware.xenon.common.OperationContext; import com.vmware.xenon.common.Service; import com.vmware.xenon.common.Service.Action; import com.vmware.xenon.common.Service.ServiceOption; @@ -1052,7 +1053,15 @@ public ServiceDocumentQueryResult getExpandedFactoryState(URI factoryUri) { } public Map<String, ServiceStat> getServiceStats(URI serviceUri) { + AuthorizationContext ctx = null; + if (this.isAuthorizationEnabled()) { + ctx = OperationContext.getAuthorizationContext(); + this.setSystemAuthorizationContext(); + } ServiceStats stats = this.sender.sendStatsGetAndWait(serviceUri); + if (this.isAuthorizationEnabled()) { + this.setAuthorizationContext(ctx); + } return stats.entries; } diff --git a/xenon-common/src/test/java/com/vmware/xenon/services/common/TestNodeGroupService.java b/xenon-common/src/test/java/com/vmware/xenon/services/common/TestNodeGroupService.java index 9045b5f11..d042f79cc 100644 --- a/xenon-common/src/test/java/com/vmware/xenon/services/common/TestNodeGroupService.java +++ b/xenon-common/src/test/java/com/vmware/xenon/services/common/TestNodeGroupService.java @@ -3023,6 +3023,7 @@ public void replicationWithAuthzCacheClear() throws Throwable { VerificationHost groupHost = this.host.getPeerHost(); + groupHost.setSystemAuthorizationContext(); // wait for auth related services to be stabilized groupHost.waitForReplicatedFactoryServiceAvailable( UriUtils.buildUri(groupHost, UserService.FACTORY_LINK)); @@ -3040,7 +3041,7 @@ public void replicationWithAuthzCacheClear() throws Throwable { String bazUserLink = UriUtils.buildUriPath(ServiceUriPaths.CORE_AUTHZ_USERS, "[email protected]"); - groupHost.setSystemAuthorizationContext(); + // create user, user-group, resource-group, role for [email protected] // user: /core/authz/users/[email protected] @@ -3251,7 +3252,7 @@ private void populateAuthCacheInAllPeers(AuthorizationContext authContext) throw // based on the role created in test, all users have access to ExampleService this.host.sendAndWaitExpectSuccess( - Operation.createGet(UriUtils.buildStatsUri(peer, ExampleService.FACTORY_LINK))); + Operation.createGet(UriUtils.buildUri(peer, ExampleService.FACTORY_LINK))); } this.host.waitFor("Timeout waiting for correct auth cache state",
1
e63be2769c039e4e9ada523a8497ce3206cc8a9b
https://github.com/josh/rails/commit/e63be2769c039e4e9ada523a8497ce3206cc8a9b
Convert StrongParameters cache to a hash. This fixes an unbounded memory leak demonstrated on @tenderlove's latest blog post: http://tenderlovemaking.com/2014/06/02/yagni-methods-are-killing-me.html
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index d86d49c9dc510..265048a308aaa 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -130,7 +130,7 @@ def initialize(attributes = nil) # looping in the common use case permit + mass-assignment. Defined in a # method to instantiate it only if needed. def converted_arrays - @converted_arrays ||= Set.new + @converted_arrays ||= {} end # Returns +true+ if the parameter is permitted, +false+ otherwise. @@ -333,15 +333,15 @@ def permitted=(new_permitted) private def convert_hashes_to_parameters(key, value, assign_if_converted=true) - converted = convert_value_to_parameters(value) + converted = convert_value_to_parameters(key, value) self[key] = converted if assign_if_converted && !converted.equal?(value) converted end - def convert_value_to_parameters(value) - if value.is_a?(Array) && !converted_arrays.member?(value) - converted = value.map { |_| convert_value_to_parameters(_) } - converted_arrays << converted + def convert_value_to_parameters(key, value) + if value.is_a?(Array) && !converted_arrays.member?(key) + converted = value.map { |v| convert_value_to_parameters(nil, v) } + converted_arrays[key] = converted if key converted elsif value.is_a?(Parameters) || !value.is_a?(Hash) value diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index 33a91d72d94f5..1856ecd42be05 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -169,7 +169,7 @@ def assert_filtered_out(params, key) test 'arrays are converted at most once' do params = ActionController::Parameters.new(foo: [{}]) - assert params[:foo].equal?(params[:foo]) + assert_same params[:foo], params[:foo] end test "fetch doesnt raise ParameterMissing exception if there is a default" do
1
d100d0c28a9a11601bc7c7780f4fd41a5bdca41d
https://github.com/markevans/dragonfly/commit/d100d0c28a9a11601bc7c7780f4fd41a5bdca41d
Replace after_destroy by after_commit on: :destroy
diff --git a/lib/dragonfly/model/class_methods.rb b/lib/dragonfly/model/class_methods.rb index f82c6650..b93ca93d 100644 --- a/lib/dragonfly/model/class_methods.rb +++ b/lib/dragonfly/model/class_methods.rb @@ -30,7 +30,12 @@ def dragonfly_accessor(attribute, opts={}, &config_block) # Add callbacks before_save :save_dragonfly_attachments if respond_to?(:before_save) - after_destroy :destroy_dragonfly_attachments if respond_to?(:after_destroy) + case + when respond_to?(:after_commit) + after_commit :destroy_dragonfly_attachments, on: :destroy + when respond_to?(:after_destroy) + after_destroy :destroy_dragonfly_attachments + end # Register the new attribute dragonfly_attachment_classes << new_dragonfly_attachment_class(attribute, app, config_block)
0
acaac81f96fec91ab45bd0412beaf9c3acd8defa#diff-e75226a9ca49217a7276b29242ec59ce
https://github.com/bcgit/bc-java/commit/acaac81f96fec91ab45bd0412beaf9c3acd8defa#diff-e75226a9ca49217a7276b29242ec59ce
added randomizer to DSA signature generation
diff --git a/core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java b/core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java index 44f838b25..920611bcb 100644 --- a/core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java +++ b/core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java @@ -95,7 +95,8 @@ public void init( BigInteger k = kCalculator.nextK(); - BigInteger r = params.getG().modPow(k, params.getP()).mod(q); + // the randomizer is to conceal timing information related to k and x. + BigInteger r = params.getG().modPow(k.add(getRandomizer(q, random)), params.getP()).mod(q); k = k.modInverse(q).multiply(m.add(x.multiply(r))); @@ -163,4 +164,12 @@ protected SecureRandom initSecureRandom(boolean needed, SecureRandom provided) { return !needed ? null : (provided != null) ? provided : new SecureRandom(); } + + private BigInteger getRandomizer(BigInteger q, SecureRandom provided) + { + // Calculate a random multiple of q to add to k. Note that g^q = 1 (mod p), so adding multiple of q to k does not change r. + int randomBits = 7; + + return new BigInteger(randomBits, provided != null ? provided : new SecureRandom()).add(BigInteger.valueOf(128)).multiply(q); + } } diff --git a/core/src/test/java/org/bouncycastle/crypto/test/DSATest.java b/core/src/test/java/org/bouncycastle/crypto/test/DSATest.java index 088e494ce..5f1a1f867 100644 --- a/core/src/test/java/org/bouncycastle/crypto/test/DSATest.java +++ b/core/src/test/java/org/bouncycastle/crypto/test/DSATest.java @@ -44,7 +44,7 @@ byte[] keyData = Hex.decode("b5014e4b60ef2ba8b6211b4062ba3224e0427dd3"); SecureRandom keyRandom = new FixedSecureRandom( - new FixedSecureRandom.Source[] { new FixedSecureRandom.Data(keyData), new FixedSecureRandom.Data(keyData) }); + new FixedSecureRandom.Source[] { new FixedSecureRandom.Data(keyData), new FixedSecureRandom.Data(keyData), new FixedSecureRandom.Data(Hex.decode("01020304"))}); BigInteger pValue = new BigInteger("8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291", 16); BigInteger qValue = new BigInteger("c773218c737ec8ee993b4f2ded30f48edace915f", 16); @@ -165,7 +165,11 @@ private void testDSAsha3(int size, BigInteger s) "A5613957D7E5C7A6D5A5834B4CB069E0831753ECF65BA02B", 16); DSAPrivateKeyParameters priKey = new DSAPrivateKeyParameters(x, dsaParams); - SecureRandom k = new TestRandomBigInteger("72546832179840998877302529996971396893172522460793442785601695562409154906335"); + SecureRandom k = new FixedSecureRandom( + new FixedSecureRandom.Source[] { + new FixedSecureRandom.BigInteger(BigIntegers.asUnsignedByteArray(new BigInteger("72546832179840998877302529996971396893172522460793442785601695562409154906335"))), + new FixedSecureRandom.Data(Hex.decode("01020304")) + }); byte[] M = Hex.decode("1BD4ED430B0F384B4E8D458EFF1A8A553286D7AC21CB2F6806172EF5F94A06AD"); @@ -287,7 +291,10 @@ private void dsa2Test1() DSASigner signer = new DSASigner(); - signer.init(true, new ParametersWithRandom(kp.getPrivate(), new TestRandomBigInteger("349C55648DCF992F3F33E8026CFAC87C1D2BA075", 16))); + signer.init(true, new ParametersWithRandom(kp.getPrivate(), new FixedSecureRandom( + new FixedSecureRandom.Source[] { + new FixedSecureRandom.BigInteger("349C55648DCF992F3F33E8026CFAC87C1D2BA075"), + new FixedSecureRandom.Data(Hex.decode("01020304")) }))); byte[] msg = Hex.decode("A9993E364706816ABA3E25717850C26C9CD0D89D"); @@ -404,7 +411,11 @@ private void dsa2Test2() DSASigner signer = new DSASigner(); - signer.init(true, new ParametersWithRandom(kp.getPrivate(), new TestRandomData(Hex.decode("735959CC4463B8B440E407EECA8A473BF6A6D1FE657546F67D401F05")))); + signer.init(true, new ParametersWithRandom(kp.getPrivate(), new FixedSecureRandom( + new FixedSecureRandom.Source[] { + new FixedSecureRandom.BigInteger(Hex.decode("735959CC4463B8B440E407EECA8A473BF6A6D1FE657546F67D401F05")), + new FixedSecureRandom.Data(Hex.decode("01020304")) + }))); byte[] msg = Hex.decode("23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7E36C9DA7"); @@ -520,7 +531,11 @@ private void dsa2Test3() DSASigner signer = new DSASigner(); - signer.init(true, new ParametersWithRandom(kp.getPrivate(), new TestRandomData(Hex.decode("0CAF2EF547EC49C4F3A6FE6DF4223A174D01F2C115D49A6F73437C29A2A8458C")))); + signer.init(true, new ParametersWithRandom(kp.getPrivate(), new FixedSecureRandom( + new FixedSecureRandom.Source[] { + new FixedSecureRandom.BigInteger(Hex.decode("0CAF2EF547EC49C4F3A6FE6DF4223A174D01F2C115D49A6F73437C29A2A8458C")), + new FixedSecureRandom.Data(Hex.decode("01020304")) + }))); byte[] msg = Hex.decode("BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD"); @@ -651,7 +666,10 @@ private void dsa2Test4() DSASigner signer = new DSASigner(); - signer.init(true, new ParametersWithRandom(kp.getPrivate(), new TestRandomData(Hex.decode("A6902C1E6E3943C5628061588A8B007BCCEA91DBF12915483F04B24AB0678BEE")))); + signer.init(true, new ParametersWithRandom(kp.getPrivate(), new FixedSecureRandom( + new FixedSecureRandom.Source[] + { new FixedSecureRandom.BigInteger("A6902C1E6E3943C5628061588A8B007BCCEA91DBF12915483F04B24AB0678BEE"), + new FixedSecureRandom.Data(Hex.decode("01020304")) }))); byte[] msg = Hex.decode("BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD"); diff --git a/prov/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java b/prov/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java index 30eba82e8..a388c0e1b 100644 --- a/prov/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java +++ b/prov/src/test/java/org/bouncycastle/jce/provider/test/DSATest.java @@ -686,7 +686,9 @@ private void testDSAsha3(ASN1ObjectIdentifier sigOid, int size, BigInteger s) private void doDsaTest(String sigName, BigInteger s, KeyFactory ecKeyFact, DSAPublicKeySpec pubKey, DSAPrivateKeySpec priKey) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, InvalidKeySpecException, SignatureException { - SecureRandom k = new TestRandomBigInteger(BigIntegers.asUnsignedByteArray(new BigInteger("72546832179840998877302529996971396893172522460793442785601695562409154906335"))); + SecureRandom k = new FixedSecureRandom( + new FixedSecureRandom.Source[] { new FixedSecureRandom.BigInteger(BigIntegers.asUnsignedByteArray(new BigInteger("72546832179840998877302529996971396893172522460793442785601695562409154906335"))), + new FixedSecureRandom.Data(Hex.decode("01020304")) }); byte[] M = Hex.decode("1BD4ED430B0F384B4E8D458EFF1A8A553286D7AC21CB2F6806172EF5F94A06AD");
1
269ec6efd7275f0aae0ba0e645b360ae5ac1d023
https://github.com/webbukkit/dynmap/commit/269ec6efd7275f0aae0ba0e645b360ae5ac1d023
Update README.md
diff --git a/README.md b/README.md index 015b167eb..df42ffb65 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Dynmap - dynamic web maps for Minecraft servers +# Dynmap™ - dynamic web maps for Minecraft servers ## How to build Dynmap 3.x+ uses Gradle for building support for all platforms, with all resulting artifacts produced in the /targets directory @@ -101,3 +101,4 @@ We also have a subreddit located at https://www.reddit.com/r/Dynmap/ I've set up a coffee-fund jar (I believe in the theory that software developers are machines that turn caffeine into code), for anyone who wants to throw in some tips! I've got a Patreon here - https://www.patreon.com/dynmap, and for folks just looking to for a one-time coffee buy, hit my Ko-Fi at https://ko-fi.com/michaelprimm ! +Dynmap is a trademark of Michael Primm, TX USA. All Rights Reserved.
0
a4010572cbe9810d184359e9944583c635f6446a
https://github.com/qos-ch/slf4j/commit/a4010572cbe9810d184359e9944583c635f6446a
have slf4j log markers and key-value pairs by default
diff --git a/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java b/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java index 41a74af07..93c669b6d 100755 --- a/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java +++ b/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java @@ -107,7 +107,7 @@ private void logViaPublicLoggerAPI(LoggingEvent logggingEvent) { combinedArguments[argLen] = t; } - msg = mergeKeyValuePairs(logggingEvent, msg); + msg = mergeMarkersAndKeyValuePairs(logggingEvent, msg); switch (logggingEvent.getLevel()) { case TRACE: @@ -129,21 +129,42 @@ private void logViaPublicLoggerAPI(LoggingEvent logggingEvent) { } - private String mergeKeyValuePairs(LoggingEvent logggingEvent, String msg) { + /** + * Prepend markers and key-value pairs to the message. + * + * @param logggingEvent + * @param msg + * @return + */ + private String mergeMarkersAndKeyValuePairs(LoggingEvent logggingEvent, String msg) { + StringBuilder sb = null; + + if(loggingEvent.getMarkers() != null) { + sb = new StringBuilder(); + for(Marker marker: logggingEvent.getMarkers()) { + sb.append(marker); + sb.append(' '); + } + } + if(logggingEvent.getKeyValuePairs() != null) { - StringBuilder sb = new StringBuilder(); + if(sb == null) { + sb = new StringBuilder(); + } for(KeyValuePair kvp: logggingEvent.getKeyValuePairs()) { sb.append(kvp.key); sb.append('='); sb.append(kvp.value); sb.append(' '); } + } + + if(sb != null) { sb.append(msg); return sb.toString(); } else { return msg; - } }
0
29efd648f38b73a64d73f14cd2019d869a585888
https://github.com/ImageMagick/ImageMagick/commit/29efd648f38b73a64d73f14cd2019d869a585888
https://github.com/ImageMagick/ImageMagick/issues/1613
diff --git a/coders/pnm.c b/coders/pnm.c index a54bc60c33..afaea309d5 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -1824,14 +1824,14 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, count=(ssize_t) FormatLocaleString(buffer,MagickPathExtent, "%u ",ScaleQuantumToLong(index)); extent=(size_t) count; - (void) strncpy((char *) q,buffer,extent); - q+=extent; - if ((q-pixels+extent+2) >= sizeof(pixels)) + if ((q-pixels+extent+1) >= sizeof(pixels)) { *q++='\n'; (void) WriteBlob(image,q-pixels,pixels); q=pixels; } + (void) strncpy((char *) q,buffer,extent); + q+=extent; p+=GetPixelChannels(image); } *q++='\n'; @@ -1899,14 +1899,14 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, ScaleQuantumToLong(GetPixelGreen(image,p)), ScaleQuantumToLong(GetPixelBlue(image,p))); extent=(size_t) count; - (void) strncpy((char *) q,buffer,extent); - q+=extent; if ((q-pixels+extent+2) >= sizeof(pixels)) { *q++='\n'; (void) WriteBlob(image,q-pixels,pixels); q=pixels; } + (void) strncpy((char *) q,buffer,extent); + q+=extent; p+=GetPixelChannels(image); } *q++='\n';
1
1fa47b3ab683f1e7a4e9ec3a1d0b484dbe66bde0
https://github.com/octobercms/library/commit/1fa47b3ab683f1e7a4e9ec3a1d0b484dbe66bde0
Multiple fixes related to PR #543 (#550) * return a collection, not an object * use fully qualified key names to avoid conflicts * add pivot data test; add timestamps * override sync() method in order to flush query cache
diff --git a/src/Database/Relations/BelongsToMany.php b/src/Database/Relations/BelongsToMany.php index 373f3fcf5..29863be9c 100644 --- a/src/Database/Relations/BelongsToMany.php +++ b/src/Database/Relations/BelongsToMany.php @@ -88,6 +88,18 @@ public function save(Model $model, array $pivotData = [], $sessionKey = null) return $model; } + /** + * Override sync() method of BelongToMany relation in order to flush the query cache. + * @param array $ids + * @param bool $detaching + * @return array + */ + public function sync($ids, $detaching = true) + { + parent::sync($ids, $detaching); + $this->flushDuplicateCache(); + } + /** * Create a new instance of this related model with deferred binding support. */ @@ -160,7 +172,7 @@ public function detach($ids = null, $touch = true) { $attachedIdList = $this->parseIds($ids); if (empty($attachedIdList)) { - $attachedIdList = $this->allRelatedIds(); + $attachedIdList = $this->allRelatedIds()->all(); } /** diff --git a/src/Database/Relations/DefinedConstraints.php b/src/Database/Relations/DefinedConstraints.php index 50e3e8af5..4272229ad 100644 --- a/src/Database/Relations/DefinedConstraints.php +++ b/src/Database/Relations/DefinedConstraints.php @@ -137,6 +137,10 @@ public function newPivotQuery() // add relation's conditions and scopes to the query $this->addDefinedConstraintsToQuery($query); - return $query->join($this->related->getTable(), $this->relatedPivotKey, '=', $this->relatedKey); + $related = $this->getRelated(); + + return $query + ->join($related->getTable(), $related->getQualifiedKeyName(), '=', $this->getOtherKey()) + ->select($this->getTable().'.*'); } } diff --git a/tests/Database/RelationsTest.php b/tests/Database/RelationsTest.php index 2d1ef9ec4..35da6bbc0 100644 --- a/tests/Database/RelationsTest.php +++ b/tests/Database/RelationsTest.php @@ -29,6 +29,8 @@ public function createTables() $table->primary(['post_id', 'term_id']); $table->unsignedInteger('post_id'); $table->unsignedInteger('term_id'); + $table->string('data')->nullable(); + $table->timestamps(); }); } @@ -170,6 +172,19 @@ public function testBelongsToManyDetachOneCategory() $this->assertEquals(3, $post->terms()->count()); } + public function testPivotData() + { + $data = 'My Pivot Data'; + $post = Post::first(); + + $id = $post->categories()->get()->last()->id; + $updated = $post->categories()->updateExistingPivot($id, [ 'data' => $data ]); + $this->assertTrue($updated === 1); + + $category = $post->categories()->find($id); + $this->assertEquals($data, $category->pivot->data); + } + public function testTerms() { $post = Post::create([ @@ -241,26 +256,37 @@ class Post extends \October\Rain\Database\Model public $fillable = ['title']; + protected $dates = [ + 'created_at', + 'updated_at', + 'episode_at' + ]; + public $belongsToMany = [ 'tags' => [ Term::class, 'table' => 'posts_terms', 'key' => 'post_id', 'otherKey' => 'term_id', - 'conditions' => 'type = "tag"' + 'pivot' => ['data'], + 'timestamps' => true, + 'conditions' => 'type = "tag"', ], 'categories' => [ Term::class, 'table' => 'posts_terms', 'key' => 'post_id', 'otherKey' => 'term_id', - 'conditions' => 'type = "category"' + 'pivot' => ['data'], + 'timestamps' => true, + 'conditions' => 'type = "category"', ], 'terms' => [ Term::class, 'table' => 'posts_terms', 'key' => 'post_id', 'otherKey' => 'term_id', + 'timestamps' => true, ], ]; } @@ -271,13 +297,21 @@ class Term extends \October\Rain\Database\Model public $fillable = ['type', 'name']; + protected $dates = [ + 'created_at', + 'updated_at', + 'episode_at' + ]; + public $belongsToMany = [ 'posts' => [ 'Post', 'table' => 'posts_terms', 'key' => 'term_id', 'otherKey' => 'post_id', - 'conditions' => 'type = "post"' + 'pivot' => ['data'], + 'timestamps' => true, + 'conditions' => 'type = "post"', ], ]; }
0
d73c37c0b57936560bebd5657b4148480ec706f8
https://github.com/facebook/nuclide/commit/d73c37c0b57936560bebd5657b4148480ec706f8
Clarify that we don't support negative step in range() Summary: We made an API that looks like Python's range() function, but it does not support negative step. I spent a while down a blind alley because I assumed we did. This will fail faster for the next person who goes down this path. Reviewed By: wbinnssmith Differential Revision: D13352253 fbshipit-source-id: 38a3a915099882cff9de5b764890273f165107bc
diff --git a/modules/nuclide-commons/__tests__/collection-test.js b/modules/nuclide-commons/__tests__/collection-test.js index faca0c1cf3..3330ed86cc 100644 --- a/modules/nuclide-commons/__tests__/collection-test.js +++ b/modules/nuclide-commons/__tests__/collection-test.js @@ -739,6 +739,16 @@ describe('range', () => { expect([...range(2, 1)]).toEqual([]); expect([...range(1, 1)]).toEqual([]); }); + + it('can step by values other than 1', () => { + expect([...range(1, 6, 2)]).toEqual([1, 3, 5]); + }); + + it('cannot take negative step', () => { + expect(() => { + [...range(2, 1, -1)]; + }).toThrow(); + }); }); describe('objectFromPairs', () => { diff --git a/modules/nuclide-commons/collection.js b/modules/nuclide-commons/collection.js index 0d8c8b14e8..a30d50e2ec 100644 --- a/modules/nuclide-commons/collection.js +++ b/modules/nuclide-commons/collection.js @@ -10,6 +10,8 @@ * @format */ +import invariant from 'assert'; + export function ensureArray<T>(x: Array<T> | T): Array<T> { return Array.isArray(x) ? x : [x]; } @@ -547,6 +549,8 @@ export function* range( stop: number, step?: number = 1, ): Iterable<number> { + // We don't currently support negative step values. + invariant(step > 0); for (let i = start; i < stop; i += step) { yield i; }
0
912ce9dd2080c5837285a471d750fa311e09b555
https://github.com/FFmpeg/FFmpeg/commit/912ce9dd2080c5837285a471d750fa311e09b555
jpeg2000: fix dereferencing invalid pointers Found-by: Laurent Butti <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index cb1a64d14326..dc3311052ee2 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -272,7 +272,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, reslevel->log2_prec_height) - (reslevel->coord[1][0] >> reslevel->log2_prec_height); - reslevel->band = av_malloc_array(reslevel->nbands, sizeof(*reslevel->band)); + reslevel->band = av_calloc(reslevel->nbands, sizeof(*reslevel->band)); if (!reslevel->band) return AVERROR(ENOMEM); @@ -368,7 +368,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, for (j = 0; j < 2; j++) band->coord[1][j] = ff_jpeg2000_ceildiv(band->coord[1][j], dy); - band->prec = av_malloc_array(reslevel->num_precincts_x * + band->prec = av_calloc(reslevel->num_precincts_x * (uint64_t)reslevel->num_precincts_y, sizeof(*band->prec)); if (!band->prec) @@ -509,10 +509,12 @@ void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) for (bandno = 0; bandno < reslevel->nbands; bandno++) { Jpeg2000Band *band = reslevel->band + bandno; for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) { - Jpeg2000Prec *prec = band->prec + precno; - av_freep(&prec->zerobits); - av_freep(&prec->cblkincl); - av_freep(&prec->cblk); + if (band->prec) { + Jpeg2000Prec *prec = band->prec + precno; + av_freep(&prec->zerobits); + av_freep(&prec->cblkincl); + av_freep(&prec->cblk); + } } av_freep(&band->prec);
1
bc8a6fbd3128cf5ef27d808f6c6ba869fdc2262b
https://github.com/tine20/Tine-2.0-Open-Source-Groupware-and-CRM/commit/bc8a6fbd3128cf5ef27d808f6c6ba869fdc2262b
name might not be displayed correctly Change-Id: I949c7a80b5356f393d269d3004bd6800772ac63b Reviewed-on: http://gerrit.tine20.com/customers/5618 Reviewed-by: Cornelius Weiss <[email protected]> Tested-by: Cornelius Weiss <[email protected]>
diff --git a/tine20/Addressbook/js/ContactGrid.js b/tine20/Addressbook/js/ContactGrid.js index 576097d3dd..257a24485e 100644 --- a/tine20/Addressbook/js/ContactGrid.js +++ b/tine20/Addressbook/js/ContactGrid.js @@ -259,12 +259,12 @@ Tine.Addressbook.ContactGridPanel.contactTypeRenderer = function(data, cell, rec Tine.Addressbook.ContactGridPanel.displayNameRenderer = function(data) { var i18n = Tine.Tinebase.appMgr.get('Addressbook').i18n; - return data ? data : ('<div class="renderer_displayNameRenderer_noName">' + i18n._('No name') + '</div>'); + return data ? Ext.util.Format.htmlEncode(data) : ('<div class="renderer_displayNameRenderer_noName">' + i18n._('No name') + '</div>'); }; Tine.Addressbook.ContactGridPanel.countryRenderer = function(data) { data = Locale.getTranslationData('CountryList', data); - return data; + return Ext.util.Format.htmlEncode(data); }; /** diff --git a/tine20/Felamimail/js/FolderSelectPanel.js b/tine20/Felamimail/js/FolderSelectPanel.js index fdfc8f88c0..79186c42b9 100755 --- a/tine20/Felamimail/js/FolderSelectPanel.js +++ b/tine20/Felamimail/js/FolderSelectPanel.js @@ -123,7 +123,7 @@ Tine.Felamimail.FolderSelectPanel = Ext.extend(Ext.Panel, { allowDrop: false, expanded: false, text: Ext.util.Format.htmlEncode(record.get('name')), - qtip: Tine.Tinebase.common.doubleEncode(record.get('host')), + qtip: Ext.util.Format.htmlEncode(record.get('host')), leaf: false, cls: 'felamimail-node-account', delimiter: record.get('delimiter'), diff --git a/tine20/Felamimail/js/TreePanel.js b/tine20/Felamimail/js/TreePanel.js index 86a0089e53..7260c9d312 100644 --- a/tine20/Felamimail/js/TreePanel.js +++ b/tine20/Felamimail/js/TreePanel.js @@ -781,7 +781,7 @@ Ext.extend(Tine.Felamimail.TreePanel, Ext.tree.TreePanel, { allowDrop: false, expanded: false, text: Ext.util.Format.htmlEncode(record.get('name')), - qtip: Tine.Tinebase.common.doubleEncode(record.get('host')), + qtip: Ext.util.Format.htmlEncode(record.get('host')), leaf: false, cls: 'felamimail-node-account', delimiter: record.get('delimiter'), diff --git a/tine20/Filemanager/js/NodeTreePanel.js b/tine20/Filemanager/js/NodeTreePanel.js index 99c2b1c029..fdbda80bf5 100644 --- a/tine20/Filemanager/js/NodeTreePanel.js +++ b/tine20/Filemanager/js/NodeTreePanel.js @@ -253,10 +253,10 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, { if(attr.name && typeof attr.name == 'object') { Ext.apply(attr, { text: Ext.util.Format.htmlEncode(attr.name.name), - qtip: Tine.Tinebase.common.doubleEncode(attr.name.name) + qtip: Ext.util.Format.htmlEncode(attr.name.name) }); } - + // copy 'real' data to a node record NOTE: not a full record as we have no record reader here var nodeData = Ext.copyTo({}, attr, Tine.Filemanager.Model.Node.getFieldNames()); attr.nodeRecord = new Tine.Filemanager.Model.Node(nodeData); @@ -577,13 +577,13 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, { var newNodeRecord = new Tine.Filemanager.Model.Node(nodeData); var newNode = new Ext.tree.AsyncTreeNode({ - text: nodeName, + text: Ext.util.Format.htmlEncode(nodeName), path: nodeData.path, name: nodeData.name, nodeRecord: newNodeRecord, account_grants: nodeData.account_grants, id: nodeData.id - }) + }); newNode.attributes.nodeRecord.beginEdit(); newNode.attributes.nodeRecord.set('path', nodeData.path); diff --git a/tine20/Phone/js/PhoneTreePanel.js b/tine20/Phone/js/PhoneTreePanel.js index 915f32aa5c..c1ab2df497 100644 --- a/tine20/Phone/js/PhoneTreePanel.js +++ b/tine20/Phone/js/PhoneTreePanel.js @@ -101,13 +101,13 @@ Tine.Phone.PhoneTreePanel = Ext.extend(Ext.tree.TreePanel, { this.store.each(function(record) { var label = (record.data.description == '') ? record.data.macaddress - : Ext.util.Format.ellipsis(record.data.description, 30); + : Ext.util.Format.ellipsis(Ext.util.Format.htmlEncode(record.data.description), 30); var node = new Ext.tree.TreeNode({ id: record.id, record: record, text: label, iconCls: 'PhoneIconCls', - qtip: Tine.Tinebase.common.doubleEncode(record.data.description), + qtip: Ext.util.Format.htmlEncode(record.data.description), leaf: true }); rootNode.appendChild(node); diff --git a/tine20/Tinebase/js/ux/Percentage.js b/tine20/Tinebase/js/ux/Percentage.js index 8b8a1f2ea1..ffe412d64b 100644 --- a/tine20/Tinebase/js/ux/Percentage.js +++ b/tine20/Tinebase/js/ux/Percentage.js @@ -192,7 +192,7 @@ Ext.ux.PercentRendererWithName = function(value, metadata, record) { metadata.css = 'x-tinebase-uploadrow'; } - return fileName; + return Ext.util.Format.htmlEncode(fileName); } if (! Ext.ux.PercentRendererWithName.template) { @@ -221,7 +221,7 @@ Ext.ux.PercentRendererWithName = function(value, metadata, record) { if (typeof value == 'object') { fileName = value.name; } - + fileName = Ext.util.Format.htmlEncode(fileName); var percent = record.get('progress'); var additionalStyle = ''; @@ -229,7 +229,7 @@ Ext.ux.PercentRendererWithName = function(value, metadata, record) { fileName = _('(paused)') + '&#160;&#160;' + fileName; additionalStyle = 'background-image: url(\'styles/images/tine20/progress/progress-bg-y.gif\') !important;'; } - + var display = 'width:0px'; if(percent > -1 && percent < 100) { display = ''; diff --git a/tine20/Tinebase/js/widgets/ActivitiesPanel.js b/tine20/Tinebase/js/widgets/ActivitiesPanel.js index a71ba8df8a..c6efc1d85f 100644 --- a/tine20/Tinebase/js/widgets/ActivitiesPanel.js +++ b/tine20/Tinebase/js/widgets/ActivitiesPanel.js @@ -122,6 +122,8 @@ Tine.widgets.activities.ActivitiesTabPanel = Ext.extend(Ext.Panel, { var recordClass = Tine.Tinebase.data.RecordMgr.get(this.record_model), app = Tine.Tinebase.appMgr.get(this.app); + note = Ext.util.Format.htmlEncode(note); + if (recordClass) { Ext.each(recordClass.getFieldDefinitions(), function(field) { if (field.label) { diff --git a/tine20/Tinebase/js/widgets/container/TreePanel.js b/tine20/Tinebase/js/widgets/container/TreePanel.js index 510693fca2..5e5fb5c251 100644 --- a/tine20/Tinebase/js/widgets/container/TreePanel.js +++ b/tine20/Tinebase/js/widgets/container/TreePanel.js @@ -495,12 +495,15 @@ Ext.extend(Tine.widgets.container.TreePanel, Ext.tree.TreePanel, { } Ext.applyIf(attr, { - text: Ext.util.Format.htmlEncode(attr.name), - qtip: Tine.Tinebase.common.doubleEncode(attr.name), + text: attr.name, + qtip: attr.name, leaf: !!attr.account_grants, allowDrop: !!attr.account_grants && attr.account_grants.addGrant }); - + + attr.text = Ext.util.Format.htmlEncode(attr.text); + attr.qtip = Ext.util.Format.htmlEncode(attr.qtip); + // copy 'real' data to container space attr.container = Ext.copyTo({}, attr, Tine.Tinebase.Model.Container.getFieldNames()); }, diff --git a/tine20/Tinebase/js/widgets/grid/FilterPanel.js b/tine20/Tinebase/js/widgets/grid/FilterPanel.js index a9b08c86b8..f79b42a3fd 100644 --- a/tine20/Tinebase/js/widgets/grid/FilterPanel.js +++ b/tine20/Tinebase/js/widgets/grid/FilterPanel.js @@ -520,7 +520,7 @@ Ext.extend(Tine.widgets.grid.FilterPanel, Ext.Panel, { for (var id in this.filterPanels) { if (this.filterPanels.hasOwnProperty(id) && this.filterPanels[id].isActive) { - filters.push({'condition': 'AND', 'filters': this.filterPanels[id].getValue(), 'id': id, label: this.filterPanels[id].title}); + filters.push({'condition': 'AND', 'filters': this.filterPanels[id].getValue(), 'id': id, label: Ext.util.Format.htmlDecode(this.filterPanels[id].title)}); } } diff --git a/tine20/Tinebase/js/widgets/grid/FilterStructureTreePanel.js b/tine20/Tinebase/js/widgets/grid/FilterStructureTreePanel.js index 7dbc3eaec5..298b81b49a 100644 --- a/tine20/Tinebase/js/widgets/grid/FilterStructureTreePanel.js +++ b/tine20/Tinebase/js/widgets/grid/FilterStructureTreePanel.js @@ -82,6 +82,9 @@ Tine.widgets.grid.FilterStructureTreePanel = Ext.extend(Ext.tree.TreePanel, { this.filterPanel.activeFilterPanel.on('titlechange', this.onFilterPanelTitleChange, this); this.editor = new Ext.tree.TreeEditor(this); + this.editor.on('startedit', function(el, value) { + this.editor.setValue(Ext.util.Format.htmlDecode(value)); + }, this); Tine.widgets.grid.FilterStructureTreePanel.superclass.initComponent.call(this); }, @@ -113,7 +116,7 @@ Tine.widgets.grid.FilterStructureTreePanel = Ext.extend(Ext.tree.TreePanel, { */ onNodeTextChange: function(node, text, oldText) { if (node.attributes && node.attributes.filterPanel) { - node.attributes.filterPanel.setTitle(text); + node.attributes.filterPanel.setTitle(Ext.util.Format.htmlEncode(text)); } }, diff --git a/tine20/Tinebase/js/widgets/persistentfilter/PickerPanel.js b/tine20/Tinebase/js/widgets/persistentfilter/PickerPanel.js index 0d8077e626..5f346e8e8e 100644 --- a/tine20/Tinebase/js/widgets/persistentfilter/PickerPanel.js +++ b/tine20/Tinebase/js/widgets/persistentfilter/PickerPanel.js @@ -626,7 +626,7 @@ Tine.widgets.persistentfilter.PickerTreePanelLoader = Ext.extend(Tine.widgets.tr Ext.apply(attr, { isPersistentFilter : isPersistentFilter, text : Ext.util.Format.htmlEncode(this.app.i18n._hidden(attr.name)), - qtip : Tine.Tinebase.common.doubleEncode(attr.description ? this.app.i18n._hidden(attr.description) + ' ' + addText : addText), + qtip : Ext.util.Format.htmlEncode(attr.description ? this.app.i18n._hidden(attr.description) + ' ' + addText : addText), selected : attr.id === this.selectedFilterId, id : attr.id, diff --git a/tine20/Tinebase/js/widgets/relation/GridRenderer.js b/tine20/Tinebase/js/widgets/relation/GridRenderer.js index 55c02d874b..58610de266 100644 --- a/tine20/Tinebase/js/widgets/relation/GridRenderer.js +++ b/tine20/Tinebase/js/widgets/relation/GridRenderer.js @@ -60,7 +60,7 @@ Ext.extend(Tine.widgets.relation.GridRenderer, Ext.Component, { var el = relations[index]; if (el.type == this.type && el.related_model == this.relModel) { var record = new this.recordClass(el.related_record); - return record.getTitle(); + return Ext.util.Format.htmlEncode(record.getTitle()); } } } diff --git a/tine20/Tinebase/js/widgets/tree/ContextMenu.js b/tine20/Tinebase/js/widgets/tree/ContextMenu.js index 76507b4398..e3fdb5edf3 100644 --- a/tine20/Tinebase/js/widgets/tree/ContextMenu.js +++ b/tine20/Tinebase/js/widgets/tree/ContextMenu.js @@ -282,7 +282,7 @@ Tine.widgets.tree.ContextMenu = { title: String.format(_('Rename {0}'), this.nodeName), msg: String.format(_('Please enter the new name of the {0}:'), this.nodeName), buttons: Ext.MessageBox.OKCANCEL, - value: node.attributes.longName || node.text, + value: Ext.util.Format.htmlDecode(node.attributes.longName || node.text), fn: function(_btn, _text){ if (_btn == 'ok') { if (! _text) { @@ -326,7 +326,7 @@ Tine.widgets.tree.ContextMenu = { success: function(_result, _request){ var nodeData = Ext.util.JSON.decode(_result.responseText); - node.setText(_text); + node.setText(Ext.util.Format.htmlEncode(_text)); this.scope.fireEvent('containerrename', nodeData, node, _text); diff --git a/tine20/Tinebase/js/widgets/tree/Loader.js b/tine20/Tinebase/js/widgets/tree/Loader.js index 300e461577..8b117a4406 100644 --- a/tine20/Tinebase/js/widgets/tree/Loader.js +++ b/tine20/Tinebase/js/widgets/tree/Loader.js @@ -120,7 +120,7 @@ Tine.widgets.tree.Loader = Ext.extend(Ext.tree.TreeLoader, { }, this); node.longName = node.name; - node.text = node.name = Ext.util.Format.htmlEncode(containerName); + node.text = node.name = containerName; parentNode.push(node); }, this);
1
48bfa06f0bed36597a2cb8cae7e4694038ac822f
https://github.com/exponentcms/exponent-cms/commit/48bfa06f0bed36597a2cb8cae7e4694038ac822f
Update Bootstrap 4 & Bootswatch 4 to v4.4.1
diff --git a/external/ExtPrograms.csv b/external/ExtPrograms.csv index 9e0a62e586..3f3347520d 100644 --- a/external/ExtPrograms.csv +++ b/external/ExtPrograms.csv @@ -1,5 +1,5 @@ Program,Version,URL,Avail version,Exponent Customization Notes: -Swiftmailer,5.4.12/6.2.1,github.com/swiftmailer/swiftmailer,6.2.3,we add eDebugLogger & eDebugHtmlReporter plugins & fix php 5.6 ssl issue +Swiftmailer,5.4.12/6.2.3,github.com/swiftmailer/swiftmailer,6.2.3,we add eDebugLogger & eDebugHtmlReporter plugins & fix php 5.6 ssl issue Doctrine Lexer,1.1.0,github.com/doctrine/lexer,1.2.0,needed by swiftmailer v6 EmailValidator,2.1.11,github.com/egulias/EmailValidator,2.1.11,needed by swiftmailer v6; add autoloader and move within folders ups-php,0.2,code.google.com/p/ups-php,0.2,"updated/fixed xml, etc to work" @@ -26,15 +26,15 @@ lessphp,0.5.0,github.com/leafo/lessphp,0.5.0,will not compile bootstrap v3+ less.php,1.7.0.14,github.com/oyejorge/less.php,1.7.0.14, Twitter-Bootstrap2,2.3.2,twitter.github.com/bootstrap,2.3.2,"patched bootstrap.less includes swatches, fontawesome & exp variables" Twitter-Bootstrap3,3.4.1,twitter.github.com/bootstrap,3.4.1,patched bootstrap.less includes swatches & exp variables -Twitter-Bootstrap4,4.3.1,twitter.github.com/bootstrap,4.3.1,patched bootstrap.scss includes swatches & exp variables +Twitter-Bootstrap4,4.4.1,twitter.github.com/bootstrap,4.4.1,patched bootstrap.scss includes swatches & exp variables popper.js,1.16.0,github.com/FezVrasta/popper.js,1.16.0,needed by BS4 (umd) Bootswatch2,2.3.2,bootswatch.com/,2.3.2, Bootswatch3,3.4.1+1,bootswatch.com/,3.4.1+1,change 1st line variables.less comment to output to .css file -Bootswatch4,4.3.1,bootswatch.com/,4.3.1,change 1st line variables.scss comment to output to .css file +Bootswatch4,4.4.1,bootswatch.com/,4.4.1,change 1st line variables.scss comment to output to .css file Font-Awesome3,3.2.1,fortawesome.github.com/Font-Awesome,3.2.1,updated FontAwesomePath in variables.less Font-Awesome4,4.7.0,fortawesome.github.com/Font-Awesome,4.7.0, Font-Awesome5,5.11.2,fontawesome.com,5.11.2,add import all 'fonts' sheets to main sheet -Adminer,4.7.5exp,www.adminer.org,"4.7.5 +Adminer,4.7.1exp,www.adminer.org,"4.7.5 ","customized plugins: tinymce, ckeditor, previewSerialized, edit-textarea & edit-calendar; edit sql tweak" SimpleAjaxUploader,2.6.7,github.com/LPology/Simple-Ajax-Uploader,2.6.7,also converted to yui module 2.5.3 normalize.css,8.0.1,necolas.github.com/normalize.css/,8.0.1,auto included in bootstrap 3 @@ -95,7 +95,7 @@ Webshim,1.16.0,github.com/aFarkas/webshim,1.16.0, ,,,, "Optional, not included",,,, dompdf,0.8.2exp/0.7.0exp/0.6.2exp,github.com/dompdf/dompdf,0.8.3,"optional, patched to display our images and not break on bad tables" -mPDF,7.0.2/6.1.4/5.7.4a,github.com/mpdf/mpdf,7.1.9/8.0.3,optional +mPDF,7.0.2/6.1.4/5.7.4a,github.com/mpdf/mpdf,7.1.9/8.0.4,optional log,1.0.2,github.com/php-fig/log,1.1.2,"optional, required by mPDF v7" DeepCopy,1.7.0,github.com/myclabs/DeepCopy,1.9.3,"optional, required by mPDF v7" HTML2PDF,5.0.1/4.6.1,github.com/spipu/html2pdf,5.2.1,"optional, we tweak tcpdfConfig.php" diff --git a/external/bootstrap4/README.md b/external/bootstrap4/README.md index 9fa8f536a5..d70069ee24 100644 --- a/external/bootstrap4/README.md +++ b/external/bootstrap4/README.md @@ -1,6 +1,6 @@ <p align="center"> <a href="https://getbootstrap.com/"> - <img src="https://getbootstrap.com/docs/4.3/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72"> + <img src="https://getbootstrap.com/docs/4.4/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72"> </a> </p> @@ -9,7 +9,7 @@ <p align="center"> Sleek, intuitive, and powerful front-end framework for faster and easier web development. <br> - <a href="https://getbootstrap.com/docs/4.3/"><strong>Explore Bootstrap docs »</strong></a> + <a href="https://getbootstrap.com/docs/4.4/"><strong>Explore Bootstrap docs »</strong></a> <br> <br> <a href="https://github.com/twbs/bootstrap/issues/new?template=bug.md">Report bug</a> @@ -41,20 +41,20 @@ Several quick start options are available: -- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.3.1.zip) +- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.4.1.zip) - Clone the repo: `git clone https://github.com/twbs/bootstrap.git` - Install with [npm](https://www.npmjs.com/): `npm install bootstrap` -- Install with [yarn](https://yarnpkg.com/): `yarn add [email protected]` -- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.3.1` +- Install with [yarn](https://yarnpkg.com/): `yarn add [email protected]` +- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.4.1` - Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass` -Read the [Getting started page](https://getbootstrap.com/docs/4.3/getting-started/introduction/) for information on the framework contents, templates and examples, and more. +Read the [Getting started page](https://getbootstrap.com/docs/4.4/getting-started/introduction/) for information on the framework contents, templates and examples, and more. ## Status [![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/) -[![Build Status](https://img.shields.io/travis/twbs/bootstrap/v4-dev.svg)](https://travis-ci.org/twbs/bootstrap) +[![Build Status](https://github.com/twbs/bootstrap/workflows/Tests/badge.svg)](https://github.com/twbs/bootstrap/actions?workflow=Tests) [![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap) [![Gem version](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap) [![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue.svg)](https://atmospherejs.com/twbs/bootstrap) @@ -113,11 +113,11 @@ Have a bug or a feature request? Please first read the [issue guidelines](https: Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally. -Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.3/assets/js/src/search.js` file. +Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.4/assets/js/src/search.js` file. ### Running documentation locally -1. Run through the [tooling setup](https://getbootstrap.com/docs/4.3/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`. +1. Run through the [tooling setup](https://getbootstrap.com/docs/4.4/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`. 2. Run `npm install` to install Node.js dependencies. 3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes. 4. Open `http://localhost:9001` in your browser, and voilà. @@ -126,12 +126,7 @@ Learn more about using Jekyll by reading its [documentation](https://jekyllrb.co ### Documentation for previous releases -- For v2.3.2: <https://getbootstrap.com/2.3.2/> -- For v3.3.x: <https://getbootstrap.com/docs/3.3/> -- For v3.4.0: <https://getbootstrap.com/docs/3.4/> -- For v4.0.x: <https://getbootstrap.com/docs/4.0/> -- For v4.1.x: <https://getbootstrap.com/docs/4.1/> -- For v4.2.x: <https://getbootstrap.com/docs/4.2/> +You can find all our previous releases docs on <https://getbootstrap.com/docs/versions/>. [Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download. @@ -211,4 +206,4 @@ Support this project by becoming a sponsor. Your logo will show up here with a l ## Copyright and license -Code and documentation copyright 2011-2019 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE). +Code and documentation copyright 2011-2019 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/). diff --git a/external/bootstrap4/js/dist/alert.js b/external/bootstrap4/js/dist/alert.js index 2a2e157edc..b825d19d51 100644 --- a/external/bootstrap4/js/dist/alert.js +++ b/external/bootstrap4/js/dist/alert.js @@ -1,5 +1,5 @@ /*! - * Bootstrap alert.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap alert.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Alert = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -35,7 +35,7 @@ */ var NAME = 'alert'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.alert'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -52,13 +52,12 @@ ALERT: 'alert', FADE: 'fade', SHOW: 'show' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Alert = /*#__PURE__*/ @@ -195,5 +194,5 @@ return Alert; -})); +}))); //# sourceMappingURL=alert.js.map diff --git a/external/bootstrap4/js/dist/alert.js.map b/external/bootstrap4/js/dist/alert.js.map index c87f8e3d5b..21b7991e66 100644 --- a/external/bootstrap4/js/dist/alert.js.map +++ b/external/bootstrap4/js/dist/alert.js.map @@ -1 +1 @@ -{"version":3,"file":"alert.js","sources":["../src/alert.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'alert'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n}\n\nconst Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Alert {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n close(element) {\n let rootElement = this._element\n if (element) {\n rootElement = this._getRootElement(element)\n }\n\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(element)\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(transitionDuration)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n)\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Alert._jQueryInterface\n$.fn[NAME].Constructor = Alert\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n}\n\nexport default Alert\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","ALERT","FADE","SHOW","Alert","element","_element","close","rootElement","_getRootElement","customEvent","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","selector","Util","getSelectorFromElement","parent","document","querySelector","closest","closeEvent","trigger","removeClass","hasClass","_destroyElement","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","event","emulateTransitionEnd","detach","remove","_jQueryInterface","config","each","$element","data","_handleDismiss","alertInstance","preventDefault","on","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,OAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,UAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,QAAQ,GAAG;EACfC,EAAAA,OAAO,EAAG;EADK,CAAjB;EAIA,IAAMC,KAAK,GAAG;EACZC,EAAAA,KAAK,YAAoBR,SADb;EAEZS,EAAAA,MAAM,aAAoBT,SAFd;EAGZU,EAAAA,cAAc,YAAWV,SAAX,GAAuBC;EAHzB,CAAd;EAMA,IAAMU,SAAS,GAAG;EAChBC,EAAAA,KAAK,EAAG,OADQ;EAEhBC,EAAAA,IAAI,EAAI,MAFQ;EAGhBC,EAAAA,IAAI,EAAI;EAGV;;;;;;EANkB,CAAlB;;MAYMC;;;EACJ,iBAAYC,OAAZ,EAAqB;EACnB,SAAKC,QAAL,GAAgBD,O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d,CAAoB,IAApB;EACD,KAND;EAOD;;;;0BAlGoB;EACnB,aAAOpB,OAAP;EACD;;;;;EAmGH;;;;;;;EAMAK,CAAC,CAAC4B,QAAD,CAAD,CAAYwB,EAAZ,CACEhD,KAAK,CAACG,cADR,EAEEL,QAAQ,CAACC,OAFX,EAGES,KAAK,CAACqC,cAAN,CAAqB,IAAIrC,KAAJ,EAArB,CAHF;EAMA;;;;;;EAMAZ,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAyBkB,KAAK,CAACgC,gBAA/B;EACA5C,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW2D,WAAX,GAAyBzC,KAAzB;;EACAZ,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW4D,UAAX,GAAyB,YAAM;EAC7BtD,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOa,KAAK,CAACgC,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"alert.js","sources":["../src/alert.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'alert'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n}\n\nconst Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Alert {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n close(element) {\n let rootElement = this._element\n if (element) {\n rootElement = this._getRootElement(element)\n }\n\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(element)\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(transitionDuration)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n)\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Alert._jQueryInterface\n$.fn[NAME].Constructor = Alert\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n}\n\nexport default Alert\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","ALERT","FADE","SHOW","Alert","element","_element","close","rootElement","_getRootElement","customEvent","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","selector","Util","getSelectorFromElement","parent","document","querySelector","closest","closeEvent","trigger","removeClass","hasClass","_destroyElement","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","event","emulateTransitionEnd","detach","remove","_jQueryInterface","config","each","$element","data","_handleDismiss","alertInstance","preventDefault","on","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,OAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,UAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,QAAQ,GAAG;EACfC,EAAAA,OAAO,EAAG;EADK,CAAjB;EAIA,IAAMC,KAAK,GAAG;EACZC,EAAAA,KAAK,YAAoBR,SADb;EAEZS,EAAAA,MAAM,aAAoBT,SAFd;EAGZU,EAAAA,cAAc,YAAWV,SAAX,GAAuBC;EAHzB,CAAd;EAMA,IAAMU,SAAS,GAAG;EAChBC,EAAAA,KAAK,EAAG,OADQ;EAEhBC,EAAAA,IAAI,EAAI,MAFQ;EAGhBC,EAAAA,IAAI,EAAI;EAHQ,CAAlB;EAMA;;;;;;MAMMC;;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AA,KAAK,CAACW,cAAN;EACD;;EAEDD,MAAAA,aAAa,CAACnC,KAAd,CAAoB,IAApB;EACD,KAND;EAOD;;;;0BAlGoB;EACnB,aAAOpB,OAAP;EACD;;;;;EAmGH;;;;;;;EAMAK,CAAC,CAAC4B,QAAD,CAAD,CAAYwB,EAAZ,CACEhD,KAAK,CAACG,cADR,EAEEL,QAAQ,CAACC,OAFX,EAGES,KAAK,CAACqC,cAAN,CAAqB,IAAIrC,KAAJ,EAArB,CAHF;EAMA;;;;;;EAMAZ,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAyBkB,KAAK,CAACgC,gBAA/B;EACA5C,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW2D,WAAX,GAAyBzC,KAAzB;;EACAZ,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW4D,UAAX,GAAyB,YAAM;EAC7BtD,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOa,KAAK,CAACgC,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/button.js b/external/bootstrap4/js/dist/button.js index e8dfecbaf9..92a3640fcd 100644 --- a/external/bootstrap4/js/dist/button.js +++ b/external/bootstrap4/js/dist/button.js @@ -1,5 +1,5 @@ /*! - * Bootstrap button.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap button.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = global || self, global.Button = factory(global.jQuery)); -}(this, function ($) { 'use strict'; +}(this, (function ($) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; @@ -34,7 +34,7 @@ */ var NAME = 'button'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.button'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -46,21 +46,23 @@ }; var Selector = { DATA_TOGGLE_CARROT: '[data-toggle^="button"]', - DATA_TOGGLE: '[data-toggle="buttons"]', + DATA_TOGGLES: '[data-toggle="buttons"]', + DATA_TOGGLE: '[data-toggle="button"]', + DATA_TOGGLES_BUTTONS: '[data-toggle="buttons"] .btn', INPUT: 'input:not([type="hidden"])', ACTIVE: '.active', BUTTON: '.btn' }; var Event = { CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY, - FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY) - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - + FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY), + LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Button = /*#__PURE__*/ @@ -76,7 +78,7 @@ _proto.toggle = function toggle() { var triggerChangeEvent = true; var addAriaPressed = true; - var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLES)[0]; if (rootElement) { var input = this._element.querySelector(Selector.INPUT); @@ -92,13 +94,16 @@ $(activeElement).removeClass(ClassName.ACTIVE); } } + } else if (input.type === 'checkbox') { + if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } + } else { + // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input + triggerChangeEvent = false; } if (triggerChangeEvent) { - if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { - return; - } - input.checked = !this._element.classList.contains(ClassName.ACTIVE); $(input).trigger('change'); } @@ -108,12 +113,14 @@ } } - if (addAriaPressed) { - this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE)); - } + if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE)); + } - if (triggerChangeEvent) { - $(this._element).toggleClass(ClassName.ACTIVE); + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); + } } }; @@ -155,18 +162,58 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { - event.preventDefault(); var button = event.target; if (!$(button).hasClass(ClassName.BUTTON)) { - button = $(button).closest(Selector.BUTTON); + button = $(button).closest(Selector.BUTTON)[0]; } - Button._jQueryInterface.call($(button), 'toggle'); + if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { + event.preventDefault(); // work around Firefox bug #1540995 + } else { + var inputBtn = button.querySelector(Selector.INPUT); + + if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { + event.preventDefault(); // work around Firefox bug #1540995 + + return; + } + + Button._jQueryInterface.call($(button), 'toggle'); + } }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { var button = $(event.target).closest(Selector.BUTTON)[0]; $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); }); + $(window).on(Event.LOAD_DATA_API, function () { + // ensure correct active class is set to match the controls' actual values/states + // find all checkboxes/readio buttons inside data-toggle groups + var buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLES_BUTTONS)); + + for (var i = 0, len = buttons.length; i < len; i++) { + var button = buttons[i]; + var input = button.querySelector(Selector.INPUT); + + if (input.checked || input.hasAttribute('checked')) { + button.classList.add(ClassName.ACTIVE); + } else { + button.classList.remove(ClassName.ACTIVE); + } + } // find all button toggles + + + buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE)); + + for (var _i = 0, _len = buttons.length; _i < _len; _i++) { + var _button = buttons[_i]; + + if (_button.getAttribute('aria-pressed') === 'true') { + _button.classList.add(ClassName.ACTIVE); + } else { + _button.classList.remove(ClassName.ACTIVE); + } + } + }); /** * ------------------------------------------------------------------------ * jQuery @@ -183,5 +230,5 @@ return Button; -})); +}))); //# sourceMappingURL=button.js.map diff --git a/external/bootstrap4/js/dist/button.js.map b/external/bootstrap4/js/dist/button.js.map index fe82b1c104..462a16bc65 100644 --- a/external/bootstrap4/js/dist/button.js.map +++ b/external/bootstrap4/js/dist/button.js.map @@ -1 +1 @@ -{"version":3,"file":"button.js","sources":["../src/button.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n}\n\nconst Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLE : '[data-toggle=\"buttons\"]',\n INPUT : 'input:not([type=\"hidden\"])',\n ACTIVE : '.active',\n BUTTON : '.btn'\n}\n\nconst Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +\n `blur${EVENT_KEY}${DATA_API_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n const input = this._element.querySelector(Selector.INPUT)\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = rootElement.querySelector(Selector.ACTIVE)\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') ||\n rootElement.hasAttribute('disabled') ||\n input.classList.contains('disabled') ||\n rootElement.classList.contains('disabled')) {\n return\n }\n input.checked = !this._element.classList.contains(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n event.preventDefault()\n\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Button._jQueryInterface\n$.fn[NAME].Constructor = Button\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n}\n\nexport default Button\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","Button","element","_element","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","querySelector","type","checked","classList","contains","activeElement","removeClass","hasAttribute","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","hasClass","call","test","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA;;;;;;EAMA,IAAMA,IAAI,GAAkB,QAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,WAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,SAAS,GAAG;EAChBC,EAAAA,MAAM,EAAG,QADO;EAEhBC,EAAAA,MAAM,EAAG,KAFO;EAGhBC,EAAAA,KAAK,EAAI;EAHO,CAAlB;EAMA,IAAMC,QAAQ,GAAG;EACfC,EAAAA,kBAAkB,EAAG,yBADN;EAEfC,EAAAA,WAAW,EAAU,yBAFN;EAGfC,EAAAA,KAAK,EAAgB,4BAHN;EAIfN,EAAAA,MAAM,EAAe,SAJN;EAKfC,EAAAA,M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AC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOc,MAAM,CAACuB,gBAAd;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"button.js","sources":["../src/button.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n}\n\nconst Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLES : '[data-toggle=\"buttons\"]',\n DATA_TOGGLE : '[data-toggle=\"button\"]',\n DATA_TOGGLES_BUTTONS : '[data-toggle=\"buttons\"] .btn',\n INPUT : 'input:not([type=\"hidden\"])',\n ACTIVE : '.active',\n BUTTON : '.btn'\n}\n\nconst Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +\n `blur${EVENT_KEY}${DATA_API_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLES\n )[0]\n\n if (rootElement) {\n const input = this._element.querySelector(Selector.INPUT)\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = rootElement.querySelector(Selector.ACTIVE)\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n } else if (input.type === 'checkbox') {\n if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n }\n } else {\n // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input\n triggerChangeEvent = false\n }\n\n if (triggerChangeEvent) {\n input.checked = !this._element.classList.contains(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)[0]\n }\n\n if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {\n event.preventDefault() // work around Firefox bug #1540995\n } else {\n const inputBtn = button.querySelector(Selector.INPUT)\n\n if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {\n event.preventDefault() // work around Firefox bug #1540995\n return\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n }\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n$(window).on(Event.LOAD_DATA_API, () => {\n // ensure correct active class is set to match the controls' actual values/states\n\n // find all checkboxes/readio buttons inside data-toggle groups\n let buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLES_BUTTONS))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n const input = button.querySelector(Selector.INPUT)\n if (input.checked || input.hasAttribute('checked')) {\n button.classList.add(ClassName.ACTIVE)\n } else {\n button.classList.remove(ClassName.ACTIVE)\n }\n }\n\n // find all button toggles\n buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n if (button.getAttribute('aria-pressed') === 'true') {\n button.classList.add(ClassName.ACTIVE)\n } else {\n button.classList.remove(ClassName.ACTIVE)\n }\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Button._jQueryInterface\n$.fn[NAME].Constructor = Button\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n}\n\nexport default Button\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLES","DATA_TOGGLE","DATA_TOGGLES_BUTTONS","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","LOAD_DATA_API","Button","element","_element","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","querySelector","type","checked","classList","contains","activeElement","removeClass","tagName","trigger","focus","hasAttribute","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","button","target","hasClass","preventDefault","inputBtn","call","test","window","buttons","slice","querySelectorAll","i","len","length","add","remove","getAttribute","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA;;;;;;EAMA,IAAMA,IAAI,GAAkB,QAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,WAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,SAAS,GAAG;EAChBC,EAAAA,MAAM,EAAG,QADO;EAEhBC,EAAAA,MAAM,EAAG,KAFO;EAGhBC,EAAAA,KAAK,EAAI;EAHO,CAAlB;EAMA,IAAMC,QAAQ,GAAG;EACfC,EAAAA,kBAAkB,EAAK,yBADR;EAEfC,EAAAA,YAAY,EAAW,yBAFR;EAGfC,EAAAA,WAAW,EAAY,wBAHR;EAIfC,EAAAA,oBAAoB,EAAG,8BAJR;EAKfC,EAAAA,KAAK,EAAkB,4BALR;EAMfR,EAAAA,MAAM,EAAiB,SANR;EAOfC,EAAAA,MAAM,EAAiB;EAPR,CAAjB;EAUA,IAAMQ,KAAK,GAAG;EACZC,EAAAA,cAAc,YAAgBhB,SAAhB,GAA4BC,YAD9B;EAEZgB,EAAAA,mBAAmB,EAAG,UAAQjB,SAAR,GAAoBC,YAApB,mBACSD,SADT,GACqBC,YADrB,CAFV;EAIZiB,EAAAA,aAAa,WAAgBlB,SAAhB,GAA4BC;EAJ7B,CAAd;EAOA;;;;;;MAMMkB;;;EACJ,kBAAYC,OAAZ,EAAqB;EACnB,SAAKC,QAAL,GAAgBD,OAAhB;EACD;;;;;EAQD;WAEAE,SAAA,kBAAS;EACP,QAAIC,kBAAkB,GAAG,IAAzB;EACA,Q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ACG,EAAD,CAAtB;;EACA,QAAIX,OAAM,CAACgB,YAAP,CAAoB,cAApB,MAAwC,MAA5C,EAAoD;EAClDhB,MAAAA,OAAM,CAACnB,SAAP,CAAiBiC,GAAjB,CAAqB3D,SAAS,CAACC,MAA/B;EACD,KAFD,MAEO;EACL4C,MAAAA,OAAM,CAACnB,SAAP,CAAiBkC,MAAjB,CAAwB5D,SAAS,CAACC,MAAlC;EACD;EACF;EACF,CAzBD;EA2BA;;;;;;EAMAH,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAasB,MAAM,CAACwB,gBAApB;EACAxC,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWsE,WAAX,GAAyBhD,MAAzB;;EACAhB,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWuE,UAAX,GAAwB,YAAM;EAC5BjE,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOiB,MAAM,CAACwB,gBAAd;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/carousel.js b/external/bootstrap4/js/dist/carousel.js index 287b2435f6..66e8147c07 100644 --- a/external/bootstrap4/js/dist/carousel.js +++ b/external/bootstrap4/js/dist/carousel.js @@ -1,5 +1,5 @@ /*! - * Bootstrap carousel.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap carousel.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Carousel = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -69,7 +84,7 @@ */ var NAME = 'carousel'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.carousel'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -142,13 +157,12 @@ var PointerType = { TOUCH: 'touch', PEN: 'pen' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Carousel = /*#__PURE__*/ @@ -268,7 +282,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, config); + config = _objectSpread2({}, Default, {}, config); Util.typeCheckConfig(NAME, config, DefaultType); return config; }; @@ -280,7 +294,8 @@ return; } - var direction = absDeltax / this.touchDeltaX; // swipe left + var direction = absDeltax / this.touchDeltaX; + this.touchDeltaX = 0; // swipe left if (direction > 0) { this.prev(); @@ -406,8 +421,6 @@ event.preventDefault(); this.next(); break; - - default: } }; @@ -559,10 +572,10 @@ return this.each(function () { var data = $(this).data(DATA_KEY); - var _config = _objectSpread({}, Default, $(this).data()); + var _config = _objectSpread2({}, Default, {}, $(this).data()); if (typeof config === 'object') { - _config = _objectSpread({}, _config, config); + _config = _objectSpread2({}, _config, {}, config); } var action = typeof config === 'string' ? config : _config.slide; @@ -600,7 +613,7 @@ return; } - var config = _objectSpread({}, $(target).data(), $(this).data()); + var config = _objectSpread2({}, $(target).data(), {}, $(this).data()); var slideIndex = this.getAttribute('data-slide-to'); @@ -664,5 +677,5 @@ return Carousel; -})); +}))); //# sourceMappingURL=carousel.js.map diff --git a/external/bootstrap4/js/dist/carousel.js.map b/external/bootstrap4/js/dist/carousel.js.map index fe6f694072..2c625b33f2 100644 --- a/external/bootstrap4/js/dist/carousel.js.map +++ b/external/bootstrap4/js/dist/carousel.js.map @@ -1 +1 @@ -{"version":3,"file":"carousel.js","sources":["../src/carousel.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'carousel'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\nconst ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true,\n touch : true\n}\n\nconst DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean',\n touch : 'boolean'\n}\n\nconst Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n}\n\nconst Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHSTART : `touchstart${EVENT_KEY}`,\n TOUCHMOVE : `touchmove${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n POINTERDOWN : `pointerdown${EVENT_KEY}`,\n POINTERUP : `pointerup${EVENT_KEY}`,\n DRAG_START : `dragstart${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item',\n POINTER_EVENT : 'pointer-event'\n}\n\nconst Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n ITEM_IMG : '.carousel-item img',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n}\n\nconst PointerType = {\n TOUCH : 'touch',\n PEN : 'pen'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\nclass Carousel {\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n this._isPaused = false\n this._isSliding = false\n this.touchTimeout = null\n this.touchStartX = 0\n this.touchDeltaX = 0\n\n this._config = this._getConfig(config)\n this._element = element\n this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if (this._element.querySelector(Selector.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex\n ? Direction.NEXT\n : Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX)\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltax / this.touchDeltaX\n\n // swipe left\n if (direction > 0) {\n this.prev()\n }\n\n // swipe right\n if (direction < 0) {\n this.next()\n }\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n if (!this._touchSupported) {\n return\n }\n\n const start = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchStartX = event.originalEvent.clientX\n } else if (!this._pointerEvent) {\n this.touchStartX = event.originalEvent.touches[0].clientX\n }\n }\n\n const move = (event) => {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n this.touchDeltaX = 0\n } else {\n this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX\n }\n }\n\n const end = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchDeltaX = event.originalEvent.clientX - this.touchStartX\n }\n\n this._handleSwipe()\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n }\n\n $(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())\n if (this._pointerEvent) {\n $(this._element).on(Event.POINTERDOWN, (event) => start(event))\n $(this._element).on(Event.POINTERUP, (event) => end(event))\n\n this._element.classList.add(ClassName.POINTER_EVENT)\n } else {\n $(this._element).on(Event.TOUCHSTART, (event) => start(event))\n $(this._element).on(Event.TOUCHMOVE, (event) => move(event))\n $(this._element).on(Event.TOUCHEND, (event) => end(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode\n ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))\n : []\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1\n ? this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))\n $(indicators)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval\n this._config.interval = nextElementInterval\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(activeElement)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n })\n .emulateTransitionEnd(transitionDuration)\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = {\n ...Default,\n ...$(this).data()\n }\n\n if (typeof config === 'object') {\n _config = {\n ..._config,\n ...config\n }\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval && _config.ride) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = {\n ...$(target).data(),\n ...$(this).data()\n }\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n$(window).on(Event.LOAD_DATA_API, () => {\n const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))\n for (let i = 0, len = carousels.length; i < len; i++) {\n const $carousel = $(carousels[i])\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Carousel._jQueryInterface\n$.fn[NAME].Constructor = Carousel\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n}\n\nexport default Carousel\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","TOUCHEVENT_COMPAT_WAIT","SWIPE_THRESHOLD","Default","interval","keyboard","slide","pause","wrap","touch","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHSTART","TOUCHMOVE","TOUCHEND","POINTERDOWN","POINTERUP","DRAG_START","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","POINTER_EVENT","Selector","ACTIVE_ITEM","ITEM_IMG","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","PointerType","TOUCH","PEN","Carousel","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","touchStartX","touchDeltaX","_config","_getConfig","_element","_indicatorsElement","querySelector","_touchSupported","document","documentElement","navigator","maxTouchPoints","_pointerEvent","Boolean","window","PointerEvent","MSPointerEvent","_addEventListeners","next","_slide","nextWhenVisible","hidden","is","css","prev","event","Util","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","typeCheckConfig","_handleSwipe","absDeltax","Math","abs","on","_keydown","_addTouchEventListeners","start","originalEvent","pointerType","toUpperCase","clientX","touches","move","end","clearTimeout","setTimeout","querySelectorAll","e","preventDefault","classList","add","test","target","tagName","which","parentNode","slice","call","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","_setActiveIndicatorElement","indicators","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","nextElementIndex","isCycling","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","nextElementInterval","parseInt","getAttribute","defaultInterval","transitionDuration","getTransitionDurationFromElement","TRANSITION_END","emulateTransitionEnd","_jQueryInterface","each","data","action","TypeError","ride","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","carousels","i","len","$carousel","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAqB,UAA/B;EACA,IAAMC,OAAO,GAAkB,OAA/B;EACA,IAAMC,QAAQ,GAAiB,aAA/B;EACA,IAAMC,SAAS,SAAoBD,QAAnC;EACA,IAAME,YAAY,GAAa,WAA/B;EACA,IAAMC,kBAAkB,GAAOC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA/B;EACA,IAAMQ,kBAAkB,GAAO,EAA/B;;EACA,IAAMC,mBAAmB,GAAM,EAA/B;;EACA,IAAMC,sBAAsB,GAAG,GAA/B;;EACA,IAAMC,eAAe,GAAU,EAA/B;EAEA,IAAMC,OAAO,GAAG;EACdC,EAAAA,Q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EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOiD,QAAQ,CAAC2H,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"carousel.js","sources":["../src/carousel.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'carousel'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\nconst ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true,\n touch : true\n}\n\nconst DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean',\n touch : 'boolean'\n}\n\nconst Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n}\n\nconst Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHSTART : `touchstart${EVENT_KEY}`,\n TOUCHMOVE : `touchmove${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n POINTERDOWN : `pointerdown${EVENT_KEY}`,\n POINTERUP : `pointerup${EVENT_KEY}`,\n DRAG_START : `dragstart${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item',\n POINTER_EVENT : 'pointer-event'\n}\n\nconst Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n ITEM_IMG : '.carousel-item img',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n}\n\nconst PointerType = {\n TOUCH : 'touch',\n PEN : 'pen'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\nclass Carousel {\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n this._isPaused = false\n this._isSliding = false\n this.touchTimeout = null\n this.touchStartX = 0\n this.touchDeltaX = 0\n\n this._config = this._getConfig(config)\n this._element = element\n this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if (this._element.querySelector(Selector.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex\n ? Direction.NEXT\n : Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX)\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltax / this.touchDeltaX\n\n this.touchDeltaX = 0\n\n // swipe left\n if (direction > 0) {\n this.prev()\n }\n\n // swipe right\n if (direction < 0) {\n this.next()\n }\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n if (!this._touchSupported) {\n return\n }\n\n const start = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchStartX = event.originalEvent.clientX\n } else if (!this._pointerEvent) {\n this.touchStartX = event.originalEvent.touches[0].clientX\n }\n }\n\n const move = (event) => {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n this.touchDeltaX = 0\n } else {\n this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX\n }\n }\n\n const end = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchDeltaX = event.originalEvent.clientX - this.touchStartX\n }\n\n this._handleSwipe()\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n }\n\n $(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())\n if (this._pointerEvent) {\n $(this._element).on(Event.POINTERDOWN, (event) => start(event))\n $(this._element).on(Event.POINTERUP, (event) => end(event))\n\n this._element.classList.add(ClassName.POINTER_EVENT)\n } else {\n $(this._element).on(Event.TOUCHSTART, (event) => start(event))\n $(this._element).on(Event.TOUCHMOVE, (event) => move(event))\n $(this._element).on(Event.TOUCHEND, (event) => end(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode\n ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))\n : []\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1\n ? this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))\n $(indicators)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval\n this._config.interval = nextElementInterval\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(activeElement)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n })\n .emulateTransitionEnd(transitionDuration)\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = {\n ...Default,\n ...$(this).data()\n }\n\n if (typeof config === 'object') {\n _config = {\n ..._config,\n ...config\n }\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval && _config.ride) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = {\n ...$(target).data(),\n ...$(this).data()\n }\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n$(window).on(Event.LOAD_DATA_API, () => {\n const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))\n for (let i = 0, len = carousels.length; i < len; i++) {\n const $carousel = $(carousels[i])\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Carousel._jQueryInterface\n$.fn[NAME].Constructor = Carousel\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n}\n\nexport default Carousel\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","TOUCHEVENT_COMPAT_WAIT","SWIPE_THRESHOLD","Default","interval","keyboard","slide","pause","wrap","touch","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHSTART","TOUCHMOVE","TOUCHEND","POINTERDOWN","POINTERUP","DRAG_START","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","POINTER_EVENT","Selector","ACTIVE_ITEM","ITEM_IMG","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","PointerType","TOUCH","PEN","Carousel","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","touchStartX","touchDeltaX","_config","_getConfig","_element","_indicatorsElement","querySelector","_touchSupported","document","documentElement","navigator","maxTouchPoints","_pointerEvent","Boolean","window","PointerEvent","MSPointerEvent","_addEventListeners","next","_slide","nextWhenVisible","hidden","is","css","prev","event","Util","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","typeCheckConfig","_handleSwipe","absDeltax","Math","abs","on","_keydown","_addTouchEventListeners","start","originalEvent","pointerType","toUpperCase","clientX","touches","move","end","clearTimeout","setTimeout","querySelectorAll","e","preventDefault","classList","add","test","target","tagName","which","parentNode","slice","call","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","_setActiveIndicatorElement","indicators","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","nextElementIndex","isCycling","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","nextElementInterval","parseInt","getAttribute","defaultInterval","transitionDuration","getTransitionDurationFromElement","TRANSITION_END","emulateTransitionEnd","_jQueryInterface","each","data","action","TypeError","ride","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","carousels","i","len","$carousel","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAqB,UAA/B;EACA,IAAMC,OAAO,GAAkB,OAA/B;EACA,IAAMC,QAAQ,GAAiB,aAA/B;EACA,IAAMC,SAAS,SAAoBD,QAAnC;EACA,IAAME,YAAY,GAAa,WAA/B;EACA,IAAMC,kBAAkB,GAAOC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA/B;EACA,IAAMQ,kBAAkB,GAAO,EAA/B;;EACA,IAAMC,mBAAmB,GAAM,EAA/B;;EACA,IAAMC,sBAAsB,GAAG,GAA/B;;EACA,IAAMC,eAAe,GAAU,EAA/B;EAEA,IAAMC,OAAO,GAAG;EACdC,EAAAA,QAAQ,EAAG,IADG;EAEdC,EAAAA,QAAQ,EAAG,IAFG;EAGdC,EAAAA,KAAK,EAAM,KAHG;EAIdC,EAAAA,KAAK,EAAM,OAJG;EAKdC,EAAAA,IAAI,EAAO,IALG;EAMdC,EAAAA,KAAK,EAAM;EANG,CAAhB;EASA,IAAMC,WAAW,GAAG;EAClBN,EAAAA,QAAQ,EAAG,kBADO;EAElBC,EAAAA,QAAQ,EAAG,SAFO;EAGlBC,EAAAA,KAAK,EAAM,kBAHO;EAIlBC,EAAAA,KAAK,EAAM,kBAJO;EAKlBC,EAAAA,IAAI,EAAO,SALO;EAMlBC,EAAAA,KAAK,EAAM;EANO,CAApB;EASA,IAAME,SAAS,GAAG;EAChBC,EAAAA,IAAI,EAAO,MADK;EAEh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oBAD1D;EAGAjL,CAAC,CAACuE,MAAD,CAAD,CAAUkC,EAAV,CAAatF,KAAK,CAACY,aAAnB,EAAkC,YAAM;EACtC,MAAMsJ,SAAS,GAAG,GAAGrD,KAAH,CAASC,IAAT,CAAchE,QAAQ,CAACqD,gBAAT,CAA0BhF,QAAQ,CAACM,SAAnC,CAAd,CAAlB;;EACA,OAAK,IAAI0I,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAGF,SAAS,CAACvF,MAAhC,EAAwCwF,CAAC,GAAGC,GAA5C,EAAiDD,CAAC,EAAlD,EAAsD;EACpD,QAAME,SAAS,GAAGxL,CAAC,CAACqL,SAAS,CAACC,CAAD,CAAV,CAAnB;;EACAtI,IAAAA,QAAQ,CAAC2H,gBAAT,CAA0B1C,IAA1B,CAA+BuD,SAA/B,EAA0CA,SAAS,CAACX,IAAV,EAA1C;EACD;EACF,CAND;EAQA;;;;;;EAMA7K,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAasD,QAAQ,CAAC2H,gBAAtB;EACA3K,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW+L,WAAX,GAAyBzI,QAAzB;;EACAhD,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWgM,UAAX,GAAwB,YAAM;EAC5B1L,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOiD,QAAQ,CAAC2H,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/collapse.js b/external/bootstrap4/js/dist/collapse.js index d46dfec848..6b128b58fa 100644 --- a/external/bootstrap4/js/dist/collapse.js +++ b/external/bootstrap4/js/dist/collapse.js @@ -1,5 +1,5 @@ /*! - * Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap collapse.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Collapse = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -69,7 +84,7 @@ */ var NAME = 'collapse'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.collapse'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -102,13 +117,12 @@ var Selector = { ACTIVES: '.show, .collapsing', DATA_TOGGLE: '[data-toggle="collapse"]' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Collapse = /*#__PURE__*/ @@ -295,7 +309,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, config); + config = _objectSpread2({}, Default, {}, config); config.toggle = Boolean(config.toggle); // Coerce string values Util.typeCheckConfig(NAME, config, DefaultType); @@ -349,7 +363,7 @@ var $this = $(this); var data = $this.data(DATA_KEY); - var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {}); + var _config = _objectSpread2({}, Default, {}, $this.data(), {}, typeof config === 'object' && config ? config : {}); if (!data && _config.toggle && /show|hide/.test(config)) { _config.toggle = false; @@ -424,5 +438,5 @@ return Collapse; -})); +}))); //# sourceMappingURL=collapse.js.map diff --git a/external/bootstrap4/js/dist/collapse.js.map b/external/bootstrap4/js/dist/collapse.js.map index 6e5283d145..bed8da9dfa 100644 --- a/external/bootstrap4/js/dist/collapse.js.map +++ b/external/bootstrap4/js/dist/collapse.js.map @@ -1 +1 @@ -{"version":3,"file":"collapse.js","sources":["../src/collapse.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'collapse'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n toggle : true,\n parent : ''\n}\n\nconst DefaultType = {\n toggle : 'boolean',\n parent : '(string|element)'\n}\n\nconst Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n}\n\nconst Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n}\n\nconst Selector = {\n ACTIVES : '.show, .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Collapse {\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = [].slice.call(document.querySelectorAll(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i]\n const selector = Util.getSelectorFromElement(elem)\n const filterElement = [].slice.call(document.querySelectorAll(selector))\n .filter((foundElem) => foundElem === element)\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector\n this._triggerArray.push(elem)\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))\n .filter((elem) => {\n if (typeof this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === this._config.parent\n }\n\n return elem.classList.contains(ClassName.COLLAPSE)\n })\n\n if (actives.length === 0) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n const triggerArrayLength = this._triggerArray.length\n if (triggerArrayLength > 0) {\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n\n if (selector !== null) {\n const $elem = $([].slice.call(document.querySelectorAll(selector)))\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n config.toggle = Boolean(config.toggle) // Coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent\n\n // It's a jQuery object\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0]\n }\n } else {\n parent = document.querySelector(this._config.parent)\n }\n\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n const children = [].slice.call(parent.querySelectorAll(selector))\n $(children).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n\n // Static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? document.querySelector(selector) : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = {\n ...Default,\n ...$this.data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault()\n }\n\n const $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n const selectors = [].slice.call(document.querySelectorAll(selector))\n\n $(selectors).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Collapse._jQueryInterface\n$.fn[NAME].Constructor = Collapse\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n}\n\nexport default Collapse\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","Collapse","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","slice","call","document","querySelectorAll","id","toggleList","i","len","length","elem","selector","Util","getSelectorFromElement","filterElement","filter","foundElem","_selector","push","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","getAttribute","classList","contains","not","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","capitalizedDimension","toUpperCase","scrollSize","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","triggerArrayLength","$elem","isTransitioning","dispose","removeData","Boolean","typeCheckConfig","hasWidth","isElement","jquery","querySelector","children","each","_getTargetFromElement","triggerArray","isOpen","toggleClass","$this","test","TypeError","on","event","currentTarget","tagName","preventDefault","$trigger","selectors","$target","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,UAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,aAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,OAAO,GAAG;EACdC,EAAAA,MAAM,EAAG,IADK;EAEdC,EAAAA,MAAM,EAAG;EAFK,CAAhB;EAKA,IAAMC,WAAW,GAAG;EAClBF,EAAAA,MAAM,EAAG,SADS;EAElBC,EAAAA,MAAM,EAAG;EAFS,CAApB;EAKA,IAAME,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAoBV,SADZ;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B;EACA,QAAM4B,MAAM,GAAIoC,IAAI,GAAG,QAAH,GAAcgD,QAAQ,CAAChD,IAAT,EAAlC;;EACAtC,IAAAA,QAAQ,CAAC0C,gBAAT,CAA0BjC,IAA1B,CAA+B+E,OAA/B,EAAwCtF,MAAxC;EACD,GALD;EAMD,CAhBD;EAkBA;;;;;;EAMAxB,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAa4B,QAAQ,CAAC0C,gBAAtB;EACAhE,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWqH,WAAX,GAAyBzF,QAAzB;;EACAtB,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWsH,UAAX,GAAwB,YAAM;EAC5BhH,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOuB,QAAQ,CAAC0C,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"collapse.js","sources":["../src/collapse.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'collapse'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n toggle : true,\n parent : ''\n}\n\nconst DefaultType = {\n toggle : 'boolean',\n parent : '(string|element)'\n}\n\nconst Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n}\n\nconst Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n}\n\nconst Selector = {\n ACTIVES : '.show, .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Collapse {\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = [].slice.call(document.querySelectorAll(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i]\n const selector = Util.getSelectorFromElement(elem)\n const filterElement = [].slice.call(document.querySelectorAll(selector))\n .filter((foundElem) => foundElem === element)\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector\n this._triggerArray.push(elem)\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))\n .filter((elem) => {\n if (typeof this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === this._config.parent\n }\n\n return elem.classList.contains(ClassName.COLLAPSE)\n })\n\n if (actives.length === 0) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n const triggerArrayLength = this._triggerArray.length\n if (triggerArrayLength > 0) {\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n\n if (selector !== null) {\n const $elem = $([].slice.call(document.querySelectorAll(selector)))\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n config.toggle = Boolean(config.toggle) // Coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent\n\n // It's a jQuery object\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0]\n }\n } else {\n parent = document.querySelector(this._config.parent)\n }\n\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n const children = [].slice.call(parent.querySelectorAll(selector))\n $(children).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n\n // Static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? document.querySelector(selector) : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = {\n ...Default,\n ...$this.data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault()\n }\n\n const $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n const selectors = [].slice.call(document.querySelectorAll(selector))\n\n $(selectors).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Collapse._jQueryInterface\n$.fn[NAME].Constructor = Collapse\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n}\n\nexport default Collapse\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","Collapse","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","slice","call","document","querySelectorAll","id","toggleList","i","len","length","elem","selector","Util","getSelectorFromElement","filterElement","filter","foundElem","_selector","push","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","getAttribute","classList","contains","not","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","capitalizedDimension","toUpperCase","scrollSize","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","triggerArrayLength","$elem","isTransitioning","dispose","removeData","Boolean","typeCheckConfig","hasWidth","isElement","jquery","querySelector","children","each","_getTargetFromElement","triggerArray","isOpen","toggleClass","$this","test","TypeError","on","event","currentTarget","tagName","preventDefault","$trigger","selectors","$target","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,UAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,aAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,YAAY,GAAU,WAA5B;EACA,IAAMC,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA5B;EAEA,IAAMQ,OAAO,GAAG;EACdC,EAAAA,MAAM,EAAG,IADK;EAEdC,EAAAA,MAAM,EAAG;EAFK,CAAhB;EAKA,IAAMC,WAAW,GAAG;EAClBF,EAAAA,MAAM,EAAG,SADS;EAElBC,EAAAA,MAAM,EAAG;EAFS,CAApB;EAKA,IAAME,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAoBV,SADZ;EAEZW,EAAAA,KAAK,YAAoBX,SAFb;EAGZY,EAAAA,IAAI,WAAoBZ,SAHZ;EAIZa,EAAAA,MAAM,aAAoBb,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Q,CAAC0C,gBAAT,CAA0BjC,IAA1B,CAA+B+E,OAA/B,EAAwCtF,MAAxC;EACD,GALD;EAMD,CAhBD;EAkBA;;;;;;EAMAxB,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAa4B,QAAQ,CAAC0C,gBAAtB;EACAhE,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWqH,WAAX,GAAyBzF,QAAzB;;EACAtB,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWsH,UAAX,GAAwB,YAAM;EAC5BhH,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOuB,QAAQ,CAAC0C,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/dropdown.js b/external/bootstrap4/js/dist/dropdown.js index 32aff75c1b..3557cecba6 100644 --- a/external/bootstrap4/js/dist/dropdown.js +++ b/external/bootstrap4/js/dist/dropdown.js @@ -1,5 +1,5 @@ /*! - * Bootstrap dropdown.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap dropdown.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : (global = global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util)); -}(this, function ($, Popper, Util) { 'use strict'; +}(this, (function ($, Popper, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; @@ -44,20 +44,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -70,7 +85,7 @@ */ var NAME = 'dropdown'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.dropdown'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -130,21 +145,22 @@ flip: true, boundary: 'scrollParent', reference: 'toggle', - display: 'dynamic' + display: 'dynamic', + popperConfig: null }; var DefaultType = { offset: '(number|string|function)', flip: 'boolean', boundary: '(string|element)', reference: '(string|element)', - display: 'string' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - + display: 'string', + popperConfig: '(null|object)' }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Dropdown = /*#__PURE__*/ @@ -168,8 +184,6 @@ return; } - var parent = Dropdown._getParentFromElement(this._element); - var isActive = $(this._menu).hasClass(ClassName.SHOW); Dropdown._clearMenus(); @@ -178,10 +192,25 @@ return; } + this.show(true); + }; + + _proto.show = function show(usePopper) { + if (usePopper === void 0) { + usePopper = false; + } + + if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) { + return; + } + var relatedTarget = { relatedTarget: this._element }; var showEvent = $.Event(Event.SHOW, relatedTarget); + + var parent = Dropdown._getParentFromElement(this._element); + $(parent).trigger(showEvent); if (showEvent.isDefaultPrevented()) { @@ -189,7 +218,7 @@ } // Disable totally Popper.js for Dropdown in Navbar - if (!this._inNavbar) { + if (!this._inNavbar && usePopper) { /** * Check for Popper dependency * Popper - https://popper.js.org @@ -236,28 +265,6 @@ $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); }; - _proto.show = function show() { - if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) { - return; - } - - var relatedTarget = { - relatedTarget: this._element - }; - var showEvent = $.Event(Event.SHOW, relatedTarget); - - var parent = Dropdown._getParentFromElement(this._element); - - $(parent).trigger(showEvent); - - if (showEvent.isDefaultPrevented()) { - return; - } - - $(this._menu).toggleClass(ClassName.SHOW); - $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); - }; - _proto.hide = function hide() { if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) { return; @@ -276,6 +283,10 @@ return; } + if (this._popper) { + this._popper.destroy(); + } + $(this._menu).toggleClass(ClassName.SHOW); $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); }; @@ -314,7 +325,7 @@ }; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); + config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config); Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); return config; }; @@ -363,7 +374,7 @@ if (typeof this._config.offset === 'function') { offset.fn = function (data) { - data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); + data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {}); return data; }; } else { @@ -384,9 +395,8 @@ preventOverflow: { boundariesElement: this._config.boundary } - } // Disable Popper.js if we have a static display - - }; + } + }; // Disable Popper.js if we have a static display if (this._config.display === 'static') { popperConfig.modifiers.applyStyle = { @@ -394,7 +404,7 @@ }; } - return popperConfig; + return _objectSpread2({}, popperConfig, {}, this._config.popperConfig); } // Static ; @@ -466,6 +476,11 @@ } toggles[i].setAttribute('aria-expanded', 'false'); + + if (context._popper) { + context._popper.destroy(); + } + $(dropdownMenu).removeClass(ClassName.SHOW); $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); } @@ -506,6 +521,10 @@ var isActive = $(parent).hasClass(ClassName.SHOW); + if (!isActive && event.which === ESCAPE_KEYCODE) { + return; + } + if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { if (event.which === ESCAPE_KEYCODE) { var toggle = parent.querySelector(Selector.DATA_TOGGLE); @@ -516,7 +535,9 @@ return; } - var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)); + var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS)).filter(function (item) { + return $(item).is(':visible'); + }); if (items.length === 0) { return; @@ -591,5 +612,5 @@ return Dropdown; -})); +}))); //# sourceMappingURL=dropdown.js.map diff --git a/external/bootstrap4/js/dist/dropdown.js.map b/external/bootstrap4/js/dist/dropdown.js.map index 2cb044ce67..51cf39f4ed 100644 --- a/external/bootstrap4/js/dist/dropdown.js.map +++ b/external/bootstrap4/js/dist/dropdown.js.map @@ -1 +1 @@ -{"version":3,"file":"dropdown.js","sources":["../src/dropdown.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'dropdown'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\nconst SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\nconst TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\nconst ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\nconst ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\nconst RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\nconst REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show',\n DROPUP : 'dropup',\n DROPRIGHT : 'dropright',\n DROPLEFT : 'dropleft',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left',\n POSITION_STATIC : 'position-static'\n}\n\nconst Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n}\n\nconst AttachmentMap = {\n TOP : 'top-start',\n TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end',\n RIGHT : 'right-start',\n RIGHTEND : 'right-end',\n LEFT : 'left-start',\n LEFTEND : 'left-end'\n}\n\nconst Default = {\n offset : 0,\n flip : true,\n boundary : 'scrollParent',\n reference : 'toggle',\n display : 'dynamic'\n}\n\nconst DefaultType = {\n offset : '(number|string|function)',\n flip : 'boolean',\n boundary : '(string|element)',\n reference : '(string|element)',\n display : 'string'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Dropdown {\n constructor(element, config) {\n this._element = element\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n this._inNavbar = this._detectNavbar()\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this._element)\n const isActive = $(this._menu).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n // Disable totally Popper.js for Dropdown in Navbar\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = parent\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference\n\n // Check if it's jQuery element\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0]\n }\n }\n\n // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC)\n }\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n show() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n hide() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n this._menu = null\n if (this._popper !== null) {\n this._popper.destroy()\n this._popper = null\n }\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, (event) => {\n event.preventDefault()\n event.stopPropagation()\n this.toggle()\n })\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...$(this._element).data(),\n ...config\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getMenuElement() {\n if (!this._menu) {\n const parent = Dropdown._getParentFromElement(this._element)\n\n if (parent) {\n this._menu = parent.querySelector(Selector.MENU)\n }\n }\n return this._menu\n }\n\n _getPlacement() {\n const $parentDropdown = $(this._element.parentNode)\n let placement = AttachmentMap.BOTTOM\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getOffset() {\n const offset = {}\n\n if (typeof this._config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this._config.offset(data.offsets, this._element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this._config.offset\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }\n\n // Disable Popper.js if we have a static display\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n }\n }\n\n return popperConfig\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data) {\n data = new Dropdown(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const context = $(toggles[i]).data(DATA_KEY)\n const relatedTarget = {\n relatedTarget: toggles[i]\n }\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n if (!context) {\n continue\n }\n\n const dropdownMenu = context._menu\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) &&\n $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(dropdownMenu).removeClass(ClassName.SHOW)\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n return parent || element.parentNode\n }\n\n // eslint-disable-next-line complexity\n static _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName)\n ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&\n (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||\n $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = parent.querySelector(Selector.DATA_TOGGLE)\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))\n\n if (items.length === 0) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n event.stopPropagation()\n Dropdown._jQueryInterface.call($(this), 'toggle')\n })\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Dropdown._jQueryInterface\n$.fn[NAME].Constructor = Dropdown\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n}\n\n\nexport default Dropdown\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ESCAPE_KEYCODE","SPACE_KEYCODE","TAB_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","REGEXP_KEYDOWN","RegExp","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","KEYUP_DATA_API","ClassName","DISABLED","DROPUP","DROPRIGHT","DROPLEFT","MENURIGHT","MENULEFT","POSITION_STATIC","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","RIGHT","RIGHTEND","LEFT","LEFTEND","Default","offset","flip","boundary","reference","display","DefaultType","Dropdown","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_inNavbar","_detectNavbar","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","Popper","TypeError","referenceElement","Util","isElement","jquery","addClass","_getPopperConfig","document","documentElement","closest","length","body","children","on","noop","focus","setAttribute","toggleClass","show","hide","hideEvent","dispose","removeData","off","destroy","update","scheduleUpdate","event","preventDefault","stopPropagation","constructor","data","typeCheckConfig","querySelector","_getPlacement","$parentDropdown","parentNode","placement","_getOffset","offsets","popperConfig","modifiers","enabled","preventOverflow","boundariesElement","applyStyle","_jQueryInterface","each","which","type","toggles","slice","call","querySelectorAll","i","len","context","clickEvent","dropdownMenu","test","target","tagName","contains","removeClass","selector","getSelectorFromElement","_dataApiKeydownHandler","items","index","indexOf","e","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA;;;;;;EAMA,IAAMA,IAAI,GAAuB,UAAjC;EACA,IAAMC,OAAO,GAAoB,OAAjC;EACA,IAAMC,QAAQ,GAAmB,aAAjC;EACA,IAAMC,SAAS,SAAsBD,QAArC;EACA,IAAME,YAAY,GAAe,WAAjC;EACA,IAAMC,kBAAkB,GAASC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAAjC;EACA,IAAMQ,cAAc,GAAa,EAAjC;;EACA,IAAMC,aAAa,GAAc,EAAjC;;EACA,IAAMC,WAAW,GAAgB,CAAjC;;EACA,IAAMC,gBAAgB,GAAW,EAAjC;;EACA,IAAMC,kBAAkB,GAAS,EAAjC;;EACA,IAAMC,wBAAwB,GAAG,CAAjC;;EACA,IAAMC,cAAc,GAAa,IAAIC,MAAJ,CAAcJ,gBAAd,SAAkCC,kBAAlC,SAAwDJ,cAAxD,CAAjC;EAEA,IAAMQ,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAsBd,SADd;EAEZe,EAAAA,MAAM,aAAsBf,SAFhB;EAGZgB,EAAAA,IAAI,WAAsBhB,SAHd;EAIZiB,EAAAA,KAAK,YAAsBjB,SAJf;EAKZkB,EAAAA,KAAK,YAAsBlB,SALf;EAMZmB,EAAAA,cAAc,YAAanB,SAAb,GAAyBC,YAN3B;EAOZmB,EAAA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,sBAFtD,EAGGrD,EAHH,CAGS5E,KAAK,CAACM,cAHf,SAGiCN,KAAK,CAACQ,cAHvC,EAGyD+B,QAAQ,CAACkB,WAHlE,EAIGmB,EAJH,CAIM5E,KAAK,CAACM,cAJZ,EAI4BW,QAAQ,CAACC,WAJrC,EAIkD,UAAUwE,KAAV,EAAiB;EAC/DA,EAAAA,KAAK,CAACC,cAAN;EACAD,EAAAA,KAAK,CAACE,eAAN;;EACArD,EAAAA,QAAQ,CAACsE,gBAAT,CAA0BM,IAA1B,CAA+B7H,CAAC,CAAC,IAAD,CAAhC,EAAwC,QAAxC;EACD,CARH,EASGsF,EATH,CASM5E,KAAK,CAACM,cATZ,EAS4BW,QAAQ,CAACE,UATrC,EASiD,UAACkH,CAAD,EAAO;EACpDA,EAAAA,CAAC,CAACzC,eAAF;EACD,CAXH;EAaA;;;;;;EAMAtG,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAauD,QAAQ,CAACsE,gBAAtB;EACAvH,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWsJ,WAAX,GAAyB/F,QAAzB;;EACAjD,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWuJ,UAAX,GAAwB,YAAM;EAC5BjJ,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOkD,QAAQ,CAACsE,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"dropdown.js","sources":["../src/dropdown.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'dropdown'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\nconst SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\nconst TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\nconst ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\nconst ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\nconst RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\nconst REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show',\n DROPUP : 'dropup',\n DROPRIGHT : 'dropright',\n DROPLEFT : 'dropleft',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left',\n POSITION_STATIC : 'position-static'\n}\n\nconst Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n}\n\nconst AttachmentMap = {\n TOP : 'top-start',\n TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end',\n RIGHT : 'right-start',\n RIGHTEND : 'right-end',\n LEFT : 'left-start',\n LEFTEND : 'left-end'\n}\n\nconst Default = {\n offset : 0,\n flip : true,\n boundary : 'scrollParent',\n reference : 'toggle',\n display : 'dynamic',\n popperConfig : null\n}\n\nconst DefaultType = {\n offset : '(number|string|function)',\n flip : 'boolean',\n boundary : '(string|element)',\n reference : '(string|element)',\n display : 'string',\n popperConfig : '(null|object)'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Dropdown {\n constructor(element, config) {\n this._element = element\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n this._inNavbar = this._detectNavbar()\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const isActive = $(this._menu).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return\n }\n\n this.show(true)\n }\n\n show(usePopper = false) {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n // Disable totally Popper.js for Dropdown in Navbar\n if (!this._inNavbar && usePopper) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = parent\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference\n\n // Check if it's jQuery element\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0]\n }\n }\n\n // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC)\n }\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n hide() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (this._popper) {\n this._popper.destroy()\n }\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n this._menu = null\n if (this._popper !== null) {\n this._popper.destroy()\n this._popper = null\n }\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, (event) => {\n event.preventDefault()\n event.stopPropagation()\n this.toggle()\n })\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...$(this._element).data(),\n ...config\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getMenuElement() {\n if (!this._menu) {\n const parent = Dropdown._getParentFromElement(this._element)\n\n if (parent) {\n this._menu = parent.querySelector(Selector.MENU)\n }\n }\n return this._menu\n }\n\n _getPlacement() {\n const $parentDropdown = $(this._element.parentNode)\n let placement = AttachmentMap.BOTTOM\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getOffset() {\n const offset = {}\n\n if (typeof this._config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this._config.offset(data.offsets, this._element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this._config.offset\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }\n\n // Disable Popper.js if we have a static display\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n }\n }\n\n return {\n ...popperConfig,\n ...this._config.popperConfig\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data) {\n data = new Dropdown(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const context = $(toggles[i]).data(DATA_KEY)\n const relatedTarget = {\n relatedTarget: toggles[i]\n }\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n if (!context) {\n continue\n }\n\n const dropdownMenu = context._menu\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) &&\n $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n if (context._popper) {\n context._popper.destroy()\n }\n\n $(dropdownMenu).removeClass(ClassName.SHOW)\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n return parent || element.parentNode\n }\n\n // eslint-disable-next-line complexity\n static _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName)\n ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&\n (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||\n $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive && event.which === ESCAPE_KEYCODE) {\n return\n }\n\n if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = parent.querySelector(Selector.DATA_TOGGLE)\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))\n .filter((item) => $(item).is(':visible'))\n\n if (items.length === 0) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n event.stopPropagation()\n Dropdown._jQueryInterface.call($(this), 'toggle')\n })\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Dropdown._jQueryInterface\n$.fn[NAME].Constructor = Dropdown\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n}\n\n\nexport default Dropdown\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ESCAPE_KEYCODE","SPACE_KEYCODE","TAB_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","REGEXP_KEYDOWN","RegExp","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","KEYUP_DATA_API","ClassName","DISABLED","DROPUP","DROPRIGHT","DROPLEFT","MENURIGHT","MENULEFT","POSITION_STATIC","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","RIGHT","RIGHTEND","LEFT","LEFTEND","Default","offset","flip","boundary","reference","display","popperConfig","DefaultType","Dropdown","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_inNavbar","_detectNavbar","_addEventListeners","toggle","disabled","hasClass","isActive","_clearMenus","show","usePopper","relatedTarget","showEvent","parent","_getParentFromElement","trigger","isDefaultPrevented","Popper","TypeError","referenceElement","Util","isElement","jquery","addClass","_getPopperConfig","document","documentElement","closest","length","body","children","on","noop","focus","setAttribute","toggleClass","hide","hideEvent","destroy","dispose","removeData","off","update","scheduleUpdate","event","preventDefault","stopPropagation","constructor","data","typeCheckConfig","querySelector","_getPlacement","$parentDropdown","parentNode","placement","_getOffset","offsets","modifiers","enabled","preventOverflow","boundariesElement","applyStyle","_jQueryInterface","each","which","type","toggles","slice","call","querySelectorAll","i","len","context","clickEvent","dropdownMenu","test","target","tagName","contains","removeClass","selector","getSelectorFromElement","_dataApiKeydownHandler","items","filter","item","is","index","indexOf","e","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA;;;;;;EAMA,IAAMA,IAAI,GAAuB,UAAjC;EACA,IAAMC,OAAO,GAAoB,OAAjC;EACA,IAAMC,QAAQ,GAAmB,aAAjC;EACA,IAAMC,SAAS,SAAsBD,QAArC;EACA,IAAME,YAAY,GAAe,WAAjC;EACA,IAAMC,kBAAkB,GAASC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAAjC;EACA,IAAMQ,cAAc,GAAa,EAAjC;;EACA,IAAMC,aAAa,GAAc,EAAjC;;EACA,IAAMC,WAAW,GAAgB,CAAjC;;EACA,IAAMC,gBAAgB,GAAW,EAAjC;;EACA,IAAMC,kBAAkB,GAAS,EAAjC;;EACA,IAAMC,wBAAwB,GAAG,CAAjC;;EACA,IAAMC,cAAc,GAAa,IAAIC,MAAJ,CAAcJ,gBAAd,SAAkCC,kBAAlC,SAAwDJ,cAAxD,CAAjC;EAEA,IAAMQ,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAsBd,SADd;EAEZe,EAAAA,MAAM,aAAsBf,SAFhB;EAGZgB,EAAAA,IAAI,WAAsBhB,SAHd;EAIZiB,EAAAA,KAAK,YAAsBjB,SAJf;EAKZkB,EAAAA,KAAK,YAAsBlB,SALf;EAMZmB,EAAAA,cAAc,YAAanB,SAAb,GAAyBC,YAN3B;EAOZmB,EAAAA,gBAAgB,cAAapB,SAAb,GAAyBC,YAP7B;EAQZoB,EAAAA,cAAc,YAAarB,SAAb,GAAyBC;EAR3B,CAAd;EAWA,IAAMqB,SAAS,GAAG;EAChBC,EAAAA,QAAQ,EAAU,UADF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ACC,WAJrC,EAIkD,UAAU0E,KAAV,EAAiB;EAC/DA,EAAAA,KAAK,CAACC,cAAN;EACAD,EAAAA,KAAK,CAACE,eAAN;;EACAtD,EAAAA,QAAQ,CAACsE,gBAAT,CAA0BM,IAA1B,CAA+B9H,CAAC,CAAC,IAAD,CAAhC,EAAwC,QAAxC;EACD,CARH,EASGyF,EATH,CASM/E,KAAK,CAACM,cATZ,EAS4BW,QAAQ,CAACE,UATrC,EASiD,UAACsH,CAAD,EAAO;EACpDA,EAAAA,CAAC,CAAC3C,eAAF;EACD,CAXH;EAaA;;;;;;EAMAxG,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAawD,QAAQ,CAACsE,gBAAtB;EACAxH,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW0J,WAAX,GAAyBlG,QAAzB;;EACAlD,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW2J,UAAX,GAAwB,YAAM;EAC5BrJ,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOmD,QAAQ,CAACsE,gBAAhB;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/index.js b/external/bootstrap4/js/dist/index.js index 8646da61bb..60a6276e2f 100644 --- a/external/bootstrap4/js/dist/index.js +++ b/external/bootstrap4/js/dist/index.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.3.1): index.js + * Bootstrap (v4.4.0): index.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ diff --git a/external/bootstrap4/js/dist/modal.js b/external/bootstrap4/js/dist/modal.js index 43b7e61be4..dbdb649518 100644 --- a/external/bootstrap4/js/dist/modal.js +++ b/external/bootstrap4/js/dist/modal.js @@ -1,5 +1,5 @@ /*! - * Bootstrap modal.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap modal.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Modal = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -69,7 +84,7 @@ */ var NAME = 'modal'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.modal'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -90,6 +105,7 @@ }; var Event = { HIDE: "hide" + EVENT_KEY, + HIDE_PREVENTED: "hidePrevented" + EVENT_KEY, HIDDEN: "hidden" + EVENT_KEY, SHOW: "show" + EVENT_KEY, SHOWN: "shown" + EVENT_KEY, @@ -107,7 +123,8 @@ BACKDROP: 'modal-backdrop', OPEN: 'modal-open', FADE: 'fade', - SHOW: 'show' + SHOW: 'show', + STATIC: 'modal-static' }; var Selector = { DIALOG: '.modal-dialog', @@ -116,13 +133,12 @@ DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', STICKY_CONTENT: '.sticky-top' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Modal = /*#__PURE__*/ @@ -268,15 +284,40 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, config); + config = _objectSpread2({}, Default, {}, config); Util.typeCheckConfig(NAME, config, DefaultType); return config; }; - _proto._showElement = function _showElement(relatedTarget) { + _proto._triggerBackdropTransition = function _triggerBackdropTransition() { var _this3 = this; + if (this._config.backdrop === 'static') { + var hideEventPrevented = $.Event(Event.HIDE_PREVENTED); + $(this._element).trigger(hideEventPrevented); + + if (hideEventPrevented.defaultPrevented) { + return; + } + + this._element.classList.add(ClassName.STATIC); + + var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element); + $(this._element).one(Util.TRANSITION_END, function () { + _this3._element.classList.remove(ClassName.STATIC); + }).emulateTransitionEnd(modalTransitionDuration); + + this._element.focus(); + } else { + this.hide(); + } + }; + + _proto._showElement = function _showElement(relatedTarget) { + var _this4 = this; + var transition = $(this._element).hasClass(ClassName.FADE); + var modalBody = this._dialog ? this._dialog.querySelector(Selector.MODAL_BODY) : null; if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { // Don't move modal's DOM position @@ -289,8 +330,8 @@ this._element.setAttribute('aria-modal', true); - if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) { - this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0; + if ($(this._dialog).hasClass(ClassName.SCROLLABLE) && modalBody) { + modalBody.scrollTop = 0; } else { this._element.scrollTop = 0; } @@ -310,12 +351,12 @@ }); var transitionComplete = function transitionComplete() { - if (_this3._config.focus) { - _this3._element.focus(); + if (_this4._config.focus) { + _this4._element.focus(); } - _this3._isTransitioning = false; - $(_this3._element).trigger(shownEvent); + _this4._isTransitioning = false; + $(_this4._element).trigger(shownEvent); }; if (transition) { @@ -327,25 +368,23 @@ }; _proto._enforceFocus = function _enforceFocus() { - var _this4 = this; + var _this5 = this; $(document).off(Event.FOCUSIN) // Guard against infinite focus loop .on(Event.FOCUSIN, function (event) { - if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { - _this4._element.focus(); + if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) { + _this5._element.focus(); } }); }; _proto._setEscapeEvent = function _setEscapeEvent() { - var _this5 = this; + var _this6 = this; if (this._isShown && this._config.keyboard) { $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { if (event.which === ESCAPE_KEYCODE) { - event.preventDefault(); - - _this5.hide(); + _this6._triggerBackdropTransition(); } }); } else if (!this._isShown) { @@ -354,11 +393,11 @@ }; _proto._setResizeEvent = function _setResizeEvent() { - var _this6 = this; + var _this7 = this; if (this._isShown) { $(window).on(Event.RESIZE, function (event) { - return _this6.handleUpdate(event); + return _this7.handleUpdate(event); }); } else { $(window).off(Event.RESIZE); @@ -366,7 +405,7 @@ }; _proto._hideModal = function _hideModal() { - var _this7 = this; + var _this8 = this; this._element.style.display = 'none'; @@ -379,11 +418,11 @@ this._showBackdrop(function () { $(document.body).removeClass(ClassName.OPEN); - _this7._resetAdjustments(); + _this8._resetAdjustments(); - _this7._resetScrollbar(); + _this8._resetScrollbar(); - $(_this7._element).trigger(Event.HIDDEN); + $(_this8._element).trigger(Event.HIDDEN); }); }; @@ -395,7 +434,7 @@ }; _proto._showBackdrop = function _showBackdrop(callback) { - var _this8 = this; + var _this9 = this; var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; @@ -409,8 +448,8 @@ $(this._backdrop).appendTo(document.body); $(this._element).on(Event.CLICK_DISMISS, function (event) { - if (_this8._ignoreBackdropClick) { - _this8._ignoreBackdropClick = false; + if (_this9._ignoreBackdropClick) { + _this9._ignoreBackdropClick = false; return; } @@ -418,11 +457,7 @@ return; } - if (_this8._config.backdrop === 'static') { - _this8._element.focus(); - } else { - _this8.hide(); - } + _this9._triggerBackdropTransition(); }); if (animate) { @@ -446,7 +481,7 @@ $(this._backdrop).removeClass(ClassName.SHOW); var callbackRemove = function callbackRemove() { - _this8._removeBackdrop(); + _this9._removeBackdrop(); if (callback) { callback(); @@ -493,7 +528,7 @@ }; _proto._setScrollbar = function _setScrollbar() { - var _this9 = this; + var _this10 = this; if (this._isBodyOverflowing) { // Note: DOMNode.style.paddingRight returns the actual value or '' if not set @@ -504,13 +539,13 @@ $(fixedContent).each(function (index, element) { var actualPadding = element.style.paddingRight; var calculatedPadding = $(element).css('padding-right'); - $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); + $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); }); // Adjust sticky content margin $(stickyContent).each(function (index, element) { var actualMargin = element.style.marginRight; var calculatedMargin = $(element).css('margin-right'); - $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); + $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); }); // Adjust body padding var actualPadding = document.body.style.paddingRight; @@ -559,7 +594,7 @@ return this.each(function () { var data = $(this).data(DATA_KEY); - var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {}); + var _config = _objectSpread2({}, Default, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {}); if (!data) { data = new Modal(this, _config); @@ -600,7 +635,7 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - var _this10 = this; + var _this11 = this; var target; var selector = Util.getSelectorFromElement(this); @@ -609,7 +644,7 @@ target = document.querySelector(selector); } - var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); + var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data()); if (this.tagName === 'A' || this.tagName === 'AREA') { event.preventDefault(); @@ -622,8 +657,8 @@ } $target.one(Event.HIDDEN, function () { - if ($(_this10).is(':visible')) { - _this10.focus(); + if ($(_this11).is(':visible')) { + _this11.focus(); } }); }); @@ -646,5 +681,5 @@ return Modal; -})); +}))); //# sourceMappingURL=modal.js.map diff --git a/external/bootstrap4/js/dist/modal.js.map b/external/bootstrap4/js/dist/modal.js.map index 544a44081a..78643ea6ff 100644 --- a/external/bootstrap4/js/dist/modal.js.map +++ b/external/bootstrap4/js/dist/modal.js.map @@ -1 +1 @@ -{"version":3,"file":"modal.js","sources":["../src/modal.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'modal'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\nconst Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n}\n\nconst DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SCROLLABLE : 'modal-dialog-scrollable',\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n DIALOG : '.modal-dialog',\n MODAL_BODY : '.modal-body',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT : '.sticky-top'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Modal {\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = element.querySelector(Selector.DIALOG)\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._scrollbarWidth = 0\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n this._adjustDialog()\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(transitionDuration)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n [window, this._element, this._dialog]\n .forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))\n\n /**\n * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `Event.CLICK_DATA_API` event that should remain\n */\n $(document).off(Event.FOCUSIN)\n\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._isTransitioning = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _showElement(relatedTarget) {\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n\n if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {\n this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0\n } else {\n this._element.scrollTop = 0\n }\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)\n\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n $(this._element).has(event.target).length === 0) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault()\n this.hide()\n }\n })\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE)\n ? ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n this._backdrop.classList.add(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (animate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!animate) {\n callback()\n return\n }\n\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else {\n callbackRemove()\n }\n } else if (callback) {\n callback()\n }\n }\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n const rect = document.body.getBoundingClientRect()\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))\n\n // Adjust fixed content padding\n $(fixedContent).each((index, element) => {\n const actualPadding = element.style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust sticky content margin\n $(stickyContent).each((index, element) => {\n const actualMargin = element.style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element)\n .data('margin-right', actualMargin)\n .css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $(document.body).css('padding-right')\n $(document.body)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n\n $(document.body).addClass(ClassName.OPEN)\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n $(fixedContent).each((index, element) => {\n const padding = $(element).data('padding-right')\n $(element).removeData('padding-right')\n element.style.paddingRight = padding ? padding : ''\n })\n\n // Restore sticky content\n const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))\n $(elements).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $(document.body).data('padding-right')\n $(document.body).removeData('padding-right')\n document.body.style.paddingRight = padding ? padding : ''\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n // Static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data) {\n data = new Modal(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n const config = $(target).data(DATA_KEY)\n ? 'toggle' : {\n ...$(target).data(),\n ...$(this).data()\n }\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Modal._jQueryInterface\n$.fn[NAME].Constructor = Modal\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n}\n\nexport default Modal\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLABLE","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","MODAL_BODY","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","STICKY_CONTENT","Modal","element","config","_config","_getConfig","_element","_dialog","querySelector","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_isTransitioning","_scrollbarWidth","toggle","relatedTarget","hide","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","_adjustDialog","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","hideEvent","transition","document","off","removeClass","transitionDuration","Util","getTransitionDurationFromElement","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","window","forEach","htmlElement","removeData","handleUpdate","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","body","appendChild","style","display","removeAttribute","setAttribute","scrollTop","reflow","addClass","_enforceFocus","shownEvent","transitionComplete","has","length","which","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","createElement","className","classList","add","appendTo","currentTarget","backdropTransitionDuration","callbackRemove","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","rect","getBoundingClientRect","left","right","innerWidth","_getScrollbarWidth","fixedContent","slice","call","querySelectorAll","stickyContent","each","index","actualPadding","calculatedPadding","css","data","parseFloat","actualMargin","marginRight","calculatedMargin","padding","elements","margin","scrollDiv","scrollbarWidth","width","clientWidth","removeChild","_jQueryInterface","TypeError","selector","getSelectorFromElement","tagName","$target","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,OAA3B;EACA,IAAMC,OAAO,GAAc,OAA3B;EACA,IAAMC,QAAQ,GAAa,UAA3B;EACA,IAAMC,SAAS,SAAgBD,QAA/B;EACA,IAAME,YAAY,GAAS,WAA3B;EACA,IAAMC,kBAAkB,GAAGC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA3B;EACA,IAAMQ,cAAc,GAAO,EAA3B;;EAEA,IAAMC,OAAO,GAAG;EACdC,EAAAA,QAAQ,EAAG,IADG;EAEdC,EAAAA,QAAQ,EAAG,IAFG;EAGdC,EAAAA,KAAK,EAAM,IAHG;EAIdC,EAAAA,IAAI,EAAO;EAJG,CAAhB;EAOA,IAAMC,WAAW,GAAG;EAClBJ,EAAAA,QAAQ,EAAG,kBADO;EAElBC,EAAAA,QAAQ,EAAG,SAFO;EAGlBC,EAAAA,KAAK,EAAM,SAHO;EAIlBC,EAAAA,IAAI,EAAO;EAJO,CAApB;EAOA,IAAME,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAuBb,SADf;EAEZc,EAAAA,MAAM,aA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,MAAD,CAAD,CAAUD,GAAV,CAAcrD,KAAK,CAACG,IAApB,EAA0B,UAACwC,SAAD,EAAe;EACvD,QAAIA,SAAS,CAACE,kBAAV,EAAJ,EAAoC;EAClC;EACA;EACD;;EAEDyG,IAAAA,OAAO,CAACjG,GAAR,CAAYrD,KAAK,CAACE,MAAlB,EAA0B,YAAM;EAC9B,UAAIX,CAAC,CAAC,OAAD,CAAD,CAAQgE,EAAR,CAAW,UAAX,CAAJ,EAA4B;EAC1B,QAAA,OAAI,CAAC1D,KAAL;EACD;EACF,KAJD;EAKD,GAXe,CAAhB;;EAaA4B,EAAAA,KAAK,CAACwH,gBAAN,CAAuBrB,IAAvB,CAA4BrI,CAAC,CAAC+D,MAAD,CAA7B,EAAuC3B,MAAvC,EAA+C,IAA/C;EACD,CAhCD;EAkCA;;;;;;EAMApC,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAawC,KAAK,CAACwH,gBAAnB;EACA1J,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWsK,WAAX,GAAyB9H,KAAzB;;EACAlC,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWuK,UAAX,GAAwB,YAAM;EAC5BjK,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOmC,KAAK,CAACwH,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"modal.js","sources":["../src/modal.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'modal'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\nconst Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n}\n\nconst DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDE_PREVENTED : `hidePrevented${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SCROLLABLE : 'modal-dialog-scrollable',\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show',\n STATIC : 'modal-static'\n}\n\nconst Selector = {\n DIALOG : '.modal-dialog',\n MODAL_BODY : '.modal-body',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT : '.sticky-top'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Modal {\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = element.querySelector(Selector.DIALOG)\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._scrollbarWidth = 0\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n this._adjustDialog()\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(transitionDuration)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n [window, this._element, this._dialog]\n .forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))\n\n /**\n * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `Event.CLICK_DATA_API` event that should remain\n */\n $(document).off(Event.FOCUSIN)\n\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._isTransitioning = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _triggerBackdropTransition() {\n if (this._config.backdrop === 'static') {\n const hideEventPrevented = $.Event(Event.HIDE_PREVENTED)\n\n $(this._element).trigger(hideEventPrevented)\n if (hideEventPrevented.defaultPrevented) {\n return\n }\n\n this._element.classList.add(ClassName.STATIC)\n\n const modalTransitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element).one(Util.TRANSITION_END, () => {\n this._element.classList.remove(ClassName.STATIC)\n })\n .emulateTransitionEnd(modalTransitionDuration)\n this._element.focus()\n } else {\n this.hide()\n }\n }\n\n _showElement(relatedTarget) {\n const transition = $(this._element).hasClass(ClassName.FADE)\n const modalBody = this._dialog ? this._dialog.querySelector(Selector.MODAL_BODY) : null\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n\n if ($(this._dialog).hasClass(ClassName.SCROLLABLE) && modalBody) {\n modalBody.scrollTop = 0\n } else {\n this._element.scrollTop = 0\n }\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)\n\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n $(this._element).has(event.target).length === 0) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n this._triggerBackdropTransition()\n }\n })\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE)\n ? ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n this._backdrop.classList.add(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n\n this._triggerBackdropTransition()\n })\n\n if (animate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!animate) {\n callback()\n return\n }\n\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else {\n callbackRemove()\n }\n } else if (callback) {\n callback()\n }\n }\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n const rect = document.body.getBoundingClientRect()\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))\n\n // Adjust fixed content padding\n $(fixedContent).each((index, element) => {\n const actualPadding = element.style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust sticky content margin\n $(stickyContent).each((index, element) => {\n const actualMargin = element.style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element)\n .data('margin-right', actualMargin)\n .css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $(document.body).css('padding-right')\n $(document.body)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n\n $(document.body).addClass(ClassName.OPEN)\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n $(fixedContent).each((index, element) => {\n const padding = $(element).data('padding-right')\n $(element).removeData('padding-right')\n element.style.paddingRight = padding ? padding : ''\n })\n\n // Restore sticky content\n const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))\n $(elements).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $(document.body).data('padding-right')\n $(document.body).removeData('padding-right')\n document.body.style.paddingRight = padding ? padding : ''\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n // Static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data) {\n data = new Modal(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n const config = $(target).data(DATA_KEY)\n ? 'toggle' : {\n ...$(target).data(),\n ...$(this).data()\n }\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Modal._jQueryInterface\n$.fn[NAME].Constructor = Modal\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n}\n\nexport default Modal\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDE_PREVENTED","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLABLE","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","STATIC","Selector","DIALOG","MODAL_BODY","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","STICKY_CONTENT","Modal","element","config","_config","_getConfig","_element","_dialog","querySelector","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_isTransitioning","_scrollbarWidth","toggle","relatedTarget","hide","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","_adjustDialog","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","hideEvent","transition","document","off","removeClass","transitionDuration","Util","getTransitionDurationFromElement","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","window","forEach","htmlElement","removeData","handleUpdate","typeCheckConfig","_triggerBackdropTransition","hideEventPrevented","defaultPrevented","classList","add","modalTransitionDuration","remove","modalBody","parentNode","nodeType","Node","ELEMENT_NODE","body","appendChild","style","display","removeAttribute","setAttribute","scrollTop","reflow","addClass","_enforceFocus","shownEvent","transitionComplete","has","length","which","_resetAdjustments","_resetScrollbar","_removeBackdrop","callback","animate","createElement","className","appendTo","currentTarget","backdropTransitionDuration","callbackRemove","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","rect","getBoundingClientRect","left","right","innerWidth","_getScrollbarWidth","fixedContent","slice","call","querySelectorAll","stickyContent","each","index","actualPadding","calculatedPadding","css","data","parseFloat","actualMargin","marginRight","calculatedMargin","padding","elements","margin","scrollDiv","scrollbarWidth","width","clientWidth","removeChild","_jQueryInterface","TypeError","selector","getSelectorFromElement","tagName","$target","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,OAA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,CAAC,CAAC,IAAD,CAAD,CAAQoJ,IAAR,EAHQ,CAAf;;EAMA,MAAI,KAAKiB,OAAL,KAAiB,GAAjB,IAAwB,KAAKA,OAAL,KAAiB,MAA7C,EAAqD;EACnDtG,IAAAA,KAAK,CAACM,cAAN;EACD;;EAED,MAAMiG,OAAO,GAAGtK,CAAC,CAACiE,MAAD,CAAD,CAAUD,GAAV,CAAcvD,KAAK,CAACI,IAApB,EAA0B,UAACyC,SAAD,EAAe;EACvD,QAAIA,SAAS,CAACE,kBAAV,EAAJ,EAAoC;EAClC;EACA;EACD;;EAED8G,IAAAA,OAAO,CAACtG,GAAR,CAAYvD,KAAK,CAACG,MAAlB,EAA0B,YAAM;EAC9B,UAAIZ,CAAC,CAAC,OAAD,CAAD,CAAQkE,EAAR,CAAW,UAAX,CAAJ,EAA4B;EAC1B,QAAA,OAAI,CAAC5D,KAAL;EACD;EACF,KAJD;EAKD,GAXe,CAAhB;;EAaA8B,EAAAA,KAAK,CAAC6H,gBAAN,CAAuBrB,IAAvB,CAA4B5I,CAAC,CAACiE,MAAD,CAA7B,EAAuC3B,MAAvC,EAA+C,IAA/C;EACD,CAhCD;EAkCA;;;;;;EAMAtC,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAa0C,KAAK,CAAC6H,gBAAnB;EACAjK,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW6K,WAAX,GAAyBnI,KAAzB;;EACApC,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW8K,UAAX,GAAwB,YAAM;EAC5BxK,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOqC,KAAK,CAAC6H,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/popover.js b/external/bootstrap4/js/dist/popover.js index 26a67313bd..daaa2bfd67 100644 --- a/external/bootstrap4/js/dist/popover.js +++ b/external/bootstrap4/js/dist/popover.js @@ -1,5 +1,5 @@ /*! - * Bootstrap popover.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap popover.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) : typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) : (global = global || self, global.Popover = factory(global.jQuery, global.Tooltip)); -}(this, function ($, Tooltip) { 'use strict'; +}(this, (function ($, Tooltip) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -75,21 +90,21 @@ */ var NAME = 'popover'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.popover'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var CLASS_PREFIX = 'bs-popover'; var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); - var Default = _objectSpread({}, Tooltip.Default, { + var Default = _objectSpread2({}, Tooltip.Default, { placement: 'right', trigger: 'click', content: '', template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' }); - var DefaultType = _objectSpread({}, Tooltip.DefaultType, { + var DefaultType = _objectSpread2({}, Tooltip.DefaultType, { content: '(string|element|function)' }); @@ -112,13 +127,12 @@ FOCUSOUT: "focusout" + EVENT_KEY, MOUSEENTER: "mouseenter" + EVENT_KEY, MOUSELEAVE: "mouseleave" + EVENT_KEY - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Popover = /*#__PURE__*/ @@ -257,5 +271,5 @@ return Popover; -})); +}))); //# sourceMappingURL=popover.js.map diff --git a/external/bootstrap4/js/dist/popover.js.map b/external/bootstrap4/js/dist/popover.js.map index 84bb47b31e..7b9482a68d 100644 --- a/external/bootstrap4/js/dist/popover.js.map +++ b/external/bootstrap4/js/dist/popover.js.map @@ -1 +1 @@ -{"version":3,"file":"popover.js","sources":["../src/popover.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Tooltip from './tooltip'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'popover'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.popover'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-popover'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\nconst Default = {\n ...Tooltip.Default,\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<h3 class=\"popover-header\"></h3>' +\n '<div class=\"popover-body\"></div></div>'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content : '(string|element|function)'\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT : '.popover-body'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Popover extends Tooltip {\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // We use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n let content = this._getContent()\n if (typeof content === 'function') {\n content = content.call(this.element)\n }\n this.setElementContent($tip.find(Selector.CONTENT), content)\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n // Private\n\n _getContent() {\n return this.element.getAttribute('data-content') ||\n this.config.content\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Popover._jQueryInterface\n$.fn[NAME].Constructor = Popover\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n}\n\nexport default Popover\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","Default","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","Popover","isWithContent","getTitle","_getContent","addAttachmentClass","attachment","getTipElement","addClass","tip","config","setContent","$tip","setElementContent","find","call","element","removeClass","getAttribute","_cleanTipClass","tabClass","attr","match","length","join","_jQueryInterface","each","data","_config","test","TypeError","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,SAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,YAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA,IAAME,kBAAkB,GAAIC,CAAC,CAACC,EAAF,CAAKN,IAAL,CAA5B;EACA,IAAMO,YAAY,GAAU,YAA5B;EACA,IAAMC,kBAAkB,GAAI,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA5B;;EAEA,IAAMG,OAAO,qBACRC,OAAO,CAACD,OADA;EAEXE,EAAAA,SAAS,EAAG,OAFD;EAGXC,EAAAA,OAAO,EAAK,OAHD;EAIXC,EAAAA,OAAO,EAAK,EAJD;EAKXC,EAAAA,QAAQ,EAAI,yCACA,2BADA,GAEA,kCAFA,GAGA;EARD,EAAb;;EAWA,IAAMC,WAAW,qBACZL,OAAO,CAACK,WADI;EAEfF,EAAAA,OAAO,EAAG;EAFK,EAAjB;;EAKA,IAAMG,SAAS,GAAG;EAChBC,EAAAA,IAAI,EAAG,MADS;EAEhBC,EAAAA,IAAI,EAAG;EAFS,CAAlB;EAKA,IAAMC,QAAQ,GAAG;EACfC,EAAAA,KAAK,EAAK,iBADK;EAEfC,EAAAA,OAAO,EAAG;EAFK,CAAjB;EAKA,IAAMC,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAgBrB,SADR;EAEZsB,EAAAA,MAAM,aAAgBtB,SAFV;EAGZgB,EAAAA,IAAI,WAAgBhB,SAHR;EAIZuB,EAAAA,KAAK,YAAgBvB,SAJT;EAKZwB,EAAAA,QAAQ,eAAgBxB,SALZ;EAMZyB,EAAAA,KAAK,YAAgBzB,SANT;EAOZ0B,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AEoB;EACnB,aAAOS,OAAP;EACD;;;0BAEiB;EAChB,aAAOV,IAAP;EACD;;;0BAEqB;EACpB,aAAOE,QAAP;EACD;;;0BAEkB;EACjB,aAAOqB,KAAP;EACD;;;0BAEsB;EACrB,aAAOpB,SAAP;EACD;;;0BAEwB;EACvB,aAAOa,WAAP;EACD;;;;IA7BmBL;EAqGtB;;;;;;;EAMAN,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaiC,OAAO,CAACwB,gBAArB;EACApD,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW+D,WAAX,GAAyB9B,OAAzB;;EACA5B,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAWgE,UAAX,GAAwB,YAAM;EAC5B3D,EAAAA,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAO6B,OAAO,CAACwB,gBAAf;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"popover.js","sources":["../src/popover.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Tooltip from './tooltip'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'popover'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.popover'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-popover'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\nconst Default = {\n ...Tooltip.Default,\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<h3 class=\"popover-header\"></h3>' +\n '<div class=\"popover-body\"></div></div>'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content : '(string|element|function)'\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT : '.popover-body'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Popover extends Tooltip {\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // We use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n let content = this._getContent()\n if (typeof content === 'function') {\n content = content.call(this.element)\n }\n this.setElementContent($tip.find(Selector.CONTENT), content)\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n // Private\n\n _getContent() {\n return this.element.getAttribute('data-content') ||\n this.config.content\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Popover._jQueryInterface\n$.fn[NAME].Constructor = Popover\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n}\n\nexport default Popover\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","Default","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","Popover","isWithContent","getTitle","_getContent","addAttachmentClass","attachment","getTipElement","addClass","tip","config","setContent","$tip","setElementContent","find","call","element","removeClass","getAttribute","_cleanTipClass","tabClass","attr","match","length","join","_jQueryInterface","each","data","_config","test","TypeError","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAkB,SAA5B;EACA,IAAMC,OAAO,GAAe,OAA5B;EACA,IAAMC,QAAQ,GAAc,YAA5B;EACA,IAAMC,SAAS,SAAiBD,QAAhC;EACA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C,EAAF,CAAKN,IAAL,EAAW+D,WAAX,GAAyB9B,OAAzB;;EACA5B,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAWgE,UAAX,GAAwB,YAAM;EAC5B3D,EAAAA,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAO6B,OAAO,CAACwB,gBAAf;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/scrollspy.js b/external/bootstrap4/js/dist/scrollspy.js index 7949b9f33d..067ca0c594 100644 --- a/external/bootstrap4/js/dist/scrollspy.js +++ b/external/bootstrap4/js/dist/scrollspy.js @@ -1,5 +1,5 @@ /*! - * Bootstrap scrollspy.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap scrollspy.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.ScrollSpy = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -69,7 +84,7 @@ */ var NAME = 'scrollspy'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.scrollspy'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -108,13 +123,12 @@ var OffsetMethod = { OFFSET: 'offset', POSITION: 'position' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var ScrollSpy = /*#__PURE__*/ @@ -196,7 +210,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, Default, {}, typeof config === 'object' && config ? config : {}); if (typeof config.target !== 'string') { var id = $(config.target).attr('id'); @@ -371,5 +385,5 @@ return ScrollSpy; -})); +}))); //# sourceMappingURL=scrollspy.js.map diff --git a/external/bootstrap4/js/dist/scrollspy.js.map b/external/bootstrap4/js/dist/scrollspy.js.map index e90c199ec1..1c4cbfaded 100644 --- a/external/bootstrap4/js/dist/scrollspy.js.map +++ b/external/bootstrap4/js/dist/scrollspy.js.map @@ -1 +1 @@ -{"version":3,"file":"scrollspy.js","sources":["../src/scrollspy.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'scrollspy'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n offset : 10,\n method : 'auto',\n target : ''\n}\n\nconst DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n}\n\nconst Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n}\n\nconst Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n NAV_ITEMS : '.nav-item',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n}\n\nconst OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass ScrollSpy {\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +\n `${this._config.target} ${Selector.LIST_ITEMS},` +\n `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window\n ? OffsetMethod.OFFSET : OffsetMethod.POSITION\n\n const offsetMethod = this._config.method === 'auto'\n ? autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION\n ? this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = [].slice.call(document.querySelectorAll(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = document.querySelector(targetSelector)\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window\n ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window\n ? window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset +\n scrollHeight -\n this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n const offsetLength = this._offsets.length\n for (let i = offsetLength; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n const queries = this._selector\n .split(',')\n .map((selector) => `${selector}[data-target=\"${target}\"],${selector}[href=\"${target}\"]`)\n\n const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)\n // Handle special case when .nav-link is inside .nav-item\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n [].slice.call(document.querySelectorAll(this._selector))\n .filter((node) => node.classList.contains(ClassName.ACTIVE))\n .forEach((node) => node.classList.remove(ClassName.ACTIVE))\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))\n const scrollSpysLength = scrollSpys.length\n\n for (let i = scrollSpysLength; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = ScrollSpy._jQueryInterface\n$.fn[NAME].Constructor = ScrollSpy\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n}\n\nexport default ScrollSpy\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","NAV_ITEMS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","ScrollSpy","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","slice","call","document","querySelectorAll","map","targetSelector","Util","getSelectorFromElement","querySelector","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","offsetLength","i","isActiveTarget","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","prev","children","trigger","relatedTarget","node","classList","contains","remove","_jQueryInterface","each","data","TypeError","scrollSpys","scrollSpysLength","$spy","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,WAA3B;EACA,IAAMC,OAAO,GAAc,OAA3B;EACA,IAAMC,QAAQ,GAAa,cAA3B;EACA,IAAMC,SAAS,SAAgBD,QAA/B;EACA,IAAME,YAAY,GAAS,WAA3B;EACA,IAAMC,kBAAkB,GAAGC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA3B;EAEA,IAAMQ,OAAO,GAAG;EACdC,EAAAA,MAAM,EAAG,EADK;EAEdC,EAAAA,MAAM,EAAG,MAFK;EAGdC,EAAAA,MAAM,EAAG;EAHK,CAAhB;EAMA,IAAMC,WAAW,GAAG;EAClBH,EAAAA,MAAM,EAAG,QADS;EAElBC,EAAAA,MAAM,EAAG,QAFS;EAGlBC,EAAAA,MAAM,EAAG;EAHS,CAApB;EAMA,IAAME,KAAK,GAAG;EACZC,EAAAA,QAAQ,eAAmBX,SADf;EAEZY,EAAAA,MAAM,aAAmBZ,SAFb;EAGZa,EAAAA,aAAa,WAAUb,SAAV,GAAsBC;EAHvB,CAAd;EAMA,IAAMa,SAAS,GAAG;EAChBC,EAAAA,aAAa,EAAG,eADA;EAEhBC,EAAAA,aAAa,EAAG,eAFA;EAG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C,CAACqH,UAAU,CAACxB,CAAD,CAAX,CAAd;;EACAlE,IAAAA,SAAS,CAACsF,gBAAV,CAA2B7D,IAA3B,CAAgCmE,IAAhC,EAAsCA,IAAI,CAACJ,IAAL,EAAtC;EACD;EACF,CARD;EAUA;;;;;;EAMAnH,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaiC,SAAS,CAACsF,gBAAvB;EACAjH,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW8H,WAAX,GAAyB7F,SAAzB;;EACA3B,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW+H,UAAX,GAAwB,YAAM;EAC5BzH,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAO4B,SAAS,CAACsF,gBAAjB;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"scrollspy.js","sources":["../src/scrollspy.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'scrollspy'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n offset : 10,\n method : 'auto',\n target : ''\n}\n\nconst DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n}\n\nconst Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n}\n\nconst Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n NAV_ITEMS : '.nav-item',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n}\n\nconst OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass ScrollSpy {\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +\n `${this._config.target} ${Selector.LIST_ITEMS},` +\n `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window\n ? OffsetMethod.OFFSET : OffsetMethod.POSITION\n\n const offsetMethod = this._config.method === 'auto'\n ? autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION\n ? this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = [].slice.call(document.querySelectorAll(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = document.querySelector(targetSelector)\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window\n ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window\n ? window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset +\n scrollHeight -\n this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n const offsetLength = this._offsets.length\n for (let i = offsetLength; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n const queries = this._selector\n .split(',')\n .map((selector) => `${selector}[data-target=\"${target}\"],${selector}[href=\"${target}\"]`)\n\n const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)\n // Handle special case when .nav-link is inside .nav-item\n $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n [].slice.call(document.querySelectorAll(this._selector))\n .filter((node) => node.classList.contains(ClassName.ACTIVE))\n .forEach((node) => node.classList.remove(ClassName.ACTIVE))\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))\n const scrollSpysLength = scrollSpys.length\n\n for (let i = scrollSpysLength; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = ScrollSpy._jQueryInterface\n$.fn[NAME].Constructor = ScrollSpy\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n}\n\nexport default ScrollSpy\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","NAV_ITEMS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","ScrollSpy","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","slice","call","document","querySelectorAll","map","targetSelector","Util","getSelectorFromElement","querySelector","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","offsetLength","i","isActiveTarget","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","prev","children","trigger","relatedTarget","node","classList","contains","remove","_jQueryInterface","each","data","TypeError","scrollSpys","scrollSpysLength","$spy","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,WAA3B;EACA,IAAMC,OAAO,GAAc,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index a5272e65de..a2b72b0134 100644 --- a/external/bootstrap4/js/dist/tab.js +++ b/external/bootstrap4/js/dist/tab.js @@ -1,5 +1,5 @@ /*! - * Bootstrap tab.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap tab.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Tab = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -35,7 +35,7 @@ */ var NAME = 'tab'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.tab'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -62,13 +62,12 @@ DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DROPDOWN_TOGGLE: '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Tab = /*#__PURE__*/ @@ -265,5 +264,5 @@ return Tab; -})); +}))); //# sourceMappingURL=tab.js.map diff --git a/external/bootstrap4/js/dist/tab.js.map b/external/bootstrap4/js/dist/tab.js.map index 21b64f45e8..d0a5cde515 100644 --- a/external/bootstrap4/js/dist/tab.js.map +++ b/external/bootstrap4/js/dist/tab.js.map @@ -1 +1 @@ -{"version":3,"file":"tab.js","sources":["../src/tab.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tab'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active',\n DISABLED : 'disabled',\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n DROPDOWN : '.dropdown',\n NAV_LIST_GROUP : '.nav, .list-group',\n ACTIVE : '.active',\n ACTIVE_UL : '> li > .active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE : '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tab {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(ClassName.ACTIVE) ||\n $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')\n ? $(container).find(Selector.ACTIVE_UL)\n : $(container).children(Selector.ACTIVE)\n\n const active = activeElements[0]\n const isTransitioning = callback && (active && $(active).hasClass(ClassName.FADE))\n const complete = () => this._transitionComplete(\n element,\n active,\n callback\n )\n\n if (active && isTransitioning) {\n const transitionDuration = Util.getTransitionDurationFromElement(active)\n\n $(active)\n .removeClass(ClassName.SHOW)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n const dropdownChild = $(active.parentNode).find(\n Selector.DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n $(element).addClass(ClassName.ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n Util.reflow(element)\n\n if (element.classList.contains(ClassName.FADE)) {\n element.classList.add(ClassName.SHOW)\n }\n\n if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]\n\n if (dropdownElement) {\n const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))\n\n $(dropdownToggleList).addClass(ClassName.ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Tab._jQueryInterface\n$.fn[NAME].Constructor = Tab\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n}\n\nexport default Tab\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","Tab","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","document","querySelector","_activate","complete","hiddenEvent","shownEvent","dispose","removeData","container","callback","activeElements","children","active","isTransitioning","_transitionComplete","transitionDuration","getTransitionDurationFromElement","removeClass","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","getAttribute","setAttribute","addClass","reflow","classList","contains","add","dropdownElement","dropdownToggleList","slice","call","querySelectorAll","_jQueryInterface","config","each","$this","data","TypeError","on","event","preventDefault","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,KAA3B;EACA,IAAMC,OAAO,GAAc,OAA3B;EACA,IAAMC,QAAQ,GAAa,QAA3B;EACA,IAAMC,SAAS,SAAgBD,QAA/B;EACA,IAAME,YAAY,GAAS,WAA3B;EACA,IAAMC,kBAAkB,GAAGC,CAAC,CAACC,EAAF,CAAKP,IAAL,CAA3B;EAEA,IAAMQ,KAAK,GAAG;EACZC,EAAAA,IAAI,WAAoBN,SADZ;EAEZO,EAAAA,MAAM,aAAoBP,SAFd;EAGZQ,EAAAA,IAAI,WAAoBR,SAHZ;EAIZS,EAAAA,KAAK,YAAoBT,SAJb;EAKZU,EAAAA,cAAc,YAAWV,SAAX,GAAuBC;EALzB,CAAd;EAQA,IAAMU,SAAS,GAAG;EAChBC,EAAAA,aAAa,EAAG,eADA;EAEhBC,EAAAA,MAAM,EAAU,QAFA;EAGhBC,EAAAA,QAAQ,EAAQ,UAHA;EAIhBC,EAAAA,IAAI,EAAY,MAJA;EAKhBP,EAAAA,IAAI,EAAY;EALA,CAAlB;EAQA,IAAMQ,QAAQ,GAAG;EACfC,EAAA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4BM,QAAQ,CAACI,WADrC,EACkD,UAAUsE,KAAV,EAAiB;EAC/DA,EAAAA,KAAK,CAACC,cAAN;;EACApE,EAAAA,GAAG,CAAC4D,gBAAJ,CAAqBF,IAArB,CAA0B9E,CAAC,CAAC,IAAD,CAA3B,EAAmC,MAAnC;EACD,CAJH;EAMA;;;;;;EAMAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAa0B,GAAG,CAAC4D,gBAAjB;EACAhF,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW+F,WAAX,GAAyBrE,GAAzB;;EACApB,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWgG,UAAX,GAAwB,YAAM;EAC5B1F,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOqB,GAAG,CAAC4D,gBAAX;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"tab.js","sources":["../src/tab.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tab'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active',\n DISABLED : 'disabled',\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n DROPDOWN : '.dropdown',\n NAV_LIST_GROUP : '.nav, .list-group',\n ACTIVE : '.active',\n ACTIVE_UL : '> li > .active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE : '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tab {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(ClassName.ACTIVE) ||\n $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')\n ? $(container).find(Selector.ACTIVE_UL)\n : $(container).children(Selector.ACTIVE)\n\n const active = activeElements[0]\n const isTransitioning = callback && (active && $(active).hasClass(ClassName.FADE))\n const complete = () => this._transitionComplete(\n element,\n active,\n callback\n )\n\n if (active && isTransitioning) {\n const transitionDuration = Util.getTransitionDurationFromElement(active)\n\n $(active)\n .removeClass(ClassName.SHOW)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n const dropdownChild = $(active.parentNode).find(\n Selector.DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n $(element).addClass(ClassName.ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n Util.reflow(element)\n\n if (element.classList.contains(ClassName.FADE)) {\n element.classList.add(ClassName.SHOW)\n }\n\n if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]\n\n if (dropdownElement) {\n const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))\n\n $(dropdownToggleList).addClass(ClassName.ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Tab._jQueryInterface\n$.fn[NAME].Constructor = Tab\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n}\n\nexport default Tab\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","Tab","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","document","querySelector","_activate","complete","hiddenEvent","shownEvent","dispose","removeData","container","callback","activeElements","children","active","isTransitioning","_transitionComplete","transitionDuration","getTransitionDurationFromElement","removeClass","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","getAttribute","setAttribute","addClass","reflow","classList","contains","add","dropdownElement","dropdownToggleList","slice","call","querySelectorAll","_jQueryInterface","config","each","$this","data","TypeError","on","event","preventDefault","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,KAA3B;EACA,IAAMC,OAAO,GAAc,OAA3B;EACA,IAAMC,QAAQ,GAAa,Q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A,UAAIoF,IAAI,GAAGD,KAAK,CAACC,IAAN,CAAWxF,QAAX,CAAX;;EAEA,UAAI,CAACwF,IAAL,EAAW;EACTA,QAAAA,IAAI,GAAG,IAAIhE,GAAJ,CAAQ,IAAR,CAAP;EACA+D,QAAAA,KAAK,CAACC,IAAN,CAAWxF,QAAX,EAAqBwF,IAArB;EACD;;EAED,UAAI,OAAOH,MAAP,KAAkB,QAAtB,EAAgC;EAC9B,YAAI,OAAOG,IAAI,CAACH,MAAD,CAAX,KAAwB,WAA5B,EAAyC;EACvC,gBAAM,IAAII,SAAJ,wBAAkCJ,MAAlC,QAAN;EACD;;EACDG,QAAAA,IAAI,CAACH,MAAD,CAAJ;EACD;EACF,KAfM,CAAP;EAgBD;;;;0BAzKoB;EACnB,aAAOtF,OAAP;EACD;;;;;EA0KH;;;;;;;EAMAK,CAAC,CAAC8C,QAAD,CAAD,CACGwC,EADH,CACMpF,KAAK,CAACK,cADZ,EAC4BM,QAAQ,CAACI,WADrC,EACkD,UAAUsE,KAAV,EAAiB;EAC/DA,EAAAA,KAAK,CAACC,cAAN;;EACApE,EAAAA,GAAG,CAAC4D,gBAAJ,CAAqBF,IAArB,CAA0B9E,CAAC,CAAC,IAAD,CAA3B,EAAmC,MAAnC;EACD,CAJH;EAMA;;;;;;EAMAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAa0B,GAAG,CAAC4D,gBAAjB;EACAhF,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAW+F,WAAX,GAAyBrE,GAAzB;;EACApB,CAAC,CAACC,EAAF,CAAKP,IAAL,EAAWgG,UAAX,GAAwB,YAAM;EAC5B1F,EAAAA,CAAC,CAACC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;EACA,SAAOqB,GAAG,CAAC4D,gBAAX;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/toast.js b/external/bootstrap4/js/dist/toast.js index b1be5fc377..9283b2effc 100644 --- a/external/bootstrap4/js/dist/toast.js +++ b/external/bootstrap4/js/dist/toast.js @@ -1,5 +1,5 @@ /*! - * Bootstrap toast.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap toast.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : (global = global || self, global.Toast = factory(global.jQuery, global.Util)); -}(this, function ($, Util) { 'use strict'; +}(this, (function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -43,20 +43,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -69,7 +84,7 @@ */ var NAME = 'toast'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.toast'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -98,13 +113,12 @@ }; var Selector = { DATA_DISMISS: '[data-dismiss="toast"]' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Toast = /*#__PURE__*/ @@ -124,7 +138,12 @@ _proto.show = function show() { var _this = this; - $(this._element).trigger(Event.SHOW); + var showEvent = $.Event(Event.SHOW); + $(this._element).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; + } if (this._config.animation) { this._element.classList.add(ClassName.FADE); @@ -138,12 +157,16 @@ $(_this._element).trigger(Event.SHOWN); if (_this._config.autohide) { - _this.hide(); + _this._timeout = setTimeout(function () { + _this.hide(); + }, _this._config.delay); } }; this._element.classList.remove(ClassName.HIDE); + Util.reflow(this._element); + this._element.classList.add(ClassName.SHOWING); if (this._config.animation) { @@ -154,22 +177,19 @@ } }; - _proto.hide = function hide(withoutTimeout) { - var _this2 = this; - + _proto.hide = function hide() { if (!this._element.classList.contains(ClassName.SHOW)) { return; } - $(this._element).trigger(Event.HIDE); + var hideEvent = $.Event(Event.HIDE); + $(this._element).trigger(hideEvent); - if (withoutTimeout) { - this._close(); - } else { - this._timeout = setTimeout(function () { - _this2._close(); - }, this._config.delay); + if (hideEvent.isDefaultPrevented()) { + return; } + + this._close(); }; _proto.dispose = function dispose() { @@ -188,26 +208,26 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, Default, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {}); Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); return config; }; _proto._setListeners = function _setListeners() { - var _this3 = this; + var _this2 = this; $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () { - return _this3.hide(true); + return _this2.hide(); }); }; _proto._close = function _close() { - var _this4 = this; + var _this3 = this; var complete = function complete() { - _this4._element.classList.add(ClassName.HIDE); + _this3._element.classList.add(ClassName.HIDE); - $(_this4._element).trigger(Event.HIDDEN); + $(_this3._element).trigger(Event.HIDDEN); }; this._element.classList.remove(ClassName.SHOW); @@ -279,5 +299,5 @@ return Toast; -})); +}))); //# sourceMappingURL=toast.js.map diff --git a/external/bootstrap4/js/dist/toast.js.map b/external/bootstrap4/js/dist/toast.js.map index 512e5c0d8c..90c6f2d694 100644 --- a/external/bootstrap4/js/dist/toast.js.map +++ b/external/bootstrap4/js/dist/toast.js.map @@ -1 +1 @@ -{"version":3,"file":"toast.js","sources":["../src/toast.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'toast'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.toast'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Event = {\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`\n}\n\nconst ClassName = {\n FADE : 'fade',\n HIDE : 'hide',\n SHOW : 'show',\n SHOWING : 'showing'\n}\n\nconst DefaultType = {\n animation : 'boolean',\n autohide : 'boolean',\n delay : 'number'\n}\n\nconst Default = {\n animation : true,\n autohide : true,\n delay : 500\n}\n\nconst Selector = {\n DATA_DISMISS : '[data-dismiss=\"toast\"]'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Toast {\n constructor(element, config) {\n this._element = element\n this._config = this._getConfig(config)\n this._timeout = null\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n show() {\n $(this._element).trigger(Event.SHOW)\n\n if (this._config.animation) {\n this._element.classList.add(ClassName.FADE)\n }\n\n const complete = () => {\n this._element.classList.remove(ClassName.SHOWING)\n this._element.classList.add(ClassName.SHOW)\n\n $(this._element).trigger(Event.SHOWN)\n\n if (this._config.autohide) {\n this.hide()\n }\n }\n\n this._element.classList.remove(ClassName.HIDE)\n this._element.classList.add(ClassName.SHOWING)\n if (this._config.animation) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n hide(withoutTimeout) {\n if (!this._element.classList.contains(ClassName.SHOW)) {\n return\n }\n\n $(this._element).trigger(Event.HIDE)\n\n if (withoutTimeout) {\n this._close()\n } else {\n this._timeout = setTimeout(() => {\n this._close()\n }, this._config.delay)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n this._timeout = null\n\n if (this._element.classList.contains(ClassName.SHOW)) {\n this._element.classList.remove(ClassName.SHOW)\n }\n\n $(this._element).off(Event.CLICK_DISMISS)\n\n $.removeData(this._element, DATA_KEY)\n this._element = null\n this._config = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...$(this._element).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _setListeners() {\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n () => this.hide(true)\n )\n }\n\n _close() {\n const complete = () => {\n this._element.classList.add(ClassName.HIDE)\n $(this._element).trigger(Event.HIDDEN)\n }\n\n this._element.classList.remove(ClassName.SHOW)\n if (this._config.animation) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new Toast(this, _config)\n $element.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Toast._jQueryInterface\n$.fn[NAME].Constructor = Toast\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Toast._jQueryInterface\n}\n\nexport default Toast\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","Event","CLICK_DISMISS","HIDE","HIDDEN","SHOW","SHOWN","ClassName","FADE","SHOWING","DefaultType","animation","autohide","delay","Default","Selector","DATA_DISMISS","Toast","element","config","_element","_config","_getConfig","_timeout","_setListeners","show","trigger","classList","add","complete","remove","hide","transitionDuration","Util","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","withoutTimeout","contains","_close","setTimeout","dispose","clearTimeout","off","removeData","data","typeCheckConfig","constructor","on","_jQueryInterface","each","$element","TypeError","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;;;;;;EAMA,IAAMA,IAAI,GAAiB,OAA3B;EACA,IAAMC,OAAO,GAAc,OAA3B;EACA,IAAMC,QAAQ,GAAa,UAA3B;EACA,IAAMC,SAAS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kClC,MAAlC,QAAN;EACD;;EAED2B,QAAAA,IAAI,CAAC3B,MAAD,CAAJ,CAAa,IAAb;EACD;EACF,KAjBM,CAAP;EAkBD;;;;0BA7IoB;EACnB,aAAOxB,OAAP;EACD;;;0BAEwB;EACvB,aAAOe,WAAP;EACD;;;0BAEoB;EACnB,aAAOI,OAAP;EACD;;;;;EAsIH;;;;;;;EAMAf,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAyBuB,KAAK,CAACiC,gBAA/B;EACAnD,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW4D,WAAX,GAAyBrC,KAAzB;;EACAlB,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW6D,UAAX,GAAyB,YAAM;EAC7BxD,EAAAA,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAOmB,KAAK,CAACiC,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"toast.js","sources":["../src/toast.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): toast.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'toast'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.toast'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Event = {\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`\n}\n\nconst ClassName = {\n FADE : 'fade',\n HIDE : 'hide',\n SHOW : 'show',\n SHOWING : 'showing'\n}\n\nconst DefaultType = {\n animation : 'boolean',\n autohide : 'boolean',\n delay : 'number'\n}\n\nconst Default = {\n animation : true,\n autohide : true,\n delay : 500\n}\n\nconst Selector = {\n DATA_DISMISS : '[data-dismiss=\"toast\"]'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Toast {\n constructor(element, config) {\n this._element = element\n this._config = this._getConfig(config)\n this._timeout = null\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n show() {\n const showEvent = $.Event(Event.SHOW)\n\n $(this._element).trigger(showEvent)\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n if (this._config.animation) {\n this._element.classList.add(ClassName.FADE)\n }\n\n const complete = () => {\n this._element.classList.remove(ClassName.SHOWING)\n this._element.classList.add(ClassName.SHOW)\n\n $(this._element).trigger(Event.SHOWN)\n\n if (this._config.autohide) {\n this._timeout = setTimeout(() => {\n this.hide()\n }, this._config.delay)\n }\n }\n\n this._element.classList.remove(ClassName.HIDE)\n Util.reflow(this._element)\n this._element.classList.add(ClassName.SHOWING)\n if (this._config.animation) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n hide() {\n if (!this._element.classList.contains(ClassName.SHOW)) {\n return\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._close()\n }\n\n dispose() {\n clearTimeout(this._timeout)\n this._timeout = null\n\n if (this._element.classList.contains(ClassName.SHOW)) {\n this._element.classList.remove(ClassName.SHOW)\n }\n\n $(this._element).off(Event.CLICK_DISMISS)\n\n $.removeData(this._element, DATA_KEY)\n this._element = null\n this._config = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...$(this._element).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _setListeners() {\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n () => this.hide()\n )\n }\n\n _close() {\n const complete = () => {\n this._element.classList.add(ClassName.HIDE)\n $(this._element).trigger(Event.HIDDEN)\n }\n\n this._element.classList.remove(ClassName.SHOW)\n if (this._config.animation) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new Toast(this, _config)\n $element.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Toast._jQueryInterface\n$.fn[NAME].Constructor = Toast\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Toast._jQueryInterface\n}\n\nexport default Toast\n"],"names":["NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","Event","CLICK_DISMISS","HIDE","HIDDEN","SHOW","SHOWN","ClassName","FADE","SHOWING","DefaultType","animation","autohide","delay","Default","Selector","DATA_DISMISS","Toast","element","config","_element","_config","_getConfig","_timeout","_setListeners","show","showEvent","trigger","isDefaultPrevented","classList","add","complete","remove","setTimeout","hide","Util","reflow","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","contains","hideEvent","_close","dispose","clearTimeout","off","removeData","data","typeCheckConfig","constructor","on","_jQueryInterface","each","$element","TypeError","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AASM,QAAQ,CAACN,IAAT,CAAcrD,QAAd,CAAjB;;EACA,UAAMyB,OAAO,GAAI,OAAOF,MAAP,KAAkB,QAAlB,IAA8BA,MAA/C;;EAEA,UAAI,CAAC8B,IAAL,EAAW;EACTA,QAAAA,IAAI,GAAG,IAAIhC,KAAJ,CAAU,IAAV,EAAgBI,OAAhB,CAAP;EACAkC,QAAAA,QAAQ,CAACN,IAAT,CAAcrD,QAAd,EAAwBqD,IAAxB;EACD;;EAED,UAAI,OAAO9B,MAAP,KAAkB,QAAtB,EAAgC;EAC9B,YAAI,OAAO8B,IAAI,CAAC9B,MAAD,CAAX,KAAwB,WAA5B,EAAyC;EACvC,gBAAM,IAAIqC,SAAJ,wBAAkCrC,MAAlC,QAAN;EACD;;EAED8B,QAAAA,IAAI,CAAC9B,MAAD,CAAJ,CAAa,IAAb;EACD;EACF,KAjBM,CAAP;EAkBD;;;;0BApJoB;EACnB,aAAOxB,OAAP;EACD;;;0BAEwB;EACvB,aAAOe,WAAP;EACD;;;0BAEoB;EACnB,aAAOI,OAAP;EACD;;;;;EA6IH;;;;;;;EAMAf,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAyBuB,KAAK,CAACoC,gBAA/B;EACAtD,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW+D,WAAX,GAAyBxC,KAAzB;;EACAlB,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAWgE,UAAX,GAAyB,YAAM;EAC7B3D,EAAAA,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAOmB,KAAK,CAACoC,gBAAb;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/tooltip.js b/external/bootstrap4/js/dist/tooltip.js index 2351fe6e07..5608e9531d 100644 --- a/external/bootstrap4/js/dist/tooltip.js +++ b/external/bootstrap4/js/dist/tooltip.js @@ -1,5 +1,5 @@ /*! - * Bootstrap tooltip.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap tooltip.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) : (global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util)); -}(this, function ($, Popper, Util) { 'use strict'; +}(this, (function ($, Popper, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; @@ -44,20 +44,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -65,7 +80,7 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.3.1): tools/sanitizer.js + * Bootstrap (v4.4.1): tools/sanitizer.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -103,13 +118,13 @@ strong: [], u: [], ul: [] - /** - * A pattern that recognizes a commonly useful subset of URLs that are safe. - * - * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts - */ - }; + /** + * A pattern that recognizes a commonly useful subset of URLs that are safe. + * + * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts + */ + var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; /** * A pattern that matches safe data URLs. Only matches image, video and audio types. @@ -176,7 +191,7 @@ }; for (var i = 0, len = elements.length; i < len; i++) { - var _ret = _loop(i, len); + var _ret = _loop(i); if (_ret === "continue") continue; } @@ -191,7 +206,7 @@ */ var NAME = 'tooltip'; - var VERSION = '4.3.1'; + var VERSION = '4.4.1'; var DATA_KEY = 'bs.tooltip'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -213,7 +228,8 @@ boundary: '(string|element)', sanitize: 'boolean', sanitizeFn: '(null|function)', - whiteList: 'object' + whiteList: 'object', + popperConfig: '(null|object)' }; var AttachmentMap = { AUTO: 'auto', @@ -237,7 +253,8 @@ boundary: 'scrollParent', sanitize: true, sanitizeFn: null, - whiteList: DefaultWhitelist + whiteList: DefaultWhitelist, + popperConfig: null }; var HoverState = { SHOW: 'show', @@ -269,22 +286,17 @@ FOCUS: 'focus', CLICK: 'click', MANUAL: 'manual' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ - }; + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ var Tooltip = /*#__PURE__*/ function () { function Tooltip(element, config) { - /** - * Check for Popper dependency - * Popper - https://popper.js.org - */ if (typeof Popper === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); } // private @@ -355,7 +367,7 @@ clearTimeout(this._timeout); $.removeData(this.element, this.constructor.DATA_KEY); $(this.element).off(this.constructor.EVENT_KEY); - $(this.element).closest('.modal').off('hide.bs.modal'); + $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); if (this.tip) { $(this.tip).remove(); @@ -366,7 +378,7 @@ this._hoverState = null; this._activeTrigger = null; - if (this._popper !== null) { + if (this._popper) { this._popper.destroy(); } @@ -419,29 +431,7 @@ } $(this.element).trigger(this.constructor.Event.INSERTED); - this._popper = new Popper(this.element, tip, { - placement: attachment, - modifiers: { - offset: this._getOffset(), - flip: { - behavior: this.config.fallbackPlacement - }, - arrow: { - element: Selector.ARROW - }, - preventOverflow: { - boundariesElement: this.config.boundary - } - }, - onCreate: function onCreate(data) { - if (data.originalPlacement !== data.placement) { - _this._handlePopperPlacementChange(data); - } - }, - onUpdate: function onUpdate(data) { - return _this._handlePopperPlacementChange(data); - } - }); + this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment)); $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS @@ -589,14 +579,43 @@ } // Private ; - _proto._getOffset = function _getOffset() { + _proto._getPopperConfig = function _getPopperConfig(attachment) { var _this3 = this; + var defaultBsConfig = { + placement: attachment, + modifiers: { + offset: this._getOffset(), + flip: { + behavior: this.config.fallbackPlacement + }, + arrow: { + element: Selector.ARROW + }, + preventOverflow: { + boundariesElement: this.config.boundary + } + }, + onCreate: function onCreate(data) { + if (data.originalPlacement !== data.placement) { + _this3._handlePopperPlacementChange(data); + } + }, + onUpdate: function onUpdate(data) { + return _this3._handlePopperPlacementChange(data); + } + }; + return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig); + }; + + _proto._getOffset = function _getOffset() { + var _this4 = this; + var offset = {}; if (typeof this.config.offset === 'function') { offset.fn = function (data) { - data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); + data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {}); return data; }; } else { @@ -623,32 +642,35 @@ }; _proto._setListeners = function _setListeners() { - var _this4 = this; + var _this5 = this; var triggers = this.config.trigger.split(' '); triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { - return _this4.toggle(event); + $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { + return _this5.toggle(event); }); } else if (trigger !== Trigger.MANUAL) { - var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; - var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; - $(_this4.element).on(eventIn, _this4.config.selector, function (event) { - return _this4._enter(event); - }).on(eventOut, _this4.config.selector, function (event) { - return _this4._leave(event); + var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; + var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; + $(_this5.element).on(eventIn, _this5.config.selector, function (event) { + return _this5._enter(event); + }).on(eventOut, _this5.config.selector, function (event) { + return _this5._leave(event); }); } }); - $(this.element).closest('.modal').on('hide.bs.modal', function () { - if (_this4.element) { - _this4.hide(); + + this._hideModalHandler = function () { + if (_this5.element) { + _this5.hide(); } - }); + }; + + $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); if (this.config.selector) { - this.config = _objectSpread({}, this.config, { + this.config = _objectSpread2({}, this.config, { trigger: 'manual', selector: '' }); @@ -748,7 +770,7 @@ delete dataAttributes[dataAttr]; } }); - config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {}); if (typeof config.delay === 'number') { config.delay = { @@ -903,5 +925,5 @@ return Tooltip; -})); +}))); //# sourceMappingURL=tooltip.js.map diff --git a/external/bootstrap4/js/dist/tooltip.js.map b/external/bootstrap4/js/dist/tooltip.js.map index 848a58cf00..9ba528e166 100644 --- a/external/bootstrap4/js/dist/tooltip.js.map +++ b/external/bootstrap4/js/dist/tooltip.js.map @@ -1 +1 @@ -{"version":3,"file":"tooltip.js","sources":["../src/tools/sanitizer.js","../src/tooltip.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst uriAttrs = [\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n]\n\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi\n\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i\n\nfunction allowedAttribute(attr, allowedAttributeList) {\n const attrName = attr.nodeName.toLowerCase()\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))\n }\n\n return true\n }\n\n const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)\n\n // Check if a regular expression validates the attribute.\n for (let i = 0, l = regExp.length; i < l; i++) {\n if (attrName.match(regExp[i])) {\n return true\n }\n }\n\n return false\n}\n\nexport function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const whitelistKeys = Object.keys(whiteList)\n const elements = [].slice.call(createdDocument.body.querySelectorAll('*'))\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const el = elements[i]\n const elName = el.nodeName.toLowerCase()\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el)\n\n continue\n }\n\n const attributeList = [].slice.call(el.attributes)\n const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])\n\n attributeList.forEach((attr) => {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName)\n }\n })\n }\n\n return createdDocument.body.innerHTML\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n DefaultWhitelist,\n sanitizeHtml\n} from './tools/sanitizer'\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tooltip'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.tooltip'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-tooltip'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\nconst DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']\n\nconst DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : '(number|string|function)',\n container : '(string|element|boolean)',\n fallbackPlacement : '(string|array)',\n boundary : '(string|element)',\n sanitize : 'boolean',\n sanitizeFn : '(null|function)',\n whiteList : 'object'\n}\n\nconst AttachmentMap = {\n AUTO : 'auto',\n TOP : 'top',\n RIGHT : 'right',\n BOTTOM : 'bottom',\n LEFT : 'left'\n}\n\nconst Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<div class=\"tooltip-inner\"></div></div>',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : 0,\n container : false,\n fallbackPlacement : 'flip',\n boundary : 'scrollParent',\n sanitize : true,\n sanitizeFn : null,\n whiteList : DefaultWhitelist\n}\n\nconst HoverState = {\n SHOW : 'show',\n OUT : 'out'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner',\n ARROW : '.arrow'\n}\n\nconst Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n}\n\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tooltip {\n constructor(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)')\n }\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // Protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return\n }\n\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n this._popper = null\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const shadowRoot = Util.findShadowRoot(this.element)\n const isInTheDom = $.contains(\n shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function'\n ? this.config.placement.call(this, tip, this.element)\n : this.config.placement\n\n const attachment = this._getAttachment(placement)\n this.addAttachmentClass(attachment)\n\n const container = this._getContainer()\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: (data) => {\n if (data.originalPlacement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n },\n onUpdate: (data) => this._handlePopperPlacementChange(data)\n })\n\n $(tip).addClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n if (this.config.animation) {\n this._fixTransition()\n }\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(this.tip)\n\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(tip)\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const tip = this.getTipElement()\n this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())\n $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n setElementContent($element, content) {\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n\n return\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn)\n }\n\n $element.html(content)\n } else {\n $element.text(content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function'\n ? this.config.title.call(this.element)\n : this.config.title\n }\n\n return title\n }\n\n // Private\n\n _getOffset() {\n const offset = {}\n\n if (typeof this.config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this.config.offset(data.offsets, this.element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this.config.offset\n }\n\n return offset\n }\n\n _getContainer() {\n if (this.config.container === false) {\n return document.body\n }\n\n if (Util.isElement(this.config.container)) {\n return $(this.config.container)\n }\n\n return $(document).find(this.config.container)\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSEENTER\n : this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSELEAVE\n : this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n })\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => {\n if (this.element) {\n this.hide()\n }\n }\n )\n\n if (this.config.selector) {\n this.config = {\n ...this.config,\n trigger: 'manual',\n selector: ''\n }\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n const dataAttributes = $(this.element).data()\n\n Object.keys(dataAttributes)\n .forEach((dataAttr) => {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr]\n }\n })\n\n config = {\n ...this.constructor.Default,\n ...dataAttributes,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _handlePopperPlacementChange(popperData) {\n const popperInstance = popperData.instance\n this.tip = popperInstance.popper\n this._cleanTipClass()\n this.addAttachmentClass(this._getAttachment(popperData.placement))\n }\n\n _fixTransition() {\n const tip = this.getTipElement()\n const initConfigAnimation = this.config.animation\n\n if (tip.getAttribute('x-placement') !== null) {\n return\n }\n\n $(tip).removeClass(ClassName.FADE)\n this.config.animation = false\n this.hide()\n this.show()\n this.config.animation = initConfigAnimation\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Tooltip._jQueryInterface\n$.fn[NAME].Constructor = Tooltip\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n}\n\nexport default Tooltip\n"],"names":["uriAttrs","ARIA_ATTRIBUTE_PATTERN","DefaultWhitelist","a","area","b","br","col","code","div","em","hr","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","s","small","span","sub","sup","strong","u","ul","SAFE_URL_PATTERN","DATA_URL_PATTERN","allowedAttribute","attr","allowedAttributeList","attrName","nodeName","toLowerCase","indexOf","Boolean","nodeValue","match","regExp","filter","attrRegex","RegExp","l","length","sanitizeHtml","unsafeHtml","whiteList","sanitizeFn","domParser","window","DOMParser","createdDocument","parseFromString","whitelistKeys","Object","keys","elements","slice","call","body","querySelectorAll","len","el","elName","parentNode","removeChild","attributeList","attributes","whitelistedAttributes","concat","forEach","removeAttribute","innerHTML","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","DISALLOWED_ATTRIBUTES","DefaultType","animation","template","title","trigger","delay","html","selector","placement","offset","container","fallbackPlacement","boundary","sanitize","AttachmentMap","AUTO","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","ARROW","Trigger","HOVER","FOCUS","MANUAL","Tooltip","element","config","Popper","TypeError","_isEnabled","_timeout","_hoverState","_activeTrigger","_popper","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","removeData","off","closest","remove","destroy","show","css","Error","showEvent","isWithContent","shadowRoot","Util","findShadowRoot","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","getUID","setAttribute","setContent","addClass","attachment","_getAttachment","addAttachmentClass","_getContainer","appendTo","modifiers","_getOffset","flip","behavior","arrow","preventOverflow","boundariesElement","onCreate","originalPlacement","_handlePopperPlacementChange","onUpdate","document","children","on","noop","complete","_fixTransition","prevHoverState","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","hide","callback","hideEvent","_cleanTipClass","removeClass","update","scheduleUpdate","getTitle","setElementContent","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","offsets","isElement","find","toUpperCase","triggers","split","eventIn","eventOut","_fixTitle","titleType","type","setTimeout","dataAttributes","dataAttr","toString","typeCheckConfig","key","$tip","tabClass","join","popperData","popperInstance","instance","popper","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CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAOkD,OAAO,CAAC+H,gBAAf;EACD,CAHD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"tooltip.js","sources":["../src/tools/sanitizer.js","../src/tooltip.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst uriAttrs = [\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n]\n\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi\n\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i\n\nfunction allowedAttribute(attr, allowedAttributeList) {\n const attrName = attr.nodeName.toLowerCase()\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))\n }\n\n return true\n }\n\n const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)\n\n // Check if a regular expression validates the attribute.\n for (let i = 0, l = regExp.length; i < l; i++) {\n if (attrName.match(regExp[i])) {\n return true\n }\n }\n\n return false\n}\n\nexport function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const whitelistKeys = Object.keys(whiteList)\n const elements = [].slice.call(createdDocument.body.querySelectorAll('*'))\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const el = elements[i]\n const elName = el.nodeName.toLowerCase()\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el)\n\n continue\n }\n\n const attributeList = [].slice.call(el.attributes)\n const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])\n\n attributeList.forEach((attr) => {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName)\n }\n })\n }\n\n return createdDocument.body.innerHTML\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n DefaultWhitelist,\n sanitizeHtml\n} from './tools/sanitizer'\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tooltip'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.tooltip'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-tooltip'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\nconst DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']\n\nconst DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : '(number|string|function)',\n container : '(string|element|boolean)',\n fallbackPlacement : '(string|array)',\n boundary : '(string|element)',\n sanitize : 'boolean',\n sanitizeFn : '(null|function)',\n whiteList : 'object',\n popperConfig : '(null|object)'\n}\n\nconst AttachmentMap = {\n AUTO : 'auto',\n TOP : 'top',\n RIGHT : 'right',\n BOTTOM : 'bottom',\n LEFT : 'left'\n}\n\nconst Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">' +\n '<div class=\"arrow\"></div>' +\n '<div class=\"tooltip-inner\"></div></div>',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : 0,\n container : false,\n fallbackPlacement : 'flip',\n boundary : 'scrollParent',\n sanitize : true,\n sanitizeFn : null,\n whiteList : DefaultWhitelist,\n popperConfig : null\n}\n\nconst HoverState = {\n SHOW : 'show',\n OUT : 'out'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner',\n ARROW : '.arrow'\n}\n\nconst Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n}\n\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tooltip {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)')\n }\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // Protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return\n }\n\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler)\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n if (this._popper) {\n this._popper.destroy()\n }\n\n this._popper = null\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const shadowRoot = Util.findShadowRoot(this.element)\n const isInTheDom = $.contains(\n shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function'\n ? this.config.placement.call(this, tip, this.element)\n : this.config.placement\n\n const attachment = this._getAttachment(placement)\n this.addAttachmentClass(attachment)\n\n const container = this._getContainer()\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment))\n\n $(tip).addClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n if (this.config.animation) {\n this._fixTransition()\n }\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(this.tip)\n\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(tip)\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const tip = this.getTipElement()\n this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())\n $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n setElementContent($element, content) {\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n\n return\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn)\n }\n\n $element.html(content)\n } else {\n $element.text(content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function'\n ? this.config.title.call(this.element)\n : this.config.title\n }\n\n return title\n }\n\n // Private\n\n _getPopperConfig(attachment) {\n const defaultBsConfig = {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: (data) => {\n if (data.originalPlacement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n },\n onUpdate: (data) => this._handlePopperPlacementChange(data)\n }\n\n return {\n ...defaultBsConfig,\n ...this.config.popperConfig\n }\n }\n\n _getOffset() {\n const offset = {}\n\n if (typeof this.config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this.config.offset(data.offsets, this.element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this.config.offset\n }\n\n return offset\n }\n\n _getContainer() {\n if (this.config.container === false) {\n return document.body\n }\n\n if (Util.isElement(this.config.container)) {\n return $(this.config.container)\n }\n\n return $(document).find(this.config.container)\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSEENTER\n : this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSELEAVE\n : this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n })\n\n this._hideModalHandler = () => {\n if (this.element) {\n this.hide()\n }\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n this._hideModalHandler\n )\n\n if (this.config.selector) {\n this.config = {\n ...this.config,\n trigger: 'manual',\n selector: ''\n }\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n const dataAttributes = $(this.element).data()\n\n Object.keys(dataAttributes)\n .forEach((dataAttr) => {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr]\n }\n })\n\n config = {\n ...this.constructor.Default,\n ...dataAttributes,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _handlePopperPlacementChange(popperData) {\n const popperInstance = popperData.instance\n this.tip = popperInstance.popper\n this._cleanTipClass()\n this.addAttachmentClass(this._getAttachment(popperData.placement))\n }\n\n _fixTransition() {\n const tip = this.getTipElement()\n const initConfigAnimation = this.config.animation\n\n if (tip.getAttribute('x-placement') !== null) {\n return\n }\n\n $(tip).removeClass(ClassName.FADE)\n this.config.animation = false\n this.hide()\n this.show()\n this.config.animation = initConfigAnimation\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Tooltip._jQueryInterface\n$.fn[NAME].Constructor = Tooltip\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n}\n\nexport default Tooltip\n"],"names":["uriAttrs","ARIA_ATTRIBUTE_PATTERN","DefaultWhitelist","a","area","b","br","col","code","div","em","hr","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","s","small","span","sub","sup","strong","u","ul","SAFE_URL_PATTERN","DATA_URL_PATTERN","allowedAttribute","attr","allowedAttributeList","attrName","nodeName","toLowerCase","indexOf","Boolean","nodeValue","match","regExp","filter","attrRegex","RegExp","l","length","sanitizeHtml","unsafeHtml","whiteList","sanitizeFn","domParser","window","DOMParser","createdDocument","parseFromString","whitelistKeys","Object","keys","elements","slice","call","body","querySelectorAll","len","el","elName","parentNode","removeChild","attributeList","attributes","whitelistedAttributes","concat","forEach","removeAttribute","innerHTML","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","$","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","DISALLOWED_ATTRIBUTES","DefaultType","animation","template","title","trigger","delay","html","selector","placement","offset","container","fallbackPlacement","boundary","sanitize","popperConfig","AttachmentMap","AUTO","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","ARROW","Trigger","HOVER","FOCUS","MANUAL","Tooltip","element","config","Popper","TypeError","_isEnabled","_timeout","_hoverState","_activeTrigger","_popper","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","removeData","off","closest","_hideModalHandler","remove","destroy","show","css","Error","showEvent","isWithContent","shadowRoot","Util","findShadowRoot","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","getUID","setAttribute","setContent","addClass","attachment","_getAttachment","addAttachmentClass","_getContainer","appendTo","_getPopperConfig","document","children","on","noop","complete","_fixTransition","prevHoverState","transitionDuration","getTransitionDurationFromElement","one","TRANSITION_END","emulateTransitionEnd","hide","callback","hideEvent","_cleanTipClass","removeClass","update","scheduleUpdate","getTitle","setElementContent","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","defaultBsConfig","modifiers","_getOffset","flip","behavior","arrow","preventOverflow","boundariesElement","onCreate","originalPlacement","_handlePopperPlacementChange","onUpdate","offsets","isElement","find","toUpperCase","triggers","split","eventIn","eventOut","_fixTitle","titleType","type","setTimeout","dataAttributes","dataAttr","toString","typeCheckConfig","key","$tip","tabClass","join","popperData","popperInstance","instance","popper","initConfigAnimation","_jQueryInterface","each","_config","test","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,WAAP;EACD;;;;;EAkmBH;;;;;;;EAMAL,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAauD,OAAO,CAACkI,gBAArB;EACApL,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW6L,WAAX,GAAyBtI,OAAzB;;EACAlD,CAAC,CAACC,EAAF,CAAKN,IAAL,EAAW8L,UAAX,GAAwB,YAAM;EAC5BzL,EAAAA,CAAC,CAACC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;EACA,SAAOmD,OAAO,CAACkI,gBAAf;EACD,CAHD;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/js/dist/util.js b/external/bootstrap4/js/dist/util.js index 0e9b3d0a72..54bd0fe685 100644 --- a/external/bootstrap4/js/dist/util.js +++ b/external/bootstrap4/js/dist/util.js @@ -1,5 +1,5 @@ /*! - * Bootstrap util.js v4.3.1 (https://getbootstrap.com/) + * Bootstrap util.js v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -7,13 +7,13 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = global || self, global.Util = factory(global.jQuery)); -}(this, function ($) { 'use strict'; +}(this, (function ($) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; /** * -------------------------------------------------------------------------- - * Bootstrap (v4.3.1): util.js + * Bootstrap (v4.4.1): util.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -162,11 +162,28 @@ } return Util.findShadowRoot(element.parentNode); + }, + jQueryDetection: function jQueryDetection() { + if (typeof $ === 'undefined') { + throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); + } + + var version = $.fn.jquery.split(' ')[0].split('.'); + var minMajor = 1; + var ltMajor = 2; + var minMinor = 9; + var minPatch = 1; + var maxMajor = 4; + + if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); + } } }; + Util.jQueryDetection(); setTransitionEndSupport(); return Util; -})); +}))); //# sourceMappingURL=util.js.map diff --git a/external/bootstrap4/js/dist/util.js.map b/external/bootstrap4/js/dist/util.js.map index 8463ab6154..b2331f9d41 100644 --- a/external/bootstrap4/js/dist/util.js.map +++ b/external/bootstrap4/js/dist/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sources":["../src/util.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\nconst TRANSITION_END = 'transitionend'\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nfunction toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nfunction getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n}\n\nfunction transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return Util.findShadowRoot(element.parentNode)\n }\n}\n\nsetTransitionEndSupport()\n\nexport default Util\n"],"names":["TRANSITION_END","MAX_UID","MILLISECONDS_MULTIPLIER","toType","obj","toString","call","match","toLowerCase","getSpecialTransitionEndEvent","bindType","delegateType","handle","event","$","target","is","handleObj","handler","apply","arguments","undefined","transitionEndEmulator","duration","called","one","Util","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","special","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","root","ShadowRoot","parentNode"],"mappings":";;;;;;;;;;;;;EAAA;;;;;;AAOA,EAEA;;;;;;EAMA,IAAMA,cAAc,GAAG,eAAvB;EACA,IAAMC,OAAO,GAAG,OAAhB;EACA,IAAMC,uBAAuB,GAAG,IAAhC;;EAGA,SAASC,MAAT,CAAgBC,GAAhB,EAAqB;EACnB,SAAO,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,aAA5B,EAA2C,CAA3C,EAA8CC,WAA9C,EAAP;EACD;;EAED,SAASC,4BAAT,GAAw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FU;EAsFXO,EAAAA,cAtFW,0BAsFIrC,OAtFJ,EAsFa;EACtB,QAAI,CAACH,QAAQ,CAACyC,eAAT,CAAyBC,YAA9B,EAA4C;EAC1C,aAAO,IAAP;EACD,KAHqB;;;EAMtB,QAAI,OAAOvC,OAAO,CAACwC,WAAf,KAA+B,UAAnC,EAA+C;EAC7C,UAAMC,IAAI,GAAGzC,OAAO,CAACwC,WAAR,EAAb;EACA,aAAOC,IAAI,YAAYC,UAAhB,GAA6BD,IAA7B,GAAoC,IAA3C;EACD;;EAED,QAAIzC,OAAO,YAAY0C,UAAvB,EAAmC;EACjC,aAAO1C,OAAP;EACD,KAbqB;;;EAgBtB,QAAI,CAACA,OAAO,CAAC2C,UAAb,EAAyB;EACvB,aAAO,IAAP;EACD;;EAED,WAAOzD,IAAI,CAACmD,cAAL,CAAoBrC,OAAO,CAAC2C,UAA5B,CAAP;EACD;EA3GU,CAAb;EA8GAtD,uBAAuB;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"util.js","sources":["../src/util.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\nconst TRANSITION_END = 'transitionend'\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nfunction toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nfunction getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n}\n\nfunction transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return Util.findShadowRoot(element.parentNode)\n },\n\n jQueryDetection() {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n }\n}\n\nUtil.jQueryDetection()\nsetTransitionEndSupport()\n\nexport default Util\n"],"names":["TRANSITION_END","MAX_UID","MILLISECONDS_MULTIPLIER","toType","obj","toString","call","match","toLowerCase","getSpecialTransitionEndEvent","bindType","delegateType","handle","event","$","target","is","handleObj","handler","apply","arguments","undefined","transitionEndEmulator","duration","called","one","Util","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","special","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","root","ShadowRoot","parentNode","jQueryDetection","TypeError","version","jquery","minMajor","ltMajor","minMinor","minPatch","maxMajor"],"mappings":";;;;;;;;;;;;;EAAA;;;;;;AAOA,EAEA;;;;;;EAMA,IAAMA,cAAc,GAAG,eAAvB;EACA,IAAMC,OAAO,GAAG,OAAhB;EACA,IAAMC,uBAAuB,GAAG,IAAhC;;EAGA,SAASC,MAAT,CAAgBC,GAAhB,EAAqB;EACnB,SAAO,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,aAA5B,EAA2C,CAA3C,EAA8CC,WAA9C,EAAP;EACD;;EAED,SAASC,4BAAT,GAAwC;EACtC,SAAO;EACLC,IAAAA,QAAQ,EAAEV,cADL;EAELW,IAAAA,YAAY,EAAEX,cAFT;EAGLY,IAAAA,MAHK,kBAGEC,KAHF,EAGS;EACZ,UAAIC,CAAC,CAACD,KAAK,CAACE,MAAP,CAAD,CAAgBC,EAAhB,CAAmB,IAAnB,CAAJ,EAA8B;EAC5B,eAAOH,KAAK,CAACI,SAAN,CAAgBC,OAAhB,CAAwBC,KAAxB,CAA8B,IAA9B,EAAoCC,SAApC,CAAP,CAD4B;EAE7B;;EACD,aAAOC,SAAP,CAJY;EAKb;EARI,GAAP;EAUD;;EAED,SAASC,qBAAT,CAA+BC,QAA/B,EAAyC;EAAA;;EACvC,MAAIC,MAAM,GAAG,KAAb;EAEAV,EAAAA,CAAC,CAAC,IAAD,CAAD,CAAQW,GAAR,CAAYC,IAAI,CAAC1B,cAAjB,EAAiC,YAAM;EACrCwB,IAAAA,MAAM,GAAG,IAAT;EACD,GAFD;EAIAG,EAAA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,OAAOtE,CAAP,KAAa,WAAjB,EAA8B;EAC5B,YAAM,IAAIuE,SAAJ,CAAc,kGAAd,CAAN;EACD;;EAED,QAAMC,OAAO,GAAGxE,CAAC,CAACgB,EAAF,CAAKyD,MAAL,CAAYjC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;EACA,QAAMkC,QAAQ,GAAG,CAAjB;EACA,QAAMC,OAAO,GAAG,CAAhB;EACA,QAAMC,QAAQ,GAAG,CAAjB;EACA,QAAMC,QAAQ,GAAG,CAAjB;EACA,QAAMC,QAAQ,GAAG,CAAjB;;EAEA,QAAIN,OAAO,CAAC,CAAD,CAAP,GAAaG,OAAb,IAAwBH,OAAO,CAAC,CAAD,CAAP,GAAaI,QAArC,IAAiDJ,OAAO,CAAC,CAAD,CAAP,KAAeE,QAAf,IAA2BF,OAAO,CAAC,CAAD,CAAP,KAAeI,QAA1C,IAAsDJ,OAAO,CAAC,CAAD,CAAP,GAAaK,QAApH,IAAgIL,OAAO,CAAC,CAAD,CAAP,IAAcM,QAAlJ,EAA4J;EAC1J,YAAM,IAAIjB,KAAJ,CAAU,8EAAV,CAAN;EACD;EACF;EA5HU,CAAb;EA+HAjD,IAAI,CAAC0D,eAAL;EACAvD,uBAAuB;;;;;;;;"} \ No newline at end of file diff --git a/external/bootstrap4/scss/_badge.scss b/external/bootstrap4/scss/_badge.scss index a4c59fddfa..42c5d08d74 100644 --- a/external/bootstrap4/scss/_badge.scss +++ b/external/bootstrap4/scss/_badge.scss @@ -6,19 +6,20 @@ .badge { display: inline-block; padding: $badge-padding-y $badge-padding-x; - font-size: $badge-font-size; + @include font-size($badge-font-size); font-weight: $badge-font-weight; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; @include border-radius($badge-border-radius); + @include transition($badge-transition); - //@at-root a#{&} { - // @include hover-focus { - // text-decoration: none; - // } - //} + @at-root a#{&} { + @include hover-focus() { + text-decoration: none; + } + } // Empty badges collapse automatically &:empty { diff --git a/external/bootstrap4/scss/_breadcrumb.scss b/external/bootstrap4/scss/_breadcrumb.scss index be30950690..d748894f96 100644 --- a/external/bootstrap4/scss/_breadcrumb.scss +++ b/external/bootstrap4/scss/_breadcrumb.scss @@ -3,6 +3,7 @@ flex-wrap: wrap; padding: $breadcrumb-padding-y $breadcrumb-padding-x; margin-bottom: $breadcrumb-margin-bottom; + @include font-size($breadcrumb-font-size); list-style: none; background-color: $breadcrumb-bg; @include border-radius($breadcrumb-border-radius); @@ -17,7 +18,7 @@ display: inline-block; // Suppress underlining of the separator in modern browsers padding-right: $breadcrumb-item-padding; color: $breadcrumb-divider-color; - content: $breadcrumb-divider; + content: escape-svg($breadcrumb-divider); } } diff --git a/external/bootstrap4/scss/_button-group.scss b/external/bootstrap4/scss/_button-group.scss index d7220029ad..da02d7931b 100644 --- a/external/bootstrap4/scss/_button-group.scss +++ b/external/bootstrap4/scss/_button-group.scss @@ -13,7 +13,7 @@ // Bring the hover, focused, and "active" buttons to the front to overlay // the borders properly - @include hover { + @include hover() { z-index: 1; } &:focus, diff --git a/external/bootstrap4/scss/_buttons.scss b/external/bootstrap4/scss/_buttons.scss index 2a7d94ad22..e87d3393a1 100644 --- a/external/bootstrap4/scss/_buttons.scss +++ b/external/bootstrap4/scss/_buttons.scss @@ -10,14 +10,16 @@ font-weight: $btn-font-weight; color: $body-color; text-align: center; + white-space: $btn-white-space; vertical-align: middle; + cursor: if($enable-pointer-cursor-for-buttons, pointer, null); user-select: none; background-color: transparent; border: $btn-border-width solid transparent; @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius); @include transition($btn-transition); - @include hover { + @include hover() { color: $body-color; text-decoration: none; } @@ -79,7 +81,7 @@ fieldset:disabled a.btn { color: $link-color; text-decoration: $link-decoration; - @include hover { + @include hover() { color: $link-hover-color; text-decoration: $link-hover-decoration; } diff --git a/external/bootstrap4/scss/_card.scss b/external/bootstrap4/scss/_card.scss index c6b67ce05d..d6759fde68 100644 --- a/external/bootstrap4/scss/_card.scss +++ b/external/bootstrap4/scss/_card.scss @@ -7,6 +7,7 @@ display: flex; flex-direction: column; min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106 + height: $card-height; word-wrap: break-word; background-color: $card-bg; background-clip: border-box; @@ -35,6 +36,9 @@ // Enable `flex-grow: 1` for decks and groups so that card blocks take up // as much space as possible, ensuring footers are aligned to the bottom. flex: 1 1 auto; + // Workaround for the image size bug in IE + // See: https://github.com/twbs/bootstrap/pull/28855 + min-height: 1px; padding: $card-spacer-x; color: $card-color; } @@ -53,7 +57,7 @@ } .card-link { - @include hover { + @include hover() { text-decoration: none; } @@ -121,19 +125,20 @@ padding: $card-img-overlay-padding; } -.card-img { +.card-img, +.card-img-top, +.card-img-bottom { + flex-shrink: 0; // For IE: https://github.com/twbs/bootstrap/issues/29396 width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch - @include border-radius($card-inner-border-radius); } -// Card image caps +.card-img, .card-img-top { - width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch @include border-top-radius($card-inner-border-radius); } +.card-img, .card-img-bottom { - width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch @include border-bottom-radius($card-inner-border-radius); } @@ -141,23 +146,19 @@ // Card deck .card-deck { - display: flex; - flex-direction: column; - .card { margin-bottom: $card-deck-margin; } @include media-breakpoint-up(sm) { + display: flex; flex-flow: row wrap; margin-right: -$card-deck-margin; margin-left: -$card-deck-margin; .card { - display: flex; // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 flex: 1 0 0%; - flex-direction: column; margin-right: $card-deck-margin; margin-bottom: 0; // Override the default margin-left: $card-deck-margin; @@ -171,9 +172,6 @@ // .card-group { - display: flex; - flex-direction: column; - // The child selector allows nested `.card` within `.card-group` // to display properly. > .card { @@ -181,6 +179,7 @@ } @include media-breakpoint-up(sm) { + display: flex; flex-flow: row wrap; // The child selector allows nested `.card` within `.card-group` // to display properly. @@ -262,27 +261,17 @@ > .card { overflow: hidden; - &:not(:first-of-type) { - .card-header:first-child { - @include border-radius(0); - } - - &:not(:last-of-type) { - border-bottom: 0; - @include border-radius(0); - } - } - - &:first-of-type { + &:not(:last-of-type) { border-bottom: 0; @include border-bottom-radius(0); } - &:last-of-type { + &:not(:first-of-type) { @include border-top-radius(0); } - .card-header { + > .card-header { + @include border-radius(0); margin-bottom: -$card-border-width; } } diff --git a/external/bootstrap4/scss/_carousel.scss b/external/bootstrap4/scss/_carousel.scss index 20ea04baf4..fb5e9f856a 100644 --- a/external/bootstrap4/scss/_carousel.scss +++ b/external/bootstrap4/scss/_carousel.scss @@ -75,7 +75,7 @@ .active.carousel-item-right { z-index: 0; opacity: 0; - @include transition(0s $carousel-transition-duration opacity); + @include transition(opacity 0s $carousel-transition-duration); } } @@ -101,7 +101,7 @@ @include transition($carousel-control-transition); // Hover/focus state - @include hover-focus { + @include hover-focus() { color: $carousel-control-color; text-decoration: none; outline: 0; @@ -111,13 +111,13 @@ .carousel-control-prev { left: 0; @if $enable-gradients { - background: linear-gradient(90deg, rgba($black, .25), rgba($black, .001)); + background-image: linear-gradient(90deg, rgba($black, .25), rgba($black, .001)); } } .carousel-control-next { right: 0; @if $enable-gradients { - background: linear-gradient(270deg, rgba($black, .25), rgba($black, .001)); + background-image: linear-gradient(270deg, rgba($black, .25), rgba($black, .001)); } } @@ -130,10 +130,10 @@ background: no-repeat 50% / 100% 100%; } .carousel-control-prev-icon { - background-image: $carousel-control-prev-icon-bg; + background-image: escape-svg($carousel-control-prev-icon-bg); } .carousel-control-next-icon { - background-image: $carousel-control-next-icon-bg; + background-image: escape-svg($carousel-control-next-icon-bg); } diff --git a/external/bootstrap4/scss/_close.scss b/external/bootstrap4/scss/_close.scss index 5cc96f573e..071aebe80f 100644 --- a/external/bootstrap4/scss/_close.scss +++ b/external/bootstrap4/scss/_close.scss @@ -8,13 +8,13 @@ opacity: .5; // Override <a>'s hover style - @include hover { + @include hover() { color: $close-color; text-decoration: none; } &:not(:disabled):not(.disabled) { - @include hover-focus { + @include hover-focus() { opacity: .75; } } diff --git a/external/bootstrap4/scss/_code.scss b/external/bootstrap4/scss/_code.scss index 74b6e1c89b..4bc117a96d 100644 --- a/external/bootstrap4/scss/_code.scss +++ b/external/bootstrap4/scss/_code.scss @@ -2,7 +2,7 @@ code { @include font-size($code-font-size); color: $code-color; - word-break: break-word; + word-wrap: break-word; // Streamline the style when inside anchors to avoid broken underline and more a > & { diff --git a/external/bootstrap4/scss/_custom-forms.scss b/external/bootstrap4/scss/_custom-forms.scss index 03f3fc5be2..21e72da7dd 100644 --- a/external/bootstrap4/scss/_custom-forms.scss +++ b/external/bootstrap4/scss/_custom-forms.scss @@ -21,7 +21,10 @@ .custom-control-input { position: absolute; + left: 0; z-index: -1; // Put the input behind the label so it doesn't overlay text + width: $custom-control-indicator-size; + height: ($font-size-base * $line-height-base + $custom-control-indicator-size) / 2; opacity: 0; &:checked ~ .custom-control-label::before { @@ -51,6 +54,8 @@ @include box-shadow($custom-control-indicator-active-box-shadow); } + // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247 + &[disabled], &:disabled { ~ .custom-control-label { color: $custom-control-label-disabled-color; @@ -69,7 +74,9 @@ .custom-control-label { position: relative; margin-bottom: 0; + color: $custom-control-label-color; vertical-align: top; + cursor: $custom-control-cursor; // Background-color and (when enabled) gradient &::before { @@ -111,7 +118,7 @@ .custom-control-input:checked ~ .custom-control-label { &::after { - background-image: $custom-checkbox-indicator-icon-checked; + background-image: escape-svg($custom-checkbox-indicator-icon-checked); } } @@ -122,7 +129,7 @@ @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow); } &::after { - background-image: $custom-checkbox-indicator-icon-indeterminate; + background-image: escape-svg($custom-checkbox-indicator-icon-indeterminate); } } @@ -148,7 +155,7 @@ .custom-control-input:checked ~ .custom-control-label { &::after { - background-image: $custom-radio-indicator-icon-checked; + background-image: escape-svg($custom-radio-indicator-icon-checked); } } @@ -177,8 +184,8 @@ } &::after { - top: calc(#{(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2)} + #{$custom-control-indicator-border-width * 2}); - left: calc(#{-($custom-switch-width + $custom-control-gutter)} + #{$custom-control-indicator-border-width * 2}); + top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2, $custom-control-indicator-border-width * 2); + left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2); width: $custom-switch-indicator-size; height: $custom-switch-indicator-size; background-color: $custom-control-indicator-border-color; @@ -220,8 +227,7 @@ line-height: $custom-select-line-height; color: $custom-select-color; vertical-align: middle; - background: $custom-select-background; - background-color: $custom-select-bg; + background: $custom-select-bg $custom-select-background; border: $custom-select-border-width solid $custom-select-border-color; @include border-radius($custom-select-border-radius, 0); @include box-shadow($custom-select-box-shadow); @@ -263,6 +269,12 @@ &::-ms-expand { display: none; } + + // Remove outline from select box in FF + &:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 $custom-select-color; + } } .custom-select-sm { @@ -307,6 +319,8 @@ box-shadow: $custom-file-focus-box-shadow; } + // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247 + &[disabled] ~ .custom-file-label, &:disabled ~ .custom-file-label { background-color: $custom-file-disabled-bg; } @@ -365,7 +379,7 @@ .custom-range { width: 100%; - height: calc(#{$custom-range-thumb-height} + #{$custom-range-thumb-focus-box-shadow-width * 2}); + height: add($custom-range-thumb-height, $custom-range-thumb-focus-box-shadow-width * 2); padding: 0; // Need to reset padding background-color: transparent; appearance: none; diff --git a/external/bootstrap4/scss/_dropdown.scss b/external/bootstrap4/scss/_dropdown.scss index ac3c8c8a2c..76f33a4fd8 100644 --- a/external/bootstrap4/scss/_dropdown.scss +++ b/external/bootstrap4/scss/_dropdown.scss @@ -10,7 +10,7 @@ white-space: nowrap; // Generate the caret automatically - @include caret; + @include caret(); } // The dropdown menu @@ -114,7 +114,7 @@ // Dividers (basically an `<hr>`) within the dropdown .dropdown-divider { - @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y); + @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y, true); } // Links, buttons, and more within the dropdown menu @@ -144,7 +144,7 @@ } } - @include hover-focus { + @include hover-focus() { color: $dropdown-link-hover-color; text-decoration: none; @include gradient-bg($dropdown-link-hover-bg); diff --git a/external/bootstrap4/scss/_forms.scss b/external/bootstrap4/scss/_forms.scss index ec9c335591..b2edb7b27b 100644 --- a/external/bootstrap4/scss/_forms.scss +++ b/external/bootstrap4/scss/_forms.scss @@ -30,8 +30,14 @@ border: 0; } + // Remove select outline from select box in FF + &:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 $input-color; + } + // Customize the `:focus` state to imitate native WebKit styles. - @include form-control-focus(); + @include form-control-focus($ignore-warning: true); // Placeholder &::placeholder { @@ -80,23 +86,23 @@ select.form-control { // For use with horizontal and inline forms, when you need the label (or legend) // text to align with the form controls. .col-form-label { - padding-top: calc(#{$input-padding-y} + #{$input-border-width}); - padding-bottom: calc(#{$input-padding-y} + #{$input-border-width}); + padding-top: add($input-padding-y, $input-border-width); + padding-bottom: add($input-padding-y, $input-border-width); margin-bottom: 0; // Override the `<label>/<legend>` default @include font-size(inherit); // Override the `<legend>` default line-height: $input-line-height; } .col-form-label-lg { - padding-top: calc(#{$input-padding-y-lg} + #{$input-border-width}); - padding-bottom: calc(#{$input-padding-y-lg} + #{$input-border-width}); + padding-top: add($input-padding-y-lg, $input-border-width); + padding-bottom: add($input-padding-y-lg, $input-border-width); @include font-size($input-font-size-lg); line-height: $input-line-height-lg; } .col-form-label-sm { - padding-top: calc(#{$input-padding-y-sm} + #{$input-border-width}); - padding-bottom: calc(#{$input-padding-y-sm} + #{$input-border-width}); + padding-top: add($input-padding-y-sm, $input-border-width); + padding-bottom: add($input-padding-y-sm, $input-border-width); @include font-size($input-font-size-sm); line-height: $input-line-height-sm; } @@ -110,9 +116,9 @@ select.form-control { .form-control-plaintext { display: block; width: 100%; - padding-top: $input-padding-y; - padding-bottom: $input-padding-y; + padding: $input-padding-y 0; margin-bottom: 0; // match inputs if this class comes on inputs with default margins + @include font-size($input-font-size); line-height: $input-line-height; color: $input-plaintext-color; background-color: transparent; @@ -210,6 +216,8 @@ textarea.form-control { margin-top: $form-check-input-margin-y; margin-left: -$form-check-input-gutter; + // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247 + &[disabled] ~ .form-check-label, &:disabled ~ .form-check-label { color: $text-muted; } diff --git a/external/bootstrap4/scss/_functions.scss b/external/bootstrap4/scss/_functions.scss index d2cc91d57a..695e6cd2f8 100644 --- a/external/bootstrap4/scss/_functions.scss +++ b/external/bootstrap4/scss/_functions.scss @@ -8,7 +8,7 @@ $prev-key: null; $prev-num: null; @each $key, $num in $map { - @if $prev-num == null or unit($num) == "%" { + @if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" { // Do nothing } @else if not comparable($prev-num, $num) { @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !"; @@ -48,6 +48,17 @@ @return $string; } +// See https://codepen.io/kevinweber/pen/dXWoRw +@function escape-svg($string) { + @if str-index($string, "data:image/svg+xml") { + @each $char, $encoded in $escaped-characters { + $string: str-replace($string, $char, $encoded); + } + } + + @return $string; +} + // Color contrast @function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) { $r: red($color); @@ -84,3 +95,40 @@ @return mix($color-base, $color, $level * $theme-color-interval); } + +// Return valid calc +@function add($value1, $value2, $return-calc: true) { + @if $value1 == null { + @return $value2; + } + + @if $value2 == null { + @return $value1; + } + + @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) { + @return $value1 + $value2; + } + + @return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2); +} + +@function subtract($value1, $value2, $return-calc: true) { + @if $value1 == null and $value2 == null { + @return null; + } + + @if $value1 == null { + @return -$value2; + } + + @if $value2 == null { + @return $value1; + } + + @if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) { + @return $value1 - $value2; + } + + @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2); +} diff --git a/external/bootstrap4/scss/_grid.scss b/external/bootstrap4/scss/_grid.scss index a227515379..d36ee75d88 100644 --- a/external/bootstrap4/scss/_grid.scss +++ b/external/bootstrap4/scss/_grid.scss @@ -3,26 +3,43 @@ // Set the container width, and override it for fixed navbars in media queries. @if $enable-grid-classes { + // Single container class with breakpoint max-widths .container { @include make-container(); @include make-container-max-widths(); } -} - -// Fluid container -// -// Utilizes the mixin meant for fixed width containers, but with 100% width for -// fluid, full width layouts. -@if $enable-grid-classes { + // 100% wide container at all breakpoints .container-fluid { @include make-container(); } + + // Responsive containers that are 100% wide until a breakpoint + @each $breakpoint, $container-max-width in $container-max-widths { + .container-#{$breakpoint} { + @extend .container-fluid; + } + + @include media-breakpoint-up($breakpoint, $grid-breakpoints) { + %responsive-container-#{$breakpoint} { + max-width: $container-max-width; + } + + @each $name, $width in $grid-breakpoints { + @if ($container-max-width > $width or $breakpoint == $name) { + .container#{breakpoint-infix($name, $grid-breakpoints)} { + @extend %responsive-container-#{$breakpoint}; + } + } + } + } + } } + // Row // -// Rows contain and clear the floats of your columns. +// Rows contain your columns. @if $enable-grid-classes { .row { diff --git a/external/bootstrap4/scss/_images.scss b/external/bootstrap4/scss/_images.scss index cb9795e272..b11b45a37b 100644 --- a/external/bootstrap4/scss/_images.scss +++ b/external/bootstrap4/scss/_images.scss @@ -6,7 +6,7 @@ // which weren't expecting the images within themselves to be involuntarily resized. // See also https://github.com/twbs/bootstrap/issues/18178 .img-fluid { - @include img-fluid; + @include img-fluid(); } @@ -19,7 +19,7 @@ @include box-shadow($thumbnail-box-shadow); // Keep them at most 100% wide - @include img-fluid; + @include img-fluid(); } // diff --git a/external/bootstrap4/scss/_input-group.scss b/external/bootstrap4/scss/_input-group.scss index ac49f696cb..bf69ddb41d 100644 --- a/external/bootstrap4/scss/_input-group.scss +++ b/external/bootstrap4/scss/_input-group.scss @@ -16,10 +16,8 @@ > .custom-select, > .custom-file { position: relative; // For focus state's z-index - flex: 1 1 auto; - // Add width 1% and flex-basis auto to ensure that button will not wrap out - // the column. Applies to IE Edge+ and Firefox. Chrome does not require this. - width: 1%; + flex: 1 1 0%; + min-width: 0; // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size margin-bottom: 0; + .form-control, diff --git a/external/bootstrap4/scss/_list-group.scss b/external/bootstrap4/scss/_list-group.scss index 3f80687ab4..468c2e31ac 100644 --- a/external/bootstrap4/scss/_list-group.scss +++ b/external/bootstrap4/scss/_list-group.scss @@ -23,7 +23,7 @@ text-align: inherit; // For `<button>`s (anchors inherit) // Hover state - @include hover-focus { + @include hover-focus() { z-index: 1; // Place hover/focus items above their siblings for proper border styling color: $list-group-action-hover-color; text-decoration: none; @@ -45,8 +45,6 @@ position: relative; display: block; padding: $list-group-item-padding-y $list-group-item-padding-x; - // Place the border on the list items and negative margin up for better styling - margin-bottom: -$list-group-border-width; color: $list-group-color; background-color: $list-group-bg; border: $list-group-border-width solid $list-group-border-color; @@ -56,7 +54,6 @@ } &:last-child { - margin-bottom: 0; @include border-bottom-radius($list-group-border-radius); } @@ -74,6 +71,15 @@ background-color: $list-group-active-bg; border-color: $list-group-active-border-color; } + + & + & { + border-top-width: 0; + + &.active { + margin-top: -$list-group-border-width; + border-top-width: $list-group-border-width; + } + } } @@ -89,19 +95,29 @@ flex-direction: row; .list-group-item { - margin-right: -$list-group-border-width; - margin-bottom: 0; - &:first-child { - @include border-left-radius($list-group-border-radius); + @include border-bottom-left-radius($list-group-border-radius); @include border-top-right-radius(0); } &:last-child { - margin-right: 0; - @include border-right-radius($list-group-border-radius); + @include border-top-right-radius($list-group-border-radius); @include border-bottom-left-radius(0); } + + &.active { + margin-top: 0; + } + + & + .list-group-item { + border-top-width: $list-group-border-width; + border-left-width: 0; + + &.active { + margin-left: -$list-group-border-width; + border-left-width: $list-group-border-width; + } + } } } } @@ -115,25 +131,18 @@ .list-group-flush { .list-group-item { - border-right: 0; - border-left: 0; + border-right-width: 0; + border-left-width: 0; @include border-radius(0); - &:last-child { - margin-bottom: -$list-group-border-width; - } - } - - &:first-child { - .list-group-item:first-child { - border-top: 0; + &:first-child { + border-top-width: 0; } } &:last-child { .list-group-item:last-child { - margin-bottom: 0; - border-bottom: 0; + border-bottom-width: 0; } } } diff --git a/external/bootstrap4/scss/_mixins.scss b/external/bootstrap4/scss/_mixins.scss index cc957843f2..7e7a23d254 100644 --- a/external/bootstrap4/scss/_mixins.scss +++ b/external/bootstrap4/scss/_mixins.scss @@ -22,7 +22,7 @@ @import "mixins/text-truncate"; @import "mixins/visibility"; -// // Components +// Components @import "mixins/alert"; @import "mixins/buttons"; @import "mixins/caret"; @@ -33,14 +33,14 @@ @import "mixins/forms"; @import "mixins/table-row"; -// // Skins +// Skins @import "mixins/background-variant"; @import "mixins/border-radius"; @import "mixins/box-shadow"; @import "mixins/gradients"; @import "mixins/transition"; -// // Layout +// Layout @import "mixins/clearfix"; @import "mixins/grid-framework"; @import "mixins/grid"; diff --git a/external/bootstrap4/scss/_modal.scss b/external/bootstrap4/scss/_modal.scss index 6b6770b32c..9053c173f8 100644 --- a/external/bootstrap4/scss/_modal.scss +++ b/external/bootstrap4/scss/_modal.scss @@ -48,14 +48,19 @@ .modal.show & { transform: $modal-show-transform; } + + // When trying to close, animate focus to scale + .modal.modal-static & { + transform: $modal-scale-transform; + } } .modal-dialog-scrollable { display: flex; // IE10/11 - max-height: calc(100% - #{$modal-dialog-margin * 2}); + max-height: subtract(100%, $modal-dialog-margin * 2); .modal-content { - max-height: calc(100vh - #{$modal-dialog-margin * 2}); // IE10/11 + max-height: subtract(100vh, $modal-dialog-margin * 2); // IE10/11 overflow: hidden; } @@ -72,12 +77,12 @@ .modal-dialog-centered { display: flex; align-items: center; - min-height: calc(100% - #{$modal-dialog-margin * 2}); + min-height: subtract(100%, $modal-dialog-margin * 2); // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11) &::before { display: block; // IE10 - height: calc(100vh - #{$modal-dialog-margin * 2}); + height: subtract(100vh, $modal-dialog-margin * 2); content: ""; } @@ -138,7 +143,7 @@ justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends padding: $modal-header-padding; border-bottom: $modal-header-border-width solid $modal-header-border-color; - @include border-top-radius($modal-content-border-radius); + @include border-top-radius($modal-content-inner-border-radius); .close { padding: $modal-header-padding; @@ -158,7 +163,7 @@ .modal-body { position: relative; // Enable `flex-grow: 1` so that the body take up as much space as possible - // when should there be a fixed height on `.modal-dialog`. + // when there should be a fixed height on `.modal-dialog`. flex: 1 1 auto; padding: $modal-inner-padding; } @@ -166,15 +171,20 @@ // Footer (for actions) .modal-footer { display: flex; + flex-wrap: wrap; align-items: center; // vertically center justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items - padding: $modal-inner-padding; + padding: $modal-inner-padding - $modal-footer-margin-between / 2; border-top: $modal-footer-border-width solid $modal-footer-border-color; - @include border-bottom-radius($modal-content-border-radius); - - // Easily place margin between footer elements - > :not(:first-child) { margin-left: .25rem; } - > :not(:last-child) { margin-right: .25rem; } + @include border-bottom-radius($modal-content-inner-border-radius); + + // Place margin between footer elements + // This solution is far from ideal because of the universal selector usage, + // but is needed to fix https://github.com/twbs/bootstrap/issues/24800 + // stylelint-disable-next-line selector-max-universal + > * { + margin: $modal-footer-margin-between / 2; + } } // Measure scrollbar width for padding body during modal show/hide @@ -195,18 +205,18 @@ } .modal-dialog-scrollable { - max-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2}); + max-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2); .modal-content { - max-height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2}); + max-height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2); } } .modal-dialog-centered { - min-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2}); + min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2); &::before { - height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2}); + height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2); } } diff --git a/external/bootstrap4/scss/_nav.scss b/external/bootstrap4/scss/_nav.scss index e5519b3a4d..667d682721 100644 --- a/external/bootstrap4/scss/_nav.scss +++ b/external/bootstrap4/scss/_nav.scss @@ -1,7 +1,7 @@ // Base class // // Kickstart any navigation component with a set of style resets. Works with -// `<nav>`s or `<ul>`s. +// `<nav>`s, `<ul>`s or `<ol>`s. .nav { display: flex; @@ -15,7 +15,7 @@ display: block; padding: $nav-link-padding-y $nav-link-padding-x; - @include hover-focus { + @include hover-focus() { text-decoration: none; } @@ -42,7 +42,7 @@ border: $nav-tabs-border-width solid transparent; @include border-top-radius($nav-tabs-border-radius); - @include hover-focus { + @include hover-focus() { border-color: $nav-tabs-link-hover-border-color; } diff --git a/external/bootstrap4/scss/_navbar.scss b/external/bootstrap4/scss/_navbar.scss index 5c6e96399e..5f10a62f14 100644 --- a/external/bootstrap4/scss/_navbar.scss +++ b/external/bootstrap4/scss/_navbar.scss @@ -25,13 +25,23 @@ // Because flex properties aren't inherited, we need to redeclare these first // few properties so that content nested within behave properly. - > .container, - > .container-fluid { + %container-flex-properties { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; } + + .container, + .container-fluid { + @extend %container-flex-properties; + } + + @each $breakpoint, $container-max-width in $container-max-widths { + > .container#{breakpoint-infix($breakpoint, $container-max-widths)} { + @extend %container-flex-properties; + } + } } @@ -48,7 +58,7 @@ line-height: inherit; white-space: nowrap; - @include hover-focus { + @include hover-focus() { text-decoration: none; } } @@ -113,7 +123,7 @@ border: $border-width solid transparent; // remove default button style @include border-radius($navbar-toggler-border-radius); - @include hover-focus { + @include hover-focus() { text-decoration: none; } } @@ -139,11 +149,21 @@ &#{$infix} { @include media-breakpoint-down($breakpoint) { - > .container, - > .container-fluid { + %container-navbar-expand-#{$breakpoint} { padding-right: 0; padding-left: 0; } + + > .container, + > .container-fluid { + @extend %container-navbar-expand-#{$breakpoint}; + } + + @each $size, $container-max-width in $container-max-widths { + > .container#{breakpoint-infix($size, $container-max-widths)} { + @extend %container-navbar-expand-#{$breakpoint}; + } + } } @include media-breakpoint-up($next) { @@ -164,9 +184,19 @@ } // For nesting containers, have to redeclare for alignment purposes + %container-nesting-#{$breakpoint} { + flex-wrap: nowrap; + } + > .container, > .container-fluid { - flex-wrap: nowrap; + @extend %container-nesting-#{$breakpoint}; + } + + @each $size, $container-max-width in $container-max-widths { + > .container#{breakpoint-infix($size, $container-max-widths)} { + @extend %container-nesting-#{$breakpoint}; + } } .navbar-collapse { @@ -194,7 +224,7 @@ .navbar-brand { color: $navbar-light-brand-color; - @include hover-focus { + @include hover-focus() { color: $navbar-light-brand-hover-color; } } @@ -203,7 +233,7 @@ .nav-link { color: $navbar-light-color; - @include hover-focus { + @include hover-focus() { color: $navbar-light-hover-color; } @@ -226,7 +256,7 @@ } .navbar-toggler-icon { - background-image: $navbar-light-toggler-icon-bg; + background-image: escape-svg($navbar-light-toggler-icon-bg); } .navbar-text { @@ -234,7 +264,7 @@ a { color: $navbar-light-active-color; - @include hover-focus { + @include hover-focus() { color: $navbar-light-active-color; } } @@ -246,7 +276,7 @@ .navbar-brand { color: $navbar-dark-brand-color; - @include hover-focus { + @include hover-focus() { color: $navbar-dark-brand-hover-color; } } @@ -255,7 +285,7 @@ .nav-link { color: $navbar-dark-color; - @include hover-focus { + @include hover-focus() { color: $navbar-dark-hover-color; } @@ -278,7 +308,7 @@ } .navbar-toggler-icon { - background-image: $navbar-dark-toggler-icon-bg; + background-image: escape-svg($navbar-dark-toggler-icon-bg); } .navbar-text { @@ -286,7 +316,7 @@ a { color: $navbar-dark-active-color; - @include hover-focus { + @include hover-focus() { color: $navbar-dark-active-color; } } diff --git a/external/bootstrap4/scss/_pagination.scss b/external/bootstrap4/scss/_pagination.scss index b4345311d3..953a35a7fe 100644 --- a/external/bootstrap4/scss/_pagination.scss +++ b/external/bootstrap4/scss/_pagination.scss @@ -23,7 +23,7 @@ } &:focus { - z-index: 2; + z-index: 3; outline: $pagination-focus-outline; box-shadow: $pagination-focus-box-shadow; } @@ -43,7 +43,7 @@ } &.active .page-link { - z-index: 1; + z-index: 3; color: $pagination-active-color; background-color: $pagination-active-bg; border-color: $pagination-active-border-color; diff --git a/external/bootstrap4/scss/_popover.scss b/external/bootstrap4/scss/_popover.scss index f205e66818..0ad76af3ee 100644 --- a/external/bootstrap4/scss/_popover.scss +++ b/external/bootstrap4/scss/_popover.scss @@ -22,7 +22,7 @@ display: block; width: $popover-arrow-width; height: $popover-arrow-height; - margin: 0 $border-radius-lg; + margin: 0 $popover-border-radius; &::before, &::after { @@ -39,7 +39,7 @@ margin-bottom: $popover-arrow-height; > .arrow { - bottom: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + bottom: subtract(-$popover-arrow-height, $popover-border-width); &::before { bottom: 0; @@ -59,10 +59,10 @@ margin-left: $popover-arrow-height; > .arrow { - left: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + left: subtract(-$popover-arrow-height, $popover-border-width); width: $popover-arrow-height; height: $popover-arrow-width; - margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners + margin: $popover-border-radius 0; // make sure the arrow does not touch the popover's rounded corners &::before { left: 0; @@ -82,7 +82,7 @@ margin-top: $popover-arrow-height; > .arrow { - top: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + top: subtract(-$popover-arrow-height, $popover-border-width); &::before { top: 0; @@ -114,10 +114,10 @@ margin-right: $popover-arrow-height; > .arrow { - right: calc((#{$popover-arrow-height} + #{$popover-border-width}) * -1); + right: subtract(-$popover-arrow-height, $popover-border-width); width: $popover-arrow-height; height: $popover-arrow-width; - margin: $border-radius-lg 0; // make sure the arrow does not touch the popover's rounded corners + margin: $popover-border-radius 0; // make sure the arrow does not touch the popover's rounded corners &::before { right: 0; @@ -157,8 +157,7 @@ color: $popover-header-color; background-color: $popover-header-bg; border-bottom: $popover-border-width solid darken($popover-header-bg, 5%); - $offset-border-width: calc(#{$border-radius-lg} - #{$popover-border-width}); - @include border-top-radius($offset-border-width); + @include border-top-radius($popover-inner-border-radius); &:empty { display: none; diff --git a/external/bootstrap4/scss/_print.scss b/external/bootstrap4/scss/_print.scss index 61b60b9807..8f73024a8b 100644 --- a/external/bootstrap4/scss/_print.scss +++ b/external/bootstrap4/scss/_print.scss @@ -1,6 +1,6 @@ // stylelint-disable declaration-no-important, selector-no-qualifying-type -// Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css +// Source: https://github.com/h5bp/main.css/blob/master/src/_print.css // ========================================================================== // Print styles. @@ -57,7 +57,7 @@ // // Printing Tables: - // http://css-discuss.incutio.com/wiki/Printing_Tables + // https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables // thead { diff --git a/external/bootstrap4/scss/_progress.scss b/external/bootstrap4/scss/_progress.scss index ab9ea0ffbe..37ef6022e5 100644 --- a/external/bootstrap4/scss/_progress.scss +++ b/external/bootstrap4/scss/_progress.scss @@ -20,6 +20,7 @@ display: flex; flex-direction: column; justify-content: center; + overflow: hidden; color: $progress-bar-color; text-align: center; white-space: nowrap; @@ -36,8 +37,10 @@ .progress-bar-animated { animation: progress-bar-stripes $progress-bar-animation-timing; - @media (prefers-reduced-motion: reduce) { - animation: none; + @if $enable-prefers-reduced-motion-media-query { + @media (prefers-reduced-motion: reduce) { + animation: none; + } } } } diff --git a/external/bootstrap4/scss/_reboot.scss b/external/bootstrap4/scss/_reboot.scss index c55d42e44a..b6c98ccd77 100644 --- a/external/bootstrap4/scss/_reboot.scss +++ b/external/bootstrap4/scss/_reboot.scss @@ -54,12 +54,16 @@ body { background-color: $body-bg; // 2 } -// Suppress the focus outline on elements that cannot be accessed via keyboard. -// This prevents an unwanted focus outline from appearing around elements that -// might still respond to pointer events. -// -// Credit: https://github.com/suitcss/base -[tabindex="-1"]:focus { +// Future-proof rule: in browsers that support :focus-visible, suppress the focus outline +// on elements that programmatically receive focus but wouldn't normally show a visible +// focus outline. In general, this would mean that the outline is only applied if the +// interaction that led to the element receiving programmatic focus was a keyboard interaction, +// or the browser has somehow determined that the user is primarily a keyboard user and/or +// wants focus outlines to always be presented. +// +// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible +// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/ +[tabindex="-1"]:focus:not(:focus-visible) { outline: 0 !important; } @@ -184,30 +188,25 @@ a { text-decoration: $link-decoration; background-color: transparent; // Remove the gray background on active links in IE 10. - @include hover { + @include hover() { color: $link-hover-color; text-decoration: $link-hover-decoration; } } -// And undo these styles for placeholder links/named anchors (without href) -// which have not been made explicitly keyboard-focusable (without tabindex). +// And undo these styles for placeholder links/named anchors (without href). // It would be more straightforward to just use a[href] in previous block, but that // causes specificity issues in many other styles that are too complex to fix. // See https://github.com/twbs/bootstrap/issues/19402 -a:not([href]):not([tabindex]) { +a:not([href]) { color: inherit; text-decoration: none; - @include hover-focus { + @include hover() { color: inherit; text-decoration: none; } - - &:focus { - outline: 0; - } } diff --git a/external/bootstrap4/scss/_root.scss b/external/bootstrap4/scss/_root.scss index ad550df3b4..8110030c64 100644 --- a/external/bootstrap4/scss/_root.scss +++ b/external/bootstrap4/scss/_root.scss @@ -1,3 +1,4 @@ +// Do not forget to update getting-started/theming.md! :root { // Custom variable values only support SassScript inside `#{}`. @each $color, $value in $colors { diff --git a/external/bootstrap4/scss/_tables.scss b/external/bootstrap4/scss/_tables.scss index b7ab3d5062..5fd77a4eb0 100644 --- a/external/bootstrap4/scss/_tables.scss +++ b/external/bootstrap4/scss/_tables.scss @@ -84,7 +84,7 @@ .table-hover { tbody tr { - @include hover { + @include hover() { color: $table-hover-color; background-color: $table-hover-bg; } @@ -142,14 +142,14 @@ } &.table-striped { - tbody tr:nth-of-type(odd) { + tbody tr:nth-of-type(#{$table-striped-order}) { background-color: $table-dark-accent-bg; } } &.table-hover { tbody tr { - @include hover { + @include hover() { color: $table-dark-hover-color; background-color: $table-dark-hover-bg; } diff --git a/external/bootstrap4/scss/_type.scss b/external/bootstrap4/scss/_type.scss index f8ed09065e..43dde7d0fe 100644 --- a/external/bootstrap4/scss/_type.scss +++ b/external/bootstrap4/scss/_type.scss @@ -82,12 +82,12 @@ mark, // .list-unstyled { - @include list-unstyled; + @include list-unstyled(); } // Inline turns list items into inline-block .list-inline { - @include list-unstyled; + @include list-unstyled(); } .list-inline-item { display: inline-block; diff --git a/external/bootstrap4/scss/_variables.scss b/external/bootstrap4/scss/_variables.scss index d9e88df9a3..5d3135cd95 100644 --- a/external/bootstrap4/scss/_variables.scss +++ b/external/bootstrap4/scss/_variables.scss @@ -101,6 +101,13 @@ $yiq-contrasted-threshold: 150 !default; $yiq-text-dark: $gray-900 !default; $yiq-text-light: $white !default; +// Characters which are escaped by the escape-svg function +$escaped-characters: ( + ("<","%3c"), + (">","%3e"), + ("#","%23"), +) !default; + // Options // @@ -220,6 +227,7 @@ $container-max-widths: ( $grid-columns: 12 !default; $grid-gutter-width: 30px !default; +$grid-row-columns: 6 !default; // Components @@ -366,7 +374,6 @@ $table-dark-accent-bg: rgba($white, .05) !default; $table-dark-hover-color: $table-dark-color !default; $table-dark-hover-bg: rgba($white, .075) !default; $table-dark-border-color: lighten($table-dark-bg, 7.5%) !default; -$table-dark-color: $white !default; $table-striped-order: odd !default; @@ -412,6 +419,7 @@ $btn-padding-x: $input-btn-padding-x !default; $btn-font-family: $input-btn-font-family !default; $btn-font-size: $input-btn-font-size !default; $btn-line-height: $input-btn-line-height !default; +$btn-white-space: null !default; // Set to `nowrap` to prevent text wrapping $btn-padding-y-sm: $input-btn-padding-y-sm !default; $btn-padding-x-sm: $input-btn-padding-x-sm !default; @@ -488,13 +496,13 @@ $input-plaintext-color: $body-color !default; $input-height-border: $input-border-width * 2 !default; -$input-height-inner: calc(#{$input-line-height * 1em} + #{$input-padding-y * 2}) !default; -$input-height-inner-half: calc(#{$input-line-height * .5em} + #{$input-padding-y}) !default; -$input-height-inner-quarter: calc(#{$input-line-height * .25em} + #{$input-padding-y / 2}) !default; +$input-height-inner: add($input-line-height * 1em, $input-padding-y * 2) !default; +$input-height-inner-half: add($input-line-height * .5em, $input-padding-y) !default; +$input-height-inner-quarter: add($input-line-height * .25em, $input-padding-y / 2) !default; -$input-height: calc(#{$input-line-height * 1em} + #{$input-padding-y * 2} + #{$input-height-border}) !default; -$input-height-sm: calc(#{$input-line-height-sm * 1em} + #{$input-btn-padding-y-sm * 2} + #{$input-height-border}) !default; -$input-height-lg: calc(#{$input-line-height-lg * 1em} + #{$input-btn-padding-y-lg * 2} + #{$input-height-border}) !default; +$input-height: add($input-line-height * 1em, add($input-padding-y * 2, $input-height-border, false)) !default; +$input-height-sm: add($input-line-height-sm * 1em, add($input-padding-y-sm * 2, $input-height-border, false)) !default; +$input-height-lg: add($input-line-height-lg * 1em, add($input-padding-y-lg * 2, $input-height-border, false)) !default; $input-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; @@ -518,6 +526,7 @@ $custom-forms-transition: background-color .15s ease-in-out, borde $custom-control-gutter: .5rem !default; $custom-control-spacer-x: 1rem !default; +$custom-control-cursor: null !default; $custom-control-indicator-size: 1rem !default; $custom-control-indicator-bg: $input-bg !default; @@ -527,6 +536,8 @@ $custom-control-indicator-box-shadow: $input-box-shadow !default; $custom-control-indicator-border-color: $gray-500 !default; $custom-control-indicator-border-width: $input-border-width !default; +$custom-control-label-color: null !default; + $custom-control-indicator-disabled-bg: $input-disabled-bg !default; $custom-control-label-disabled-color: $gray-600 !default; @@ -545,20 +556,20 @@ $custom-control-indicator-active-box-shadow: none !default; $custom-control-indicator-active-border-color: $custom-control-indicator-active-bg !default; $custom-checkbox-indicator-border-radius: $border-radius !default; -$custom-checkbox-indicator-icon-checked: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e"), "#", "%23") !default; +$custom-checkbox-indicator-icon-checked: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><path fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/></svg>") !default; $custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default; $custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default; -$custom-checkbox-indicator-icon-indeterminate: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3e%3c/svg%3e"), "#", "%23") !default; +$custom-checkbox-indicator-icon-indeterminate: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'><path stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/></svg>") !default; $custom-checkbox-indicator-indeterminate-box-shadow: none !default; $custom-checkbox-indicator-indeterminate-border-color: $custom-checkbox-indicator-indeterminate-bg !default; $custom-radio-indicator-border-radius: 50% !default; -$custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3e%3c/svg%3e"), "#", "%23") !default; +$custom-radio-indicator-icon-checked: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'><circle r='3' fill='#{$custom-control-indicator-checked-color}'/></svg>") !default; $custom-switch-width: $custom-control-indicator-size * 1.75 !default; $custom-switch-indicator-border-radius: $custom-control-indicator-size / 2 !default; -$custom-switch-indicator-size: calc(#{$custom-control-indicator-size} - #{$custom-control-indicator-border-width * 4}) !default; +$custom-switch-indicator-size: subtract($custom-control-indicator-size, $custom-control-indicator-border-width * 4) !default; $custom-select-padding-y: $input-padding-y !default; $custom-select-padding-x: $input-padding-x !default; @@ -574,10 +585,10 @@ $custom-select-bg: $input-bg !default; $custom-select-disabled-bg: $gray-200 !default; $custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions $custom-select-indicator-color: $gray-800 !default; -$custom-select-indicator: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e"), "#", "%23") !default; -$custom-select-background: $custom-select-indicator no-repeat right $custom-select-padding-x center / $custom-select-bg-size !default; // Used so we can have multiple background elements (e.g., arrow and feedback icon) +$custom-select-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'><path fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") !default; +$custom-select-background: escape-svg($custom-select-indicator) no-repeat right $custom-select-padding-x center / $custom-select-bg-size !default; // Used so we can have multiple background elements (e.g., arrow and feedback icon) -$custom-select-feedback-icon-padding-right: calc((1em + #{2 * $custom-select-padding-y}) * 3 / 4 + #{$custom-select-padding-x + $custom-select-indicator-padding}) !default; +$custom-select-feedback-icon-padding-right: add(1em * .75, (2 * $custom-select-padding-y * .75) + $custom-select-padding-x + $custom-select-indicator-padding) !default; $custom-select-feedback-icon-position: center right ($custom-select-padding-x + $custom-select-indicator-padding) !default; $custom-select-feedback-icon-size: $input-height-inner-half $input-height-inner-half !default; @@ -650,9 +661,9 @@ $form-feedback-valid-color: theme-color("success") !default; $form-feedback-invalid-color: theme-color("danger") !default; $form-feedback-icon-valid-color: $form-feedback-valid-color !default; -$form-feedback-icon-valid: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='#{$form-feedback-icon-valid-color}' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"), "#", "%23") !default; +$form-feedback-icon-valid: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><path fill='#{$form-feedback-icon-valid-color}' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/></svg>") !default; $form-feedback-icon-invalid-color: $form-feedback-invalid-color !default; -$form-feedback-icon-invalid: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='#{$form-feedback-icon-invalid-color}' viewBox='-2 -2 7 7'%3e%3cpath stroke='#{$form-feedback-icon-invalid-color}' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E"), "#", "%23") !default; +$form-feedback-icon-invalid: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='#{$form-feedback-icon-invalid-color}' viewBox='0 0 12 12'><circle cx='6' cy='6' r='4.5'/><path stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/><circle cx='6' cy='8.2' r='.6' fill='#{$form-feedback-icon-invalid-color}' stroke='none'/></svg>") !default; $form-validation-states: () !default; // stylelint-disable-next-line scss/dollar-variable-default @@ -728,14 +739,14 @@ $navbar-dark-color: rgba($white, .5) !default; $navbar-dark-hover-color: rgba($white, .75) !default; $navbar-dark-active-color: $white !default; $navbar-dark-disabled-color: rgba($white, .25) !default; -$navbar-dark-toggler-icon-bg: str-replace(url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"), "#", "%23") !default; +$navbar-dark-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><path stroke='#{$navbar-dark-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>") !default; $navbar-dark-toggler-border-color: rgba($white, .1) !default; $navbar-light-color: rgba($black, .5) !default; $navbar-light-hover-color: rgba($black, .7) !default; $navbar-light-active-color: rgba($black, .9) !default; $navbar-light-disabled-color: rgba($black, .3) !default; -$navbar-light-toggler-icon-bg: str-replace(url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"), "#", "%23") !default; +$navbar-light-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><path stroke='#{$navbar-light-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>") !default; $navbar-light-toggler-border-color: rgba($black, .1) !default; $navbar-light-brand-color: $navbar-light-active-color !default; @@ -757,7 +768,7 @@ $dropdown-bg: $white !default; $dropdown-border-color: rgba($black, .15) !default; $dropdown-border-radius: $border-radius !default; $dropdown-border-width: $border-width !default; -$dropdown-inner-border-radius: calc(#{$dropdown-border-radius} - #{$dropdown-border-width}) !default; +$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width) !default; $dropdown-divider-bg: $gray-200 !default; $dropdown-divider-margin-y: $nav-divider-margin-y !default; $dropdown-box-shadow: 0 .5rem 1rem rgba($black, .175) !default; @@ -822,9 +833,10 @@ $card-spacer-x: 1.25rem !default; $card-border-width: $border-width !default; $card-border-radius: $border-radius !default; $card-border-color: rgba($black, .125) !default; -$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default; +$card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default; $card-cap-bg: rgba($black, .03) !default; $card-cap-color: null !default; +$card-height: null !default; $card-color: null !default; $card-bg: $white !default; @@ -871,6 +883,7 @@ $popover-max-width: 276px !default; $popover-border-width: $border-width !default; $popover-border-color: rgba($black, .2) !default; $popover-border-radius: $border-radius-lg !default; +$popover-inner-border-radius: subtract($popover-border-radius, $popover-border-width) !default; $popover-box-shadow: 0 .25rem .5rem rgba($black, .2) !default; $popover-header-bg: darken($popover-bg, 3%) !default; @@ -929,6 +942,9 @@ $badge-pill-border-radius: 10rem !default; // Padding applied to the modal body $modal-inner-padding: 1rem !default; +// Margin between elements in footer, must be lower than or equal to 2 * $modal-inner-padding +$modal-footer-margin-between: .5rem !default; + $modal-dialog-margin: .5rem !default; $modal-dialog-margin-y-sm-up: 1.75rem !default; @@ -939,6 +955,7 @@ $modal-content-bg: $white !default; $modal-content-border-color: rgba($black, .2) !default; $modal-content-border-width: $border-width !default; $modal-content-border-radius: $border-radius-lg !default; +$modal-content-inner-border-radius: subtract($modal-content-border-radius, $modal-content-border-width) !default; $modal-content-box-shadow-xs: 0 .25rem .5rem rgba($black, .5) !default; $modal-content-box-shadow-sm-up: 0 .5rem 1rem rgba($black, .5) !default; @@ -960,6 +977,7 @@ $modal-sm: 300px !default; $modal-fade-transform: translate(0, -50px) !default; $modal-show-transform: none !default; $modal-transition: transform .3s ease-out !default; +$modal-scale-transform: scale(1.02) !default; // Alerts @@ -1035,6 +1053,8 @@ $figure-caption-color: $gray-600 !default; // Breadcrumbs +$breadcrumb-font-size: null !default; + $breadcrumb-padding-y: .75rem !default; $breadcrumb-padding-x: 1rem !default; $breadcrumb-item-padding: .5rem !default; @@ -1069,8 +1089,8 @@ $carousel-caption-color: $white !default; $carousel-control-icon-width: 20px !default; -$carousel-control-prev-icon-bg: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3e%3c/svg%3e"), "#", "%23") !default; -$carousel-control-next-icon-bg: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3e%3c/svg%3e"), "#", "%23") !default; +$carousel-control-prev-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' width='8' height='8' viewBox='0 0 8 8'><path d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/></svg>") !default; +$carousel-control-next-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' width='8' height='8' viewBox='0 0 8 8'><path d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/></svg>") !default; $carousel-transition-duration: .6s !default; $carousel-transition: transform $carousel-transition-duration ease-in-out !default; // Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`) diff --git a/external/bootstrap4/scss/bootstrap-grid.scss b/external/bootstrap4/scss/bootstrap-grid.scss index d5f92a16ac..33e1376b36 100644 --- a/external/bootstrap4/scss/bootstrap-grid.scss +++ b/external/bootstrap4/scss/bootstrap-grid.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap Grid v4.3.1 (https://getbootstrap.com/) + * Bootstrap Grid v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors * Copyright 2011-2019 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) diff --git a/external/bootstrap4/scss/bootstrap-reboot.scss b/external/bootstrap4/scss/bootstrap-reboot.scss index 2983f3f6df..5dd6f846b4 100644 --- a/external/bootstrap4/scss/bootstrap-reboot.scss +++ b/external/bootstrap4/scss/bootstrap-reboot.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) + * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors * Copyright 2011-2019 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) diff --git a/external/bootstrap4/scss/bootstrap.scss b/external/bootstrap4/scss/bootstrap.scss index db1931e85d..eb139b6c34 100644 --- a/external/bootstrap4/scss/bootstrap.scss +++ b/external/bootstrap4/scss/bootstrap.scss @@ -1,5 +1,5 @@ /*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) + * Bootstrap v4.4.1 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors * Copyright 2011-2019 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) diff --git a/external/bootstrap4/scss/custom/_bootswatch.scss b/external/bootstrap4/scss/custom/_bootswatch.scss index 86f0216990..c998c2a9a6 100644 --- a/external/bootstrap4/scss/custom/_bootswatch.scss +++ b/external/bootstrap4/scss/custom/_bootswatch.scss @@ -1,4 +1,4 @@ -/* Custom 4.3.1 */ +/* Custom 4.4.1 */ // Bootswatch diff --git a/external/bootstrap4/scss/custom/_variables.scss b/external/bootstrap4/scss/custom/_variables.scss index 5cf118f033..5d3135cd95 100644 --- a/external/bootstrap4/scss/custom/_variables.scss +++ b/external/bootstrap4/scss/custom/_variables.scss @@ -3,10 +3,7 @@ // Variables should follow the `$component-state-property-size` formula for // consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs. - -// // Color system -// $white: #fff !default; $gray-100: #f8f9fa !default; @@ -37,7 +34,6 @@ $grays: map-merge( $grays ); - $blue: #007bff !default; $indigo: #6610f2 !default; $purple: #6f42c1 !default; @@ -105,18 +101,31 @@ $yiq-contrasted-threshold: 150 !default; $yiq-text-dark: $gray-900 !default; $yiq-text-light: $white !default; +// Characters which are escaped by the escape-svg function +$escaped-characters: ( + ("<","%3c"), + (">","%3e"), + ("#","%23"), +) !default; + + // Options // // Quickly modify global styling by enabling or disabling optional features. -$enable-caret: true !default; -$enable-rounded: true !default; -$enable-shadows: false !default; -$enable-gradients: false !default; -$enable-transitions: true !default; -$enable-hover-media-query: false !default; // Deprecated, no longer affects any compiled CSS -$enable-grid-classes: true !default; -$enable-print-styles: true !default; +$enable-caret: true !default; +$enable-rounded: true !default; +$enable-shadows: false !default; +$enable-gradients: false !default; +$enable-transitions: true !default; +$enable-prefers-reduced-motion-media-query: true !default; +$enable-hover-media-query: false !default; // Deprecated, no longer affects any compiled CSS +$enable-grid-classes: true !default; +$enable-pointer-cursor-for-buttons: true !default; +$enable-print-styles: true !default; +$enable-responsive-font-sizes: false !default; +$enable-validation-icons: true !default; +$enable-deprecation-messages: true !default; // Spacing @@ -154,6 +163,7 @@ $sizes: map-merge( $sizes ); + // Body // // Settings for the `<body>` element. @@ -161,14 +171,17 @@ $sizes: map-merge( $body-bg: $white !default; $body-color: $gray-900 !default; + // Links // // Style anchor elements. -$link-color: theme-color("primary") !default; -$link-decoration: none !default; -$link-hover-color: darken($link-color, 15%) !default; -$link-hover-decoration: underline !default; +$link-color: theme-color("primary") !default; +$link-decoration: none !default; +$link-hover-color: darken($link-color, 15%) !default; +$link-hover-decoration: underline !default; +// Darken percentage for links with `.text-*` class (e.g. `.text-success`) +$emphasized-link-hover-darken-percentage: 15% !default; // Paragraphs // @@ -191,7 +204,7 @@ $grid-breakpoints: ( ) !default; @include _assert-ascending($grid-breakpoints, "$grid-breakpoints"); -@include _assert-starts-at-zero($grid-breakpoints); +@include _assert-starts-at-zero($grid-breakpoints, "$grid-breakpoints"); // Grid containers @@ -214,6 +227,8 @@ $container-max-widths: ( $grid-columns: 12 !default; $grid-gutter-width: 30px !default; +$grid-row-columns: 6 !default; + // Components // @@ -229,6 +244,8 @@ $border-radius: .25rem !default; $border-radius-lg: .3rem !default; $border-radius-sm: .2rem !default; +$rounded-pill: 50rem !default; + $box-shadow-sm: 0 .125rem .25rem rgba($black, .075) !default; $box-shadow: 0 .5rem 1rem rgba($black, .15) !default; $box-shadow-lg: 0 1rem 3rem rgba($black, .175) !default; @@ -237,29 +254,44 @@ $component-active-color: $white !default; $component-active-bg: theme-color("primary") !default; $caret-width: .3em !default; +$caret-vertical-align: $caret-width * .85 !default; +$caret-spacing: $caret-width * .85 !default; $transition-base: all .2s ease-in-out !default; $transition-fade: opacity .15s linear !default; $transition-collapse: height .35s ease !default; +$embed-responsive-aspect-ratios: () !default; +// stylelint-disable-next-line scss/dollar-variable-default +$embed-responsive-aspect-ratios: join( + ( + (21 9), + (16 9), + (4 3), + (1 1), + ), + $embed-responsive-aspect-ratios +); -// Fonts +// Typography // // Font, line-height, and color for body text, headings, and more. // stylelint-disable value-keyword-case -$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default; +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default; $font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default; $font-family-base: $font-family-sans-serif !default; // stylelint-enable value-keyword-case $font-size-base: 1rem !default; // Assumes the browser default, typically `16px` -$font-size-lg: ($font-size-base * 1.25) !default; -$font-size-sm: ($font-size-base * .875) !default; +$font-size-lg: $font-size-base * 1.25 !default; +$font-size-sm: $font-size-base * .875 !default; +$font-weight-lighter: lighter !default; $font-weight-light: 300 !default; $font-weight-normal: 400 !default; $font-weight-bold: 700 !default; +$font-weight-bolder: bolder !default; $font-weight-base: $font-weight-normal !default; $line-height-base: 1.5 !default; @@ -271,11 +303,11 @@ $h4-font-size: $font-size-base * 1.5 !default; $h5-font-size: $font-size-base * 1.25 !default; $h6-font-size: $font-size-base !default; -$headings-margin-bottom: ($spacer / 2) !default; -$headings-font-family: inherit !default; +$headings-margin-bottom: $spacer / 2 !default; +$headings-font-family: null !default; $headings-font-weight: 500 !default; $headings-line-height: 1.2 !default; -$headings-color: inherit !default; +$headings-color: null !default; $display1-size: 6rem !default; $display2-size: 5.5rem !default; @@ -288,7 +320,7 @@ $display3-weight: 300 !default; $display4-weight: 300 !default; $display-line-height: $headings-line-height !default; -$lead-font-size: ($font-size-base * 1.25) !default; +$lead-font-size: $font-size-base * 1.25 !default; $lead-font-weight: 300 !default; $small-font-size: 80% !default; @@ -296,7 +328,8 @@ $small-font-size: 80% !default; $text-muted: $gray-600 !default; $blockquote-small-color: $gray-600 !default; -$blockquote-font-size: ($font-size-base * 1.25) !default; +$blockquote-small-font-size: $small-font-size !default; +$blockquote-font-size: $font-size-base * 1.25 !default; $hr-border-color: rgba($black, .1) !default; $hr-border-width: $border-width !default; @@ -322,33 +355,42 @@ $hr-margin-y: $spacer !default; $table-cell-padding: .75rem !default; $table-cell-padding-sm: .3rem !default; -$table-bg: transparent !default; +$table-color: $body-color !default; +$table-bg: null !default; $table-accent-bg: rgba($black, .05) !default; +$table-hover-color: $table-color !default; $table-hover-bg: rgba($black, .075) !default; $table-active-bg: $table-hover-bg !default; $table-border-width: $border-width !default; -$table-border-color: $gray-300 !default; +$table-border-color: $border-color !default; $table-head-bg: $gray-200 !default; $table-head-color: $gray-700 !default; -$table-dark-bg: $gray-900 !default; +$table-dark-color: $white !default; +$table-dark-bg: $gray-800 !default; $table-dark-accent-bg: rgba($white, .05) !default; +$table-dark-hover-color: $table-dark-color !default; $table-dark-hover-bg: rgba($white, .075) !default; -$table-dark-border-color: lighten($gray-900, 7.5%) !default; -$table-dark-color: $body-bg !default; +$table-dark-border-color: lighten($table-dark-bg, 7.5%) !default; $table-striped-order: odd !default; $table-caption-color: $text-muted !default; +$table-bg-level: -9 !default; +$table-border-level: -6 !default; + + // Buttons + Forms // // Shared variables that are reassigned to `$input-` and `$btn-` specific variables. $input-btn-padding-y: .375rem !default; $input-btn-padding-x: .75rem !default; +$input-btn-font-family: null !default; +$input-btn-font-size: $font-size-base !default; $input-btn-line-height: $line-height-base !default; $input-btn-focus-width: .2rem !default; @@ -357,10 +399,12 @@ $input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-colo $input-btn-padding-y-sm: .25rem !default; $input-btn-padding-x-sm: .5rem !default; +$input-btn-font-size-sm: $font-size-sm !default; $input-btn-line-height-sm: $line-height-sm !default; $input-btn-padding-y-lg: .5rem !default; $input-btn-padding-x-lg: 1rem !default; +$input-btn-font-size-lg: $font-size-lg !default; $input-btn-line-height-lg: $line-height-lg !default; $input-btn-border-width: $border-width !default; @@ -372,14 +416,19 @@ $input-btn-border-width: $border-width !default; $btn-padding-y: $input-btn-padding-y !default; $btn-padding-x: $input-btn-padding-x !default; +$btn-font-family: $input-btn-font-family !default; +$btn-font-size: $input-btn-font-size !default; $btn-line-height: $input-btn-line-height !default; +$btn-white-space: null !default; // Set to `nowrap` to prevent text wrapping $btn-padding-y-sm: $input-btn-padding-y-sm !default; $btn-padding-x-sm: $input-btn-padding-x-sm !default; +$btn-font-size-sm: $input-btn-font-size-sm !default; $btn-line-height-sm: $input-btn-line-height-sm !default; $btn-padding-y-lg: $input-btn-padding-y-lg !default; $btn-padding-x-lg: $input-btn-padding-x-lg !default; +$btn-font-size-lg: $input-btn-font-size-lg !default; $btn-line-height-lg: $input-btn-line-height-lg !default; $btn-border-width: $input-btn-border-width !default; @@ -409,14 +458,19 @@ $label-margin-bottom: .5rem !default; $input-padding-y: $input-btn-padding-y !default; $input-padding-x: $input-btn-padding-x !default; +$input-font-family: $input-btn-font-family !default; +$input-font-size: $input-btn-font-size !default; +$input-font-weight: $font-weight-base !default; $input-line-height: $input-btn-line-height !default; $input-padding-y-sm: $input-btn-padding-y-sm !default; $input-padding-x-sm: $input-btn-padding-x-sm !default; +$input-font-size-sm: $input-btn-font-size-sm !default; $input-line-height-sm: $input-btn-line-height-sm !default; $input-padding-y-lg: $input-btn-padding-y-lg !default; $input-padding-x-lg: $input-btn-padding-x-lg !default; +$input-font-size-lg: $input-btn-font-size-lg !default; $input-line-height-lg: $input-btn-line-height-lg !default; $input-bg: $white !default; @@ -442,14 +496,13 @@ $input-plaintext-color: $body-color !default; $input-height-border: $input-border-width * 2 !default; -$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default; -$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default; - -$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default; -$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default; +$input-height-inner: add($input-line-height * 1em, $input-padding-y * 2) !default; +$input-height-inner-half: add($input-line-height * .5em, $input-padding-y) !default; +$input-height-inner-quarter: add($input-line-height * .25em, $input-padding-y / 2) !default; -$input-height-inner-lg: ($font-size-lg * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default; -$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default; +$input-height: add($input-line-height * 1em, add($input-padding-y * 2, $input-height-border, false)) !default; +$input-height-sm: add($input-line-height-sm * 1em, add($input-padding-y-sm * 2, $input-height-border, false)) !default; +$input-height-lg: add($input-line-height-lg * 1em, add($input-padding-y-lg * 2, $input-height-border, false)) !default; $input-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; @@ -462,6 +515,7 @@ $form-check-input-margin-x: .25rem !default; $form-check-inline-margin-x: .75rem !default; $form-check-inline-input-margin-x: .3125rem !default; +$form-grid-gutter-width: 10px !default; $form-group-margin-bottom: 1rem !default; $input-group-addon-color: $input-color !default; @@ -470,64 +524,91 @@ $input-group-addon-border-color: $input-border-color !default; $custom-forms-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !default; -$custom-control-gutter: 1.5rem !default; +$custom-control-gutter: .5rem !default; $custom-control-spacer-x: 1rem !default; +$custom-control-cursor: null !default; $custom-control-indicator-size: 1rem !default; -$custom-control-indicator-bg: $gray-300 !default; +$custom-control-indicator-bg: $input-bg !default; + $custom-control-indicator-bg-size: 50% 50% !default; -$custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black, .1) !default; +$custom-control-indicator-box-shadow: $input-box-shadow !default; +$custom-control-indicator-border-color: $gray-500 !default; +$custom-control-indicator-border-width: $input-border-width !default; + +$custom-control-label-color: null !default; -$custom-control-indicator-disabled-bg: $gray-200 !default; +$custom-control-indicator-disabled-bg: $input-disabled-bg !default; $custom-control-label-disabled-color: $gray-600 !default; $custom-control-indicator-checked-color: $component-active-color !default; $custom-control-indicator-checked-bg: $component-active-bg !default; $custom-control-indicator-checked-disabled-bg: rgba(theme-color("primary"), .5) !default; $custom-control-indicator-checked-box-shadow: none !default; +$custom-control-indicator-checked-border-color: $custom-control-indicator-checked-bg !default; -$custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, $input-btn-focus-box-shadow !default; +$custom-control-indicator-focus-box-shadow: $input-focus-box-shadow !default; +$custom-control-indicator-focus-border-color: $input-focus-border-color !default; $custom-control-indicator-active-color: $component-active-color !default; $custom-control-indicator-active-bg: lighten($component-active-bg, 35%) !default; $custom-control-indicator-active-box-shadow: none !default; +$custom-control-indicator-active-border-color: $custom-control-indicator-active-bg !default; $custom-checkbox-indicator-border-radius: $border-radius !default; -$custom-checkbox-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"), "#", "%23") !default; +$custom-checkbox-indicator-icon-checked: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><path fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/></svg>") !default; -$custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default; -$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default; -$custom-checkbox-indicator-icon-indeterminate: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E"), "#", "%23") !default; -$custom-checkbox-indicator-indeterminate-box-shadow: none !default; +$custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default; +$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default; +$custom-checkbox-indicator-icon-indeterminate: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'><path stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/></svg>") !default; +$custom-checkbox-indicator-indeterminate-box-shadow: none !default; +$custom-checkbox-indicator-indeterminate-border-color: $custom-checkbox-indicator-indeterminate-bg !default; $custom-radio-indicator-border-radius: 50% !default; -$custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E"), "#", "%23") !default; +$custom-radio-indicator-icon-checked: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'><circle r='3' fill='#{$custom-control-indicator-checked-color}'/></svg>") !default; + +$custom-switch-width: $custom-control-indicator-size * 1.75 !default; +$custom-switch-indicator-border-radius: $custom-control-indicator-size / 2 !default; +$custom-switch-indicator-size: subtract($custom-control-indicator-size, $custom-control-indicator-border-width * 4) !default; -$custom-select-padding-y: .375rem !default; -$custom-select-padding-x: .75rem !default; +$custom-select-padding-y: $input-padding-y !default; +$custom-select-padding-x: $input-padding-x !default; +$custom-select-font-family: $input-font-family !default; +$custom-select-font-size: $input-font-size !default; $custom-select-height: $input-height !default; $custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator -$custom-select-line-height: $input-btn-line-height !default; +$custom-select-font-weight: $input-font-weight !default; +$custom-select-line-height: $input-line-height !default; $custom-select-color: $input-color !default; $custom-select-disabled-color: $gray-600 !default; $custom-select-bg: $input-bg !default; $custom-select-disabled-bg: $gray-200 !default; $custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions $custom-select-indicator-color: $gray-800 !default; -$custom-select-indicator: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E"), "#", "%23") !default; -$custom-select-border-width: $input-btn-border-width !default; +$custom-select-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'><path fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") !default; +$custom-select-background: escape-svg($custom-select-indicator) no-repeat right $custom-select-padding-x center / $custom-select-bg-size !default; // Used so we can have multiple background elements (e.g., arrow and feedback icon) + +$custom-select-feedback-icon-padding-right: add(1em * .75, (2 * $custom-select-padding-y * .75) + $custom-select-padding-x + $custom-select-indicator-padding) !default; +$custom-select-feedback-icon-position: center right ($custom-select-padding-x + $custom-select-indicator-padding) !default; +$custom-select-feedback-icon-size: $input-height-inner-half $input-height-inner-half !default; + +$custom-select-border-width: $input-border-width !default; $custom-select-border-color: $input-border-color !default; $custom-select-border-radius: $border-radius !default; $custom-select-box-shadow: inset 0 1px 2px rgba($black, .075) !default; $custom-select-focus-border-color: $input-focus-border-color !default; -$custom-select-focus-width: $input-btn-focus-width !default; -$custom-select-focus-box-shadow: 0 0 0 $custom-select-focus-width rgba($custom-select-focus-border-color, .5) !default; +$custom-select-focus-width: $input-focus-width !default; +$custom-select-focus-box-shadow: 0 0 0 $custom-select-focus-width $input-btn-focus-color !default; -$custom-select-font-size-sm: 75% !default; +$custom-select-padding-y-sm: $input-padding-y-sm !default; +$custom-select-padding-x-sm: $input-padding-x-sm !default; +$custom-select-font-size-sm: $input-font-size-sm !default; $custom-select-height-sm: $input-height-sm !default; -$custom-select-font-size-lg: 125% !default; +$custom-select-padding-y-lg: $input-padding-y-lg !default; +$custom-select-padding-x-lg: $input-padding-x-lg !default; +$custom-select-font-size-lg: $input-font-size-lg !default; $custom-select-height-lg: $input-height-lg !default; $custom-range-track-width: 100% !default; @@ -543,22 +624,25 @@ $custom-range-thumb-bg: $component-active-bg !default; $custom-range-thumb-border: 0 !default; $custom-range-thumb-border-radius: 1rem !default; $custom-range-thumb-box-shadow: 0 .1rem .25rem rgba($black, .1) !default; -$custom-range-thumb-focus-box-shadow: 0 0 0 1px $body-bg, $input-btn-focus-box-shadow !default; -$custom-range-thumb-focus-box-shadow-width: $input-btn-focus-width !default; // For focus box shadow issue in IE/Edge +$custom-range-thumb-focus-box-shadow: 0 0 0 1px $body-bg, $input-focus-box-shadow !default; +$custom-range-thumb-focus-box-shadow-width: $input-focus-width !default; // For focus box shadow issue in IE/Edge $custom-range-thumb-active-bg: lighten($component-active-bg, 35%) !default; +$custom-range-thumb-disabled-bg: $gray-500 !default; $custom-file-height: $input-height !default; $custom-file-height-inner: $input-height-inner !default; $custom-file-focus-border-color: $input-focus-border-color !default; -$custom-file-focus-box-shadow: $input-btn-focus-box-shadow !default; +$custom-file-focus-box-shadow: $input-focus-box-shadow !default; $custom-file-disabled-bg: $input-disabled-bg !default; -$custom-file-padding-y: $input-btn-padding-y !default; -$custom-file-padding-x: $input-btn-padding-x !default; -$custom-file-line-height: $input-btn-line-height !default; +$custom-file-padding-y: $input-padding-y !default; +$custom-file-padding-x: $input-padding-x !default; +$custom-file-line-height: $input-line-height !default; +$custom-file-font-family: $input-font-family !default; +$custom-file-font-weight: $input-font-weight !default; $custom-file-color: $input-color !default; $custom-file-bg: $input-bg !default; -$custom-file-border-width: $input-btn-border-width !default; +$custom-file-border-width: $input-border-width !default; $custom-file-border-color: $input-border-color !default; $custom-file-border-radius: $input-border-radius !default; $custom-file-box-shadow: $input-box-shadow !default; @@ -570,40 +654,32 @@ $custom-file-text: ( // Form validation + $form-feedback-margin-top: $form-text-margin-top !default; $form-feedback-font-size: $small-font-size !default; $form-feedback-valid-color: theme-color("success") !default; $form-feedback-invalid-color: theme-color("danger") !default; +$form-feedback-icon-valid-color: $form-feedback-valid-color !default; +$form-feedback-icon-valid: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'><path fill='#{$form-feedback-icon-valid-color}' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/></svg>") !default; +$form-feedback-icon-invalid-color: $form-feedback-invalid-color !default; +$form-feedback-icon-invalid: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='#{$form-feedback-icon-invalid-color}' viewBox='0 0 12 12'><circle cx='6' cy='6' r='4.5'/><path stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/><circle cx='6' cy='8.2' r='.6' fill='#{$form-feedback-icon-invalid-color}' stroke='none'/></svg>") !default; -// Dropdowns -// -// Dropdown menu container and contents. - -$dropdown-min-width: 10rem !default; -$dropdown-padding-y: .5rem !default; -$dropdown-spacer: .125rem !default; -$dropdown-bg: $white !default; -$dropdown-border-color: rgba($black, .15) !default; -$dropdown-border-radius: $border-radius !default; -$dropdown-border-width: $border-width !default; -$dropdown-divider-bg: $gray-200 !default; -$dropdown-box-shadow: 0 .5rem 1rem rgba($black, .175) !default; - -$dropdown-link-color: $gray-900 !default; -$dropdown-link-hover-color: darken($gray-900, 5%) !default; -$dropdown-link-hover-bg: $gray-100 !default; - -$dropdown-link-active-color: $component-active-color !default; -$dropdown-link-active-bg: $component-active-bg !default; - -$dropdown-link-disabled-color: $gray-600 !default; - -$dropdown-item-padding-y: .25rem !default; -$dropdown-item-padding-x: 1.5rem !default; - -$dropdown-header-color: $gray-600 !default; - +$form-validation-states: () !default; +// stylelint-disable-next-line scss/dollar-variable-default +$form-validation-states: map-merge( + ( + "valid": ( + "color": $form-feedback-valid-color, + "icon": $form-feedback-icon-valid + ), + "invalid": ( + "color": $form-feedback-invalid-color, + "icon": $form-feedback-icon-invalid + ), + ), + $form-validation-states +); // Z-index master list // @@ -618,6 +694,7 @@ $zindex-modal: 1050 !default; $zindex-popover: 1060 !default; $zindex-tooltip: 1070 !default; + // Navs $nav-link-padding-y: .5rem !default; @@ -637,18 +714,19 @@ $nav-pills-link-active-color: $component-active-color !default; $nav-pills-link-active-bg: $component-active-bg !default; $nav-divider-color: $gray-200 !default; -$nav-divider-margin-y: ($spacer / 2) !default; +$nav-divider-margin-y: $spacer / 2 !default; + // Navbar -$navbar-padding-y: ($spacer / 2) !default; +$navbar-padding-y: $spacer / 2 !default; $navbar-padding-x: $spacer !default; $navbar-nav-link-padding-x: .5rem !default; $navbar-brand-font-size: $font-size-lg !default; // Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link -$nav-link-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default; +$nav-link-height: $font-size-base * $line-height-base + $nav-link-padding-y * 2 !default; $navbar-brand-height: $navbar-brand-font-size * $line-height-base !default; $navbar-brand-padding-y: ($nav-link-height - $navbar-brand-height) / 2 !default; @@ -661,16 +739,55 @@ $navbar-dark-color: rgba($white, .5) !default; $navbar-dark-hover-color: rgba($white, .75) !default; $navbar-dark-active-color: $white !default; $navbar-dark-disabled-color: rgba($white, .25) !default; -$navbar-dark-toggler-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"), "#", "%23") !default; +$navbar-dark-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><path stroke='#{$navbar-dark-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>") !default; $navbar-dark-toggler-border-color: rgba($white, .1) !default; $navbar-light-color: rgba($black, .5) !default; $navbar-light-hover-color: rgba($black, .7) !default; $navbar-light-active-color: rgba($black, .9) !default; $navbar-light-disabled-color: rgba($black, .3) !default; -$navbar-light-toggler-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"), "#", "%23") !default; +$navbar-light-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><path stroke='#{$navbar-light-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>") !default; $navbar-light-toggler-border-color: rgba($black, .1) !default; +$navbar-light-brand-color: $navbar-light-active-color !default; +$navbar-light-brand-hover-color: $navbar-light-active-color !default; +$navbar-dark-brand-color: $navbar-dark-active-color !default; +$navbar-dark-brand-hover-color: $navbar-dark-active-color !default; + + +// Dropdowns +// +// Dropdown menu container and contents. + +$dropdown-min-width: 10rem !default; +$dropdown-padding-y: .5rem !default; +$dropdown-spacer: .125rem !default; +$dropdown-font-size: $font-size-base !default; +$dropdown-color: $body-color !default; +$dropdown-bg: $white !default; +$dropdown-border-color: rgba($black, .15) !default; +$dropdown-border-radius: $border-radius !default; +$dropdown-border-width: $border-width !default; +$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width) !default; +$dropdown-divider-bg: $gray-200 !default; +$dropdown-divider-margin-y: $nav-divider-margin-y !default; +$dropdown-box-shadow: 0 .5rem 1rem rgba($black, .175) !default; + +$dropdown-link-color: $gray-900 !default; +$dropdown-link-hover-color: darken($gray-900, 5%) !default; +$dropdown-link-hover-bg: $gray-100 !default; + +$dropdown-link-active-color: $component-active-color !default; +$dropdown-link-active-bg: $component-active-bg !default; + +$dropdown-link-disabled-color: $gray-600 !default; + +$dropdown-item-padding-y: .25rem !default; +$dropdown-item-padding-x: 1.5rem !default; + +$dropdown-header-color: $gray-600 !default; + + // Pagination $pagination-padding-y: .5rem !default; @@ -705,6 +822,7 @@ $pagination-disabled-border-color: $gray-300 !default; // Jumbotron $jumbotron-padding: 2rem !default; +$jumbotron-color: null !default; $jumbotron-bg: $gray-200 !default; @@ -715,13 +833,16 @@ $card-spacer-x: 1.25rem !default; $card-border-width: $border-width !default; $card-border-radius: $border-radius !default; $card-border-color: rgba($black, .125) !default; -$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default; +$card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default; $card-cap-bg: rgba($black, .03) !default; +$card-cap-color: null !default; +$card-height: null !default; +$card-color: null !default; $card-bg: $white !default; $card-img-overlay-padding: 1.25rem !default; -$card-group-margin: ($grid-gutter-width / 2) !default; +$card-group-margin: $grid-gutter-width / 2 !default; $card-deck-margin: $card-group-margin !default; $card-columns-count: 3 !default; @@ -745,6 +866,14 @@ $tooltip-arrow-width: .8rem !default; $tooltip-arrow-height: .4rem !default; $tooltip-arrow-color: $tooltip-bg !default; +// Form tooltips must come after regular tooltips +$form-feedback-tooltip-padding-y: $tooltip-padding-y !default; +$form-feedback-tooltip-padding-x: $tooltip-padding-x !default; +$form-feedback-tooltip-font-size: $tooltip-font-size !default; +$form-feedback-tooltip-line-height: $line-height-base !default; +$form-feedback-tooltip-opacity: $tooltip-opacity !default; +$form-feedback-tooltip-border-radius: $tooltip-border-radius !default; + // Popovers @@ -754,6 +883,7 @@ $popover-max-width: 276px !default; $popover-border-width: $border-width !default; $popover-border-color: rgba($black, .2) !default; $popover-border-radius: $border-radius-lg !default; +$popover-inner-border-radius: subtract($popover-border-radius, $popover-border-width) !default; $popover-box-shadow: 0 .25rem .5rem rgba($black, .2) !default; $popover-header-bg: darken($popover-bg, 3%) !default; @@ -772,6 +902,24 @@ $popover-arrow-color: $popover-bg !default; $popover-arrow-outer-color: fade-in($popover-border-color, .05) !default; +// Toasts + +$toast-max-width: 350px !default; +$toast-padding-x: .75rem !default; +$toast-padding-y: .25rem !default; +$toast-font-size: .875rem !default; +$toast-color: null !default; +$toast-background-color: rgba($white, .85) !default; +$toast-border-width: 1px !default; +$toast-border-color: rgba(0, 0, 0, .1) !default; +$toast-border-radius: .25rem !default; +$toast-box-shadow: 0 .25rem .75rem rgba($black, .1) !default; + +$toast-header-color: $gray-600 !default; +$toast-header-background-color: rgba($white, .85) !default; +$toast-header-border-color: rgba(0, 0, 0, .05) !default; + + // Badges $badge-font-size: 75% !default; @@ -780,6 +928,9 @@ $badge-padding-y: .25em !default; $badge-padding-x: .4em !default; $badge-border-radius: $border-radius !default; +$badge-transition: $btn-transition !default; +$badge-focus-width: $input-btn-focus-width !default; + $badge-pill-padding-x: .6em !default; // Use a higher than normal value to ensure completely rounded edges when // customizing padding or font-size on labels. @@ -791,31 +942,42 @@ $badge-pill-border-radius: 10rem !default; // Padding applied to the modal body $modal-inner-padding: 1rem !default; +// Margin between elements in footer, must be lower than or equal to 2 * $modal-inner-padding +$modal-footer-margin-between: .5rem !default; + $modal-dialog-margin: .5rem !default; $modal-dialog-margin-y-sm-up: 1.75rem !default; $modal-title-line-height: $line-height-base !default; +$modal-content-color: null !default; $modal-content-bg: $white !default; $modal-content-border-color: rgba($black, .2) !default; $modal-content-border-width: $border-width !default; $modal-content-border-radius: $border-radius-lg !default; +$modal-content-inner-border-radius: subtract($modal-content-border-radius, $modal-content-border-width) !default; $modal-content-box-shadow-xs: 0 .25rem .5rem rgba($black, .5) !default; $modal-content-box-shadow-sm-up: 0 .5rem 1rem rgba($black, .5) !default; $modal-backdrop-bg: $black !default; $modal-backdrop-opacity: .5 !default; -$modal-header-border-color: $gray-200 !default; +$modal-header-border-color: $border-color !default; $modal-footer-border-color: $modal-header-border-color !default; $modal-header-border-width: $modal-content-border-width !default; $modal-footer-border-width: $modal-header-border-width !default; -$modal-header-padding: 1rem !default; +$modal-header-padding-y: 1rem !default; +$modal-header-padding-x: 1rem !default; +$modal-header-padding: $modal-header-padding-y $modal-header-padding-x !default; // Keep this for backwards compatibility +$modal-xl: 1140px !default; $modal-lg: 800px !default; $modal-md: 500px !default; $modal-sm: 300px !default; +$modal-fade-transform: translate(0, -50px) !default; +$modal-show-transform: none !default; $modal-transition: transform .3s ease-out !default; +$modal-scale-transform: scale(1.02) !default; // Alerts @@ -837,7 +999,7 @@ $alert-color-level: 6 !default; // Progress bars $progress-height: 1rem !default; -$progress-font-size: ($font-size-base * .75) !default; +$progress-font-size: $font-size-base * .75 !default; $progress-bg: $gray-200 !default; $progress-border-radius: $border-radius !default; $progress-box-shadow: inset 0 .1rem .1rem rgba($black, .1) !default; @@ -846,8 +1008,10 @@ $progress-bar-bg: theme-color("primary") !default; $progress-bar-animation-timing: 1s linear infinite !default; $progress-bar-transition: width .6s ease !default; + // List group +$list-group-color: null !default; $list-group-bg: $white !default; $list-group-border-color: rgba($black, .125) !default; $list-group-border-width: $border-width !default; @@ -889,6 +1053,8 @@ $figure-caption-color: $gray-600 !default; // Breadcrumbs +$breadcrumb-font-size: null !default; + $breadcrumb-padding-y: .75rem !default; $breadcrumb-padding-x: 1rem !default; $breadcrumb-item-padding: .5rem !default; @@ -905,24 +1071,40 @@ $breadcrumb-border-radius: $border-radius !default; // Carousel -$carousel-control-color: $white !default; -$carousel-control-width: 15% !default; -$carousel-control-opacity: .5 !default; +$carousel-control-color: $white !default; +$carousel-control-width: 15% !default; +$carousel-control-opacity: .5 !default; +$carousel-control-hover-opacity: .9 !default; +$carousel-control-transition: opacity .15s ease !default; + +$carousel-indicator-width: 30px !default; +$carousel-indicator-height: 3px !default; +$carousel-indicator-hit-area-height: 10px !default; +$carousel-indicator-spacer: 3px !default; +$carousel-indicator-active-bg: $white !default; +$carousel-indicator-transition: opacity .6s ease !default; + +$carousel-caption-width: 70% !default; +$carousel-caption-color: $white !default; + +$carousel-control-icon-width: 20px !default; -$carousel-indicator-width: 30px !default; -$carousel-indicator-height: 3px !default; -$carousel-indicator-spacer: 3px !default; -$carousel-indicator-active-bg: $white !default; +$carousel-control-prev-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' width='8' height='8' viewBox='0 0 8 8'><path d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/></svg>") !default; +$carousel-control-next-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' width='8' height='8' viewBox='0 0 8 8'><path d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/></svg>") !default; -$carousel-caption-width: 70% !default; -$carousel-caption-color: $white !default; +$carousel-transition-duration: .6s !default; +$carousel-transition: transform $carousel-transition-duration ease-in-out !default; // Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`) -$carousel-control-icon-width: 20px !default; -$carousel-control-prev-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"), "#", "%23") !default; -$carousel-control-next-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"), "#", "%23") !default; +// Spinners -$carousel-transition: transform .6s ease !default; // Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`) +$spinner-width: 2rem !default; +$spinner-height: $spinner-width !default; +$spinner-border-width: .25em !default; + +$spinner-width-sm: 1rem !default; +$spinner-height-sm: $spinner-width-sm !default; +$spinner-border-width-sm: .2em !default; // Close @@ -932,6 +1114,7 @@ $close-font-weight: $font-weight-bold !default; $close-color: $black !default; $close-text-shadow: 0 1px 0 $white !default; + // Code $code-font-size: 87.5% !default; @@ -947,6 +1130,14 @@ $pre-color: $gray-900 !default; $pre-scrollable-max-height: 340px !default; +// Utilities + +$displays: none, inline, inline-block, block, table, table-row, table-cell, flex, inline-flex !default; +$overflows: auto, hidden !default; +$positions: static, relative, absolute, fixed, sticky !default; + + // Printing + $print-page-size: a3 !default; $print-body-min-width: map-get($grid-breakpoints, "lg") !default; diff --git a/external/bootstrap4/scss/cyborg/_bootswatch.scss b/external/bootstrap4/scss/cyborg/_bootswatch.scss index a3f6e85fdb..9bc6b11c0e 100644 --- a/external/bootstrap4/scss/cyborg/_bootswatch.scss +++ b/external/bootstrap4/scss/cyborg/_bootswatch.scss @@ -233,14 +233,6 @@ legend { } } } - - &-light { - &, - & a, - & .alert-link { - color: $body-bg; - } - } } .badge { diff --git a/external/bootstrap4/scss/cyborg/_variables.scss b/external/bootstrap4/scss/cyborg/_variables.scss index 678373f6ff..49e34d7dcd 100644 --- a/external/bootstrap4/scss/cyborg/_variables.scss +++ b/external/bootstrap4/scss/cyborg/_variables.scss @@ -43,7 +43,7 @@ $yiq-contrasted-threshold: 175 !default; // Body $body-bg: #060606 !default; -$body-color: $gray-500 !default; +$body-color: $gray-400 !default; // Fonts @@ -61,6 +61,7 @@ $headings-color: $white !default; // Tables +$table-color: $white !default; $table-accent-bg: rgba($white,.05) !default; $table-hover-bg: rgba($white,.075) !default; @@ -68,7 +69,6 @@ $table-border-color: $gray-700 !default; $table-dark-bg: $gray-500 !default; $table-dark-border-color: darken($gray-500, 7.5%) !default; -$table-dark-color: $body-bg !default; // Buttons diff --git a/external/bootstrap4/scss/darkly/_bootswatch.scss b/external/bootstrap4/scss/darkly/_bootswatch.scss index 4eefa254b0..56e8b27239 100644 --- a/external/bootstrap4/scss/darkly/_bootswatch.scss +++ b/external/bootstrap4/scss/darkly/_bootswatch.scss @@ -15,9 +15,12 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Lato:400,700,400italic" } } -.bg-dark { - background-color: $success !important; - &.navbar-dark .navbar-nav { +.bg-light { + &.navbar { + background-color: $success !important; + } + + &.navbar-light .navbar-nav { .nav-link:focus, .nav-link:hover, .active > .nav-link { diff --git a/external/bootstrap4/scss/darkly/_variables.scss b/external/bootstrap4/scss/darkly/_variables.scss index 923462f304..bbafe56063 100644 --- a/external/bootstrap4/scss/darkly/_variables.scss +++ b/external/bootstrap4/scss/darkly/_variables.scss @@ -34,8 +34,8 @@ $success: $green !default; $info: $cyan !default; $warning: $yellow !default; $danger: $red !default; -$light: $gray-800 !default; -$dark: $gray-500 !default; +$light: $gray-600 !default; +$dark: $gray-800 !default; $yiq-contrasted-threshold: 175 !default; @@ -64,19 +64,15 @@ $table-accent-bg: $gray-800 !default; $table-border-color: $gray-700 !default; -$table-dark-bg: $gray-500 !default; -$table-dark-border-color: darken($gray-500, 7.5%) !default; -$table-dark-color: $body-bg !default; - // Forms -$input-border-color: transparent !default; +$input-border-color: $body-bg !default; $input-group-addon-color: $gray-500 !default; $input-group-addon-bg: $gray-700 !default; $custom-file-color: $gray-500 !default; -$custom-file-border-color: $gray-700 !default; +$custom-file-border-color: $body-bg !default; // Dropdowns @@ -102,11 +98,11 @@ $nav-tabs-link-active-border-color: $nav-tabs-border-color $nav-tabs-border-colo $navbar-padding-y: 1rem !default; -$navbar-dark-color: $white !default; -$navbar-dark-hover-color: $success !default; +$navbar-dark-color: rgba($white,.6) !default; +$navbar-dark-hover-color: $white !default; -$navbar-light-color: rgba($white,.5) !default; -$navbar-light-hover-color: $white !default; +$navbar-light-color: $white !default; +$navbar-light-hover-color: $success !default; $navbar-light-active-color: $white !default; $navbar-light-disabled-color: rgba($white,.3) !default; $navbar-light-toggler-border-color: rgba($white,.1) !default; diff --git a/external/bootstrap4/scss/litera/_bootswatch.scss b/external/bootstrap4/scss/litera/_bootswatch.scss index 05348ad457..36e07ce082 100644 --- a/external/bootstrap4/scss/litera/_bootswatch.scss +++ b/external/bootstrap4/scss/litera/_bootswatch.scss @@ -9,23 +9,23 @@ $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif !defa // Navbar ====================================================================== .navbar { - font-size: 0.875em; -} + font-size: $font-size-sm; -.bg-dark { - background-color: $success !important; -} + &.bg-dark { + background-color: $success !important; + } -.bg-light { - background-color: #fff !important; - border: 1px solid rgba(0, 0, 0, 0.1); + &.bg-light { + background-color: #fff !important; + border: 1px solid rgba(0, 0, 0, 0.1); - &.navbar-fixed-top { - border-width: 0 0 1px 0; - } + &.navbar-fixed-top { + border-width: 0 0 1px 0; + } - &.navbar-fixed-bottom { - border-width: 1px 0 0 0; + &.navbar-fixed-bottom { + border-width: 1px 0 0 0; + } } } @@ -33,8 +33,6 @@ $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif !defa .btn { border-radius: 1.078em; - font-family: $font-family-sans-serif; - font-size: 0.875em; &-lg { border-radius: 2.688em; @@ -42,14 +40,6 @@ $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif !defa &-sm { border-radius: 0.844em; - font-size: 0.688em; - } - - &-secondary, - &-secondary:hover, - &-warning, - &-warning:hover { - color: $white; } } @@ -64,7 +54,7 @@ blockquote { } footer { - font-size: 0.875em; + font-size: $font-size-sm; } .lead { @@ -76,7 +66,7 @@ footer { table, .table { - font-size: 0.875em; + font-size: $font-size-sm; &-primary, &-secondary, @@ -210,19 +200,18 @@ table, .nav, .breadcrumb, .pagination { - font-size: 0.875em; + font-size: $font-size-sm; } .dropdown-menu { - font-size: 0.875em; + font-size: $font-size-sm; } // Indicators ================================================================== .alert { - border: none; color: $white; - font-size: 0.875em; + font-size: $font-size-sm; &, p { font-family: $font-family-sans-serif; @@ -255,15 +244,6 @@ table, .badge { vertical-align: bottom; - - &-secondary, - &-warning { - color: $white; - } -} - -.tooltip { - font-size: 11px; } // Progress bars =============================================================== @@ -271,5 +251,5 @@ table, // Containers ================================================================== .list-group { - font-size: 0.875em; + font-size: $font-size-sm; } diff --git a/external/bootstrap4/scss/litera/_variables.scss b/external/bootstrap4/scss/litera/_variables.scss index c14427fcd9..7186229ba7 100644 --- a/external/bootstrap4/scss/litera/_variables.scss +++ b/external/bootstrap4/scss/litera/_variables.scss @@ -45,6 +45,8 @@ $body-color: $gray-800 !default; // Fonts +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default; + $font-size-base: 1.063rem !default; $headings-font-weight: 700 !default; @@ -58,6 +60,11 @@ $table-border-color: rgba(0,0,0,0.1) !default; $input-btn-padding-y: 0.5rem !default; $input-btn-padding-x: 1.1rem !default; +$btn-font-family: $font-family-sans-serif !default; +$btn-font-size: 0.875rem !default; + +$btn-font-size-sm: 0.688rem !default; + // Forms $input-border-color: rgba(0,0,0,.1) !default; @@ -72,8 +79,16 @@ $navbar-dark-hover-color: $white !default; $navbar-light-hover-color: $body-color !default; $navbar-light-active-color: $body-color !default; +// Tooltips + +$tooltip-font-size: 11px !default; + // Badges $badge-font-weight: normal !default; $badge-padding-y: 0.6em !default; $badge-padding-x: 1.2em !default; + +// Alerts + +$alert-border-width: 0 !default; diff --git a/external/bootstrap4/scss/lumen/_bootswatch.scss b/external/bootstrap4/scss/lumen/_bootswatch.scss index 8e3d757c15..b70ea0d9d5 100644 --- a/external/bootstrap4/scss/lumen/_bootswatch.scss +++ b/external/bootstrap4/scss/lumen/_bootswatch.scss @@ -123,6 +123,17 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400 color: #fff; } + &-hover tbody { + .table-primary:hover, + .table-success:hover, + .table-info:hover, + .table-warning:hover, + .table-danger:hover, + .table-dark:hover { + color: #fff; + } + } + &-primary { &, > th, > td { background-color: $primary; @@ -457,7 +468,7 @@ a.list-group-item { &.active { background-color: $warning; } - + &.active:hover, &.active:focus { background-color: darken($warning, 5%); @@ -468,7 +479,7 @@ a.list-group-item { &.active { background-color: $danger; } - + &.active:hover, &.active:focus { background-color: darken($danger, 5%); diff --git a/external/bootstrap4/scss/lux/_bootswatch.scss b/external/bootstrap4/scss/lux/_bootswatch.scss index bb5bd7ab51..1618e22352 100644 --- a/external/bootstrap4/scss/lux/_bootswatch.scss +++ b/external/bootstrap4/scss/lux/_bootswatch.scss @@ -128,6 +128,19 @@ th { // Forms ======================================================================= + +.custom-switch { + + .custom-control-label { + &::after { + top: calc(0.15625rem + 2px); + left: calc(-2.25rem + 2px); + width: calc(1rem - 4px); + height: calc(1rem - 4px); + } + } +} + // Navs ======================================================================== .dropdown-menu { @@ -137,6 +150,14 @@ th { // Indicators ================================================================== +.badge { + padding-top: 0.28rem; + + &-pill { + border-radius: 10rem; + } +} + // Progress bars =============================================================== // Containers ================================================================== diff --git a/external/bootstrap4/scss/lux/_variables.scss b/external/bootstrap4/scss/lux/_variables.scss index 7fa7358df4..d9842cc9b9 100644 --- a/external/bootstrap4/scss/lux/_variables.scss +++ b/external/bootstrap4/scss/lux/_variables.scss @@ -39,15 +39,19 @@ $dark: $gray-800 !default; $yiq-contrasted-threshold: 185 !default; +// Options + +$enable-rounded: false !default; + // Body -$body-color: $gray-600 !default; +$body-color: $gray-700 !default; // Components -$border-radius: 0 !default; -$border-radius-lg: 0 !default; -$border-radius-sm: 0 !default; +// $border-radius: 0 !default; +// $border-radius-lg: 0 !default; +// $border-radius-sm: 0 !default; // Fonts @@ -71,20 +75,20 @@ $table-border-color: rgba(0, 0, 0, 0.05) !default; // Buttons + Forms -$input-btn-border-width: 0 !default; +$input-btn-border-width: 0px !default; // Buttons $btn-line-height: 1.5rem !default; $input-btn-padding-y: 0.75rem !default; -$input-btn-padding-x: 2rem !default; +$input-btn-padding-x: 1.5rem !default; $input-btn-padding-y-sm: .5rem !default; $input-btn-padding-x-sm: 1rem !default; $input-btn-padding-y-lg: 2rem !default; -$input-btn-padding-x-lg: 3rem !default; +$input-btn-padding-x-lg: 2rem !default; $btn-font-weight: 600 !default; diff --git a/external/bootstrap4/scss/materia/_bootswatch.scss b/external/bootstrap4/scss/materia/_bootswatch.scss index 0657967fca..eb8edefb57 100644 --- a/external/bootstrap4/scss/materia/_bootswatch.scss +++ b/external/bootstrap4/scss/materia/_bootswatch.scss @@ -63,7 +63,10 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" &.bg-primary { input[type=text], - input[type=password] { + input[type=password], + input[type=email], + input[type=number], + input[type=tel] { color: #fff; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.5); @@ -268,7 +271,7 @@ input[type=number], [type=tel].form-control, [contenteditable].form-control { box-shadow: inset 0 -1px 0 #ddd; - transition: all 0.2s; + transition: box-shadow 0.2s; &:focus { box-shadow: inset 0 -2px 0 $primary; diff --git a/external/bootstrap4/scss/materia/_variables.scss b/external/bootstrap4/scss/materia/_variables.scss index 314e12938e..aadea7f542 100644 --- a/external/bootstrap4/scss/materia/_variables.scss +++ b/external/bootstrap4/scss/materia/_variables.scss @@ -63,7 +63,7 @@ $input-btn-padding-x: 1rem !default; $input-padding-y: 1rem !default; $input-padding-x: 0 !default; -$input-padding-y-sm: $font-size-base !default; +$input-padding-y-sm: 0 !default; $input-padding-x-sm: 0 !default; $input-padding-y-lg: ($font-size-base * 1.25) !default; @@ -96,6 +96,9 @@ $custom-control-indicator-disabled-bg: $gray-100 !default; $custom-radio-indicator-icon-checked: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='4' fill='%232196F3'/%3E%3C/svg%3E") !default; +$custom-select-border-radius: 0 !default; +$custom-select-box-shadow: none !default; + // Navs $nav-link-disabled-color: $gray-500 !default; diff --git a/external/bootstrap4/scss/mixins/_background-variant.scss b/external/bootstrap4/scss/mixins/_background-variant.scss index 494439d2b4..3ceb5c5639 100644 --- a/external/bootstrap4/scss/mixins/_background-variant.scss +++ b/external/bootstrap4/scss/mixins/_background-variant.scss @@ -2,16 +2,17 @@ // Contextual backgrounds -@mixin bg-variant($parent, $color) { +@mixin bg-variant($parent, $color, $ignore-warning: false) { #{$parent} { background-color: $color !important; } a#{$parent}, button#{$parent} { - @include hover-focus { + @include hover-focus() { background-color: darken($color, 10%) !important; } } + @include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning); } @mixin bg-gradient-variant($parent, $color) { diff --git a/external/bootstrap4/scss/mixins/_badge.scss b/external/bootstrap4/scss/mixins/_badge.scss index eeca0b40de..f1c499141a 100644 --- a/external/bootstrap4/scss/mixins/_badge.scss +++ b/external/bootstrap4/scss/mixins/_badge.scss @@ -2,11 +2,16 @@ color: color-yiq($bg); background-color: $bg; - &[href] { - @include hover-focus { + @at-root a#{&} { + @include hover-focus() { color: color-yiq($bg); - text-decoration: none; background-color: darken($bg, 10%); } + + &:focus, + &.focus { + outline: 0; + box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5); + } } } diff --git a/external/bootstrap4/scss/mixins/_buttons.scss b/external/bootstrap4/scss/mixins/_buttons.scss index eee903f83c..c82c4d6d09 100644 --- a/external/bootstrap4/scss/mixins/_buttons.scss +++ b/external/bootstrap4/scss/mixins/_buttons.scss @@ -9,7 +9,7 @@ border-color: $border; @include box-shadow($btn-box-shadow); - @include hover { + @include hover() { color: color-yiq($hover-background); @include gradient-bg($hover-background); border-color: $hover-border; @@ -17,6 +17,9 @@ &:focus, &.focus { + color: color-yiq($hover-background); + @include gradient-bg($hover-background); + border-color: $hover-border; // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5); @@ -62,7 +65,7 @@ color: $color; border-color: $color; - @include hover { + @include hover() { color: $color-hover; background-color: $active-background; border-color: $active-border; diff --git a/external/bootstrap4/scss/mixins/_caret.scss b/external/bootstrap4/scss/mixins/_caret.scss index 8ecef65b47..27466495b2 100644 --- a/external/bootstrap4/scss/mixins/_caret.scss +++ b/external/bootstrap4/scss/mixins/_caret.scss @@ -1,25 +1,25 @@ -@mixin caret-down { +@mixin caret-down() { border-top: $caret-width solid; border-right: $caret-width solid transparent; border-bottom: 0; border-left: $caret-width solid transparent; } -@mixin caret-up { +@mixin caret-up() { border-top: 0; border-right: $caret-width solid transparent; border-bottom: $caret-width solid; border-left: $caret-width solid transparent; } -@mixin caret-right { +@mixin caret-right() { border-top: $caret-width solid transparent; border-right: 0; border-bottom: $caret-width solid transparent; border-left: $caret-width solid; } -@mixin caret-left { +@mixin caret-left() { border-top: $caret-width solid transparent; border-right: $caret-width solid; border-bottom: $caret-width solid transparent; @@ -33,11 +33,11 @@ vertical-align: $caret-vertical-align; content: ""; @if $direction == down { - @include caret-down; + @include caret-down(); } @else if $direction == up { - @include caret-up; + @include caret-up(); } @else if $direction == right { - @include caret-right; + @include caret-right(); } } @@ -51,7 +51,7 @@ margin-right: $caret-spacing; vertical-align: $caret-vertical-align; content: ""; - @include caret-left; + @include caret-left(); } } diff --git a/external/bootstrap4/scss/mixins/_float.scss b/external/bootstrap4/scss/mixins/_float.scss index adff88e790..6b376a2580 100644 --- a/external/bootstrap4/scss/mixins/_float.scss +++ b/external/bootstrap4/scss/mixins/_float.scss @@ -1,14 +1,14 @@ // stylelint-disable declaration-no-important -@mixin float-left { +@mixin float-left() { float: left !important; @include deprecate("The `float-left` mixin", "v4.3.0", "v5"); } -@mixin float-right { +@mixin float-right() { float: right !important; @include deprecate("The `float-right` mixin", "v4.3.0", "v5"); } -@mixin float-none { +@mixin float-none() { float: none !important; @include deprecate("The `float-none` mixin", "v4.3.0", "v5"); } diff --git a/external/bootstrap4/scss/mixins/_forms.scss b/external/bootstrap4/scss/mixins/_forms.scss index ea8a91a024..418470d0b4 100644 --- a/external/bootstrap4/scss/mixins/_forms.scss +++ b/external/bootstrap4/scss/mixins/_forms.scss @@ -10,7 +10,7 @@ // // Example usage: change the default blue border and shadow to white for better // contrast against a dark gray background. -@mixin form-control-focus() { +@mixin form-control-focus($ignore-warning: false) { &:focus { color: $input-focus-color; background-color: $input-focus-bg; @@ -23,8 +23,23 @@ box-shadow: $input-focus-box-shadow; } } + @include deprecate("The `form-control-focus()` mixin", "v4.4.0", "v5", $ignore-warning); } +// This mixin uses an `if()` technique to be compatible with Dart Sass +// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details +@mixin form-validation-state-selector($state) { + @if ($state == "valid" or $state == "invalid") { + .was-validated #{if(&, "&", "")}:#{$state}, + #{if(&, "&", "")}.is-#{$state} { + @content; + } + } @else { + #{if(&, "&", "")}.is-#{$state} { + @content; + } + } +} @mixin form-validation-state($state, $color, $icon) { .#{$state}-feedback { @@ -50,16 +65,22 @@ @include border-radius($form-feedback-tooltip-border-radius); } + @include form-validation-state-selector($state) { + ~ .#{$state}-feedback, + ~ .#{$state}-tooltip { + display: block; + } + } + .form-control { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { border-color: $color; @if $enable-validation-icons { padding-right: $input-height-inner; - background-image: $icon; + background-image: escape-svg($icon); background-repeat: no-repeat; - background-position: center right $input-height-inner-quarter; + background-position: right $input-height-inner-quarter center; background-size: $input-height-inner-half $input-height-inner-half; } @@ -67,18 +88,12 @@ border-color: $color; box-shadow: 0 0 0 $input-focus-width rgba($color, .25); } - - ~ .#{$state}-feedback, - ~ .#{$state}-tooltip { - display: block; - } } } // stylelint-disable-next-line selector-no-qualifying-type textarea.form-control { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { @if $enable-validation-icons { padding-right: $input-height-inner; background-position: top $input-height-inner-quarter right $input-height-inner-quarter; @@ -87,41 +102,23 @@ } .custom-select { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { border-color: $color; @if $enable-validation-icons { padding-right: $custom-select-feedback-icon-padding-right; - background: $custom-select-background, $icon $custom-select-bg no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size; + background: $custom-select-background, escape-svg($icon) $custom-select-bg no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size; } &:focus { border-color: $color; box-shadow: 0 0 0 $input-focus-width rgba($color, .25); } - - ~ .#{$state}-feedback, - ~ .#{$state}-tooltip { - display: block; - } - } - } - - - .form-control-file { - .was-validated &:#{$state}, - &.is-#{$state} { - ~ .#{$state}-feedback, - ~ .#{$state}-tooltip { - display: block; - } } } .form-check-input { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { ~ .form-check-label { color: $color; } @@ -134,8 +131,7 @@ } .custom-control-input { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { ~ .custom-control-label { color: $color; @@ -144,11 +140,6 @@ } } - ~ .#{$state}-feedback, - ~ .#{$state}-tooltip { - display: block; - } - &:checked { ~ .custom-control-label::before { border-color: lighten($color, 10%); @@ -170,17 +161,11 @@ // custom file .custom-file-input { - .was-validated &:#{$state}, - &.is-#{$state} { + @include form-validation-state-selector($state) { ~ .custom-file-label { border-color: $color; } - ~ .#{$state}-feedback, - ~ .#{$state}-tooltip { - display: block; - } - &:focus { ~ .custom-file-label { border-color: $color; diff --git a/external/bootstrap4/scss/mixins/_grid-framework.scss b/external/bootstrap4/scss/mixins/_grid-framework.scss index 649c28bf77..8e291f7ae0 100644 --- a/external/bootstrap4/scss/mixins/_grid-framework.scss +++ b/external/bootstrap4/scss/mixins/_grid-framework.scss @@ -33,10 +33,15 @@ flex-grow: 1; max-width: 100%; } + + @for $i from 1 through $grid-row-columns { + .row-cols#{$infix}-#{$i} { + @include row-cols($i); + } + } + .col#{$infix}-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; // Reset earlier grid tiers + @include make-col-auto(); } @for $i from 1 through $columns { diff --git a/external/bootstrap4/scss/mixins/_grid.scss b/external/bootstrap4/scss/mixins/_grid.scss index 924eb0cfc0..b1240b01f1 100644 --- a/external/bootstrap4/scss/mixins/_grid.scss +++ b/external/bootstrap4/scss/mixins/_grid.scss @@ -45,7 +45,25 @@ max-width: percentage($size / $columns); } +@mixin make-col-auto() { + flex: 0 0 auto; + width: auto; + max-width: 100%; // Reset earlier grid tiers +} + @mixin make-col-offset($size, $columns: $grid-columns) { $num: $size / $columns; margin-left: if($num == 0, 0, percentage($num)); } + +// Row columns +// +// Specify on a parent element(e.g., .row) to force immediate children into NN +// numberof columns. Supports wrapping to new lines, but does not do a Masonry +// style grid. +@mixin row-cols($count) { + & > * { + flex: 0 0 100% / $count; + max-width: 100% / $count; + } +} diff --git a/external/bootstrap4/scss/mixins/_hover.scss b/external/bootstrap4/scss/mixins/_hover.scss index 192f847e17..409f8244e1 100644 --- a/external/bootstrap4/scss/mixins/_hover.scss +++ b/external/bootstrap4/scss/mixins/_hover.scss @@ -9,18 +9,18 @@ // // Issue: https://github.com/twbs/bootstrap/issues/25195 -@mixin hover { +@mixin hover() { &:hover { @content; } } -@mixin hover-focus { +@mixin hover-focus() { &:hover, &:focus { @content; } } -@mixin plain-hover-focus { +@mixin plain-hover-focus() { &, &:hover, &:focus { @@ -28,7 +28,7 @@ } } -@mixin hover-focus-active { +@mixin hover-focus-active() { &:hover, &:focus, &:active { diff --git a/external/bootstrap4/scss/mixins/_image.scss b/external/bootstrap4/scss/mixins/_image.scss index a76a6082ba..c971e038be 100644 --- a/external/bootstrap4/scss/mixins/_image.scss +++ b/external/bootstrap4/scss/mixins/_image.scss @@ -7,7 +7,7 @@ // // Keep images from scaling beyond the width of their parents. -@mixin img-fluid { +@mixin img-fluid() { // Part 1: Set a maximum relative to the parent max-width: 100%; // Part 2: Override the height to auto, otherwise images will be stretched diff --git a/external/bootstrap4/scss/mixins/_list-group.scss b/external/bootstrap4/scss/mixins/_list-group.scss index cd47a4e9fa..0da3531561 100644 --- a/external/bootstrap4/scss/mixins/_list-group.scss +++ b/external/bootstrap4/scss/mixins/_list-group.scss @@ -6,7 +6,7 @@ background-color: $background; &.list-group-item-action { - @include hover-focus { + @include hover-focus() { color: $color; background-color: darken($background, 5%); } diff --git a/external/bootstrap4/scss/mixins/_lists.scss b/external/bootstrap4/scss/mixins/_lists.scss index 2518562669..251cb07331 100644 --- a/external/bootstrap4/scss/mixins/_lists.scss +++ b/external/bootstrap4/scss/mixins/_lists.scss @@ -1,7 +1,7 @@ // Lists // Unstyled keeps list items block level, just removes default browser padding and list-style -@mixin list-unstyled { +@mixin list-unstyled() { padding-left: 0; list-style: none; } diff --git a/external/bootstrap4/scss/mixins/_nav-divider.scss b/external/bootstrap4/scss/mixins/_nav-divider.scss index 4fb37b6224..3e0cceafef 100644 --- a/external/bootstrap4/scss/mixins/_nav-divider.scss +++ b/external/bootstrap4/scss/mixins/_nav-divider.scss @@ -2,9 +2,10 @@ // // Dividers (basically an hr) within dropdowns and nav lists -@mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y) { +@mixin nav-divider($color: $nav-divider-color, $margin-y: $nav-divider-margin-y, $ignore-warning: false) { height: 0; margin: $margin-y 0; overflow: hidden; border-top: 1px solid $color; + @include deprecate("The `nav-divider()` mixin", "v4.4.0", "v5", $ignore-warning); } diff --git a/external/bootstrap4/scss/mixins/_reset-text.scss b/external/bootstrap4/scss/mixins/_reset-text.scss index bfa9f6e9ad..15b4407a0a 100644 --- a/external/bootstrap4/scss/mixins/_reset-text.scss +++ b/external/bootstrap4/scss/mixins/_reset-text.scss @@ -1,4 +1,4 @@ -@mixin reset-text { +@mixin reset-text() { font-family: $font-family-base; // We deliberately do NOT reset font-size or word-wrap. font-style: normal; diff --git a/external/bootstrap4/scss/mixins/_screen-reader.scss b/external/bootstrap4/scss/mixins/_screen-reader.scss index 812591bc5e..21230390eb 100644 --- a/external/bootstrap4/scss/mixins/_screen-reader.scss +++ b/external/bootstrap4/scss/mixins/_screen-reader.scss @@ -3,11 +3,12 @@ // See: https://a11yproject.com/posts/how-to-hide-content/ // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/ -@mixin sr-only { +@mixin sr-only() { position: absolute; width: 1px; height: 1px; padding: 0; + margin: -1px; // Fix for https://github.com/twbs/bootstrap/issues/25686 overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; @@ -20,7 +21,7 @@ // // Credit: HTML5 Boilerplate -@mixin sr-only-focusable { +@mixin sr-only-focusable() { &:active, &:focus { position: static; diff --git a/external/bootstrap4/scss/mixins/_table-row.scss b/external/bootstrap4/scss/mixins/_table-row.scss index f8d61869a4..1ccde6b6c5 100644 --- a/external/bootstrap4/scss/mixins/_table-row.scss +++ b/external/bootstrap4/scss/mixins/_table-row.scss @@ -26,7 +26,7 @@ $hover-background: darken($background, 5%); .table-#{$state} { - @include hover { + @include hover() { background-color: $hover-background; > td, diff --git a/external/bootstrap4/scss/mixins/_text-emphasis.scss b/external/bootstrap4/scss/mixins/_text-emphasis.scss index 155d6ca8cf..5eb8a55154 100644 --- a/external/bootstrap4/scss/mixins/_text-emphasis.scss +++ b/external/bootstrap4/scss/mixins/_text-emphasis.scss @@ -2,15 +2,16 @@ // Typography -@mixin text-emphasis-variant($parent, $color) { +@mixin text-emphasis-variant($parent, $color, $ignore-warning: false) { #{$parent} { color: $color !important; } @if $emphasized-link-hover-darken-percentage != 0 { a#{$parent} { - @include hover-focus { + @include hover-focus() { color: darken($color, $emphasized-link-hover-darken-percentage) !important; } } } + @include deprecate("`text-emphasis-variant()`", "v4.4.0", "v5", $ignore-warning); } diff --git a/external/bootstrap4/scss/sketchy/_bootswatch.scss b/external/bootstrap4/scss/sketchy/_bootswatch.scss index e62a3ac2a0..5610653583 100644 --- a/external/bootstrap4/scss/sketchy/_bootswatch.scss +++ b/external/bootstrap4/scss/sketchy/_bootswatch.scss @@ -7,6 +7,10 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Neucha|Cabin+Sketch" !default; @import url($web-font-path); +$border-radius-sketchy: 255px 25px 225px 25px/25px 225px 25px 255px; +$border-radius-lg-sketchy: 555px 25px 15px 25px/25px 5px 35px 555px; +$border-radius-sm-sketchy: 255px 25px 225px 25px/25px 225px 25px 255px; + // Navbar ====================================================================== .navbar { @@ -38,8 +42,16 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Neucha|Cabin+Sketch" !d // Buttons ===================================================================== .btn { - border-radius: $border-radius; + border-radius: $border-radius-sketchy; text-decoration: none; + + &-lg { + border-radius: $border-radius-lg-sketchy; + } + + &-sm { + border-radius: $border-radius-sm-sketchy; + } } // Typography ================================================================== @@ -113,22 +125,24 @@ table { &.table-hover .table-active:hover > td { background-color: $gray-800; } - + } // Forms ======================================================================= input, -.form-control { - border-radius: $border-radius; +.form-control, +.input-group-text, +.custom-file-label { + border-radius: $border-radius-sketchy; } textarea, textarea.form-control, select, select.form-control { - border-radius: $border-radius-lg !important; + border-radius: $border-radius-lg-sketchy !important; } [type="checkbox"] { @@ -230,6 +244,10 @@ select.form-control { } } +.nav-pills .nav-link, { + border-radius: $border-radius-sketchy; +} + .nav-link, .page-link, .list-group-item, @@ -245,6 +263,7 @@ select.form-control { .breadcrumb { border: 2px solid $gray-800; + border-radius: $border-radius-sketchy; } .pagination { @@ -260,6 +279,8 @@ select.form-control { } .badge { + border-radius: $border-radius-sm-sketchy; + &-pill { border-radius: 7rem 8rem 8rem 8rem / 4rem 5rem 6rem 6rem; } @@ -270,6 +291,8 @@ select.form-control { } .alert { + border-radius: $border-radius-sketchy; + &-dismissible { .close { color: transparent; @@ -324,6 +347,10 @@ select.form-control { // Progress bars =============================================================== +.progress { + border-radius: $border-radius-sm-sketchy; +} + // Containers ================================================================== .card { @@ -355,6 +382,7 @@ select.form-control { .jumbotron { border: 2px solid $gray-800; + border-radius: $border-radius-lg-sketchy; } .modal { @@ -392,6 +420,13 @@ select.form-control { } } +.tooltip { + + &-inner { + border-radius: $border-radius-sm-sketchy; + } +} + pre { border: 2px solid $gray-800; border-radius: 15px 5px 5px 25px/5px 25px 25px 5px; @@ -409,3 +444,9 @@ pre { color: $gray-800; } } + +.img { + &-thumbnail { + border-radius: $border-radius-sketchy; + } +} diff --git a/external/bootstrap4/scss/sketchy/_variables.scss b/external/bootstrap4/scss/sketchy/_variables.scss index 751e0586ee..cfd3b8e015 100644 --- a/external/bootstrap4/scss/sketchy/_variables.scss +++ b/external/bootstrap4/scss/sketchy/_variables.scss @@ -47,9 +47,9 @@ $link-decoration: underline !default; $border-width: 2px !default; -$border-radius: 255px 25px 225px 25px/25px 225px 25px 255px !default; -$border-radius-lg: 555px 25px 15px 25px/25px 5px 35px 555px !default; -$border-radius-sm: 255px 25px 225px 25px/25px 225px 25px 255px !default; +$border-radius: 25px !default; +$border-radius-lg: 35px !default; +$border-radius-sm: 15px !default; // Fonts diff --git a/external/bootstrap4/scss/slate/_bootswatch.scss b/external/bootstrap4/scss/slate/_bootswatch.scss index 52e486ea76..5e28ed9788 100644 --- a/external/bootstrap4/scss/slate/_bootswatch.scss +++ b/external/bootstrap4/scss/slate/_bootswatch.scss @@ -354,6 +354,22 @@ legend { .nav-tabs { + .nav-link { + @include btn-shadow-inverse($gray-800); + border: 1px solid rgba(0, 0, 0, 0.6); + + &:not([disabled]):not(.disabled):hover, + &:not([disabled]):not(.disabled):focus, + &:not([disabled]):not(.disabled):active, + &:not([disabled]):not(.disabled).active { + @include btn-shadow($gray-800); + } + + &.disabled { + border: 1px solid rgba(0, 0, 0, 0.6); + } + } + .nav-link, .nav-link:hover { color: #fff; diff --git a/external/bootstrap4/scss/slate/_variables.scss b/external/bootstrap4/scss/slate/_variables.scss index b3491ee817..4cde12c394 100644 --- a/external/bootstrap4/scss/slate/_variables.scss +++ b/external/bootstrap4/scss/slate/_variables.scss @@ -37,6 +37,8 @@ $danger: $red !default; $light: $gray-200 !default; $dark: $gray-900 !default; +$yiq-contrasted-threshold: 170 !default; + // Body $body-bg: $gray-900 !default; @@ -52,6 +54,7 @@ $font-size-base: 0.9375rem !default; // Tables +$table-color: $white !default; $table-accent-bg: rgba($white,.05) !default; $table-hover-bg: rgba($white,.075) !default; @@ -72,6 +75,7 @@ $input-disabled-bg: #ccc !default; // Dropdowns $dropdown-bg: $gray-800 !default; +$dropdown-border-color: rgba($black, .6) !default; $dropdown-divider-bg: rgba($black,.15) !default; $dropdown-link-color: $body-color !default; diff --git a/external/bootstrap4/scss/solar/_bootswatch.scss b/external/bootstrap4/scss/solar/_bootswatch.scss index 4b60bb73ce..f8c6b68af4 100644 --- a/external/bootstrap4/scss/solar/_bootswatch.scss +++ b/external/bootstrap4/scss/solar/_bootswatch.scss @@ -154,9 +154,28 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Source+Sans+Pro" !defau // Forms ======================================================================= -// .input-group-addon { -// color: $body-color; -// } +.custom-control-input:checked ~ .custom-control-label::before { + background: $primary; +} + +.custom-control-input:focus:not(:checked) ~ .custom-control-label::before { + border-color: $primary; +} + +.custom-control-input:not(:disabled):active ~ .custom-control-label::before { + background: $primary; + border-color: $primary; +} + +.custom-switch { + .custom-control-label::after { + background-color: rgba(255, 255, 255, 1); + } + + .custom-control-input:checked ~ .custom-control-label::after { + background-color: rgba(255, 255, 255, 0.75); + } +} // Navs ======================================================================== diff --git a/external/bootstrap4/scss/superhero/_bootswatch.scss b/external/bootstrap4/scss/superhero/_bootswatch.scss index 4513d08761..672caf851a 100644 --- a/external/bootstrap4/scss/superhero/_bootswatch.scss +++ b/external/bootstrap4/scss/superhero/_bootswatch.scss @@ -251,6 +251,13 @@ label, // Progress bars =============================================================== +// Popovers =============================================================== + +.popover-header { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + // Containers ================================================================== .modal { diff --git a/external/bootstrap4/scss/superhero/_variables.scss b/external/bootstrap4/scss/superhero/_variables.scss index ffe27cf22d..924b81e4b3 100644 --- a/external/bootstrap4/scss/superhero/_variables.scss +++ b/external/bootstrap4/scss/superhero/_variables.scss @@ -46,9 +46,9 @@ $body-color: $gray-100 !default; // Components -$border-radius: 0 !default; -$border-radius-lg: 0 !default; -$border-radius-sm: 0 !default; +$border-radius: 0px !default; +$border-radius-lg: 0px !default; +$border-radius-sm: 0px !default; // Fonts $font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default; @@ -70,6 +70,8 @@ $table-dark-color: $body-bg !default; // Forms +$input-disabled-bg: $gray-100 !default; + $input-border-color: transparent !default; $input-group-addon-color: $body-color !default; @@ -125,6 +127,7 @@ $modal-header-border-color: rgba(0,0,0,.2) !default; $card-cap-bg: $table-hover-bg !default; $card-bg: $gray-200 !default; +$card-inner-border-radius: 0px !default; // Popovers diff --git a/external/bootstrap4/scss/utilities/_background.scss b/external/bootstrap4/scss/utilities/_background.scss index 1f18b2f3f3..a997b1bdda 100644 --- a/external/bootstrap4/scss/utilities/_background.scss +++ b/external/bootstrap4/scss/utilities/_background.scss @@ -1,7 +1,7 @@ // stylelint-disable declaration-no-important @each $color, $value in $theme-colors { - @include bg-variant(".bg-#{$color}", $value); + @include bg-variant(".bg-#{$color}", $value, true); } @if $enable-gradients { diff --git a/external/bootstrap4/scss/utilities/_text.scss b/external/bootstrap4/scss/utilities/_text.scss index 589e5687a8..5d0f1c845f 100644 --- a/external/bootstrap4/scss/utilities/_text.scss +++ b/external/bootstrap4/scss/utilities/_text.scss @@ -11,7 +11,7 @@ .text-justify { text-align: justify !important; } .text-wrap { white-space: normal !important; } .text-nowrap { white-space: nowrap !important; } -.text-truncate { @include text-truncate; } +.text-truncate { @include text-truncate(); } // Responsive alignment @@ -45,7 +45,7 @@ .text-white { color: $white !important; } @each $color, $value in $theme-colors { - @include text-emphasis-variant(".text-#{$color}", $value); + @include text-emphasis-variant(".text-#{$color}", $value, true); } .text-body { color: $body-color !important; } diff --git a/external/bootstrap4/scss/yeti/_bootswatch.scss b/external/bootstrap4/scss/yeti/_bootswatch.scss index addd4aed85..7f605d6553 100644 --- a/external/bootstrap4/scss/yeti/_bootswatch.scss +++ b/external/bootstrap4/scss/yeti/_bootswatch.scss @@ -530,4 +530,13 @@ label, @include box-shadow(none); } + +// Popovers =============================================================== + +.popover-header { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + // Containers ================================================================== + diff --git a/external/bootstrap4/scss/yeti/_variables.scss b/external/bootstrap4/scss/yeti/_variables.scss index 1ccfc517e6..a06df2e678 100644 --- a/external/bootstrap4/scss/yeti/_variables.scss +++ b/external/bootstrap4/scss/yeti/_variables.scss @@ -41,9 +41,9 @@ $yiq-contrasted-threshold: 200 !default; // Components -$border-radius: 0 !default; -$border-radius-lg: 0 !default; -$border-radius-sm: 0 !default; +$border-radius: 0px !default; +$border-radius-lg: 0px !default; +$border-radius-sm: 0px !default; // Fonts @@ -90,6 +90,10 @@ $pagination-disabled-color: $gray-200 !default; $jumbotron-padding: 4rem !default; +// Cards + +$card-inner-border-radius: 0px !default; + // Badges $badge-font-weight: 300 !default;
0
d18bd17eb7d13010e3daef5351d7f7ec64480fd7
https://github.com/nextcloud/server/commit/d18bd17eb7d13010e3daef5351d7f7ec64480fd7
- eventsource.php: in case of potential CSRF attack we send an error message from the EventSource to the browser - eventsource.js: handle undefined data on event - update.js: in case of error we close the event source - advise the user to reload the page - update.php: EventSource initialization is now done before we enter the maintenance mode in order to allow browser reload in case of possible CSRF attack
diff --git a/core/js/eventsource.js b/core/js/eventsource.js index ce8c8387c8ef..536b180bc8f9 100644 --- a/core/js/eventsource.js +++ b/core/js/eventsource.js @@ -110,7 +110,11 @@ OC.EventSource.prototype={ this.listeners[type].push(callback); }else{ this.source.addEventListener(type,function(e){ - callback(JSON.parse(e.data)); + if (typeof e.data != 'undefined') { + callback(JSON.parse(e.data)); + } else { + callback(''); + } },false); } }else{ diff --git a/core/js/update.js b/core/js/update.js index 8ab02bbf9350..2c28e72f7cd8 100644 --- a/core/js/update.js +++ b/core/js/update.js @@ -5,6 +5,9 @@ $(document).ready(function () { }); updateEventSource.listen('error', function(message) { $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); + message = 'Please reload the page.'; + $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); + updateEventSource.close(); }); updateEventSource.listen('failure', function(message) { $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); @@ -20,4 +23,4 @@ $(document).ready(function () { window.location.href = OC.webroot; }, 3000); }); -}); \ No newline at end of file +}); diff --git a/lib/eventsource.php b/lib/eventsource.php index 63f197925293..31d6edc1874c 100644 --- a/lib/eventsource.php +++ b/lib/eventsource.php @@ -25,7 +25,7 @@ * wrapper for server side events (http://en.wikipedia.org/wiki/Server-sent_events) * includes a fallback for older browsers and IE * - * use server side events with causion, to many open requests can hang the server + * use server side events with caution, to many open requests can hang the server */ class OC_EventSource{ private $fallback; @@ -43,6 +43,7 @@ public function __construct() { header("Content-Type: text/event-stream"); } if( !OC_Util::isCallRegistered()) { + $this->send('error', 'Possible CSRF attack. Connection will be closed.'); exit(); } flush(); @@ -51,10 +52,10 @@ public function __construct() { /** * send a message to the client - * @param string type - * @param object data + * @param string $type + * @param object $data * - * if only one paramater is given, a typeless message will be send with that paramater as data + * if only one parameter is given, a typeless message will be send with that parameter as data */ public function send($type, $data=null) { if(is_null($data)) {
1
92daa6f273d0c5762a161972af203ef64388b05b
https://github.com/tinymce/tinymce_spellchecker_php/commit/92daa6f273d0c5762a161972af203ef64388b05b
Fixed incorrect position of suggestion menu.
diff --git a/changelog.txt b/changelog.txt index b4ae31f..ed606cf 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ -Version 2.0.6 (2011-??-??) +Version 2.0.6 (2011-09-29) + Fixed incorrect position of suggestion menu. Fixed handling of mispelled words with no suggestions in PSpellShell engine. Fixed PSpellShell command on Windows. Fixed bug where Javascript error is produced when enchant_dict_suggest() returns unexpected result.
0