Plugin Directory

Changeset 884448


Ignore:
Timestamp:
03/30/2014 02:28:32 AM (12 years ago)
Author:
gilbarbara
Message:

Better tinyMCE integration

Location:
requird/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • requird/trunk/readme.txt

    r824854 r884448  
    66Requires at least: 3.x
    77Tested up to: 3.8
    8 Stable tag: 1.2.1
     8Stable tag: 1.2.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5555= 1.2.1 =
    5656* Added a link to requird settings on Plug-ins page
     57
     58= 1.2.2 =
     59* Better tinyMCE integration
  • requird/trunk/requird-settings.php

    r824854 r884448  
    3232        add_action('admin_init', array(&$this, 'initialize_options'));
    3333        // Settings page actions
    34         $this->version = '1.2.1';
     34        $this->version = '1.2.2';
    3535    }
    3636
  • requird/trunk/requird.js

    r824854 r884448  
    44Description: Require fields for WP-Admin
    55Writer: Gil Barbara
    6 Version: 1.2.1
     6Version: 1.2.2
    77Writer URI: http://kollectiv.org
    88*/
     
    1717        },
    1818        requird = {
    19         post_type: $('#post_type').val(),
    20         fields: requirdOptions[$('#post_type').val()],
    21         message: '<div class="requird-fields" style="color:red; font-weight: bold; font-size: 18px; margin:10px 0;">' + requirdOptions.error_message + '</div>',
    22         errors: 0
    23     };
     19            post_type: $('#post_type').val(),
     20            fields: requirdOptions[$('#post_type').val()],
     21            message: '<div class="requird-fields" style="color:red; font-weight: bold; font-size: 18px; margin:10px 0;">' + requirdOptions.error_message + '</div>',
     22            errors: 0
     23        };
    2424
    2525    if (typeof(requird.fields) !== 'undefined' && requird.fields.length) {
     26        tinyMCE.triggerSave();
    2627        for(var key in requird.fields) {
    2728            if (requird.fields.hasOwnProperty(key)) {
     
    3132                if (requird.$parent.size()) {
    3233                    if (requird.fields[key] === 'editor') {
    33                         if ((tinyMCE.activeEditor && !tinyMCE.activeEditor.getContent().length) || !$('#content').val().length) {
     34                        if (!$('#content').val().length) {
    3435                            if (!requird.$parent.find('.requird-fields').size()) {
    35                                 requird.$parent.append(requird.message);
     36                                if (requird.$parent.find('.inside').size()) {
     37                                    requird.$parent.find('.inside').append(requird.message);
     38                                } else {
     39                                    requird.$parent.append(requird.message);
     40                                }
    3641                            }
    3742                            requird.errors++;
     
    9095    }
    9196    if (typeof(requirdOptions[requird.post_type+'-custom']) !== 'undefined' && requirdOptions[requird.post_type+'-custom'].length) {
    92         requird.custom = requirdOptions[requird.post_type+'-custom'].split(',');
     97        requird.custom = requirdOptions[requird.post_type+'-custom'].replace(' ', '').split(',');
    9398        if (requird.custom.length) {
     99            tinyMCE.triggerSave();
    94100            for (var key2 in requird.custom) {
    95101                if (requird.custom.hasOwnProperty(key2)) {
    96                     requird.$parent = $('#'+requird.custom[key2]+'div');
    97                     requird.$custom = $('#'+requird.custom[key2]);
     102                    requird.$parent = $('#' + requird.custom[key2] + 'div');
     103                    requird.$custom = $('#' + requird.custom[key2]);
    98104                    if (requird.$custom.size() && requird.$custom.is(':input')) {
    99105                        requird.$parent = $('#'+requird.custom[key2]+'div');
  • requird/trunk/requird.php

    r824854 r884448  
    55Description: Require fields for WP-Admin
    66Writer: Gil Barbara
    7 Version: 1.2.1
     7Version: 1.2.2
    88Writer URI: http://kollectiv.org
    99*/
Note: See TracChangeset for help on using the changeset viewer.