Plugin Directory

Changeset 2899203


Ignore:
Timestamp:
04/14/2023 03:07:50 PM (3 years ago)
Author:
Lugat
Message:

Added JS event for injects.

Location:
jinx-fast-cache/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • jinx-fast-cache/trunk/assets/js/jinx-fast-cache.js

    r2893345 r2899203  
    1010    return response.text();
    1111  }).then(html => {
    12     element.innerHTML = html;
     12    element.innerHTML = html; 
     13    element.dispatchEvent(new Event('jinx-fast-cache-inject'));
    1314  });
    1415 
  • jinx-fast-cache/trunk/index.php

    r2893514 r2899203  
    55   * Plugin URI: https://wordpress.org/plugins/jixn-fast-cache/
    66   * Description: Blazing fast full page cache.
    7    * Version: 0.7.1
     7   * Version: 0.7.2
    88   * Author: SquareFlower Websolutions (Lukas Rydygel) <hallo@squareflower.de>
    99   * Author URI: http://squareflower.de
  • jinx-fast-cache/trunk/readme.txt

    r2893345 r2899203  
    109109Every shortcode or block between "jinx_fast_cache_inject" will be parsed and injected via ajax. Note that this may cause problems when working with JS events.
    110110
     111## Injection Callbacks
     112
     113You may trigger custom JS after dynamic content has been injected.
     114
     115Using jQuery:
     116
     117    $('.element').on('jinx-fast-cache-inject', function(e) {
     118      // so smth. with e.target or this
     119    });
     120
     121Using VanillaJS:
     122   
     123    element.addEventListener('jinx-fast-cache-inject' (e) => {
     124      // so smth. with e.target
     125    }, false);
     126
    111127## Tags
    112128
     
    171187- [x] Add tags to flush related pages
    172188- [x] Add shortcode for injects
     189- [x] Add JS events for injects
    173190
    174191== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.