68 lines
1.9 KiB
Plaintext
68 lines
1.9 KiB
Plaintext
# --
|
|
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
|
|
# --
|
|
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
|
|
# the enclosed file COPYING for license information (GPL). If you
|
|
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
|
|
# --
|
|
## nofilter(TidyAll::Plugin::OTRS::TT::ScriptUsage)
|
|
|
|
<script type="text/javascript">//<![CDATA[
|
|
"use strict";
|
|
|
|
var Core = Core || {};
|
|
Core.App = Core.App || {};
|
|
|
|
/**
|
|
* @function
|
|
* Ignores an event. Implemented without jQuery because no external JavaScript is available yet.
|
|
* @return nothing
|
|
*/
|
|
function IgnoreEvent (Event) {
|
|
if (Event.preventDefault) {
|
|
Event.preventDefault();
|
|
}
|
|
Event.returnValue = false;
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @function
|
|
* This function blocks all click events on the page until it is
|
|
* unblocked after all JavaScript was loaded. Implemented without
|
|
* jQuery because no external JavaScript is available yet.
|
|
* @return nothing
|
|
*/
|
|
Core.App.BlockEvents = function() {
|
|
if (document.addEventListener) {
|
|
document.addEventListener('click', IgnoreEvent, false);
|
|
}
|
|
else {
|
|
document.attachEvent('onclick', IgnoreEvent);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @function
|
|
* This function unblocks all click events on the page
|
|
* after all JavaScript was loaded. Implemented without
|
|
* jQuery because no external JavaScript is available yet.
|
|
* @return nothing
|
|
*/
|
|
Core.App.UnblockEvents = function() {
|
|
if (document.removeEventListener) {
|
|
document.removeEventListener('click', IgnoreEvent, false);
|
|
}
|
|
else {
|
|
document.detachEvent('onclick', IgnoreEvent);
|
|
}
|
|
// allow tests to wait for complete page load
|
|
Core.App.PageLoadComplete = true;
|
|
};
|
|
|
|
// Now block all click events on the page to make sure that
|
|
// an agent does not click before all JavaScript was loaded,
|
|
// as event listeners are not yet available, for example.
|
|
Core.App.BlockEvents();
|
|
//]]></script>
|