Plugin Directory

Changeset 3443362


Ignore:
Timestamp:
01/20/2026 03:08:28 PM (7 weeks ago)
Author:
iteras
Message:

Keep images while truncating in the front-end

Location:
iteras/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • iteras/trunk/README.txt

    r3236574 r3443362  
    22Tags: paywall, subscribe, subscriptions, subscription, subscribers, access-control, paid content, premium, premium content, monetize, magazine, media pass, registration, billing, membership, member, earn money
    33Requires at least: 3.5.1
    4 Tested up to: 6.7.1
    5 Stable tag: 1.8.1
     4Tested up to: 6.9
     5Stable tag: 1.8.2
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515If you publish a printed publication in Denmark and Norway you will likely need to be able to send "indbetalingskort"/"girokort" which we have fully automated. We also integrate with the Danish NemHandel (EAN). Therefore, Iteras is a one-stop solution for Danish and Norwegian magazines and others with similar needs (foreninger, software providers, etc.).
    1616
    17 For more information, check out [iteras.dk](https://www.iteras.dk/).
     17For more information, check out [iteras.com](https://www.iteras.com/).
    1818
    1919This plugin allows you to integrate the ordering and self-service parts of ITERAS easily, and set up a paywall in WordPress to only allow access to certain posts to your ITERAS subscribers.
     
    115115
    116116== Changelog ==
     117= 1.8.2 =
     118* Keep images when truncating in the front-end
     119
    117120= 1.8.0 =
    118121* Paywall bulk actions and paywall column available on pages overview
  • iteras/trunk/iteras.php

    r3236574 r3443362  
    1313 * Plugin URI:        https://app.iteras.dk
    1414 * Description:       Integration with ITERAS, a cloud-based state-of-the-art system for managing subscriptions/memberships and payments.
    15  * Version:           1.8.1
     15 * Version:           1.8.2
    1616 * Author:            ITERAS
    1717 * Author URI:        https://www.iteras.dk
  • iteras/trunk/public/assets/js/box.js

    r2323090 r3443362  
    55        var content = $(".iteras-content-wrapper");
    66        if (!content.hasClass("iteras-content-truncated"))
    7             content.html(truncate(content.html(), box.data("snippet-size") || 300));
     7            content.html(truncate(content.html(), box.data("snippet-size") || 300, {keepImageTag: true}));
    88    };
    99})(jQuery);
  • iteras/trunk/public/assets/js/truncate.js

    r1169354 r3443362  
    3333        HTML_TAG_REGEX = new RegExp('<\\/?\\w+\\s*' + KEY_VALUE_REGEX + IS_CLOSE_REGEX + '>'),
    3434        URL_REGEX = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w\-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g, // Simple regexp
    35         IMAGE_TAG_REGEX = new RegExp('<img\\s*' + KEY_VALUE_REGEX + IS_CLOSE_REGEX + '>'),
     35        IMAGE_TAG_REGEX = new RegExp('<(img|picture)\\s*' + KEY_VALUE_REGEX + IS_CLOSE_REGEX + '>'),
    3636        WORD_BREAK_REGEX = new RegExp('\\W+', 'g'),
    3737        matches = true,
     
    6363
    6464        return string.substring(0, index) + string.substring(index + len);
     65    }
     66
     67    /**
     68     * Remove figure elements (including img tags inside them)
     69     *
     70     * @private
     71     * @method _removeFigureElements
     72     * @param {String} string not-yet-processed string
     73     * @return {String} string without figure elements
     74     */
     75    function _removeFigureElements(string) {
     76        // Match <figure>...</figure> elements (including nested content)
     77        var figureRegex = /<figure[^>]*>[\s\S]*?<\/figure>/gi;
     78        return string.replace(figureRegex, '');
    6579    }
    6680
     
    232246    if (!options.keepImageTag) {
    233247        content = _removeImageTag(content);
     248        content = _removeFigureElements(content);
    234249    }
    235250
  • iteras/trunk/public/iteras-public.php

    r3236574 r3443362  
    1616class Iteras {
    1717
    18   const VERSION = '1.8.1';
     18  const VERSION = '1.8.2';
    1919
    2020  const SETTINGS_KEY = "iteras_settings";
Note: See TracChangeset for help on using the changeset viewer.