diff options
author | Yury German <blueknight@gentoo.org> | 2016-02-12 22:22:00 -0500 |
---|---|---|
committer | Yury German <blueknight@gentoo.org> | 2016-02-12 22:22:00 -0500 |
commit | 657cafe0e955cf88033597f131aa50835140c617 (patch) | |
tree | cf21a30d319cb2a238a6cfb8b4eb3b20b1b5dcff /plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js | |
parent | Adding New Mantra version 2.4.1.1 - Bug 574468 (diff) | |
download | blogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.tar.gz blogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.tar.bz2 blogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.zip |
Updating plugins easy-table, jetpack, openid, public-post preview, talbe-of-contents-plus, wordress-mobile-pack - Bug 574468
Diffstat (limited to 'plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js')
-rw-r--r-- | plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js b/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js index 1e33a0c8..9ca642a6 100644 --- a/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js +++ b/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js @@ -4,9 +4,9 @@ var AtD_qtbutton, autosave; /* convienence method to restore the text area from the preview div */ -function AtD_restore_text_area() -{ +function AtD_restore_text_area() { var content; + /* swap the preview div for the textarea, notice how I have to restore the appropriate class/id/style attributes */ if( jQuery('#atd-content').get(0) ) { AtD.remove('atd-content'); @@ -20,6 +20,22 @@ function AtD_restore_text_area() content = content.replace(/<BR.*?class.*?atd_remove_me.*?>/gi, '\n'); } + // Remove emoji replacement images + if ( typeof window.twemoji !== 'undefined' ) { + content = content.replace( /<img [^>]+>/g, function( img ) { + // The images should have class containing 'emoji' + if ( img.indexOf( 'emoji' ) !== -1 ) { + var alt = img.match( /alt="([^"]+)"/ ); + + if ( alt && alt[1] && window.twemoji.test( alt[1] ) ) { + return alt[1]; + } + } + + return img; + }); + } + // jQuery('#content').replaceWith( AtD.content_canvas ); jQuery('#content').val( content.replace(/\<\;/g, '<').replace(/\>\;/g, '>').replace(/\&/g, '&') ) .height(AtD.height) |