[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/js/ -> mp_taxonomy.js (source)

   1  var mp_taxonomy = {
   2  
   3      options : false,
   4  
   5      init : function() {
   6  
   7          if (( typeof(document.forms[MP_AdminPageL10n.add_form_id]) != "undefined" ) && ( document.forms[MP_AdminPageL10n.add_form_id].parent ))
   8              mp_taxonomy.options = document.forms[MP_AdminPageL10n.add_form_id].parent.options;
   9  
  10          if ( mp_taxonomy.options )
  11              jQuery('#'+MP_AdminPageL10n.list_id).wpList( { dimAfter: mp_taxonomy.dimAfter, addAfter: mp_taxonomy.addAfter, delBefore: mp_taxonomy.delBefore, delAfter: mp_taxonomy.delAfter } );
  12          else
  13              jQuery('#'+MP_AdminPageL10n.list_id).wpList( { dimAfter: mp_taxonomy.dimAfter, addAfter: mp_taxonomy.addAfter2, delBefore: mp_taxonomy.delBefore });
  14  
  15          // delete
  16          jQuery('.delete a[class^="delete"]').click(function(){return false;});
  17      },
  18  
  19      dimAfter : function( r, settings ) {
  20          var item = jQuery('response_data',r).text();
  21          jQuery('#' + MP_AdminPageL10n.list_id + '  tr:first').before(item).add();
  22      },
  23  
  24      addAfter : function( r, settings ) {
  25          var name, id;
  26  
  27          name = jQuery("<span>" + jQuery('name', r).text() + "</span>").html();
  28          id = jQuery(MP_AdminPageL10n.tr_prefix_id, r).attr('id');
  29          mp_taxonomy.options[mp_taxonomy.options.length] = new Option(name, id);
  30  
  31          if (r != '') mp_taxonomy.addAfter2( r, settings );
  32      },
  33  
  34      addAfter2 : function( x, r ) {
  35          var t = jQuery(r.parsed.responses[0].data);
  36      },
  37  
  38      delAfter : function( r, settings ) {
  39          var id = jQuery(MP_AdminPageL10n.tr_prefix_id, r).attr('id'), o;
  40          for ( o = 0; o < mp_taxonomy.options.length; o++ ) if ( id == mp_taxonomy.options[o].value ) mp_taxonomy.options[o] = null;
  41      },
  42  
  43      delBefore : function(s) {
  44          if ( 'undefined' != showNotice ) return showNotice.warn() ? s : false;
  45          return s;
  46      }
  47  }
  48  jQuery(document).ready(function(){ mp_taxonomy.init(); });


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1