Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Add JS for copy post function #102
Browse files Browse the repository at this point in the history
  • Loading branch information
Biont committed Jun 30, 2015
1 parent ac0b64d commit 313028e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
var prefix = 'mlp_translation_data_' + blogId,
translationContent = tinyMCE.get( prefix + '_content' ),
content = $( '#content' ).val(), // plain content for "text"-view,
excerpt = $( '#excerpt' ).val(), // plain content for "text"-view,
tinyMCEContent = tinyMCE.get( 'content' ),
title = $( '#title' ).val(),
postSlug = $( '#editable-post-name' ).html();
Expand All @@ -77,6 +78,10 @@
$( '#' + prefix + '_name' ).val( postSlug );
}

if ( excerpt ) {
$( '#' + prefix + '_excerpt' ).val( excerpt );
}

if ( tinyMCEContent ) {
translationContent.setContent( tinyMCEContent.getContent() );
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions resources/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
var prefix = 'mlp_translation_data_' + blogId,
translationContent = tinyMCE.get( prefix + '_content' ),
content = $( '#content' ).val(), // plain content for "text"-view,
excerpt = $( '#excerpt' ).val(), // plain content for "text"-view,
tinyMCEContent = tinyMCE.get( 'content' ),
title = $( '#title' ).val(),
postSlug = $( '#editable-post-name' ).html();
Expand All @@ -77,6 +78,10 @@
$( '#' + prefix + '_name' ).val( postSlug );
}

if ( excerpt ) {
$( '#' + prefix + '_excerpt' ).val( excerpt );
}

if ( tinyMCEContent ) {
translationContent.setContent( tinyMCEContent.getContent() );
}
Expand Down

0 comments on commit 313028e

Please sign in to comment.