• last updated 22 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Improve fix: if any other click handler would take longer than the timeout (e.g. an alert) don't wait again

Make sure disabling the button always happens before re-enabling the button and that both happen after all other click handlers have completed

minor changes: fixed typo, ease debugging, ...

  1. … 3 more files in changeset.
Allow to deactivate client-side double click prevention by setting DefaultPreventDoubleClickTimeoutMs to 0

  1. … 1 more file in changeset.
added package parameter DefaultPreventDoubleClickTimeoutMs for default timeout of double click handler

  1. … 1 more file in changeset.
Fix acs-templating templates_and_scripts test, the multirow is called "body_script" with no s

  1. … 1 more file in changeset.
Define js snippet as an onload handler with identifier so that it is loaded only once

Support for handler for double-click prevention via CSS class

This change makes it possible to provide a double click prevention for

HTML elements via the CSS class "prevent-double-click". The double

click prevention deactivates a button or an anchor element after

clicking for a short time (per default for 1s) and ignores in this

time window further clicks. The time window can be specified via the

data element oacs-timeout. When a double click occurs, the duplicate

click is determined at the client side (in the browser) such that the

first request will continue to run and will render its result when

finished. Without double-click prevention (or with the

double-click-prevention on the server side), the results of the first

request are lost for the client, although these are still computed at

the server side.

Usage Example:

<p>text with a <a class="prevent-double-click" data-oacs-timeout="2000" href="/slow.tcl?t=10s">link</a>

<p>

<form action="/slow.tcl">

<input class="btn prevent-double-click" data-oacs-timeout="2000" type="submit" value="Submit">

...

</form>

By reactivating the button automatically after the timeout, this

approach works also reasonable well when opening additional tabs or

browser windows.

The handler and implementation are designed to work with streaming

HTML, provided that "template::collect_body_scripts" is called (like

the reset of the template::* styling interface).

When HTML elements are deactivated, the DOM property "disabled" is set

as well as a CSS class "disabled". Since disabled anchors are

visually not different from non-disabled anchors, this CSS class can

be used for styling disabled anchors differently.

Fix reference in doc

Make template::head::prepare_multirows a private interface: its stated purpose is to be used inside of the blank-master and it has no practical use otherwise

improve spelling

  1. … 2 more files in changeset.
support multi-line messages by using template literals

template literals are available since ES6 (2015)

fix spurious colons

  1. … 4 more files in changeset.
improve spelling

  1. … 42 more files in changeset.
Enable to attach handlers by CSS selector also for template::add_confirm_handler

Modernize javascript idiom

Allow to specify javascrit event handlers at the tcl level using CSS query selectors

Add missing substitution

Added support for streaming HTML + javascript body procs

Previously, the API for bodyscripts (e.g. template::add_body_script,

template::add_event_listener, template::add_body_handler,

template::add_script with the right flags) was not usable for

streaming HTML pages, since the full processing of such scripts was

handled in blank-master.{tcl,adp}, which is not in use for streaming

HTML.

Now the function template::collect_body_scripts was added, which can

be used at arbitrary time to collect the body scripts and translate

those to HTML. This function can be used in streaming mode to output

these function when new HTML chunks become available.

  1. … 3 more files in changeset.
template::set_css_property: support flag "-querySelector" (in addition to the leass powerful "-class")

white-space changes

  1. … 2 more files in changeset.
internationalize confirm message

  1. … 3 more files in changeset.
template::set_css_propert: generalize function

template::hide: new API function to hide certain CSS classes via javascript

support registration of csp rules for URNs

  1. … 1 more file in changeset.
check, if container resource is really loaded

fix typo in variable name

use same spelling for "i.e." as everywhere else

  1. … 1 more file in changeset.
reduce verbosity

replace hardcoded /tmp by API function [ad_tmpdir]

  1. … 10 more files in changeset.