Plugin Directory

Changeset 1971878


Ignore:
Timestamp:
11/09/2018 11:50:36 PM (7 years ago)
Author:
pressupinc
Message:

deploy from git

Location:
require-featured-image/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • require-featured-image/trunk/readme.txt

    r1714373 r1971878  
    44Tags: featured image, images, edit, post, admin, require featured image, image, media, thumbnail, thumbnails, post thumbnail, photo, pictures
    55Requires at least: 3.5
    6 Tested up to: 4.8.1
    7 Stable tag: 1.3.0
     6Tested up to: 4.9.8
     7Stable tag: 1.4.0
    88License: MIT
    99License URI: http://opensource.org/licenses/MIT
     
    7070
    7171== CHANGELOG ==
     72
     73= 1.4.0 (2018.11.09) =
     74* Crude-and-quick Gutenberg compatibility
    7275
    7376= 1.3.0 (2017.08.16) =
  • require-featured-image/trunk/require-featured-image-on-edit.js

    r1714373 r1971878  
    11jQuery(document).ready(function($) {
    22
     3    function isGutenberg() {
     4        return ($('.gutenberg').length > 0);
     5    }
     6
    37    function checkImageReturnWarningMessageOrEmpty() {
    4         var $img = $('#postimagediv').find('img');
     8        if (isGutenberg()) {
     9            var $img = $('.editor-post-featured-image').find('img');
     10        } else {
     11            var $img = $('#postimagediv').find('img');
     12        }
    513        if ($img.length === 0) {
    614            return passedFromServer.jsWarningHtml;
     
    1725    function featuredImageIsTooSmall() {
    1826        // A weird polling issue in Chrome made this necessary
    19         var $img = $('#postimagediv').find('img');
    20 
     27        if (isGutenberg()) {
     28            var $img = $('.editor-post-featured-image').find('img');
     29        } else {
     30            var $img = $('#postimagediv').find('img');
     31        }
    2132        // pop one off, if needed
    2233        if( isTooSmallTrials.length > 2 ) {
     
    4556        $('#nofeature-message').addClass("error")
    4657            .html('<p>'+message+'</p>');
    47         $('#publish').attr('disabled','disabled');
     58        if (isGutenberg()) {
     59            $('.editor-post-publish-panel__toggle').attr('disabled', 'disabled');
     60        } else {
     61            $('#publish').attr('disabled','disabled');
     62        }
    4863    }
    4964
    5065    function clearWarningAndEnablePublish() {
    5166        $('#nofeature-message').remove();
    52         $('#publish').removeAttr('disabled');
     67        if (isGutenberg()) {
     68            $('.editor-post-publish-panel__toggle').removeAttr('disabled');
     69        } else {
     70            $('#publish').removeAttr('disabled');
     71        }
    5372    }
    5473
    5574    function createMessageAreaIfNeeded() {
    5675        if ($('body').find("#nofeature-message").length === 0) {
    57             $('#post').before('<div id="nofeature-message"></div>');
     76            if (isGutenberg()) {
     77                $('.components-notice-list').append('<div id="nofeature-message"></div>');
     78            } else {
     79                $('#post').before('<div id="nofeature-message"></div>');
     80            }
    5881        }
    5982    }
  • require-featured-image/trunk/require-featured-image.php

    r1714373 r1971878  
    55Description: Like it says on the tin: requires posts to have a featured image set before they'll be published.
    66Author: Press Up
    7 Version: 1.3.0
     7Version: 1.4.0
    88Author URI: http://pressupinc.com
    99Text Domain: require-featured-image
Note: See TracChangeset for help on using the changeset viewer.