Merge branch 'MDL-56341-master' of git://github.com/damyon/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 24 Oct 2016 02:11:20 +0000 (10:11 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 24 Oct 2016 02:11:20 +0000 (10:11 +0800)
819 files changed:
.eslintignore
.eslintrc
.stylelintignore
.travis.yml
Gruntfile.js
admin/index.php
admin/renderer.php
admin/settings/security.php
admin/tool/behat/cli/init.php
admin/tool/behat/cli/util.php
admin/tool/behat/cli/util_single_run.php
admin/tool/behat/tests/behat/datetime_strings.feature [new file with mode: 0644]
admin/tool/behat/tests/behat/nasty_strings.feature
admin/tool/behat/tests/manager_util_test.php
admin/tool/mobile/autologin.php [new file with mode: 0644]
admin/tool/mobile/classes/api.php
admin/tool/mobile/classes/external.php
admin/tool/mobile/db/services.php
admin/tool/mobile/lang/en/tool_mobile.php
admin/tool/mobile/tests/api_test.php [new file with mode: 0644]
admin/tool/mobile/tests/externallib_test.php
admin/tool/mobile/version.php
admin/tool/monitor/tests/behat/subscription.feature
admin/tool/templatelibrary/classes/api.php
admin/tool/usertours/amd/build/managesteps.min.js [new file with mode: 0644]
admin/tool/usertours/amd/build/managetours.min.js [new file with mode: 0644]
admin/tool/usertours/amd/build/popper.min.js [new file with mode: 0644]
admin/tool/usertours/amd/build/tour.min.js [new file with mode: 0644]
admin/tool/usertours/amd/build/usertours.min.js [new file with mode: 0644]
admin/tool/usertours/amd/readme_moodle.txt [new file with mode: 0644]
admin/tool/usertours/amd/src/managesteps.js [new file with mode: 0644]
admin/tool/usertours/amd/src/managetours.js [new file with mode: 0644]
admin/tool/usertours/amd/src/popper.js [new file with mode: 0644]
admin/tool/usertours/amd/src/tour.js [new file with mode: 0644]
admin/tool/usertours/amd/src/usertours.js [new file with mode: 0644]
admin/tool/usertours/classes/configuration.php [new file with mode: 0644]
admin/tool/usertours/classes/event/step_shown.php [new file with mode: 0644]
admin/tool/usertours/classes/event/tour_ended.php [new file with mode: 0644]
admin/tool/usertours/classes/event/tour_reset.php [new file with mode: 0644]
admin/tool/usertours/classes/event/tour_started.php [new file with mode: 0644]
admin/tool/usertours/classes/external/tour.php [new file with mode: 0644]
admin/tool/usertours/classes/helper.php [new file with mode: 0644]
admin/tool/usertours/classes/local/filter/base.php [new file with mode: 0644]
admin/tool/usertours/classes/local/filter/role.php [new file with mode: 0644]
admin/tool/usertours/classes/local/filter/theme.php [new file with mode: 0644]
admin/tool/usertours/classes/local/forms/editstep.php [new file with mode: 0644]
admin/tool/usertours/classes/local/forms/edittour.php [new file with mode: 0644]
admin/tool/usertours/classes/local/forms/importtour.php [new file with mode: 0644]
admin/tool/usertours/classes/local/table/step_list.php [new file with mode: 0644]
admin/tool/usertours/classes/local/table/tour_list.php [new file with mode: 0644]
admin/tool/usertours/classes/local/target/base.php [new file with mode: 0644]
admin/tool/usertours/classes/local/target/block.php [new file with mode: 0644]
admin/tool/usertours/classes/local/target/selector.php [new file with mode: 0644]
admin/tool/usertours/classes/local/target/unattached.php [new file with mode: 0644]
admin/tool/usertours/classes/manager.php [new file with mode: 0644]
admin/tool/usertours/classes/output/renderer.php [moved from message/yui/src/messenger/js/constants.js with 64% similarity]
admin/tool/usertours/classes/output/step.php [new file with mode: 0644]
admin/tool/usertours/classes/output/tour.php [new file with mode: 0644]
admin/tool/usertours/classes/step.php [new file with mode: 0644]
admin/tool/usertours/classes/target.php [new file with mode: 0644]
admin/tool/usertours/classes/tour.php [new file with mode: 0644]
admin/tool/usertours/configure.php [new file with mode: 0644]
admin/tool/usertours/db/access.php [moved from message/discussion.php with 55% similarity]
admin/tool/usertours/db/install.php [new file with mode: 0644]
admin/tool/usertours/db/install.xml [new file with mode: 0644]
admin/tool/usertours/db/services.php [new file with mode: 0644]
admin/tool/usertours/lang/en/tool_usertours.php [new file with mode: 0644]
admin/tool/usertours/lib.php [new file with mode: 0644]
admin/tool/usertours/pix/b/tour-import.png [new file with mode: 0644]
admin/tool/usertours/pix/b/tour-new.png [new file with mode: 0644]
admin/tool/usertours/pix/b/tour-shared.png [new file with mode: 0644]
admin/tool/usertours/pix/i/reload.png [new file with mode: 0644]
admin/tool/usertours/pix/i/reload.svg [new file with mode: 0644]
admin/tool/usertours/pix/i/sprite-green.png [new file with mode: 0644]
admin/tool/usertours/pix/i/sprite-orange.png [new file with mode: 0644]
admin/tool/usertours/pix/t/export.png [new file with mode: 0644]
admin/tool/usertours/pix/t/export.svg [new file with mode: 0644]
admin/tool/usertours/pix/t/filler.svg [new file with mode: 0644]
admin/tool/usertours/settings.php [new file with mode: 0644]
admin/tool/usertours/styles.css [new file with mode: 0644]
admin/tool/usertours/templates/tourstep.mustache [new file with mode: 0644]
admin/tool/usertours/tests/behat/behat_tool_usertours.php [new file with mode: 0644]
admin/tool/usertours/tests/behat/create_tour.feature [new file with mode: 0644]
admin/tool/usertours/tests/behat/tour_filter.feature [new file with mode: 0644]
admin/tool/usertours/tests/manager_test.php [new file with mode: 0644]
admin/tool/usertours/tests/role_filter_test.php [new file with mode: 0644]
admin/tool/usertours/tests/step_output_test.php [new file with mode: 0644]
admin/tool/usertours/tests/step_test.php [new file with mode: 0644]
admin/tool/usertours/tests/theme_filter_test.php [new file with mode: 0644]
admin/tool/usertours/tests/tour_test.php [new file with mode: 0644]
admin/tool/usertours/thirdpartylibs.xml [new file with mode: 0644]
admin/tool/usertours/version.php [new file with mode: 0644]
auth/upgrade.txt
backup/cc/cc2moodle.php
badges/assertion.php
badges/award.php
badges/badge.php
badges/classes/assertion.php
badges/lib/awardlib.php
badges/renderer.php
badges/tests/behat/award_badge.feature
blocks/course_overview/tests/behat/block_course_overview.feature
blocks/login/block_login.php
blocks/messages/tests/behat/block_messages_course.feature
blocks/messages/tests/behat/block_messages_dashboard.feature
blocks/messages/tests/behat/block_messages_frontpage.feature
blocks/online_users/block_online_users.php
blocks/participants/tests/behat/block_participants_course.feature
blocks/settings/amd/build/settingsblock.min.js
blocks/settings/amd/src/settingsblock.js
blog/external_blog_edit_form.php
cache/classes/factory.php
cache/disabledlib.php
cache/locallib.php
cache/stores/apcu/lib.php
competency/classes/api.php
competency/tests/api_test.php
composer.json
composer.lock
course/format/lib.php
course/format/topics/styles.css
course/format/weeks/styles.css
course/lib.php
course/tests/behat/course_category_management_listing.feature
enrol/ajax.php
enrol/locallib.php
enrol/lti/cartridge.php
enrol/lti/classes/data_connector.php [new file with mode: 0644]
enrol/lti/classes/helper.php
enrol/lti/classes/manage_table.php
enrol/lti/classes/output/registration.php [new file with mode: 0644]
enrol/lti/classes/output/renderer.php [new file with mode: 0644]
enrol/lti/classes/tool_provider.php [new file with mode: 0644]
enrol/lti/db/install.xml
enrol/lti/db/upgrade.php [new file with mode: 0644]
enrol/lti/ims-blti/blti.php
enrol/lti/lang/en/enrol_lti.php
enrol/lti/lib.php
enrol/lti/proxy.php [new file with mode: 0644]
enrol/lti/styles.css
enrol/lti/templates/proxy_registration.mustache [new file with mode: 0644]
enrol/lti/tests/data_connector_test.php [new file with mode: 0644]
enrol/lti/tests/fixtures/tool_consumer_profile.json [new file with mode: 0644]
enrol/lti/tests/helper_test.php
enrol/lti/tests/lib_test.php [new file with mode: 0644]
enrol/lti/tests/tool_provider_test.php [new file with mode: 0644]
enrol/lti/tool.php
enrol/lti/version.php
enrol/manual/yui/quickenrolment/quickenrolment.js
enrol/yui/otherusersmanager/otherusersmanager.js
enrol/yui/rolemanager/rolemanager.js
grade/edit/outcome/edit.php
grade/report/overview/classes/external.php [new file with mode: 0644]
grade/report/overview/db/services.php [new file with mode: 0644]
grade/report/overview/index.php
grade/report/overview/lib.php
grade/report/overview/tests/externallib_test.php [new file with mode: 0644]
grade/report/overview/version.php
grade/report/user/index.php
grade/report/user/lang/en/gradereport_user.php
grade/report/user/lib.php
grade/report/user/renderer.php
grade/report/user/styles.css
grade/report/user/tests/behat/user_view.feature [new file with mode: 0644]
grade/tests/behat/behat_grade.php
grade/tests/behat/grade_aggregation.feature
grade/tests/behat/grade_hidden_items.feature
install/lang/cs/install.php
install/lang/mg/langconfig.php [new file with mode: 0644]
install/lang/mis/langconfig.php
install/lang/ne/install.php [new file with mode: 0644]
install/lang/ne/moodle.php [new file with mode: 0644]
install/lang/pl/admin.php
iplookup/tests/geoip_test.php
lang/en/admin.php
lang/en/badges.php
lang/en/error.php
lang/en/message.php
lang/en/moodle.php
lang/en/role.php
lang/en/webservice.php
lib/accesslib.php
lib/adminlib.php
lib/adodb/adodb-active-record.inc.php
lib/adodb/adodb-active-recordx.inc.php
lib/adodb/adodb-csvlib.inc.php
lib/adodb/adodb-datadict.inc.php
lib/adodb/adodb-error.inc.php
lib/adodb/adodb-errorhandler.inc.php
lib/adodb/adodb-errorpear.inc.php
lib/adodb/adodb-exceptions.inc.php
lib/adodb/adodb-iterator.inc.php
lib/adodb/adodb-lib.inc.php
lib/adodb/adodb-memcache.lib.inc.php
lib/adodb/adodb-pager.inc.php
lib/adodb/adodb-pear.inc.php
lib/adodb/adodb-perf.inc.php
lib/adodb/adodb-php4.inc.php
lib/adodb/adodb-time.inc.php
lib/adodb/adodb-xmlschema.inc.php
lib/adodb/adodb-xmlschema03.inc.php
lib/adodb/adodb.inc.php
lib/adodb/datadict/datadict-access.inc.php
lib/adodb/datadict/datadict-db2.inc.php
lib/adodb/datadict/datadict-firebird.inc.php
lib/adodb/datadict/datadict-generic.inc.php
lib/adodb/datadict/datadict-ibase.inc.php
lib/adodb/datadict/datadict-informix.inc.php
lib/adodb/datadict/datadict-mssql.inc.php
lib/adodb/datadict/datadict-mssqlnative.inc.php
lib/adodb/datadict/datadict-mysql.inc.php
lib/adodb/datadict/datadict-oci8.inc.php
lib/adodb/datadict/datadict-postgres.inc.php
lib/adodb/datadict/datadict-sapdb.inc.php
lib/adodb/datadict/datadict-sqlite.inc.php
lib/adodb/datadict/datadict-sybase.inc.php
lib/adodb/drivers/adodb-access.inc.php
lib/adodb/drivers/adodb-ado.inc.php
lib/adodb/drivers/adodb-ado5.inc.php
lib/adodb/drivers/adodb-ado_access.inc.php
lib/adodb/drivers/adodb-ado_mssql.inc.php
lib/adodb/drivers/adodb-borland_ibase.inc.php
lib/adodb/drivers/adodb-csv.inc.php
lib/adodb/drivers/adodb-db2.inc.php
lib/adodb/drivers/adodb-db2oci.inc.php
lib/adodb/drivers/adodb-db2ora.inc.php
lib/adodb/drivers/adodb-fbsql.inc.php
lib/adodb/drivers/adodb-firebird.inc.php
lib/adodb/drivers/adodb-ibase.inc.php
lib/adodb/drivers/adodb-informix.inc.php
lib/adodb/drivers/adodb-informix72.inc.php
lib/adodb/drivers/adodb-ldap.inc.php
lib/adodb/drivers/adodb-mssql.inc.php
lib/adodb/drivers/adodb-mssqlnative.inc.php
lib/adodb/drivers/adodb-mssqlpo.inc.php
lib/adodb/drivers/adodb-mysql.inc.php
lib/adodb/drivers/adodb-mysqli.inc.php
lib/adodb/drivers/adodb-mysqlpo.inc.php
lib/adodb/drivers/adodb-mysqlt.inc.php
lib/adodb/drivers/adodb-netezza.inc.php
lib/adodb/drivers/adodb-oci8.inc.php
lib/adodb/drivers/adodb-oci805.inc.php
lib/adodb/drivers/adodb-oci8po.inc.php
lib/adodb/drivers/adodb-oci8quercus.inc.php
lib/adodb/drivers/adodb-odbc.inc.php
lib/adodb/drivers/adodb-odbc_db2.inc.php
lib/adodb/drivers/adodb-odbc_mssql.inc.php
lib/adodb/drivers/adodb-odbc_mssql2012.inc.php [new file with mode: 0644]
lib/adodb/drivers/adodb-odbc_oracle.inc.php
lib/adodb/drivers/adodb-odbtp.inc.php
lib/adodb/drivers/adodb-odbtp_unicode.inc.php
lib/adodb/drivers/adodb-oracle.inc.php
lib/adodb/drivers/adodb-pdo.inc.php
lib/adodb/drivers/adodb-pdo_mssql.inc.php
lib/adodb/drivers/adodb-pdo_mysql.inc.php
lib/adodb/drivers/adodb-pdo_oci.inc.php
lib/adodb/drivers/adodb-pdo_pgsql.inc.php
lib/adodb/drivers/adodb-pdo_sqlite.inc.php
lib/adodb/drivers/adodb-postgres.inc.php
lib/adodb/drivers/adodb-postgres64.inc.php
lib/adodb/drivers/adodb-postgres7.inc.php
lib/adodb/drivers/adodb-postgres8.inc.php
lib/adodb/drivers/adodb-postgres9.inc.php
lib/adodb/drivers/adodb-proxy.inc.php
lib/adodb/drivers/adodb-sapdb.inc.php
lib/adodb/drivers/adodb-sqlanywhere.inc.php
lib/adodb/drivers/adodb-sqlite.inc.php
lib/adodb/drivers/adodb-sqlite3.inc.php
lib/adodb/drivers/adodb-sqlitepo.inc.php
lib/adodb/drivers/adodb-sybase.inc.php
lib/adodb/drivers/adodb-sybase_ase.inc.php
lib/adodb/drivers/adodb-vfp.inc.php
lib/adodb/perf/perf-db2.inc.php
lib/adodb/perf/perf-informix.inc.php
lib/adodb/perf/perf-mssql.inc.php
lib/adodb/perf/perf-mssqlnative.inc.php
lib/adodb/perf/perf-mysql.inc.php
lib/adodb/perf/perf-oci8.inc.php
lib/adodb/perf/perf-postgres.inc.php
lib/adodb/pivottable.inc.php
lib/adodb/readme_moodle.txt
lib/adodb/rsfilter.inc.php
lib/adodb/toexport.inc.php
lib/adodb/tohtml.inc.php
lib/amd/build/auto_rows.min.js [new file with mode: 0644]
lib/amd/build/custom_interaction_events.min.js
lib/amd/build/modal.min.js
lib/amd/build/modal_confirm.min.js [new file with mode: 0644]
lib/amd/build/modal_events.min.js
lib/amd/build/modal_factory.min.js
lib/amd/build/popover_region_controller.min.js [new file with mode: 0644]
lib/amd/build/templates.min.js
lib/amd/build/url.min.js
lib/amd/src/auto_rows.js [new file with mode: 0644]
lib/amd/src/custom_interaction_events.js
lib/amd/src/modal.js
lib/amd/src/modal_confirm.js [new file with mode: 0644]
lib/amd/src/modal_events.js
lib/amd/src/modal_factory.js
lib/amd/src/popover_region_controller.js [new file with mode: 0644]
lib/amd/src/str.js
lib/amd/src/templates.js
lib/amd/src/url.js
lib/behat/classes/behat_config_util.php
lib/behat/classes/partial_named_selector.php
lib/behat/classes/util.php
lib/blocklib.php
lib/classes/component.php
lib/classes/event/badge_revoked.php [new file with mode: 0644]
lib/classes/minify.php
lib/classes/plugin_manager.php
lib/classes/scss.php
lib/datalib.php
lib/db/access.php
lib/db/install.xml
lib/db/services.php
lib/db/upgrade.php
lib/deprecatedlib.php
lib/enrollib.php
lib/externallib.php
lib/grade/grade_category.php
lib/grade/grade_grade.php
lib/htmlpurifier/HTMLPurifier.php
lib/htmlpurifier/HTMLPurifier.safe-includes.php
lib/htmlpurifier/HTMLPurifier/Arborize.php
lib/htmlpurifier/HTMLPurifier/AttrCollections.php
lib/htmlpurifier/HTMLPurifier/AttrDef/CSS.php
lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/URI.php
lib/htmlpurifier/HTMLPurifier/AttrDef/HTML/ID.php
lib/htmlpurifier/HTMLPurifier/AttrDef/URI/Host.php
lib/htmlpurifier/HTMLPurifier/AttrTransform/ImgRequired.php
lib/htmlpurifier/HTMLPurifier/AttrTransform/TargetNoreferrer.php [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/CSSDefinition.php
lib/htmlpurifier/HTMLPurifier/ChildDef/List.php
lib/htmlpurifier/HTMLPurifier/ChildDef/Table.php
lib/htmlpurifier/HTMLPurifier/Config.php
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema.ser
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Attr.ID.HTML5.txt [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoreferrer.txt [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt
lib/htmlpurifier/HTMLPurifier/DefinitionCache.php
lib/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer.php
lib/htmlpurifier/HTMLPurifier/HTMLModule/TargetNoreferrer.php [new file with mode: 0644]
lib/htmlpurifier/HTMLPurifier/HTMLModuleManager.php
lib/htmlpurifier/HTMLPurifier/Injector/Linkify.php
lib/htmlpurifier/HTMLPurifier/Injector/RemoveEmpty.php
lib/htmlpurifier/HTMLPurifier/Injector/SafeObject.php
lib/htmlpurifier/HTMLPurifier/Lexer.php
lib/htmlpurifier/HTMLPurifier/Printer/ConfigForm.php
lib/htmlpurifier/HTMLPurifier/URIScheme/data.php
lib/htmlpurifier/HTMLPurifier/URIScheme/tel.php [new file with mode: 0644]
lib/htmlpurifier/locallib.php
lib/htmlpurifier/readme_moodle.txt
lib/javascript-static.js
lib/javascript.php
lib/ltiprovider/LICENSE [new file with mode: 0644]
lib/ltiprovider/README.md [new file with mode: 0644]
lib/ltiprovider/readme_moodle.txt [new file with mode: 0644]
lib/ltiprovider/src/HTTPMessage.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthConsumer.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthDataStore.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthException.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthRequest.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthServer.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthSignatureMethod.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthSignatureMethod_HMAC_SHA1.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthSignatureMethod_HMAC_SHA256.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthToken.php [new file with mode: 0644]
lib/ltiprovider/src/OAuth/OAuthUtil.php [new file with mode: 0644]
lib/ltiprovider/src/Profile/Item.php [new file with mode: 0644]
lib/ltiprovider/src/Profile/Message.php [new file with mode: 0644]
lib/ltiprovider/src/Profile/ResourceHandler.php [new file with mode: 0644]
lib/ltiprovider/src/Profile/ServiceDefinition.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ConsumerNonce.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ContentItem.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ContentItemImage.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ContentItemPlacement.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/Context.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/DataConnector/DataConnector.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/DataConnector/DataConnector_mysql.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/DataConnector/DataConnector_pdo.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/DataConnector/DataConnector_pdo_sqlite.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/MediaType/Message.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/MediaType/ResourceHandler.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/MediaType/SecurityContract.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/MediaType/ToolProfile.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/MediaType/ToolProxy.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/OAuthDataStore.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/Outcome.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ResourceLink.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ResourceLinkShare.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ResourceLinkShareKey.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/Service/Membership.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/Service/Service.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/Service/ToolSettings.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ToolConsumer.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ToolProvider.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/ToolProxy.php [new file with mode: 0644]
lib/ltiprovider/src/ToolProvider/User.php [new file with mode: 0644]
lib/messagelib.php
lib/minify/LICENSE.txt [deleted file]
lib/minify/config.php [deleted file]
lib/minify/groupsConfig.php [deleted file]
lib/minify/lib/CSSmin.php [deleted file]
lib/minify/lib/DooDigestAuth.php [deleted file]
lib/minify/lib/FirePHP.php [deleted file]
lib/minify/lib/HTTP/ConditionalGet.php [deleted file]
lib/minify/lib/HTTP/Encoder.php [deleted file]
lib/minify/lib/JSMinPlus.php [deleted file]
lib/minify/lib/Minify.php [deleted file]
lib/minify/lib/Minify/Build.php [deleted file]
lib/minify/lib/Minify/CSS.php [deleted file]
lib/minify/lib/Minify/CSS/Compressor.php [deleted file]
lib/minify/lib/Minify/CSS/UriRewriter.php [deleted file]
lib/minify/lib/Minify/CSSmin.php [deleted file]
lib/minify/lib/Minify/Cache/APC.php [deleted file]
lib/minify/lib/Minify/Cache/File.php [deleted file]
lib/minify/lib/Minify/Cache/Memcache.php [deleted file]
lib/minify/lib/Minify/Cache/WinCache.php [deleted file]
lib/minify/lib/Minify/Cache/XCache.php [deleted file]
lib/minify/lib/Minify/Cache/ZendPlatform.php [deleted file]
lib/minify/lib/Minify/ClosureCompiler.php [deleted file]
lib/minify/lib/Minify/CommentPreserver.php [deleted file]
lib/minify/lib/Minify/Controller/Base.php [deleted file]
lib/minify/lib/Minify/Controller/Files.php [deleted file]
lib/minify/lib/Minify/Controller/Groups.php [deleted file]
lib/minify/lib/Minify/Controller/MinApp.php [deleted file]
lib/minify/lib/Minify/Controller/Page.php [deleted file]
lib/minify/lib/Minify/Controller/Version1.php [deleted file]
lib/minify/lib/Minify/DebugDetector.php [deleted file]
lib/minify/lib/Minify/HTML.php [deleted file]
lib/minify/lib/Minify/HTML/Helper.php [deleted file]
lib/minify/lib/Minify/ImportProcessor.php [deleted file]
lib/minify/lib/Minify/JS/ClosureCompiler.php [deleted file]
lib/minify/lib/Minify/Lines.php [deleted file]
lib/minify/lib/Minify/Loader.php [deleted file]
lib/minify/lib/Minify/Logger.php [deleted file]
lib/minify/lib/Minify/Packer.php [deleted file]
lib/minify/lib/Minify/Source.php [deleted file]
lib/minify/lib/Minify/YUI/CssCompressor.java [deleted file]
lib/minify/lib/Minify/YUI/CssCompressor.php [deleted file]
lib/minify/lib/Minify/YUICompressor.php [deleted file]
lib/minify/lib/MrClay/Cli.php [deleted file]
lib/minify/lib/MrClay/Cli/Arg.php [deleted file]
lib/minify/matthiasmullie-minify/data/js/keywords_after.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/data/js/keywords_before.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/data/js/keywords_reserved.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/data/js/operators.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/data/js/operators_after.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/data/js/operators_before.txt [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/CSS.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/Exception.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/Exceptions/BasicException.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/Exceptions/FileImportException.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/Exceptions/IOException.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/JS.php [new file with mode: 0644]
lib/minify/matthiasmullie-minify/src/Minify.php [new file with mode: 0644]
lib/minify/matthiasmullie-pathconverter/src/Converter.php [new file with mode: 0644]
lib/minify/readme_moodle.txt
lib/minify/utils.php [deleted file]
lib/moodlelib.php
lib/mustache/readme_moodle.txt
lib/myprofilelib.php
lib/navigationlib.php
lib/oauthlib.php
lib/outputcomponents.php
lib/outputlib.php
lib/outputrenderers.php
lib/pagelib.php
lib/pear/HTML/QuickForm.php
lib/templates/hover_tooltip.mustache [new file with mode: 0644]
lib/templates/modal.mustache
lib/templates/modal_confirm.mustache [new file with mode: 0644]
lib/templates/modal_save_cancel.mustache
lib/templates/popover_region.mustache [new file with mode: 0644]
lib/templates/progress_bar.mustache [new file with mode: 0644]
lib/templates/skip_links.mustache
lib/testing/generator/data_generator.php
lib/tests/behat/behat_hooks.php
lib/tests/behat/behat_transformations.php
lib/tests/minify_test.php
lib/tests/string_manager_standard_test.php
lib/thirdpartylibs.xml
lib/upgrade.txt
lib/upgradelib.php
lib/weblib.php
lib/xhprof/xhprof_moodle.php
login/change_password.php
login/change_password_form.php
login/token.php
message/ajax.php [deleted file]
message/amd/build/message_area.min.js [new file with mode: 0644]
message/amd/build/message_area_actions.min.js [new file with mode: 0644]
message/amd/build/message_area_contacts.min.js [new file with mode: 0644]
message/amd/build/message_area_events.min.js [new file with mode: 0644]
message/amd/build/message_area_messages.min.js [new file with mode: 0644]
message/amd/build/message_area_profile.min.js [new file with mode: 0644]
message/amd/build/message_area_search.min.js [new file with mode: 0644]
message/amd/build/message_area_tabs.min.js [new file with mode: 0644]
message/amd/build/message_notification_preference.min.js [new file with mode: 0644]
message/amd/build/message_preferences.min.js [new file with mode: 0644]
message/amd/build/message_repository.min.js [new file with mode: 0644]
message/amd/build/notification_preference.min.js [new file with mode: 0644]
message/amd/build/notification_processor.min.js [new file with mode: 0644]
message/amd/build/notification_processor_settings.min.js [new file with mode: 0644]
message/amd/build/preferences_notifications_list_controller.min.js [new file with mode: 0644]
message/amd/build/preferences_processor_form.min.js [new file with mode: 0644]
message/amd/build/toggle_contact_button.min.js [new file with mode: 0644]
message/amd/src/message_area.js [new file with mode: 0644]
message/amd/src/message_area_actions.js [new file with mode: 0644]
message/amd/src/message_area_contacts.js [new file with mode: 0644]
message/amd/src/message_area_events.js [new file with mode: 0644]
message/amd/src/message_area_messages.js [new file with mode: 0644]
message/amd/src/message_area_profile.js [new file with mode: 0644]
message/amd/src/message_area_search.js [new file with mode: 0644]
message/amd/src/message_area_tabs.js [new file with mode: 0644]
message/amd/src/message_notification_preference.js [new file with mode: 0644]
message/amd/src/message_preferences.js [new file with mode: 0644]
message/amd/src/message_repository.js [new file with mode: 0644]
message/amd/src/notification_preference.js [new file with mode: 0644]
message/amd/src/notification_processor.js [new file with mode: 0644]
message/amd/src/notification_processor_settings.js [new file with mode: 0644]
message/amd/src/preferences_notifications_list_controller.js [new file with mode: 0644]
message/amd/src/preferences_processor_form.js [new file with mode: 0644]
message/amd/src/toggle_contact_button.js [new file with mode: 0644]
message/bell.mp3 [deleted file]
message/bell.ogg [deleted file]
message/bell.wav [deleted file]
message/classes/api.php [new file with mode: 0644]
message/classes/helper.php [new file with mode: 0644]
message/classes/output/messagearea/contact.php [new file with mode: 0644]
message/classes/output/messagearea/contacts.php [new file with mode: 0644]
message/classes/output/messagearea/message.php [new file with mode: 0644]
message/classes/output/messagearea/message_area.php [new file with mode: 0644]
message/classes/output/messagearea/message_search_results.php [new file with mode: 0644]
message/classes/output/messagearea/messages.php [new file with mode: 0644]
message/classes/output/messagearea/profile.php [new file with mode: 0644]
message/classes/output/messagearea/user_search_results.php [new file with mode: 0644]
message/classes/output/preferences/message_notification_list.php [new file with mode: 0644]
message/classes/output/preferences/message_notification_list_component.php [moved from theme/boost/classes/admin_setting_scss_variables.php with 53% similarity]
message/classes/output/preferences/notification_list.php [new file with mode: 0644]
message/classes/output/preferences/notification_list_component.php [new file with mode: 0644]
message/classes/output/preferences/notification_list_processor.php [new file with mode: 0644]
message/classes/output/preferences/processor.php [new file with mode: 0644]
message/classes/output/processor.php [new file with mode: 0644]
message/classes/output/renderer.php [new file with mode: 0644]
message/edit.php
message/externallib.php
message/index.php
message/lib.php
message/module.js
message/notificationpreferences.php [new file with mode: 0644]
message/output/airnotifier/lang/en/message_airnotifier.php
message/output/email/message_output_email.php
message/output/jabber/lang/en/message_jabber.php
message/output/lib.php
message/output/popup/amd/build/message_popover_controller.min.js [new file with mode: 0644]
message/output/popup/amd/build/notification_area_content_area.min.js [new file with mode: 0644]
message/output/popup/amd/build/notification_area_control_area.min.js [new file with mode: 0644]
message/output/popup/amd/build/notification_area_events.min.js [new file with mode: 0644]
message/output/popup/amd/build/notification_popover_controller.min.js [new file with mode: 0644]
message/output/popup/amd/build/notification_repository.min.js [new file with mode: 0644]
message/output/popup/amd/src/message_popover_controller.js [new file with mode: 0644]
message/output/popup/amd/src/notification_area_content_area.js [new file with mode: 0644]
message/output/popup/amd/src/notification_area_control_area.js [new file with mode: 0644]
message/output/popup/amd/src/notification_area_events.js [new file with mode: 0644]
message/output/popup/amd/src/notification_popover_controller.js [new file with mode: 0644]
message/output/popup/amd/src/notification_repository.js [new file with mode: 0644]
message/output/popup/classes/api.php [new file with mode: 0644]
message/output/popup/classes/output/popup_notification.php [new file with mode: 0644]
message/output/popup/db/events.php [new file with mode: 0644]
message/output/popup/db/install.xml [new file with mode: 0644]
message/output/popup/db/services.php [new file with mode: 0644]
message/output/popup/db/upgrade.php
message/output/popup/externallib.php [new file with mode: 0644]
message/output/popup/lang/en/message_popup.php
message/output/popup/lib.php [new file with mode: 0644]
message/output/popup/message_output_popup.php
message/output/popup/notifications.php [new file with mode: 0644]
message/output/popup/templates/message_content_item.mustache [new file with mode: 0644]
message/output/popup/templates/message_popover.mustache [new file with mode: 0644]
message/output/popup/templates/notification_area.mustache [new file with mode: 0644]
message/output/popup/templates/notification_area_content_area_content.mustache [new file with mode: 0644]
message/output/popup/templates/notification_area_content_area_footer.mustache [new file with mode: 0644]
message/output/popup/templates/notification_area_content_area_header.mustache [new file with mode: 0644]
message/output/popup/templates/notification_content_item.mustache [new file with mode: 0644]
message/output/popup/templates/notification_popover.mustache [new file with mode: 0644]
message/output/popup/tests/api_test.php [new file with mode: 0644]
message/output/popup/tests/base.php [new file with mode: 0644]
message/output/popup/tests/behat/behat_message_popup.php [new file with mode: 0644]
message/output/popup/tests/behat/message_popover_preferences.feature [new file with mode: 0644]
message/output/popup/tests/behat/message_popover_unread.feature [new file with mode: 0644]
message/output/popup/tests/behat/notification_popover_preferences.feature [new file with mode: 0644]
message/output/popup/tests/behat/notification_popover_unread.feature [new file with mode: 0644]
message/output/popup/tests/externallib_test.php [new file with mode: 0644]
message/output/popup/version.php
message/renderer.php
message/search.html [deleted file]
message/search_advanced.html [deleted file]
message/send_form.php [deleted file]
message/settings.html [deleted file]
message/templates/add_contact_button.mustache [new file with mode: 0644]
message/templates/message_area.mustache [new file with mode: 0644]
message/templates/message_area_contact.mustache [new file with mode: 0644]
message/templates/message_area_contacts.mustache [new file with mode: 0644]
message/templates/message_area_contacts_area.mustache [new file with mode: 0644]
message/templates/message_area_message.mustache [new file with mode: 0644]
message/templates/message_area_message_search_results.mustache [new file with mode: 0644]
message/templates/message_area_messages.mustache [new file with mode: 0644]
message/templates/message_area_messages_area.mustache [new file with mode: 0644]
message/templates/message_area_profile.mustache [new file with mode: 0644]
message/templates/message_area_response.mustache [new file with mode: 0644]
message/templates/message_area_user_search_results.mustache [new file with mode: 0644]
message/templates/message_preferences.mustache [new file with mode: 0644]
message/templates/message_preferences_component.mustache [new file with mode: 0644]
message/templates/message_preferences_notification_processor.mustache [new file with mode: 0644]
message/templates/notification_preferences.mustache [new file with mode: 0644]
message/templates/notification_preferences_component.mustache [new file with mode: 0644]
message/templates/notification_preferences_component_notification.mustache [new file with mode: 0644]
message/templates/notification_preferences_processor.mustache [new file with mode: 0644]
message/templates/preferences_processor.mustache [new file with mode: 0644]
message/templates/remove_contact_button.mustache [new file with mode: 0644]
message/tests/api_test.php [new file with mode: 0644]
message/tests/behat/behat_message.php
message/tests/behat/block_noncontacts.feature [deleted file]
message/tests/behat/block_users.feature [deleted file]
message/tests/behat/delete_all_messages.feature [new file with mode: 0644]
message/tests/behat/delete_messages.feature
message/tests/behat/display_history.feature [deleted file]
message/tests/behat/manage_contacts.feature
message/tests/behat/message_participants.feature [deleted file]
message/tests/behat/recent_conversations.feature [deleted file]
message/tests/behat/reply_message.feature [new file with mode: 0644]
message/tests/behat/search_history.feature [deleted file]
message/tests/behat/search_messages.feature [new file with mode: 0644]
message/tests/behat/search_users.feature [new file with mode: 0644]
message/tests/behat/send_message.feature [deleted file]
message/tests/behat/view_messages.feature [new file with mode: 0644]
message/tests/events_test.php
message/tests/externallib_test.php
message/tests/messagelib_test.php
message/upgrade.txt
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-debug.js [deleted file]
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger-min.js [deleted file]
message/yui/build/moodle-core_message-messenger/moodle-core_message-messenger.js [deleted file]
message/yui/build/moodle-core_message-toolbox/moodle-core_message-toolbox-debug.js [deleted file]
message/yui/build/moodle-core_message-toolbox/moodle-core_message-toolbox-min.js [deleted file]
message/yui/build/moodle-core_message-toolbox/moodle-core_message-toolbox.js [deleted file]
message/yui/src/messenger/build.json [deleted file]
message/yui/src/messenger/js/manager.js [deleted file]
message/yui/src/messenger/js/sendmessage.js [deleted file]
message/yui/src/messenger/meta/messenger.json [deleted file]
message/yui/src/toolbox/build.json [deleted file]
message/yui/src/toolbox/js/delete.js [deleted file]
message/yui/src/toolbox/meta/toolbox.json [deleted file]
mod/assign/amd/build/grading_navigation.min.js
mod/assign/amd/build/participant_selector.min.js
mod/assign/amd/src/grading_navigation.js
mod/assign/amd/src/participant_selector.js
mod/assign/externallib.php
mod/assign/feedback/editpdf/classes/renderer.php
mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/feedback/file/importziplib.php
mod/assign/feedback/offline/importgradesform.php
mod/assign/gradingoptionsform.php
mod/assign/gradingtable.php
mod/assign/lang/en/assign.php
mod/assign/locallib.php
mod/assign/module.js
mod/assign/submission/file/locallib.php
mod/assign/tests/externallib_test.php
mod/book/delete.php
mod/book/edit.php
mod/book/lang/en/book.php
mod/book/locallib.php
mod/book/tests/behat/create_chapters.feature
mod/book/tests/behat/edit_navigation_options.feature
mod/book/tests/behat/log_entries.feature
mod/book/tests/behat/show_hide_chapters.feature
mod/book/view.php
mod/choice/lib.php
mod/data/tests/generator_test.php
mod/feedback/lang/en/deprecated.txt
mod/feedback/lang/en/feedback.php
mod/feedback/lib.php
mod/folder/lang/en/folder.php
mod/folder/lib.php
mod/forum/classes/output/forum_post.php
mod/forum/classes/post_form.php
mod/lesson/tests/behat/completion_condition_end_reached.feature
mod/lesson/tests/behat/lesson_question_attempts.feature
mod/lti/amd/src/contentitem.js
mod/lti/mod_form.php
mod/lti/tests/behat/contentitem.feature
mod/quiz/report/attemptsreport.php
mod/quiz/report/attemptsreport_table.php
mod/quiz/report/grading/report.php
mod/quiz/report/grading/tests/behat/grading.feature [new file with mode: 0644]
mod/quiz/report/overview/overview_table.php
mod/quiz/report/overview/report.php
mod/quiz/report/overview/tests/behat/basic.feature [new file with mode: 0644]
mod/quiz/report/overview/tests/report_test.php
mod/quiz/report/reportlib.php
mod/quiz/report/responses/last_responses_table.php
mod/quiz/report/responses/report.php
mod/quiz/report/statistics/classes/calculator.php
mod/quiz/report/statistics/db/upgrade.php
mod/quiz/report/statistics/report.php
mod/quiz/report/statistics/statisticslib.php
mod/quiz/report/statistics/tests/statisticslib_test.php [deleted file]
mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php
mod/quiz/report/statistics/upgrade.txt
mod/quiz/report/statistics/version.php
mod/quiz/report/upgrade.txt
mod/workshop/assessment.php
mod/workshop/classes/portfolio_caller.php [new file with mode: 0644]
mod/workshop/db/access.php
mod/workshop/lang/en/workshop.php
mod/workshop/locallib.php
mod/workshop/submission.php
mod/workshop/tests/behat/behat_mod_workshop.php
mod/workshop/tests/behat/export_submission.feature [new file with mode: 0644]
mod/workshop/tests/locallib_test.php
mod/workshop/tests/portfolio_caller_test.php [new file with mode: 0644]
mod/workshop/version.php
npm-shrinkwrap.json
package.json
pix/i/notifications.png [new file with mode: 0644]
pix/i/notifications.svg [new file with mode: 0644]
question/classes/bank/action_column_base.php
question/type/match/renderer.php
repository/dropbox/classes/authentication_exception.php [new file with mode: 0644]
repository/dropbox/classes/dropbox.php [new file with mode: 0644]
repository/dropbox/classes/dropbox_exception.php [new file with mode: 0644]
repository/dropbox/classes/provider_exception.php [new file with mode: 0644]
repository/dropbox/classes/rate_limit_exception.php [new file with mode: 0644]
repository/dropbox/db/upgrade.php
repository/dropbox/lang/en/repository_dropbox.php
repository/dropbox/lib.php
repository/dropbox/locallib.php [deleted file]
repository/dropbox/tests/api_test.php [new file with mode: 0644]
repository/dropbox/thumbnail.php
repository/dropbox/version.php
search/classes/manager.php
search/engine/solr/classes/engine.php
search/engine/solr/classes/schema.php
tag/templates/taglist.mustache
theme/boost/amd/build/loader.min.js
theme/boost/amd/src/loader.js
theme/boost/classes/output/core_renderer_maintenance.php [new file with mode: 0644]
theme/boost/config.php
theme/boost/lang/en/theme_boost.php
theme/boost/lib.php
theme/boost/pix/favicon.ico
theme/boost/scss/moodle.scss
theme/boost/scss/moodle/admin.scss
theme/boost/scss/moodle/calendar.scss
theme/boost/scss/moodle/core.scss
theme/boost/scss/moodle/course.scss
theme/boost/scss/moodle/forms.scss
theme/boost/scss/moodle/message.scss
theme/boost/scss/moodle/modules.scss
theme/boost/scss/moodle/popover-region.scss [new file with mode: 0644]
theme/boost/scss/moodle/question.scss
theme/boost/scss/moodle/tool_usertours.scss [new file with mode: 0644]
theme/boost/scss/moodle/user.scss
theme/boost/settings.php
theme/boost/templates/core/modal.mustache [new file with mode: 0644]
theme/boost/templates/core/modal_backdrop.mustache [new file with mode: 0644]
theme/boost/templates/core/progress_bar.mustache [new file with mode: 0644]
theme/boost/templates/core/skip_links.mustache
theme/boost/templates/core_form/element-autocomplete.mustache
theme/boost/templates/core_form/element-button-inline.mustache
theme/boost/templates/core_form/element-radio-inline.mustache
theme/boost/templates/core_form/element-radio.mustache
theme/boost/templates/header.mustache
theme/boost/templates/maintenance.mustache
theme/boost/templates/tool_usertours/tourstep.mustache [new file with mode: 0644]
theme/bootstrapbase/less/moodle.less
theme/bootstrapbase/less/moodle/blocks.less
theme/bootstrapbase/less/moodle/core.less
theme/bootstrapbase/less/moodle/course.less
theme/bootstrapbase/less/moodle/forms.less
theme/bootstrapbase/less/moodle/message.less
theme/bootstrapbase/less/moodle/popover_region.less [new file with mode: 0644]
theme/bootstrapbase/less/moodle/question.less
theme/bootstrapbase/less/moodle/responsive.less
theme/bootstrapbase/less/moodle/tool_usertours.less [new file with mode: 0644]
theme/bootstrapbase/less/moodle/user.less
theme/bootstrapbase/style/moodle.css
theme/bootstrapbase/templates/theme_boost/admin_setting_tabs.mustache [new file with mode: 0644]
theme/clean/layout/columns1.php
theme/clean/layout/columns2.php
theme/clean/layout/columns3.php
theme/clean/style/custom.css
theme/more/style/custom.css
theme/upgrade.txt
user/editadvanced.php
user/editadvanced_form.php
user/externallib.php
user/lib.php
user/selector/lib.php
user/selector/module.js
user/selector/search.php
user/tests/behat/user_grade_navigation.feature
user/tests/behat/view_full_profile.feature
user/tests/behat/view_preferences_page.feature
user/tests/externallib_test.php
user/tests/userlib_test.php
version.php
webservice/lib.php
webservice/upgrade.txt

index e35675a..9ad89b7 100644 (file)
@@ -3,6 +3,8 @@
 */**/build/
 node_modules/
 vendor/
+admin/tool/usertours/amd/src/tour.js
+admin/tool/usertours/amd/src/popper.js
 auth/cas/CAS/
 auth/fc/fcFPP.php
 enrol/lti/ims-blti/
@@ -20,7 +22,8 @@ lib/phpexcel/
 lib/google/
 lib/htmlpurifier/
 lib/jabber/
-lib/minify/
+lib/minify/matthiasmullie-minify/
+lib/minify/matthiasmullie-pathconverter/
 lib/flowplayer/
 lib/pear/Auth/RADIUS.php
 lib/pear/Crypt/CHAP.php
@@ -53,6 +56,7 @@ lib/spout/
 lib/amd/src/chartjs-lazy.js
 lib/maxmind/GeoIp2/
 lib/maxmind/MaxMind/
+lib/ltiprovider/
 mod/assign/feedback/editpdf/fpdi/
 repository/s3/S3.php
 theme/boost/scss/bootstrap/
index c701962..3514759 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -31,7 +31,6 @@
     'no-inner-declarations': 'error',
     'no-invalid-regexp': 'error',
     'no-irregular-whitespace': 'error',
-    'no-negated-in-lhs': 'error',
     'no-obj-calls': 'error',
     'no-prototype-builtins': 'off',
     'no-regex-spaces': 'error',
@@ -39,6 +38,7 @@
     'no-unexpected-multiline': 'error',
     'no-unreachable': 'warn',
     'no-unsafe-finally': 'error',
+    'no-unsafe-negation': 'error',
     'use-isnan': 'error',
     'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
     'valid-typeof': 'error',
@@ -63,6 +63,7 @@
     'no-extra-bind': 'warn',
     'no-fallthrough': 'error',
     'no-floating-decimal': 'warn',
+    'no-global-assign': 'warn',
     // Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
     'no-implied-eval': 'error',
     'no-invalid-this': 'error',
@@ -71,7 +72,6 @@
     'no-loop-func': 'error',
     'no-multi-spaces': 'warn',
     'no-multi-str': 'error',
-    'no-native-reassign': 'warn',
     'no-new-func': 'error',
     'no-new-wrappers': 'error',
     'no-octal': 'error',
@@ -96,7 +96,7 @@
     'no-delete-var': 'error',
     'no-undef': 'error',
     'no-undef-init': 'error',
-    'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }],
+    'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
 
     // === Stylistic Issues ===
     'array-bracket-spacing': 'warn',
     'computed-property-spacing': 'error',
     'consistent-this': 'off',
     'eol-last': 'off',
+    'func-call-spacing': ['warn', 'never'],
     'func-names': 'off',
     'func-style': 'off',
     // indent currently not doing well with our wrapping style, so disabled.
     'no-nested-ternary': 'warn',
     'no-new-object': 'off',
     'no-plusplus': 'off',
-    'no-spaced-func': 'warn',
+    'no-tabs': 'error',
     'no-ternary': 'off',
     'no-trailing-spaces': 'error',
     'no-underscore-dangle': 'off',
     'spaced-comment': 'warn',
     'unicode-bom': 'error',
     'wrap-regex': 'off',
+
+    // === Deprecations ===
+    "no-restricted-properties": ['warn', {
+        'object': 'M',
+        'property': 'str',
+        'message': 'Use AMD module "core/str" or M.util.get_string()'
+    }],
   }
 }
index 9a2dc50..f6ac277 100644 (file)
@@ -1,7 +1,11 @@
 # Generated by "grunt ignorefiles"
 theme/bootstrapbase/style/
+theme/clean/style/custom.css
+theme/more/style/custom.css
 node_modules/
 vendor/
+admin/tool/usertours/amd/src/tour.js
+admin/tool/usertours/amd/src/popper.js
 auth/cas/CAS/
 auth/fc/fcFPP.php
 enrol/lti/ims-blti/
@@ -19,7 +23,8 @@ lib/phpexcel/
 lib/google/
 lib/htmlpurifier/
 lib/jabber/
-lib/minify/
+lib/minify/matthiasmullie-minify/
+lib/minify/matthiasmullie-pathconverter/
 lib/flowplayer/
 lib/pear/Auth/RADIUS.php
 lib/pear/Crypt/CHAP.php
@@ -52,6 +57,7 @@ lib/spout/
 lib/amd/src/chartjs-lazy.js
 lib/maxmind/GeoIp2/
 lib/maxmind/MaxMind/
+lib/ltiprovider/
 mod/assign/feedback/editpdf/fpdi/
 repository/s3/S3.php
 theme/boost/scss/bootstrap/
index da666ee..a0d3845 100644 (file)
@@ -16,6 +16,9 @@ php:
     - 7.0
     - 5.6
 
+services:
+    - redis-server
+
 env:
     # Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
     # start first so that the total run time is not too high.
@@ -78,6 +81,10 @@ install:
                 echo 'auth.json' >> .git/info/exclude
             fi
 
+            # Enable Redis.
+            echo 'extension="redis.so"' > /tmp/redis.ini
+            phpenv config-add /tmp/redis.ini
+
             # Install composer dependencies.
             # We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
             # Typically it should be able to use the Composer cache if any other job has already completed before we started here.
@@ -147,6 +154,7 @@ before_script:
         sed -i \
           -e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
           -e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
+          -e "/require_once/i \\define('TEST_SESSION_REDIS_HOST', '127.0.0.1');" \
           config.php ;
 
         # Initialise PHPUnit for Moodle.
index 8fc47df..5852cc4 100644 (file)
@@ -221,7 +221,12 @@ module.exports = function(grunt) {
       var eslintIgnores = ['# Generated by "grunt ignorefiles"', '*/**/yui/src/*/meta/', '*/**/build/'].concat(thirdPartyPaths);
       grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
       // Generate .stylelintignore.
-      var stylelintIgnores = ['# Generated by "grunt ignorefiles"', 'theme/bootstrapbase/style/'].concat(thirdPartyPaths);
+      var stylelintIgnores = [
+          '# Generated by "grunt ignorefiles"',
+          'theme/bootstrapbase/style/',
+          'theme/clean/style/custom.css',
+          'theme/more/style/custom.css'
+      ].concat(thirdPartyPaths);
       grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
     };
 
index 2cf9d1a..6f87285 100644 (file)
@@ -851,6 +851,7 @@ $registered = $DB->count_records('registration_hubs', array('huburl' => HUB_MOOD
 $cachewarnings = cache_helper::warnings();
 // Check if there are events 1 API handlers.
 $eventshandlers = $DB->get_records_sql('SELECT DISTINCT component FROM {events_handlers}');
+$themedesignermode = !empty($CFG->themedesignermode);
 
 admin_externalpage_setup('adminnotifications');
 
@@ -858,4 +859,4 @@ $output = $PAGE->get_renderer('core', 'admin');
 
 echo $output->admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems,
                                        $maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
-                                       $registered, $cachewarnings, $eventshandlers);
+                                       $registered, $cachewarnings, $eventshandlers, $themedesignermode);
index 7895c31..2b841d6 100644 (file)
@@ -281,7 +281,7 @@ class core_admin_renderer extends plugin_renderer_base {
      */
     public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed,
             $cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch,
-            $buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0) {
+            $buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0, $themedesignermode = false) {
         global $CFG;
         $output = '';
 
@@ -290,6 +290,7 @@ class core_admin_renderer extends plugin_renderer_base {
         $output .= $this->legacy_log_store_writing_error();
         $output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : '';
         $output .= $this->insecure_dataroot_warning($insecuredataroot);
+        $output .= $this->themedesignermode_warning($themedesignermode);
         $output .= $this->display_errors_warning($errorsdisplayed);
         $output .= $this->buggy_iconv_warning($buggyiconvnomb);
         $output .= $this->cron_overdue_warning($cronoverdue);
@@ -532,6 +533,19 @@ class core_admin_renderer extends plugin_renderer_base {
         return $this->warning(get_string('displayerrorswarning', 'admin'));
     }
 
+    /**
+     * Render an appropriate message if themdesignermode is enabled.
+     * @param bool $themedesignermode true if enabled
+     * @return string HTML to output.
+     */
+    protected function themedesignermode_warning($themedesignermode) {
+        if (!$themedesignermode) {
+            return '';
+        }
+
+        return $this->warning(get_string('themedesignermodewarning', 'admin'));
+    }
+
     /**
      * Render an appropriate message if iconv is buggy and mbstring missing.
      * @param bool $buggyiconvnomb
index 946abbd..c892566 100644 (file)
@@ -96,6 +96,11 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $temp->add(new admin_setting_configcheckbox('passwordchangelogout',
         new lang_string('passwordchangelogout', 'admin'),
         new lang_string('passwordchangelogout_desc', 'admin'), 0));
+
+    $temp->add(new admin_setting_configcheckbox('passwordchangetokendeletion',
+        new lang_string('passwordchangetokendeletion', 'admin'),
+        new lang_string('passwordchangetokendeletion_desc', 'admin'), 0));
+
     $temp->add(new admin_setting_configcheckbox('groupenrolmentkeypolicy', new lang_string('groupenrolmentkeypolicy', 'admin'), new lang_string('groupenrolmentkeypolicy_desc', 'admin'), 1));
     $temp->add(new admin_setting_configcheckbox('disableuserimages', new lang_string('disableuserimages', 'admin'), new lang_string('configdisableuserimages', 'admin'), 0));
     $temp->add(new admin_setting_configcheckbox('emailchangeconfirmation', new lang_string('emailchangeconfirmation', 'admin'), new lang_string('configemailchangeconfirmation', 'admin'), 1));
index 48327c7..a5b6616 100644 (file)
@@ -47,13 +47,15 @@ list($options, $unrecognized) = cli_get_params(
         'help'     => false,
         'fromrun'  => 1,
         'torun'    => 0,
-        'run-with-theme' => false,
         'optimize-runs' => '',
+        'add-core-features-to-theme' => false,
     ),
     array(
         'j' => 'parallel',
         'm' => 'maxruns',
         'h' => 'help',
+        'o' => 'optimize-runs',
+        'a' => 'add-core-features-to-theme',
     )
 );
 
@@ -69,8 +71,9 @@ Options:
 -m, --maxruns    Max parallel processes to be executed at one time.
 --fromrun        Execute run starting from (Used for parallel runs on different vms)
 --torun          Execute run till (Used for parallel runs on different vms)
---optimize-runs  Split features with specified tags in all parallel runs.
---run-with-theme Run all core features with specified theme.
+
+-o, --optimize-runs Split features with specified tags in all parallel runs.
+-a, --add-core-features-to-theme Add all core features to specified theme's
 
 -h, --help     Print out this help
 
@@ -99,7 +102,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
     }
 } else {
     // Only sanitize options for single run.
-    $cmdoptionsforsinglerun = array('run-with-theme');
+    $cmdoptionsforsinglerun = array('add-core-features-to-theme');
 
     foreach ($cmdoptionsforsinglerun as $option) {
         if (!empty($options[$option])) {
index a601967..b157ca7 100644 (file)
@@ -56,13 +56,15 @@ list($options, $unrecognized) = cli_get_params(
         'updatesteps' => false,
         'fromrun'     => 1,
         'torun'       => 0,
-        'run-with-theme' => false,
         'optimize-runs' => '',
+        'add-core-features-to-theme' => false,
     ),
     array(
         'h' => 'help',
         'j' => 'parallel',
         'm' => 'maxruns',
+        'o' => 'optimize-runs',
+        'a' => 'add-core-features-to-theme',
     )
 );
 
@@ -81,10 +83,10 @@ Options:
 --diag         Get behat test environment status code
 --updatesteps  Update feature step file.
 
--j, --parallel   Number of parallel behat run operation
--m, --maxruns    Max parallel processes to be executed at one time.
---optimize-runs  Split features with specified tags in all parallel runs.
---run-with-theme Run all core features with specified theme.
+-j, --parallel Number of parallel behat run operation
+-m, --maxruns Max parallel processes to be executed at one time.
+-o, --optimize-runs Split features with specified tags in all parallel runs.
+-a, --add-core-features-to-theme Add all core features to specified theme's
 
 -h, --help     Print out this help
 
@@ -180,14 +182,14 @@ if ($options['diag'] || $options['enable'] || $options['disable']) {
 } else if ($options['updatesteps']) {
     // Rewrite config file to ensure we have all the features covered.
     if (empty($options['parallel'])) {
-        behat_config_manager::update_config_file('', true, '', $options['run-with-theme'], false, false);
+        behat_config_manager::update_config_file('', true, '', $options['add-core-features-to-theme'], false, false);
     } else {
         // Update config file, ensuring we have up-to-date behat.yml.
         for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
             $CFG->behatrunprocess = $i;
 
             // Update config file for each run.
-            behat_config_manager::update_config_file('', true, $options['optimize-runs'], $options['run-with-theme'],
+            behat_config_manager::update_config_file('', true, $options['optimize-runs'], $options['add-core-features-to-theme'],
                 $options['parallel'], $i);
         }
         unset($CFG->behatrunprocess);
index 85987a0..3d0e2db 100644 (file)
@@ -47,11 +47,13 @@ list($options, $unrecognized) = cli_get_params(
         'diag'        => false,
         'tags'        => '',
         'updatesteps' => false,
-        'run-with-theme' => false,
         'optimize-runs' => '',
+        'add-core-features-to-theme' => false,
     ),
     array(
         'h' => 'help',
+        'o' => 'optimize-runs',
+        'a' => 'add-core-features-to-theme',
     )
 );
 
@@ -73,8 +75,9 @@ Options:
 --disable        Disables test environment
 --diag           Get behat test environment status code
 --updatesteps    Update feature step file.
---optimize-runs  Split features with specified tags in all parallel runs.
---run-with-theme Run all core features with specified theme.
+
+-o, --optimize-runs Split features with specified tags in all parallel runs.
+-a, --add-core-features-to-theme Add all core features to specified theme's
 
 -h, --help Print out this help
 
@@ -180,7 +183,7 @@ if ($options['install']) {
     }
 
     // Enable test mode.
-    behat_util::start_test_mode($options['run-with-theme'], $options['optimize-runs'], $parallel, $run);
+    behat_util::start_test_mode($options['add-core-features-to-theme'], $options['optimize-runs'], $parallel, $run);
 
     // This is only displayed once for parallel install.
     if (empty($run)) {
diff --git a/admin/tool/behat/tests/behat/datetime_strings.feature b/admin/tool/behat/tests/behat/datetime_strings.feature
new file mode 100644 (file)
index 0000000..0b4e7e5
--- /dev/null
@@ -0,0 +1,25 @@
+@tool @tool_behat
+Feature: Transform date time string arguments
+  In order to write tests with relative date and time
+  As a user
+  I need to apply some transformations to the steps arguments
+
+  Scenario: Set date in table and check date with specific format
+    Given I am on site homepage
+    And the following "users" exist:
+      | username  | firstname | lastname |
+      | teacher1  | Teacher   | 1        |
+    And the following "courses" exist:
+      | fullname | shortname | category |
+      | Course 1 | C1        | 0        |
+    And the following "activities" exist:
+      | activity | course | idnumber | name                 | intro                       | duedate       |
+      | assign   | C1     | assign1  | Test assignment name | Test assignment description | ##yesterday## |
+    And the following "course enrolments" exist:
+      | user     | course | role    |
+      | teacher1 | C1     | editingteacher |
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I follow "Test assignment name"
+    And I should see "##yesterday##l, j F Y##"
+    And I log out
index 4b4120d..f8d847d 100644 (file)
@@ -31,8 +31,9 @@ Feature: Transform steps arguments
     And I press "Update profile"
     And I follow "Edit profile"
     Then I should not see "NASTYSTRING"
-    And the field "Surname" matches value "$NASTYSTRING1"
-    And the field "City/town" matches value "$NASTYSTRING3"
+    # BEHAT Transformation regression - See MDL-56397
+    #And the field "Surname" matches value "$NASTYSTRING1"
+    #And the field "City/town" matches value "$NASTYSTRING3"
 
   Scenario: Use double quotes
     When I set the following fields to these values:
@@ -56,4 +57,5 @@ Feature: Transform steps arguments
     And I should see "My Firstname"
     And I should see "My Surname"
     And the field "First name" matches value "My Firstname $NASTYSTRING1"
-    And the field "Surname" matches value "My Surname $NASTYSTRING2"
+    # BEHAT Transformation regression - See MDL-56397
+    #And the field "Surname" matches value "My Surname $NASTYSTRING2"
index 5723743..6ae0a6c 100644 (file)
@@ -75,9 +75,11 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
         ),
     );
 
-    private $corefatures = array('test_1' => __DIR__.'/fixtures/core/test_1.feature',
-                                 'test_2' => __DIR__.'/fixtures/core/test_2.feature');
+    /** @var array List of core features. */
+    private $corefatures = array('test_1_core_fixtures_tests_behat_tool' => __DIR__.'/fixtures/core/test_1.feature',
+                                 'test_2_core_fixtures_tests_behat_tool' => __DIR__.'/fixtures/core/test_2.feature');
 
+    /** @var array List of core contexts. */
     private $corecontexts = array('behat_test_context_1' => __DIR__.'/fixtures/core/behat_test_context_1.php',
                                   'behat_test_context_2' => __DIR__.'/fixtures/core/behat_test_context_2.php');
 
@@ -461,5 +463,211 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             ['C:\mod_assign.feature', 'mod_assign', 'C:\mod_assign.feature'],
         );
     }
+
+    /**
+     * Behat config for blacklisted tags.
+     */
+    public function test_get_config_file_contents_with_blacklisted_tags() {
+
+        $mockbuilder = $this->getMockBuilder('behat_config_util');
+        $mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme'));
+
+        $behatconfigutil = $mockbuilder->getMock();
+
+        $behatconfigutil = $this->get_behat_config_util($behatconfigutil);
+
+        // Blacklisted tags.
+        $map = array(
+            array('withfeatures', 'tags', array('@test1')),
+            array('nofeatures', 'tags', array('@test2')),
+            array('withfeatures', 'features', array()),
+            array('nofeatures', 'features', array()),
+            array('withfeatures', 'contexts', array()),
+            array('nofeatures', 'contexts', array())
+        );
+
+        $behatconfigutil->expects($this->any())
+            ->method('get_blacklisted_tests_for_theme')
+            ->will($this->returnValueMap($map));
+
+        $behatconfigutil->set_theme_suite_to_include_core_features(true);
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+
+        // Three suites should be present.
+        $suites = $config['default']['suites'];
+        $this->assertCount(3, $suites);
+
+        $featurepaths = array(
+            'default' => array('test_1.feature', 'test_2.feature'),
+            'withfeatures' => array('test_2.feature', 'theme_test_1.feature', 'theme_test_2.feature', 'theme_test_3.feature',
+                'theme_test_4.feature', 'theme_test_5.feature'),
+            'nofeatures' => array('test_1.feature')
+        );
+
+        // Check features.
+        foreach ($featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+        // Check contexts.
+        foreach ($this->contextspath as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['contexts']);
+
+            foreach ($paths as $key => $context) {
+                $this->assertTrue(in_array($context, $suites[$themename]['contexts']));
+            }
+        }
+        // There are 6 step definitions.
+        $this->assertCount(6, $config['default']['extensions']['Moodle\BehatExtension']['steps_definitions']);
+    }
+
+    /**
+     * Behat config for blacklisted features.
+     */
+    public function test_get_config_file_contents_with_blacklisted_features_contexts() {
+
+        $mockbuilder = $this->getMockBuilder('behat_config_util');
+        $mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme'));
+
+        $behatconfigutil = $mockbuilder->getMock();
+
+        $behatconfigutil = $this->get_behat_config_util($behatconfigutil);
+
+        // Blacklisted features and contexts.
+        $map = array(
+            array('withfeatures', 'tags', array()),
+            array('nofeatures', 'tags', array()),
+            array('withfeatures', 'features', array('admin/tool/behat/tests/fixtures/core/test_1.feature')),
+            array('nofeatures', 'features', array('admin/tool/behat/tests/fixtures/core/test_2.feature')),
+            array('withfeatures', 'contexts', array('admin/tool/behat/tests/fixtures/core/behat_test_context_2.php')),
+            array('nofeatures', 'contexts', array('admin/tool/behat/tests/fixtures/core/behat_test_context_1.php'))
+        );
+
+        $behatconfigutil->expects($this->any())
+            ->method('get_blacklisted_tests_for_theme')
+            ->will($this->returnValueMap($map));
+
+        $behatconfigutil->set_theme_suite_to_include_core_features(true);
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+
+        // Three suites should be present.
+        $suites = $config['default']['suites'];
+        $this->assertCount(3, $suites);
+
+        $featurepaths = array(
+            'default' => array('test_1.feature', 'test_2.feature'),
+            'withfeatures' => array('test_2.feature', 'theme_test_1.feature', 'theme_test_2.feature', 'theme_test_3.feature',
+                'theme_test_4.feature', 'theme_test_5.feature'),
+            'nofeatures' => array('test_1.feature')
+        );
+        $contextspath = array(
+            'default' => array(
+                'behat_test_context_1',
+                'behat_test_context_2'
+            ),
+            'withfeatures' => array(
+                'behat_theme_withfeatures_test_context_2',
+                'behat_theme_withfeatures_behat_test_context_1'
+            ),
+            'nofeatures' => array(
+                'behat_theme_nofeatures_test_context_1',
+                'behat_theme_nofeatures_behat_test_context_2'
+            ),
+        );
+
+        // Check features.
+        foreach ($featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+        // Check contexts.
+        foreach ($contextspath as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['contexts']);
+
+            foreach ($paths as $key => $context) {
+                $this->assertTrue(in_array($context, $suites[$themename]['contexts']));
+            }
+        }
+        // There are 6 step definitions.
+        $this->assertCount(6, $config['default']['extensions']['Moodle\BehatExtension']['steps_definitions']);
+    }
+
+    /**
+     * Behat config for blacklisted tags.
+     */
+    public function test_core_features_to_include_in_specified_theme() {
+
+        $mockbuilder = $this->getMockBuilder('behat_config_util');
+        $mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes'));
+
+        $behatconfigutil = $mockbuilder->getMock();
+
+        $behatconfigutil = $this->get_behat_config_util($behatconfigutil);
+
+        // Check features when, no theme is specified.
+        $behatconfigutil->set_theme_suite_to_include_core_features('');
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+        $suites = $config['default']['suites'];
+        foreach ($this->featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+
+        // Check features when all themes are specified.
+        $featurepaths = $this->featurepaths;
+        $featurepaths['withfeatures'] = array_merge ($featurepaths['default'], $featurepaths['withfeatures']);
+        $featurepaths['nofeatures'] = array_merge ($featurepaths['default'], $featurepaths['nofeatures']);
+
+        $behatconfigutil->set_theme_suite_to_include_core_features('ALL');
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+        $suites = $config['default']['suites'];
+        foreach ($featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+
+        // Check features when all themes are specified.
+        $featurepaths = $this->featurepaths;
+        $featurepaths['withfeatures'] = array_merge ($featurepaths['default'], $featurepaths['withfeatures']);
+        $featurepaths['nofeatures'] = array_merge ($featurepaths['default'], $featurepaths['nofeatures']);
+
+        $behatconfigutil->set_theme_suite_to_include_core_features('withfeatures, nofeatures');
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+        $suites = $config['default']['suites'];
+        foreach ($featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+
+        // Check features when specified themes are passed..
+        $featurepaths = $this->featurepaths;
+        $featurepaths['nofeatures'] = array_merge ($featurepaths['default'], $featurepaths['nofeatures']);
+
+        $behatconfigutil->set_theme_suite_to_include_core_features('nofeatures');
+        $config = $behatconfigutil->get_config_file_contents($this->corefatures, $this->corecontexts);
+        $suites = $config['default']['suites'];
+        foreach ($featurepaths as $themename => $paths) {
+            $this->assertCount(count($paths), $suites[$themename]['paths']);
+
+            foreach ($paths as $key => $feature) {
+                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+            }
+        }
+    }
 }
 // @codeCoverageIgnoreEnd
diff --git a/admin/tool/mobile/autologin.php b/admin/tool/mobile/autologin.php
new file mode 100644 (file)
index 0000000..d5ef969
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle 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 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Auto-login end-point, a user can be fully authenticated in the site providing a valid key.
+ *
+ * @package    tool_mobile
+ * @copyright  2016 Juan Leyva
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(__DIR__ . '/../../../config.php');
+require_once($CFG->libdir . '/externallib.php');
+
+$userid = required_param('userid', PARAM_INT);  // The user id the key belongs to (for double-checking).
+$key = required_param('key', PARAM_ALPHANUMEXT);    // The key generated by the tool_mobile_external::get_autologin_key() external function.
+$urltogo = optional_param('urltogo', $CFG->wwwroot, PARAM_URL);    // URL to redirect.
+
+$context = context_system::instance();
+$PAGE->set_context($context);
+// Force https.
+$PAGE->https_required();
+
+// Check if the user is already logged-in.
+if (isloggedin() and !isguestuser()) {
+    delete_user_key('tool_mobile', $userid);
+    if ($USER->id == $userid) {
+        redirect($urltogo);
+    } else {
+        throw new moodle_exception('alreadyloggedin', 'error', '', format_string(fullname($USER)));
+    }
+}
+
+tool_mobile\api::check_autologin_prerequisites($userid);
+
+// Validate and delete the key.
+$key = validate_user_key($key, 'tool_mobile', null);
+delete_user_key('tool_mobile', $userid);
+
+// Double check key belong to user.
+if ($key->userid != $userid) {
+    throw new moodle_exception('invalidkey');
+}
+
+// Key validated, now require an active user: not guest, not suspended.
+$user = core_user::get_user($key->userid, '*', MUST_EXIST);
+core_user::require_active_user($user, true, true);
+
+// Do the user log-in.
+if (!$user = get_complete_user_data('id', $user->id)) {
+    throw new moodle_exception('cannotfinduser', '', '', $user->id);
+}
+
+complete_user_login($user);
+\core\session\manager::apply_concurrent_login_limit($user->id, session_id());
+
+redirect($urltogo);
index 192b79e..657a0e2 100644 (file)
@@ -28,6 +28,7 @@ use core_component;
 use core_plugin_manager;
 use context_system;
 use moodle_url;
+use moodle_exception;
 
 /**
  * API exposed by tool_mobile
@@ -44,6 +45,8 @@ class api {
     const LOGIN_VIA_BROWSER = 2;
     /** @var int to identify the login via an embedded browser. */
     const LOGIN_VIA_EMBEDDED_BROWSER = 3;
+    /** @var int seconds an auto-login key will expire. */
+    const LOGIN_KEY_TTL = 60;
 
     /**
      * Returns a list of Moodle plugins supporting the mobile app.
@@ -180,4 +183,43 @@ class api {
         return $settings;
     }
 
+    /*
+     * Check if all the required conditions are met to allow the auto-login process continue.
+     *
+     * @param  int $userid  current user id
+     * @since Moodle 3.2
+     * @throws moodle_exception
+     */
+    public static function check_autologin_prerequisites($userid) {
+        global $CFG;
+
+        if (!$CFG->enablewebservices or !$CFG->enablemobilewebservice) {
+            throw new moodle_exception('enablewsdescription', 'webservice');
+        }
+
+        if (!is_https()) {
+            throw new moodle_exception('httpsrequired', 'tool_mobile');
+        }
+
+        if (has_capability('moodle/site:config', context_system::instance(), $userid) or is_siteadmin($userid)) {
+            throw new moodle_exception('autologinnotallowedtoadmins', 'tool_mobile');
+        }
+    }
+
+    /**
+     * Creates an auto-login key for the current user, this key is restricted by time and ip address.
+     *
+     * @return string the key
+     * @since Moodle 3.2
+     */
+    public static function get_autologin_key() {
+        global $USER;
+        // Delete previous keys.
+        delete_user_key('tool_mobile', $USER->id);
+
+        // Create a new key.
+        $iprestriction = getremoteaddr();
+        $validuntil = time() + self::LOGIN_KEY_TTL;
+        return create_user_key('tool_mobile', $USER->id, null, $iprestriction, $validuntil);
+    }
 }
index 8058a86..e06fe73 100644 (file)
@@ -32,6 +32,10 @@ use external_value;
 use external_single_structure;
 use external_multiple_structure;
 use external_warnings;
+use context_system;
+use moodle_exception;
+use moodle_url;
+use core_text;
 
 /**
  * This is the external API for this tool.
@@ -207,4 +211,101 @@ class external extends external_api {
             )
         );
     }
+
+    /**
+     * Returns description of get_autologin_key() parameters.
+     *
+     * @return external_function_parameters
+     * @since  Moodle 3.2
+     */
+    public static function get_autologin_key_parameters() {
+        return new external_function_parameters (
+            array(
+                'privatetoken' => new external_value(PARAM_ALPHANUM, 'Private token, usually generated by login/token.php'),
+            )
+        );
+    }
+
+    /**
+     * Creates an auto-login key for the current user. Is created only in https sites and is restricted by time and ip address.
+     *
+     * @param string $privatetoken the user private token for validating the request
+     * @return array with the settings and warnings
+     * @since  Moodle 3.2
+     */
+    public static function get_autologin_key($privatetoken) {
+        global $CFG, $DB, $USER;
+
+        $params = self::validate_parameters(self::get_autologin_key_parameters(), array('privatetoken' => $privatetoken));
+        $privatetoken = $params['privatetoken'];
+
+        $context = context_system::instance();
+
+        // We must toletare these two exceptions: forcepasswordchangenotice and usernotfullysetup.
+        try {
+            self::validate_context($context);
+        } catch (Exception $e) {
+            if ($e instanceof moodle_exception) {
+                if (($e->errorcode != 'usernotfullysetup') and
+                    ($e->errorcode != 'forcepasswordchangenotice')) {
+
+                    // In case we receive a different exception, throw it.
+                    throw $e;
+                }
+            } else {
+                throw $e;
+            }
+        }
+
+        api::check_autologin_prerequisites($USER->id);
+
+        if (isset($_GET['privatetoken']) or empty($privatetoken)) {
+            throw new moodle_exception('invalidprivatetoken', 'tool_mobile');
+        }
+
+        // Check the request counter, we must limit the number of times the privatetoken is sent.
+        // Between each request 6 minutes are required.
+        $last = get_user_preferences('tool_mobile_autologin_request_last', 0, $USER);
+        // Check if we must reset the count.
+        $timenow = time();
+        if ($timenow - $last < 6 * MINSECS) {
+            throw new moodle_exception('autologinkeygenerationlockout', 'tool_mobile');
+        }
+        set_user_preference('tool_mobile_autologin_request_last', $timenow, $USER);
+
+        // We are expecting a privatetoken linked to the current token being used.
+        // This WS is only valid when using mobile services via REST (this is intended).
+        $currenttoken = required_param('wstoken', PARAM_ALPHANUM);
+        $conditions = array(
+            'userid' => $USER->id,
+            'token' => $currenttoken,
+            'privatetoken' => $privatetoken,
+        );
+        if (!$token = $DB->get_record('external_tokens', $conditions)) {
+            throw new moodle_exception('invalidprivatetoken', 'tool_mobile');
+        }
+
+        $result = array();
+        $result['key'] = api::get_autologin_key();
+        $autologinurl = new moodle_url("/$CFG->admin/tool/mobile/autologin.php");
+        $result['autologinurl'] = $autologinurl->out(false);
+        $result['warnings'] = array();
+        return $result;
+    }
+
+    /**
+     * Returns description of get_autologin_key() result value.
+     *
+     * @return external_description
+     * @since  Moodle 3.2
+     */
+    public static function get_autologin_key_returns() {
+        return new external_single_structure(
+            array(
+                'key' => new external_value(PARAM_ALPHANUMEXT, 'Auto-login key for a single usage with time expiration.'),
+                'autologinurl' => new external_value(PARAM_URL, 'Auto-login URL.'),
+                'warnings' => new external_warnings(),
+            )
+        );
+    }
 }
index 13ac5b0..9a22aa8 100644 (file)
@@ -49,7 +49,15 @@ $functions = array(
         'description' => 'Returns a list of the site configurations, filtering by section.',
         'type'        => 'read',
         'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
-    )
+    ),
 
+    'tool_mobile_get_autologin_key' => array(
+        'classname'   => 'tool_mobile\external',
+        'methodname'  => 'get_autologin_key',
+        'description' => 'Creates an auto-login key for the current user.
+                            Is created only in https sites and is restricted by time and ip address.',
+        'type'        => 'write',
+        'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
+    )
 );
 
index e5b9a40..f8c0347 100644 (file)
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
+$string['autologinkeygenerationlockout'] = 'Auto-login key generation is locked out, too much requests in an hour.';
+$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed to site admins';
 $string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
 $string['enablesmartappbanners'] = 'Enable Smart App Banners';
 $string['enablesmartappbanners_desc'] = 'This will display a banner promoting the Moodle Mobile app when visiting the site in Mobile Safari.';
 $string['forcedurlscheme'] = 'The URL scheme allows to open the mobile app from other apps like the browser. Use this setting if you want to allow only your custom branded app to be opened by the browser.';
 $string['forcedurlscheme_key'] = 'URL scheme';
+$string['httpsrequired'] = 'HTTPS required';
+$string['invalidprivatetoken'] = 'Invalid private token. Token should not be empty or passed via GET parameter.';
 $string['iosappid'] = 'App\'s unique identifier';
 $string['iosappid_desc'] = 'You only need to change this value if you have a custom iOS app';
 $string['loginintheapp'] = 'Via the app';
diff --git a/admin/tool/mobile/tests/api_test.php b/admin/tool/mobile/tests/api_test.php
new file mode 100644 (file)
index 0000000..1cd4e21
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle 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 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Moodle Mobile admin tool api tests.
+ *
+ * @package    tool_mobile
+ * @category   external
+ * @copyright  2016 Juan Leyva
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @since      Moodle 3.1
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+global $CFG;
+
+require_once($CFG->dirroot . '/webservice/tests/helpers.php');
+
+use tool_mobile\api;
+
+/**
+ * Moodle Mobile admin tool api tests.
+ *
+ * @package     tool_mobile
+ * @copyright   2016 Juan Leyva
+ * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @since       Moodle 3.1
+ */
+class tool_mobile_api_testcase extends externallib_advanced_testcase {
+
+    /**
+     * Test get_autologin_key.
+     */
+    public function test_get_autologin_key() {
+        global $USER, $DB;
+
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+
+        // Set server timezone for test.
+        $this->setTimezone('UTC');
+        // SEt user to GMT+5.
+        $USER->timezone = 5;
+
+        $timenow = time();
+        $key = api::get_autologin_key();
+
+        $key = $DB->get_record('user_private_key', array('value' => $key), '*', MUST_EXIST);
+        $this->assertEquals($timenow + api::LOGIN_KEY_TTL, $key->validuntil);
+        $this->assertEquals('0.0.0.0', $key->iprestriction);
+    }
+}
index 3fd3b3a..7300cc7 100644 (file)
@@ -34,7 +34,7 @@ use tool_mobile\external;
 use tool_mobile\api;
 
 /**
- * External learning plans webservice API tests.
+ * Moodle Mobile admin tool external functions tests.
  *
  * @package     tool_mobile
  * @copyright   2016 Juan Leyva
@@ -142,4 +142,123 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
         $this->assertEquals($expected, $result['settings']);
     }
 
+    /*
+     * Test get_autologin_key.
+     */
+    public function test_get_autologin_key() {
+        global $DB, $CFG, $USER;
+
+        $this->resetAfterTest(true);
+
+        $user = $this->getDataGenerator()->create_user();
+        $this->setUser($user);
+        $service = $DB->get_record('external_services', array('shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE));
+
+        $token = external_generate_token_for_current_user($service);
+        $this->assertDebuggingCalled(); // MDL-55992.
+
+        // Check we got the private token.
+        $this->assertTrue(isset($token->privatetoken));
+
+        // Enable requeriments.
+        $CFG->httpswwwroot = str_replace('http:', 'https:', $CFG->httpswwwroot);    // Mock https.
+        $CFG->enablewebservices = 1;
+        $CFG->enablemobilewebservice = 1;
+        $_GET['wstoken'] = $token->token;   // Mock parameters.
+
+        $this->setCurrentTimeStart();
+        $result = external::get_autologin_key($token->privatetoken);
+        $result = external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
+        // Validate the key.
+        $this->assertEquals(32, core_text::strlen($result['key']));
+        $key = $DB->get_record('user_private_key', array('value' => $result['key']));
+        $this->assertEquals($USER->id, $key->userid);
+        $this->assertTimeCurrent($key->validuntil - api::LOGIN_KEY_TTL);
+
+        // Now, try with an invalid private token.
+        set_user_preference('tool_mobile_autologin_request_last', time() - HOURSECS, $USER);
+
+        $this->expectException('moodle_exception');
+        $this->expectExceptionMessage(get_string('invalidprivatetoken', 'tool_mobile'));
+        $result = external::get_autologin_key(random_string('64'));
+    }
+
+    /**
+     * Test get_autologin_key missing ws.
+     */
+    public function test_get_autologin_key_missing_ws() {
+        $this->resetAfterTest(true);
+
+        $this->setAdminUser();
+        $this->expectException('moodle_exception');
+        $this->expectExceptionMessage(get_string('enablewsdescription', 'webservice'));
+        $result = external::get_autologin_key('');
+    }
+
+    /**
+     * Test get_autologin_key missing https.
+     */
+    public function test_get_autologin_key_missing_https() {
+        global $CFG;
+
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+        $CFG->enablewebservices = 1;
+        $CFG->enablemobilewebservice = 1;
+
+        $this->expectException('moodle_exception');
+        $this->expectExceptionMessage(get_string('httpsrequired', 'tool_mobile'));
+        $result = external::get_autologin_key('');
+    }
+
+    /**
+     * Test get_autologin_key missing admin.
+     */
+    public function test_get_autologin_key_missing_admin() {
+        global $CFG;
+
+        $this->resetAfterTest(true);
+        $this->setAdminUser();
+        $CFG->enablewebservices = 1;
+        $CFG->enablemobilewebservice = 1;
+        $CFG->httpswwwroot = str_replace('http:', 'https:', $CFG->httpswwwroot);
+
+        $this->expectException('moodle_exception');
+        $this->expectExceptionMessage(get_string('autologinnotallowedtoadmins', 'tool_mobile'));
+        $result = external::get_autologin_key('');
+    }
+
+    /**
+     * Test get_autologin_key locked.
+     */
+    public function test_get_autologin_key_missing_locked() {
+        global $CFG, $DB, $USER;
+
+        $this->resetAfterTest(true);
+        $user = $this->getDataGenerator()->create_user();
+        $this->setUser($user);
+        $CFG->enablewebservices = 1;
+        $CFG->enablemobilewebservice = 1;
+        $CFG->httpswwwroot = str_replace('http:', 'https:', $CFG->httpswwwroot);
+
+        $service = $DB->get_record('external_services', array('shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE));
+
+        $token = external_generate_token_for_current_user($service);
+        $this->assertDebuggingCalled(); // MDL-55992.
+        $_GET['wstoken'] = $token->token;   // Mock parameters.
+
+        $result = external::get_autologin_key($token->privatetoken);
+        $result = external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
+
+        // Mock last time request.
+        $mocktime = time() - 7 * MINSECS;
+        set_user_preference('tool_mobile_autologin_request_last', $mocktime, $USER);
+        $result = external::get_autologin_key($token->privatetoken);
+        $result = external_api::clean_returnvalue(external::get_autologin_key_returns(), $result);
+
+        // We just requested one token, we must wait.
+        $this->expectException('moodle_exception');
+        $this->expectExceptionMessage(get_string('autologinkeygenerationlockout', 'tool_mobile'));
+        $result = external::get_autologin_key($token->privatetoken);
+    }
 }
index e0d5dbe..8c3f25b 100644 (file)
@@ -23,6 +23,6 @@
  */
 
 defined('MOODLE_INTERNAL') || die();
-$plugin->version   = 2016052304; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->version   = 2016052305; // The current plugin version (Date: YYYYMMDDXX).
 $plugin->requires  = 2016051900; // Requires this Moodle version.
 $plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
index 496d709..bcf2ff6 100644 (file)
@@ -98,12 +98,13 @@ Feature: tool_monitor_subscriptions
     Then I should see "Subscription successfully removed"
     And "#toolmonitorsubs_r0" "css_element" should not exist
 
+  @_bug_phantomjs
   Scenario: Receiving notification on site level
     Given I log in as "admin"
     And I follow "Preferences" in the user menu
-    And I follow "Messaging"
-    And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
-    And I press "Save changes"
+    And I click on "Notification preferences" "link" in the "#page-content" "css_element"
+    And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
+    And I wait until the page is ready
     And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Acceptance test site"
@@ -113,16 +114,18 @@ Feature: tool_monitor_subscriptions
     And I am on site homepage
     And I trigger cron
     And I am on site homepage
-    When I follow "Messages" in the user menu
-    And I follow "Do not reply to this email (1)"
-    Then I should see "The course was viewed."
+    When I click on ".popover-region-notifications" "css_element"
+    And I click on "View more" "link" in the ".popover-region-notifications" "css_element"
+    Then I should see "New rule site level"
+    And I should see "The course was viewed"
 
+  @_bug_phantomjs
   Scenario: Receiving notification on course level
     Given I log in as "teacher1"
     And I follow "Preferences" in the user menu
-    And I follow "Messaging"
-    And I click on "input[name^=tool_monitor_notification_loggedin]" "css_element"
-    And I press "Save changes"
+    And I click on "Notification preferences" "link" in the "#page-content" "css_element"
+    And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
+    And I wait until the page is ready
     And I follow "Preferences" in the user menu
     And I follow "Event monitoring"
     And I set the field "Select a course" to "Course 1"
@@ -133,9 +136,10 @@ Feature: tool_monitor_subscriptions
     And I follow "Course 1"
     And I trigger cron
     And I am on site homepage
-    When I follow "Messages" in the user menu
-    And I follow "Do not reply to this email (1)"
-    Then I should see "The course was viewed."
+    When I click on ".popover-region-notifications" "css_element"
+    And I click on "View more" "link" in the ".popover-region-notifications" "css_element"
+    Then I should see "New rule course level"
+    And I should see "The course was viewed"
 
   Scenario: Navigating via quick link to rules
     Given I log in as "admin"
index 2ef5d4c..23b7dcf 100644 (file)
@@ -117,17 +117,21 @@ class api {
         // Get the list of possible template directories.
         $dirs = mustache_template_finder::get_template_directories_for_component($component);
         $filename = false;
+        $themedir = core_component::get_plugin_types()['theme'];
 
         foreach ($dirs as $dir) {
             // Skip theme dirs - we only want the original plugin/core template.
-            if (strpos($dir, "/theme/") === false) {
-                $candidate = $dir . $template . '.mustache';
-                if (file_exists($candidate)) {
-                    $filename = $candidate;
-                    break;
-                }
+            if (strpos($dir, $themedir) === 0) {
+                continue;
+            }
+
+            $candidate = $dir . $template . '.mustache';
+            if (file_exists($candidate)) {
+                $filename = $candidate;
+                break;
             }
         }
+
         if ($filename === false) {
             throw new moodle_exception('filenotfound', 'error');
         }
diff --git a/admin/tool/usertours/amd/build/managesteps.min.js b/admin/tool/usertours/amd/build/managesteps.min.js
new file mode 100644 (file)
index 0000000..886c250
Binary files /dev/null and b/admin/tool/usertours/amd/build/managesteps.min.js differ
diff --git a/admin/tool/usertours/amd/build/managetours.min.js b/admin/tool/usertours/amd/build/managetours.min.js
new file mode 100644 (file)
index 0000000..9c9e2e6
Binary files /dev/null and b/admin/tool/usertours/amd/build/managetours.min.js differ
diff --git a/admin/tool/usertours/amd/build/popper.min.js b/admin/tool/usertours/amd/build/popper.min.js
new file mode 100644 (file)
index 0000000..ac29055
Binary files /dev/null and b/admin/tool/usertours/amd/build/popper.min.js differ
diff --git a/admin/tool/usertours/amd/build/tour.min.js b/admin/tool/usertours/amd/build/tour.min.js
new file mode 100644 (file)
index 0000000..2a58fee
Binary files /dev/null and b/admin/tool/usertours/amd/build/tour.min.js differ
diff --git a/admin/tool/usertours/amd/build/usertours.min.js b/admin/tool/usertours/amd/build/usertours.min.js
new file mode 100644 (file)
index 0000000..417008a
Binary files /dev/null and b/admin/tool/usertours/amd/build/usertours.min.js differ
diff --git a/admin/tool/usertours/amd/readme_moodle.txt b/admin/tool/usertours/amd/readme_moodle.txt
new file mode 100644 (file)
index 0000000..d2db94e
--- /dev/null
@@ -0,0 +1,17 @@
+Description of External library imports into Moodle
+
+Flexitour Instructions
+----------------------
+1. Clone https://github.com/andrewnicols/flexitour into an unrelated directory
+2. Copy /build/tour.js to amd/src/tour.js
+3. Open the amd/src/tour.js file and find the AMD module define.
+4. Change the "popper" inclusion to "./popper"
+5. Update thirdpartylibs.xml
+6. Run `grunt amd`
+
+Popper.js Instructions
+----------------------
+1. Clone https://github.com/FezVrasta/popper.js into an unrelated directory
+2. Copy /build/popper.js to amd/src/popper.js
+3. Update thirdpartylibs.xml
+4. Run `grunt amd`
diff --git a/admin/tool/usertours/amd/src/managesteps.js b/admin/tool/usertours/amd/src/managesteps.js
new file mode 100644 (file)
index 0000000..ba52019
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Step management code.
+ *
+ * @module     tool_usertours/managesteps
+ * @class      managesteps
+ * @package    tool_usertours
+ * @copyright  2016 Andrew Nicols <andrew@nicols.co.uk>
+ */
+define(
+['jquery', 'core/str', 'core/notification'],
+function($, str, notification) {
+    var manager = {
+        /**
+         * Confirm removal of the specified step.
+         *
+         * @method  removeStep
+         * @param   {EventFacade}   e   The EventFacade
+         */
+        removeStep: function(e) {
+            e.preventDefault();
+            str.get_strings([
+                {
+                    key:        'confirmstepremovaltitle',
+                    component:  'tool_usertours'
+                },
+                {
+                    key:        'confirmstepremovalquestion',
+                    component:  'tool_usertours'
+                },
+                {
+                    key:        'yes',
+                    component:  'moodle'
+                },
+                {
+                    key:        'no',
+                    component:  'moodle'
+                }
+            ]).done(function(s) {
+                notification.confirm(s[0], s[1], s[2], s[3], $.proxy(function() {
+                    window.location = $(this).attr('href');
+                }, e.currentTarget));
+            });
+        },
+
+        /**
+         * Setup the step management UI.
+         *
+         * @method          setup
+         */
+        setup: function() {
+
+            $('body').delegate('[data-action="delete"]', 'click', manager.removeStep);
+        }
+    };
+
+    return /** @alias module:tool_usertours/managesteps */ {
+        /**
+         * Setup the step management UI.
+         *
+         * @method          setup
+         */
+        setup: manager.setup
+    };
+});
diff --git a/admin/tool/usertours/amd/src/managetours.js b/admin/tool/usertours/amd/src/managetours.js
new file mode 100644 (file)
index 0000000..f5c601a
--- /dev/null
@@ -0,0 +1,64 @@
+/**
+ * Tour management code.
+ *
+ * @module     tool_usertours/managetours
+ * @class      managetours
+ * @package    tool_usertours
+ * @copyright  2016 Andrew Nicols <andrew@nicols.co.uk>
+ */
+define(
+['jquery', 'core/ajax', 'core/str', 'core/notification'],
+function($, ajax, str, notification) {
+    var manager = {
+        /**
+         * Confirm removal of the specified tour.
+         *
+         * @method  removeTour
+         * @param   {EventFacade}   e   The EventFacade
+         */
+        removeTour: function(e) {
+            e.preventDefault();
+
+            str.get_strings([
+                {
+                    key:        'confirmtourremovaltitle',
+                    component:  'tool_usertours'
+                },
+                {
+                    key:        'confirmtourremovalquestion',
+                    component:  'tool_usertours'
+                },
+                {
+                    key:        'yes',
+                    component:  'moodle'
+                },
+                {
+                    key:        'no',
+                    component:  'moodle'
+                }
+            ]).done(function(s) {
+                notification.confirm(s[0], s[1], s[2], s[3], $.proxy(function() {
+                    window.location = $(this).attr('href');
+                }, e.currentTarget));
+            });
+        },
+
+        /**
+         * Setup the tour management UI.
+         *
+         * @method          setup
+         */
+        setup: function() {
+            $('body').delegate('[data-action="delete"]', 'click', manager.removeTour);
+        }
+    };
+
+    return /** @alias module:tool_usertours/managetours */ {
+        /**
+         * Setup the tour management UI.
+         *
+         * @method          setup
+         */
+        setup: manager.setup
+    };
+});
diff --git a/admin/tool/usertours/amd/src/popper.js b/admin/tool/usertours/amd/src/popper.js
new file mode 100644 (file)
index 0000000..16119ab
--- /dev/null
@@ -0,0 +1,1325 @@
+/**
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
+ * @version 0.6.4
+ * @license
+ * Copyright (c) 2016 Federico Zivolo and contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+//
+// Cross module loader
+// Supported: Node, AMD, Browser globals
+//
+;(function (root, factory) {
+    if (typeof define === 'function' && define.amd) {
+        // AMD. Register as an anonymous module.
+        define(factory);
+    } else if (typeof module === 'object' && module.exports) {
+        // Node. Does not work with strict CommonJS, but
+        // only CommonJS-like environments that support module.exports,
+        // like Node.
+        module.exports = factory();
+    } else {
+        // Browser globals (root is window)
+        root.Popper = factory();
+    }
+}(this, function () {
+
+    'use strict';
+
+    var root = window;
+
+    // default options
+    var DEFAULTS = {
+        // placement of the popper
+        placement: 'bottom',
+
+        gpuAcceleration: true,
+
+        // shift popper from its origin by the given amount of pixels (can be negative)
+        offset: 0,
+
+        // the element which will act as boundary of the popper
+        boundariesElement: 'viewport',
+
+        // amount of pixel used to define a minimum distance between the boundaries and the popper
+        boundariesPadding: 5,
+
+        // popper will try to prevent overflow following this order,
+        // by default, then, it could overflow on the left and on top of the boundariesElement
+        preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
+
+        // the behavior used by flip to change the placement of the popper
+        flipBehavior: 'flip',
+
+        arrowElement: '[x-arrow]',
+
+        // list of functions used to modify the offsets before they are applied to the popper
+        modifiers: [ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
+
+        modifiersIgnored: [],
+    };
+
+    /**
+     * Create a new Popper.js instance
+     * @constructor Popper
+     * @param {HTMLElement} reference - The reference element used to position the popper
+     * @param {HTMLElement|Object} popper
+     *      The HTML element used as popper, or a configuration used to generate the popper.
+     * @param {String} [popper.tagName='div'] The tag name of the generated popper.
+     * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
+     * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
+     * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
+     * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.
+     * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
+     * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
+     * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
+     * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
+     * @param {Object} options
+     * @param {String} [options.placement=bottom]
+     *      Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
+     *      left(-start, -end)`
+     *
+     * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
+     *      The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
+     *      its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
+     *      reference element.
+     *      By default, it will look for a child node of the popper with the `x-arrow` attribute.
+     *
+     * @param {Boolean} [options.gpuAcceleration=true]
+     *      When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
+     *      browser to use the GPU to accelerate the rendering.
+     *      If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
+     *
+     * @param {Number} [options.offset=0]
+     *      Amount of pixels the popper will be shifted (can be negative).
+     *
+     * @param {String|Element} [options.boundariesElement='viewport']
+     *      The element which will define the boundaries of the popper position, the popper will never be placed outside
+     *      of the defined boundaries (except if `keepTogether` is enabled)
+     *
+     * @param {Number} [options.boundariesPadding=5]
+     *      Additional padding for the boundaries
+     *
+     * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
+     *      Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
+     *      this means that the last ones will never overflow
+     *
+     * @param {String|Array} [options.flipBehavior='flip']
+     *      The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
+     *      overlap its reference element. Defining `flip` as value, the placement will be flipped on
+     *      its axis (`right - left`, `top - bottom`).
+     *      You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
+     *      how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
+     *      then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
+     *
+     * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
+     *      List of functions used to modify the data before they are applied to the popper, add your custom functions
+     *      to this array to edit the offsets and placement.
+     *      The function should reflect the @params and @returns of preventOverflow
+     *
+     * @param {Array} [options.modifiersIgnored=[]]
+     *      Put here any built-in modifier name you want to exclude from the modifiers list
+     *      The function should reflect the @params and @returns of preventOverflow
+     *
+     * @param {Boolean} [options.removeOnDestroy=false]
+     *      Set to true if you want to automatically remove the popper when you call the `destroy` method.
+     */
+    function Popper(reference, popper, options) {
+        this._reference = reference.jquery ? reference[0] : reference;
+        this.state = { onCreateCalled: false };
+
+        // if the popper variable is a configuration object, parse it to generate an HTMLElement
+        // generate a default popper if is not defined
+        var isNotDefined = typeof popper === 'undefined' || popper === null;
+        var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
+        if (isNotDefined || isConfig) {
+            this._popper = this.parse(isConfig ? popper : {});
+        }
+        // otherwise, use the given HTMLElement as popper
+        else {
+            this._popper = popper.jquery ? popper[0] : popper;
+        }
+
+        // with {} we create a new object with the options inside it
+        this._options = Object.assign({}, DEFAULTS, options);
+
+        // refactoring modifiers' list
+        this._options.modifiers = this._options.modifiers.map(function(modifier){
+            // remove ignored modifiers
+            if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
+
+            // set the x-placement attribute before everything else because it could be used to add margins to the popper
+            // margins needs to be calculated to get the correct popper offsets
+            if (modifier === 'applyStyle') {
+                this._popper.setAttribute('x-placement', this._options.placement);
+            }
+
+            // return predefined modifier identified by string or keep the custom one
+            return this.modifiers[modifier] || modifier;
+        }.bind(this));
+
+        // make sure to apply the popper position before any computation
+        this.state.position = this._getPosition(this._popper, this._reference);
+        setStyle(this._popper, { position: this.state.position});
+
+        // determine how we should set the origin of offsets
+        this.state.isParentTransformed = this._getIsParentTransformed(this._popper);
+
+        // fire the first update to position the popper in the right place
+        this.update();
+
+        // setup event listeners, they will take care of update the position in specific situations
+        this._setupEventListeners();
+        return this;
+    }
+
+
+    //
+    // Methods
+    //
+    /**
+     * Destroy the popper
+     * @method
+     * @memberof Popper
+     */
+    Popper.prototype.destroy = function() {
+        this._popper.removeAttribute('x-placement');
+        this._popper.style.left = '';
+        this._popper.style.position = '';
+        this._popper.style.top = '';
+        this._popper.style[getSupportedPropertyName('transform')] = '';
+        this._removeEventListeners();
+
+        // remove the popper if user explicity asked for the deletion on destroy
+        if (this._options.removeOnDestroy) {
+            this._popper.parentNode.removeChild(this._popper);
+        }
+        return this;
+    };
+
+    /**
+     * Updates the position of the popper, computing the new offsets and applying the new style
+     * @method
+     * @memberof Popper
+     */
+    Popper.prototype.update = function() {
+        var data = { instance: this, styles: {} };
+
+        // make sure to apply the popper position before any computation
+        this.state.position = this._getPosition(this._popper, this._reference);
+        setStyle(this._popper, { position: this.state.position});
+
+        // to avoid useless computations we throttle the popper position refresh to 60fps
+        root.requestAnimationFrame(function() {
+            var now = root.performance.now();
+            if(now - this.state.lastFrame <= 16) {
+                // this update fired to early! drop it
+                return;
+            }
+            this.state.lastFrame = now;
+
+            // store placement inside the data object, modifiers will be able to edit `placement` if needed
+            // and refer to _originalPlacement to know the original value
+            data.placement = this._options.placement;
+            data._originalPlacement = this._options.placement;
+
+            // compute the popper and trigger offsets and put them inside data.offsets
+            data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
+
+            // get boundaries
+            data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
+
+            data = this.runModifiers(data, this._options.modifiers);
+
+            if (!isFunction(this.state.createCalback)) {
+                this.state.onCreateCalled = true;
+            }
+            if (!this.state.onCreateCalled) {
+                this.state.onCreateCalled = true;
+                if (isFunction(this.state.createCalback)) {
+                    this.state.createCalback(this);
+                }
+            } else if (isFunction(this.state.updateCallback)) {
+                this.state.updateCallback(data);
+            }
+        }.bind(this));
+    };
+
+    /**
+     * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
+     * @method
+     * @memberof Popper
+     * @param {Function} callback
+     */
+    Popper.prototype.onCreate = function(callback) {
+        // the createCallbacks return as first argument the popper instance
+        this.state.createCalback = callback;
+        return this;
+    };
+
+    /**
+     * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
+     * used to style popper and its arrow.
+     * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
+     * @method
+     * @memberof Popper
+     * @param {Function} callback
+     */
+    Popper.prototype.onUpdate = function(callback) {
+        this.state.updateCallback = callback;
+        return this;
+    };
+
+    /**
+     * Helper used to generate poppers from a configuration file
+     * @method
+     * @memberof Popper
+     * @param config {Object} configuration
+     * @returns {HTMLElement} popper
+     */
+    Popper.prototype.parse = function(config) {
+        var defaultConfig = {
+            tagName: 'div',
+            classNames: [ 'popper' ],
+            attributes: [],
+            parent: root.document.body,
+            content: '',
+            contentType: 'text',
+            arrowTagName: 'div',
+            arrowClassNames: [ 'popper__arrow' ],
+            arrowAttributes: [ 'x-arrow']
+        };
+        config = Object.assign({}, defaultConfig, config);
+
+        var d = root.document;
+
+        var popper = d.createElement(config.tagName);
+        addClassNames(popper, config.classNames);
+        addAttributes(popper, config.attributes);
+        if (config.contentType === 'node') {
+            popper.appendChild(config.content.jquery ? config.content[0] : config.content);
+        }else if (config.contentType === 'html') {
+            popper.innerHTML = config.content;
+        } else {
+            popper.textContent = config.content;
+        }
+
+        if (config.arrowTagName) {
+            var arrow = d.createElement(config.arrowTagName);
+            addClassNames(arrow, config.arrowClassNames);
+            addAttributes(arrow, config.arrowAttributes);
+            popper.appendChild(arrow);
+        }
+
+        var parent = config.parent.jquery ? config.parent[0] : config.parent;
+
+        // if the given parent is a string, use it to match an element
+        // if more than one element is matched, the first one will be used as parent
+        // if no elements are matched, the script will throw an error
+        if (typeof parent === 'string') {
+            parent = d.querySelectorAll(config.parent);
+            if (parent.length > 1) {
+                console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
+            }
+            if (parent.length === 0) {
+                throw 'ERROR: the given `parent` doesn\'t exists!';
+            }
+            parent = parent[0];
+        }
+        // if the given parent is a DOM nodes list or an array of nodes with more than one element,
+        // the first one will be used as parent
+        if (parent.length > 1 && parent instanceof Element === false) {
+            console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
+            parent = parent[0];
+        }
+
+        // append the generated popper to its parent
+        parent.appendChild(popper);
+
+        return popper;
+
+        /**
+         * Adds class names to the given element
+         * @function
+         * @ignore
+         * @param {HTMLElement} target
+         * @param {Array} classes
+         */
+        function addClassNames(element, classNames) {
+            classNames.forEach(function(className) {
+                element.classList.add(className);
+            });
+        }
+
+        /**
+         * Adds attributes to the given element
+         * @function
+         * @ignore
+         * @param {HTMLElement} target
+         * @param {Array} attributes
+         * @example
+         * addAttributes(element, [ 'data-info:foobar' ]);
+         */
+        function addAttributes(element, attributes) {
+            attributes.forEach(function(attribute) {
+                element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
+            });
+        }
+
+    };
+
+    /**
+     * Helper used to get the position which will be applied to the popper
+     * @method
+     * @memberof Popper
+     * @param config {HTMLElement} popper element
+     * @returns {HTMLElement} reference element
+     */
+    Popper.prototype._getPosition = function(popper, reference) {
+        var container = getOffsetParent(reference);
+
+        // Decide if the popper will be fixed
+        // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
+        var isParentFixed = isFixed(container);
+        return isParentFixed ? 'fixed' : 'absolute';
+    };
+
+    /**
+     * Helper used to determine if the popper's parent is transformed.
+     * @param  {[type]} popper [description]
+     * @return {[type]}        [description]
+     */
+    Popper.prototype._getIsParentTransformed = function(popper) {
+      return isTransformed(popper.parentNode);
+    };
+
+    /**
+     * Get offsets to the popper
+     * @method
+     * @memberof Popper
+     * @access private
+     * @param {Element} popper - the popper element
+     * @param {Element} reference - the reference element (the popper will be relative to this)
+     * @returns {Object} An object containing the offsets which will be applied to the popper
+     */
+    Popper.prototype._getOffsets = function(popper, reference, placement) {
+        placement = placement.split('-')[0];
+        var popperOffsets = {};
+
+        popperOffsets.position = this.state.position;
+        var isParentFixed = popperOffsets.position === 'fixed';
+
+        var isParentTransformed = this.state.isParentTransformed;
+
+        //
+        // Get reference element position
+        //
+        var offsetParent = (isParentFixed && isParentTransformed) ? getOffsetParent(reference) : getOffsetParent(popper);
+        var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, offsetParent, isParentFixed, isParentTransformed);
+
+        //
+        // Get popper sizes
+        //
+        var popperRect = getOuterSizes(popper);
+
+        //
+        // Compute offsets of popper
+        //
+
+        // depending by the popper placement we have to compute its offsets slightly differently
+        if (['right', 'left'].indexOf(placement) !== -1) {
+            popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
+            if (placement === 'left') {
+                popperOffsets.left = referenceOffsets.left - popperRect.width;
+            } else {
+                popperOffsets.left = referenceOffsets.right;
+            }
+        } else {
+            popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
+            if (placement === 'top') {
+                popperOffsets.top = referenceOffsets.top - popperRect.height;
+            } else {
+                popperOffsets.top = referenceOffsets.bottom;
+            }
+        }
+
+        // Add width and height to our offsets object
+        popperOffsets.width   = popperRect.width;
+        popperOffsets.height  = popperRect.height;
+
+
+        return {
+            popper: popperOffsets,
+            reference: referenceOffsets
+        };
+    };
+
+
+    /**
+     * Setup needed event listeners used to update the popper position
+     * @method
+     * @memberof Popper
+     * @access private
+     */
+    Popper.prototype._setupEventListeners = function() {
+        // NOTE: 1 DOM access here
+        this.state.updateBound = this.update.bind(this);
+        root.addEventListener('resize', this.state.updateBound);
+        // if the boundariesElement is window we don't need to listen for the scroll event
+        if (this._options.boundariesElement !== 'window') {
+            var target = getScrollParent(this._reference);
+            // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
+            if (target === root.document.body || target === root.document.documentElement) {
+                target = root;
+            }
+            target.addEventListener('scroll', this.state.updateBound);
+        }
+    };
+
+    /**
+     * Remove event listeners used to update the popper position
+     * @method
+     * @memberof Popper
+     * @access private
+     */
+    Popper.prototype._removeEventListeners = function() {
+        // NOTE: 1 DOM access here
+        root.removeEventListener('resize', this.state.updateBound);
+        if (this._options.boundariesElement !== 'window') {
+            var target = getScrollParent(this._reference);
+            // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
+            if (target === root.document.body || target === root.document.documentElement) {
+                target = root;
+            }
+            target.removeEventListener('scroll', this.state.updateBound);
+        }
+        this.state.updateBound = null;
+    };
+
+    /**
+     * Computed the boundaries limits and return them
+     * @method
+     * @memberof Popper
+     * @access private
+     * @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
+     * @param {Number} padding - Boundaries padding
+     * @param {Element} boundariesElement - Element used to define the boundaries
+     * @returns {Object} Coordinates of the boundaries
+     */
+    Popper.prototype._getBoundaries = function(data, padding, boundariesElement) {
+        // NOTE: 1 DOM access here
+        var boundaries = {};
+        var width, height;
+        if (boundariesElement === 'window') {
+            var body = root.document.body,
+                html = root.document.documentElement;
+
+            height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
+            width = Math.max( body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth );
+
+            boundaries = {
+                top: 0,
+                right: width,
+                bottom: height,
+                left: 0
+            };
+        } else if (boundariesElement === 'viewport') {
+            var offsetParent = getOffsetParent(this._popper);
+            var scrollParent = getScrollParent(this._popper);
+            var offsetParentRect = getOffsetRect(offsetParent);
+
+            // if the popper is fixed we don't have to substract scrolling from the boundaries
+            var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : scrollParent.scrollTop;
+            var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : scrollParent.scrollLeft;
+
+            boundaries = {
+                top: 0 - (offsetParentRect.top - scrollTop),
+                right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
+                bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
+                left: 0 - (offsetParentRect.left - scrollLeft)
+            };
+        } else {
+            if (getOffsetParent(this._popper) === boundariesElement) {
+                boundaries = {
+                    top: 0,
+                    left: 0,
+                    right: boundariesElement.clientWidth,
+                    bottom: boundariesElement.clientHeight
+                };
+            } else {
+                boundaries = getOffsetRect(boundariesElement);
+            }
+        }
+        boundaries.left += padding;
+        boundaries.right -= padding;
+        boundaries.top = boundaries.top + padding;
+        boundaries.bottom = boundaries.bottom - padding;
+        return boundaries;
+    };
+
+
+    /**
+     * Loop trough the list of modifiers and run them in order, each of them will then edit the data object
+     * @method
+     * @memberof Popper
+     * @access public
+     * @param {Object} data
+     * @param {Array} modifiers
+     * @param {Function} ends
+     */
+    Popper.prototype.runModifiers = function(data, modifiers, ends) {
+        var modifiersToRun = modifiers.slice();
+        if (ends !== undefined) {
+            modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
+        }
+
+        modifiersToRun.forEach(function(modifier) {
+            if (isFunction(modifier)) {
+                data = modifier.call(this, data);
+            }
+        }.bind(this));
+
+        return data;
+    };
+
+    /**
+     * Helper used to know if the given modifier depends from another one.
+     * @method
+     * @memberof Popper
+     * @returns {Boolean}
+     */
+
+    Popper.prototype.isModifierRequired = function(requesting, requested) {
+        var index = getArrayKeyIndex(this._options.modifiers, requesting);
+        return !!this._options.modifiers.slice(0, index).filter(function(modifier) {
+            return modifier === requested;
+        }).length;
+    };
+
+    //
+    // Modifiers
+    //
+
+    /**
+     * Modifiers list
+     * @namespace Popper.modifiers
+     * @memberof Popper
+     * @type {Object}
+     */
+    Popper.prototype.modifiers = {};
+
+    /**
+     * Apply the computed styles to the popper element
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by `update` method
+     * @returns {Object} The same data object
+     */
+    Popper.prototype.modifiers.applyStyle = function(data) {
+        // apply the final offsets to the popper
+        // NOTE: 1 DOM access here
+        var styles = {
+            position: data.offsets.popper.position
+        };
+
+        // round top and left to avoid blurry text
+        var left = Math.round(data.offsets.popper.left);
+        var top = Math.round(data.offsets.popper.top);
+
+        // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
+        // we automatically use the supported prefixed version if needed
+        var prefixedProperty;
+        if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
+            styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
+            styles.top = 0;
+            styles.left = 0;
+        }
+        // othwerise, we use the standard `left` and `top` properties
+        else {
+            styles.left =left;
+            styles.top = top;
+        }
+
+        // any property present in `data.styles` will be applied to the popper,
+        // in this way we can make the 3rd party modifiers add custom styles to it
+        // Be aware, modifiers could override the properties defined in the previous
+        // lines of this modifier!
+        Object.assign(styles, data.styles);
+
+        setStyle(this._popper, styles);
+
+        // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
+        // NOTE: 1 DOM access here
+        this._popper.setAttribute('x-placement', data.placement);
+
+        // if the arrow style has been computed, apply the arrow style
+        if (data.offsets.arrow) {
+            setStyle(data.arrowElement, data.offsets.arrow);
+        }
+
+        // return the data object to allow chaining of other modifiers
+        return data;
+    };
+
+    /**
+     * Modifier used to shift the popper on the start or end of its reference element side
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by `update` method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.shift = function(data) {
+        var placement = data.placement;
+        var basePlacement = placement.split('-')[0];
+        var shiftVariation = placement.split('-')[1];
+
+        // if shift shiftVariation is specified, run the modifier
+        if (shiftVariation) {
+            var reference = data.offsets.reference;
+            var popper = getPopperClientRect(data.offsets.popper);
+
+            var shiftOffsets = {
+                y: {
+                    start:  { top: reference.top },
+                    end:    { top: reference.top + reference.height - popper.height }
+                },
+                x: {
+                    start:  { left: reference.left },
+                    end:    { left: reference.left + reference.width - popper.width }
+                }
+            };
+
+            var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
+
+            data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
+        }
+
+        return data;
+    };
+
+
+    /**
+     * Modifier used to make sure the popper does not overflows from it's boundaries
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by `update` method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.preventOverflow = function(data) {
+        var order = this._options.preventOverflowOrder;
+        var popper = getPopperClientRect(data.offsets.popper);
+
+        var check = {
+            left: function() {
+                var left = popper.left;
+                if (popper.left < data.boundaries.left) {
+                    left = Math.max(popper.left, data.boundaries.left);
+                }
+                return { left: left };
+            },
+            right: function() {
+                var left = popper.left;
+                if (popper.right > data.boundaries.right) {
+                    left = Math.min(popper.left, data.boundaries.right - popper.width);
+                }
+                return { left: left };
+            },
+            top: function() {
+                var top = popper.top;
+                if (popper.top < data.boundaries.top) {
+                    top = Math.max(popper.top, data.boundaries.top);
+                }
+                return { top: top };
+            },
+            bottom: function() {
+                var top = popper.top;
+                if (popper.bottom > data.boundaries.bottom) {
+                    top = Math.min(popper.top, data.boundaries.bottom - popper.height);
+                }
+                return { top: top };
+            }
+        };
+
+        order.forEach(function(direction) {
+            data.offsets.popper = Object.assign(popper, check[direction]());
+        });
+
+        return data;
+    };
+
+    /**
+     * Modifier used to make sure the popper is always near its reference
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by _update method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.keepTogether = function(data) {
+        var popper  = getPopperClientRect(data.offsets.popper);
+        var reference = data.offsets.reference;
+        var f = Math.floor;
+
+        if (popper.right < f(reference.left)) {
+            data.offsets.popper.left = f(reference.left) - popper.width;
+        }
+        if (popper.left > f(reference.right)) {
+            data.offsets.popper.left = f(reference.right);
+        }
+        if (popper.bottom < f(reference.top)) {
+            data.offsets.popper.top = f(reference.top) - popper.height;
+        }
+        if (popper.top > f(reference.bottom)) {
+            data.offsets.popper.top = f(reference.bottom);
+        }
+
+        return data;
+    };
+
+    /**
+     * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
+     * Requires the `preventOverflow` modifier before it in order to work.
+     * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by _update method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.flip = function(data) {
+        // check if preventOverflow is in the list of modifiers before the flip modifier.
+        // otherwise flip would not work as expected.
+        if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
+            console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
+            return data;
+        }
+
+        if (data.flipped && data.placement === data._originalPlacement) {
+            // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
+            return data;
+        }
+
+        var placement = data.placement.split('-')[0];
+        var placementOpposite = getOppositePlacement(placement);
+        var variation = data.placement.split('-')[1] || '';
+
+        var flipOrder = [];
+        if(this._options.flipBehavior === 'flip') {
+            flipOrder = [
+                placement,
+                placementOpposite
+            ];
+        } else {
+            flipOrder = this._options.flipBehavior;
+        }
+
+        flipOrder.forEach(function(step, index) {
+            if (placement !== step || flipOrder.length === index + 1) {
+                return;
+            }
+
+            placement = data.placement.split('-')[0];
+            placementOpposite = getOppositePlacement(placement);
+
+            var popperOffsets = getPopperClientRect(data.offsets.popper);
+
+            // this boolean is used to distinguish right and bottom from top and left
+            // they need different computations to get flipped
+            var a = ['right', 'bottom'].indexOf(placement) !== -1;
+
+            // using Math.floor because the reference offsets may contain decimals we are not going to consider here
+            if (
+                a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) ||
+                !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])
+            ) {
+                // we'll use this boolean to detect any flip loop
+                data.flipped = true;
+                data.placement = flipOrder[index + 1];
+                if (variation) {
+                    data.placement += '-' + variation;
+                }
+                data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
+
+                data = this.runModifiers(data, this._options.modifiers, this._flip);
+            }
+        }.bind(this));
+        return data;
+    };
+
+    /**
+     * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
+     * The offsets will shift the popper on the side of its reference element.
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by _update method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.offset = function(data) {
+        var offset = this._options.offset;
+        var popper  = data.offsets.popper;
+
+        if (data.placement.indexOf('left') !== -1) {
+            popper.top -= offset;
+        }
+        else if (data.placement.indexOf('right') !== -1) {
+            popper.top += offset;
+        }
+        else if (data.placement.indexOf('top') !== -1) {
+            popper.left -= offset;
+        }
+        else if (data.placement.indexOf('bottom') !== -1) {
+            popper.left += offset;
+        }
+        return data;
+    };
+
+    /**
+     * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
+     * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
+     * @method
+     * @memberof Popper.modifiers
+     * @argument {Object} data - The data object generated by _update method
+     * @returns {Object} The data object, properly modified
+     */
+    Popper.prototype.modifiers.arrow = function(data) {
+        var arrow  = this._options.arrowElement;
+
+        // if the arrowElement is a string, suppose it's a CSS selector
+        if (typeof arrow === 'string') {
+            arrow = this._popper.querySelector(arrow);
+        }
+
+        // if arrow element is not found, don't run the modifier
+        if (!arrow) {
+            return data;
+        }
+
+        // the arrow element must be child of its popper
+        if (!this._popper.contains(arrow)) {
+            console.warn('WARNING: `arrowElement` must be child of its popper element!');
+            return data;
+        }
+
+        // arrow depends on keepTogether in order to work
+        if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
+            console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
+            return data;
+        }
+
+        var arrowStyle  = {};
+        var placement   = data.placement.split('-')[0];
+        var popper      = getPopperClientRect(data.offsets.popper);
+        var reference   = data.offsets.reference;
+        var isVertical  = ['left', 'right'].indexOf(placement) !== -1;
+
+        var len         = isVertical ? 'height' : 'width';
+        var side        = isVertical ? 'top' : 'left';
+        var altSide     = isVertical ? 'left' : 'top';
+        var opSide      = isVertical ? 'bottom' : 'right';
+        var arrowSize   = getOuterSizes(arrow)[len];
+
+        //
+        // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
+        //
+
+        // top/left side
+        if (reference[opSide] - arrowSize < popper[side]) {
+            data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
+        }
+        // bottom/right side
+        if (reference[side] + arrowSize > popper[opSide]) {
+            data.offsets.popper[side] += (reference[side] + arrowSize) - popper[opSide];
+        }
+
+        // compute center of the popper
+        var center = reference[side] + (reference[len] / 2) - (arrowSize / 2);
+
+        // Compute the sideValue using the updated popper offsets
+        var sideValue = center - getPopperClientRect(data.offsets.popper)[side];
+
+        // prevent arrow from being placed not contiguously to its popper
+        sideValue = Math.max(Math.min(popper[len] - arrowSize, sideValue), 0);
+        arrowStyle[side] = sideValue;
+        arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
+
+        data.offsets.arrow = arrowStyle;
+        data.arrowElement = arrow;
+
+        return data;
+    };
+
+
+    //
+    // Helpers
+    //
+
+    /**
+     * Get the outer sizes of the given element (offset size + margins)
+     * @function
+     * @ignore
+     * @argument {Element} element
+     * @returns {Object} object containing width and height properties
+     */
+    function getOuterSizes(element) {
+        // NOTE: 1 DOM access here
+        var _display = element.style.display, _visibility = element.style.visibility;
+        element.style.display = 'block'; element.style.visibility = 'hidden';
+        var calcWidthToForceRepaint = element.offsetWidth;
+
+        // original method
+        var styles = root.getComputedStyle(element);
+        var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
+        var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
+        var result = { width: element.offsetWidth + y, height: element.offsetHeight + x };
+
+        // reset element styles
+        element.style.display = _display; element.style.visibility = _visibility;
+        return result;
+    }
+
+    /**
+     * Get the opposite placement of the given one/
+     * @function
+     * @ignore
+     * @argument {String} placement
+     * @returns {String} flipped placement
+     */
+    function getOppositePlacement(placement) {
+        var hash = {left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
+        return placement.replace(/left|right|bottom|top/g, function(matched){
+            return hash[matched];
+        });
+    }
+
+    /**
+     * Given the popper offsets, generate an output similar to getBoundingClientRect
+     * @function
+     * @ignore
+     * @argument {Object} popperOffsets
+     * @returns {Object} ClientRect like output
+     */
+    function getPopperClientRect(popperOffsets) {
+        var offsets = Object.assign({}, popperOffsets);
+        offsets.right = offsets.left + offsets.width;
+        offsets.bottom = offsets.top + offsets.height;
+        return offsets;
+    }
+
+    /**
+     * Given an array and the key to find, returns its index
+     * @function
+     * @ignore
+     * @argument {Array} arr
+     * @argument keyToFind
+     * @returns index or null
+     */
+    function getArrayKeyIndex(arr, keyToFind) {
+        var i = 0, key;
+        for (key in arr) {
+            if (arr[key] === keyToFind) {
+                return i;
+            }
+            i++;
+        }
+        return null;
+    }
+
+    /**
+     * Get CSS computed property of the given element
+     * @function
+     * @ignore
+     * @argument {Eement} element
+     * @argument {String} property
+     */
+    function getStyleComputedProperty(element, property) {
+        // NOTE: 1 DOM access here
+        var css = root.getComputedStyle(element, null);
+        return css[property];
+    }
+
+    /**
+     * Returns the offset parent of the given element
+     * @function
+     * @ignore
+     * @argument {Element} element
+     * @returns {Element} offset parent
+     */
+    function getOffsetParent(element) {
+        // NOTE: 1 DOM access here
+        var offsetParent = element.offsetParent;
+        return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
+    }
+
+    /**
+     * Returns the scrolling parent of the given element
+     * @function
+     * @ignore
+     * @argument {Element} element
+     * @returns {Element} offset parent
+     */
+    function getScrollParent(element) {
+        if (element === root.document) {
+            // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
+            // greater than 0 and return the proper element
+            if (root.document.body.scrollTop) {
+                return root.document.body;
+            } else {
+                return root.document.documentElement;
+            }
+        }
+
+        // Firefox want us to check `-x` and `-y` variations as well
+        if (
+            ['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow')) !== -1 ||
+            ['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-x')) !== -1 ||
+            ['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-y')) !== -1
+        ) {
+            // If the detected scrollParent is body, we perform an additional check on its parentNode
+            // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
+            // fixes issue #65
+            return element === root.document.body ? getScrollParent(element.parentNode) : element;
+        }
+        return element.parentNode ? getScrollParent(element.parentNode) : element;
+    }
+
+    /**
+     * Check if the given element is fixed or is inside a fixed parent
+     * @function
+     * @ignore
+     * @argument {Element} element
+     * @argument {Element} customContainer
+     * @returns {Boolean} answer to "isFixed?"
+     */
+    function isFixed(element) {
+        if (element === root.document.body || element.nodeName === 'HTML') {
+            return false;
+        }
+        if (getStyleComputedProperty(element, 'position') === 'fixed') {
+            return true;
+        }
+        return element.parentNode ? isFixed(element.parentNode) : element;
+    }
+
+    /**
+     * Check if the given element has transforms applied to itself or a parent
+     * @param  {Element} element
+     * @return {Boolean} answer to "isTransformed?"
+     */
+    function isTransformed(element) {
+      if (element === root.document.body) {
+          return false;
+      }
+      if (getStyleComputedProperty(element, 'transform') !== 'none') {
+          return true;
+      }
+      return element.parentNode ? isTransformed(element.parentNode) : element;
+    }
+
+    /**
+     * Set the style to the given popper
+     * @function
+     * @ignore
+     * @argument {Element} element - Element to apply the style to
+     * @argument {Object} styles - Object with a list of properties and values which will be applied to the element
+     */
+    function setStyle(element, styles) {
+        function is_numeric(n) {
+            return (n !== '' && !isNaN(parseFloat(n)) && isFinite(n));
+        }
+        Object.keys(styles).forEach(function(prop) {
+            var unit = '';
+            // add unit if the value is numeric and is one of the following
+            if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
+                unit = 'px';
+            }
+            element.style[prop] = styles[prop] + unit;
+        });
+    }
+
+    /**
+     * Check if the given variable is a function
+     * @function
+     * @ignore
+     * @argument {Element} element - Element to check
+     * @returns {Boolean} answer to: is a function?
+     */
+    function isFunction(functionToCheck) {
+        var getType = {};
+        return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
+    }
+
+    /**
+     * Get the position of the given element, relative to its offset parent
+     * @function
+     * @ignore
+     * @param {Element} element
+     * @return {Object} position - Coordinates of the element and its `scrollTop`
+     */
+    function getOffsetRect(element) {
+        var elementRect = {
+            width: element.offsetWidth,
+            height: element.offsetHeight,
+            left: element.offsetLeft,
+            top: element.offsetTop
+        };
+
+        elementRect.right = elementRect.left + elementRect.width;
+        elementRect.bottom = elementRect.top + elementRect.height;
+
+        // position
+        return elementRect;
+    }
+
+    /**
+     * Get bounding client rect of given element
+     * @function
+     * @ignore
+     * @param {HTMLElement} element
+     * @return {Object} client rect
+     */
+    function getBoundingClientRect(element) {
+        var rect = element.getBoundingClientRect();
+        return {
+            left: rect.left,
+            top: rect.top,
+            right: rect.right,
+            bottom: rect.bottom,
+            width: rect.right - rect.left,
+            height: rect.bottom - rect.top
+        };
+    }
+
+    /**
+     * Given an element and one of its parents, return the offset
+     * @function
+     * @ignore
+     * @param {HTMLElement} element
+     * @param {HTMLElement} parent
+     * @return {Object} rect
+     */
+    function getOffsetRectRelativeToCustomParent(element, parent, fixed, transformed) {
+        var elementRect = getBoundingClientRect(element);
+        var parentRect = getBoundingClientRect(parent);
+
+        if (fixed && !transformed) {
+            var scrollParent = getScrollParent(parent);
+            parentRect.top += scrollParent.scrollTop;
+            parentRect.bottom += scrollParent.scrollTop;
+            parentRect.left += scrollParent.scrollLeft;
+            parentRect.right += scrollParent.scrollLeft;
+        }
+
+        var rect = {
+            top: elementRect.top - parentRect.top ,
+            left: elementRect.left - parentRect.left ,
+            bottom: (elementRect.top - parentRect.top) + elementRect.height,
+            right: (elementRect.left - parentRect.left) + elementRect.width,
+            width: elementRect.width,
+            height: elementRect.height
+        };
+        return rect;
+    }
+
+    /**
+     * Get the prefixed supported property name
+     * @function
+     * @ignore
+     * @argument {String} property (camelCase)
+     * @returns {String} prefixed property (camelCase)
+     */
+    function getSupportedPropertyName(property) {
+        var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
+
+        for (var i = 0; i < prefixes.length; i++) {
+            var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
+            if (typeof root.document.body.style[toCheck] !== 'undefined') {
+                return toCheck;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
+     * objects to a target object. It will return the target object.
+     * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
+     * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
+     * @function
+     * @ignore
+     */
+    if (!Object.assign) {
+        Object.defineProperty(Object, 'assign', {
+            enumerable: false,
+            configurable: true,
+            writable: true,
+            value: function(target) {
+                if (target === undefined || target === null) {
+                    throw new TypeError('Cannot convert first argument to object');
+                }
+
+                var to = Object(target);
+                for (var i = 1; i < arguments.length; i++) {
+                    var nextSource = arguments[i];
+                    if (nextSource === undefined || nextSource === null) {
+                        continue;
+                    }
+                    nextSource = Object(nextSource);
+
+                    var keysArray = Object.keys(nextSource);
+                    for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
+                        var nextKey = keysArray[nextIndex];
+                        var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
+                        if (desc !== undefined && desc.enumerable) {
+                            to[nextKey] = nextSource[nextKey];
+                        }
+                    }
+                }
+                return to;
+            }
+        });
+    }
+
+    if (!root.requestAnimationFrame) {
+        var lastTime = 0;
+        var vendors = ['ms', 'moz', 'webkit', 'o'];
+        for(var x = 0; x < vendors.length && !root.requestAnimationFrame; ++x) {
+            root.requestAnimationFrame = root[vendors[x]+'RequestAnimationFrame'];
+            root.cancelAnimationFrame = root[vendors[x]+'CancelAnimationFrame'] || root[vendors[x]+'CancelRequestAnimationFrame'];
+        }
+
+        if (!root.requestAnimationFrame) {
+            root.requestAnimationFrame = function(callback, element) {
+                var currTime = new Date().getTime();
+                var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+                var id = root.setTimeout(function() { callback(currTime + timeToCall); },
+                                           timeToCall);
+                lastTime = currTime + timeToCall;
+                return id;
+            };
+        }
+
+        if (!root.cancelAnimationFrame) {
+            root.cancelAnimationFrame = function(id) {
+                clearTimeout(id);
+            };
+        }
+    }
+
+    return Popper;
+}));
diff --git a/admin/tool/usertours/amd/src/tour.js b/admin/tool/usertours/amd/src/tour.js
new file mode 100644 (file)
index 0000000..46a0e19
--- /dev/null
@@ -0,0 +1,1381 @@
+// jshint ignore: start
+(function (root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module unless amdModuleId is set
+    define(["jquery","./popper"], function (a0,b1) {
+      return (root['Tour'] = factory(a0,b1));
+    });
+  } else if (typeof exports === 'object') {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like environments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"),require("popper.js"));
+  } else {
+    root['Tour'] = factory($,Popper);
+  }
+}(this, function ($, Popper) {
+
+"use strict";