wp/wp-admin/js/inline-edit-post.js
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     1
/* global inlineEditL10n, ajaxurl, typenow */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     2
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     3
var inlineEditPost;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
(function($) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
inlineEditPost = {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
	init : function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
		var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
		t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
		t.what = '#post-';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
		// prepare the edit rows
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
		qeRow.keyup(function(e){
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    15
			if ( e.which === 27 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
				return inlineEditPost.revert();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
		bulkRow.keyup(function(e){
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    20
			if ( e.which === 27 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
				return inlineEditPost.revert();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    22
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		$('a.cancel', qeRow).click(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
			return inlineEditPost.revert();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
		$('a.save', qeRow).click(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
			return inlineEditPost.save(this);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
		$('td', qeRow).keydown(function(e){
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    32
			if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
				return inlineEditPost.save(this);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    34
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
		$('a.cancel', bulkRow).click(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
			return inlineEditPost.revert();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
		$('#inline-edit .inline-edit-private input[value="private"]').click( function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
			var pw = $('input.inline-edit-password-input');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
			if ( $(this).prop('checked') ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
				pw.val('').prop('disabled', true);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
			} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
				pw.prop('disabled', false);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
		// add events
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
		$('#the-list').on('click', 'a.editinline', function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
			inlineEditPost.edit(this);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
			return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
		$('#bulk-edit').find('fieldset:first').after(
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
			$('#inline-edit fieldset.inline-edit-categories').clone()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
		).siblings( 'fieldset:last' ).prepend(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
			$('#inline-edit label.inline-edit-tags').clone()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
		$('select[name="_status"] option[value="future"]', bulkRow).remove();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
		$('#doaction, #doaction2').click(function(e){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
			var n = $(this).attr('id').substr(2);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    66
			if ( 'edit' === $( 'select[name="' + n + '"]' ).val() ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
				e.preventDefault();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
				t.setBulk();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
			} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
				t.revert();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
	toggle : function(el){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
		var t = this;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    77
		$( t.what + t.getId( el ) ).css( 'display' ) === 'none' ? t.revert() : t.edit( el );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
	setBulk : function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
		var te = '', type = this.type, tax, c = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
		this.revert();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
		$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    85
		// Insert the editor at the top of the table with an empty row above to maintain zebra striping.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    86
		$('table.widefat tbody').prepend( $('#bulk-edit') ).prepend('<tr class="hidden"></tr>');
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
		$('#bulk-edit').addClass('inline-editor').show();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
		$( 'tbody th.check-column input[type="checkbox"]' ).each( function() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
			if ( $(this).prop('checked') ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
				c = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
				var id = $(this).val(), theTitle;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
				theTitle = $('#inline_'+id+' .post_title').html() || inlineEditL10n.notitle;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
				te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    98
		if ( c ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
			return this.revert();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   100
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
		$('#bulk-titles').html(te);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
		$('#bulk-titles a').click(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
			var id = $(this).attr('id').substr(1);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
			$('table.widefat input[value="' + id + '"]').prop('checked', false);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
			$('#ttle'+id).remove();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
		// enable autocomplete for tags
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   111
		if ( 'post' === type ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
			// support multi taxonomies?
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
			tax = 'post_tag';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   114
			$('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
		$('html, body').animate( { scrollTop: 0 }, 'fast' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
	edit : function(id) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   120
		var t = this, fields, editRow, rowData, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, cur_format, f, val;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
		t.revert();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   123
		if ( typeof(id) === 'object' ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
			id = t.getId(id);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   125
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
		fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password', 'post_format', 'menu_order'];
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   128
		if ( t.type === 'page' ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
			fields.push('post_parent', 'page_template');
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   130
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   132
		// add the new edit row with an extra blank row underneath to maintain zebra striping.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
		editRow = $('#inline-edit').clone(true);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
		$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   136
		$(t.what+id).hide().after(editRow).after('<tr class="hidden"></tr>');
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
		// populate the data
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
		rowData = $('#inline_'+id);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
		if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
			// author no longer has edit caps, so we need to add them to the list of authors
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
			$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
		}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   144
		if ( $( ':input[name="post_author"] option', editRow ).length === 1 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
			$('label.inline-edit-author', editRow).hide();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
		// hide unsupported formats, but leave the current format alone
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
		cur_format = $('.post_format', rowData).text();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
		$('option.unsupported', editRow).each(function() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
			var $this = $(this);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   152
			if ( $this.val() !== cur_format ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
				$this.remove();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   154
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
		for ( f = 0; f < fields.length; f++ ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   158
			val = $('.'+fields[f], rowData);
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   159
			// Deal with Twemoji
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   160
			val.find( 'img' ).replaceWith( function() { return this.alt; } );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   161
			val = val.text();
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   162
			$(':input[name="' + fields[f] + '"]', editRow).val( val );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   165
		if ( $( '.comment_status', rowData ).text() === 'open' ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   166
			$( 'input[name="comment_status"]', editRow ).prop( 'checked', true );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   167
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   168
		if ( $( '.ping_status', rowData ).text() === 'open' ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   169
			$( 'input[name="ping_status"]', editRow ).prop( 'checked', true );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   170
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   171
		if ( $( '.sticky', rowData ).text() === 'sticky' ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   172
			$( 'input[name="sticky"]', editRow ).prop( 'checked', true );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   173
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
		// hierarchical taxonomies
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
		$('.post_category', rowData).each(function(){
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   177
			var taxname,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   178
				term_ids = $(this).text();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
			if ( term_ids ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
				taxname = $(this).attr('id').replace('_'+id, '');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
				$('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
		//flat taxonomies
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
		$('.tags_input', rowData).each(function(){
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   188
			var terms = $(this),
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
				taxname = $(this).attr('id').replace('_' + id, ''),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
				textarea = $('textarea.tax_input_' + taxname, editRow),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
				comma = inlineEditL10n.comma;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   193
			terms.find( 'img' ).replaceWith( function() { return this.alt; } );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   194
			terms = terms.text();
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   195
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
			if ( terms ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   197
				if ( ',' !== comma ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
					terms = terms.replace(/,/g, comma);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   199
				}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
				textarea.val(terms);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   203
			textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma } );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
		});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
		// handle the post status
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
		status = $('._status', rowData).text();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   208
		if ( 'future' !== status ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
			$('select[name="_status"] option[value="future"]', editRow).remove();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   210
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   212
		if ( 'private' === status ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   213
			$('input[name="keep_private"]', editRow).prop('checked', true);
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
			$('input.inline-edit-password-input').val('').prop('disabled', true);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
		// remove the current page and children from the parent dropdown
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
		pageOpt = $('select[name="post_parent"] option[value="' + id + '"]', editRow);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
		if ( pageOpt.length > 0 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
			pageLevel = pageOpt[0].className.split('-')[1];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
			nextPage = pageOpt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
			while ( pageLoop ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
				nextPage = nextPage.next('option');
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   224
				if ( nextPage.length === 0 ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   225
					break;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   226
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   227
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
				nextLevel = nextPage[0].className.split('-')[1];
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   229
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
				if ( nextLevel <= pageLevel ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
					pageLoop = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
					nextPage.remove();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
					nextPage = pageOpt;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
			pageOpt.remove();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
		$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
		$('.ptitle', editRow).focus();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
		return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
	save : function(id) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   247
		var params, fields, page = $('.post_status_page').val() || '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   249
		if ( typeof(id) === 'object' ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
			id = this.getId(id);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   251
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   253
		$( 'table.widefat .spinner' ).addClass( 'is-active' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
		params = {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
			action: 'inline-save',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
			post_type: typenow,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
			post_ID: id,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
			edit_date: 'true',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
			post_status: page
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
		};
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   263
		fields = $('#edit-'+id).find(':input').serialize();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
		params = fields + '&' + $.param(params);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   266
		// make ajax request
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
		$.post( ajaxurl, params,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
			function(r) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   269
				$( 'table.widefat .spinner' ).removeClass( 'is-active' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
				if (r) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   272
					if ( -1 !== r.indexOf( '<tr' ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   273
						$(inlineEditPost.what+id).siblings('tr.hidden').addBack().remove();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   274
						$('#edit-'+id).before(r).remove();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   275
						$(inlineEditPost.what+id).hide().fadeIn();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   276
					} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   277
						r = r.replace( /<.[^<>]*?>/g, '' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   278
						$('#edit-'+id+' .inline-edit-save .error').html(r).show();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   279
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   280
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
					$('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
				}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   283
			},
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   284
		'html');
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   285
		return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   288
	revert : function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   289
		var id = $('table.widefat tr.inline-editor').attr('id');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   290
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   291
		if ( id ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   292
			$( 'table.widefat .spinner' ).removeClass( 'is-active' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   293
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   294
			if ( 'bulk-edit' === id ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   295
				$('table.widefat #bulk-edit').removeClass('inline-editor').hide().siblings('tr.hidden').remove();
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   296
				$('#bulk-titles').empty();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   297
				$('#inlineedit').append( $('#bulk-edit') );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   298
			} else {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   299
				$('#'+id).siblings('tr.hidden').addBack().remove();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   300
				id = id.substr( id.lastIndexOf('-') + 1 );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   301
				$(this.what+id).show();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   302
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   303
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
		return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
	},
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
	getId : function(o) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
		var id = $(o).closest('tr').attr('id'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
			parts = id.split('-');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
		return parts[parts.length - 1];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   312
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
};
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
$( document ).ready( function(){ inlineEditPost.init(); } );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   317
// Show/hide locks on posts
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
	var locked = data['wp-check-locked-posts'] || {};
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   320
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
	$('#the-list tr').each( function(i, el) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
		var key = el.id, row = $(el), lock_data, avatar;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
		if ( locked.hasOwnProperty( key ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
			if ( ! row.hasClass('wp-locked') ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
				lock_data = locked[key];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
				row.find('.column-title .locked-text').text( lock_data.text );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
				row.find('.check-column checkbox').prop('checked', false);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   330
				if ( lock_data.avatar_src ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   331
					avatar = $('<img class="avatar avatar-18 photo" width="18" height="18" />').attr( 'src', lock_data.avatar_src.replace(/&amp;/g, '&') );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   332
					row.find('.column-title .locked-avatar').empty().append( avatar );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   333
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   334
				row.addClass('wp-locked');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   335
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   336
		} else if ( row.hasClass('wp-locked') ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   337
			// Make room for the CSS animation
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   338
			row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   339
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
	});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   341
}).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   342
	var check = [];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   343
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   344
	$('#the-list tr').each( function(i, el) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   345
		if ( el.id ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   346
			check.push( el.id );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   347
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   348
	});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   349
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   350
	if ( check.length ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   351
		data['wp-check-locked-posts'] = check;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   352
	}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   353
}).ready( function() {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   354
	// Set the heartbeat interval to 15 sec.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   355
	if ( typeof wp !== 'undefined' && wp.heartbeat ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   356
		wp.heartbeat.interval( 15 );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   357
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   358
});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   359
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   360
}(jQuery));