~canonical-sysadmins/wordpress/4.7.2

« back to all changes in this revision

Viewing changes to wp-content/plugins/akismet/_inc/form.js

  • Committer: Jacek Nykis
  • Date: 2015-01-05 16:17:05 UTC
  • Revision ID: jacek.nykis@canonical.com-20150105161705-w544l1h5mcg7u4w9
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
var ak_js = document.getElementById( "ak_js" );
 
2
 
 
3
if ( ! ak_js ) {
 
4
        ak_js = document.createElement( 'input' );
 
5
        ak_js.setAttribute( 'id', 'ak_js' );
 
6
        ak_js.setAttribute( 'name', 'ak_js' );
 
7
        ak_js.setAttribute( 'type', 'hidden' );
 
8
}
 
9
else {
 
10
        ak_js.parentNode.removeChild( ak_js );
 
11
}
 
12
 
 
13
ak_js.setAttribute( 'value', ( new Date() ).getTime() );
 
14
 
 
15
var commentForm = document.getElementById( 'commentform' );
 
16
 
 
17
if ( commentForm ) {
 
18
        commentForm.appendChild( ak_js );
 
19
}
 
20
else {
 
21
        var replyRowContainer = document.getElementById( 'replyrow' );
 
22
 
 
23
        if ( replyRowContainer ) {
 
24
                var children = replyRowContainer.getElementsByTagName( 'td' );
 
25
 
 
26
                if ( children.length > 0 ) {
 
27
                        children[0].appendChild( ak_js );
 
28
                }
 
29
        }
 
30
}
 
 
b'\\ No newline at end of file'