d75b790ccf
prepend new elements instead of replacing HTML on AJAX update ( #9 ) ( #12 )
...
Replacing the body by prepending HTML results in the full content
being re-rendered. This can be a performance issue, but is definitely
annoying when embedding media in ticks.
2020-05-02 19:16:31 +02:00
5c4b1eaf60
select first available ticker for new blocks
2020-01-13 17:28:19 +01:00
dba37eb64b
remove undefined className attribute from block rendering
2020-01-13 17:18:52 +01:00
61a3e4a104
adjustments to block output when no tickers are available
...
Always show the first label and display spinner or message below.
2019-11-24 18:09:21 +01:00
dd074293a7
make block script ES5 compatible
...
There are polyfills for methods like apiFetch, so migrate the syntax to
ES5 (no generators, method shorthands, arrow functions, ...) and we are
done here without adding transpilers to the project.
2019-11-24 18:09:21 +01:00
df1de841e8
expose ticker taxonomy to API and add select element to Gutenberg block
...
This is more handy than entering the ticker slug manually.
2019-11-24 18:09:21 +01:00
acf3b010f1
wrap frontend JS into IIFE to
...
Exposing the liveticker functionality to a public namespace is not
necessary, so it is now wrapped into an anonymous function.
2019-11-24 18:09:21 +01:00
b88e1c2903
update ticker immediately, if not prefilled by backend
...
When a ticker is added by a Gutenberg block, it is initially empty. This
can be detected by checking the "last" flag for 0 value. If found, the
ticker is now updated immediately by the AJAX function and not waiting
for the poll interval to trigger.
2019-11-24 18:09:21 +01:00
9ddcc41c6b
implement Gutenberg block to add liveticker without legacy shortcode
...
* implement react-based JS block
* refactor shortcode and widget to use the same syntax and classes
2019-11-24 18:09:21 +01:00
0cab1a3580
update JS code style to currently recommended conventions
...
ES5 support is still present to not introduce breaking changes (dropped
IE10 support) in minor updates.
2019-08-28 11:15:02 +02:00
65eafd2524
Renamed Plugin and changed slug to stklcode-liveticker
...
Due to naming conflicts with the original wp-liveticker plugin this one
is now renamed to a unique identifier.
2018-11-02 09:01:29 +01:00
6f1cac5404
Renamed AJAX variable, JS code style, added ESLint config
2018-10-17 20:42:10 +02:00
c3cc5b1b84
Refactored JavaScript without use of jQuery
2018-10-16 20:57:43 +02:00
2d5dde9664
Enabled AJAX update for widgets
2017-12-10 21:15:55 +01:00
f10e9c63e0
AJAX nonce verification enabled
2017-12-09 16:05:09 +01:00
de347e1f81
Only send new Ticks on AJAX update
...
THis reduces the overhead of re-sending huge amounts of HTML code to the frontend without any new data to display.
2017-12-09 11:48:23 +01:00
a5144f9f17
JavaScript refactored to its own namespace
2017-12-09 10:30:36 +01:00
8100d07eed
Implemented AJAX skeleton with configurable poll interval
2017-12-07 21:15:40 +01:00