Changeset 2769687
- Timestamp:
- 08/12/2022 09:45:43 AM (4 years ago)
- Location:
- unfluff-io-content-optimization
- Files:
-
- 17 added
- 3 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin_styles.css (added)
-
tags/1.0.1/assets/css/editor_styles.css (added)
-
tags/1.0.1/assets/images (added)
-
tags/1.0.1/assets/images/100.png (added)
-
tags/1.0.1/assets/images/50.png (added)
-
tags/1.0.1/assets/images/65.png (added)
-
tags/1.0.1/assets/images/85.png (added)
-
tags/1.0.1/assets/images/icon.svg (added)
-
tags/1.0.1/assets/images/waiting.png (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/block_editor.js (added)
-
tags/1.0.1/assets/js/classic_editor.js (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/unfluff.php (added)
-
trunk/assets/js/classic_editor.js (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/unfluff.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unfluff-io-content-optimization/trunk/assets/js/classic_editor.js
r2769673 r2769687 120 120 alert('Unfluff works with the visual editor only! Please switch to the visual editor and click the unfluff button again.'); 121 121 } else { // We are in tinyMCE mode 122 let activeEditor = tinymce.get('content');123 if( activeEditor){ // Make sure we're not calling setContent on null124 highlighted_content = activeEditor.getContent(); // get tinyMCE's content122 let post_editor = tinymce.get('content'); 123 if(post_editor){ // Make sure we're not calling setContent on null 124 highlighted_content = post_editor.getContent(); // get tinyMCE's content 125 125 $('.fluff-sentence .fulff-sentence-text').each(function(i, obj) { 126 126 let fluff_sentence = $(this).text(); … … 137 137 } 138 138 }); 139 tinymce.activeEditor.setContent(highlighted_content); // Update tinyMCE's content140 $( tinymce.activeEditor.getBody()).find('unfluffmark').get(0).scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); // scroll to first highlighted sentence139 post_editor.setContent(highlighted_content); // Update tinyMCE's content 140 $(post_editor.getBody()).find('unfluffmark').get(0).scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); // scroll to first highlighted sentence 141 141 } 142 142 } … … 150 150 alert('Unfluff works with visual editor only! Please switch to visual editor and click the unfluff button again.'); 151 151 } else { // We are in tinyMCE mode 152 let activeEditor = tinyMCE.get('content');153 if( activeEditor!==null){ // Make sure we're not calling setContent on null154 unhighlighted_content = tinymce.activeEditor.getContent(); // get tinyMCE's content152 let post_editor = tinyMCE.get('content'); 153 if(post_editor!==null){ // Make sure we're not calling setContent on null 154 unhighlighted_content = post_editor.getContent(); // get tinyMCE's content 155 155 unhighlighted_content = unhighlighted_content.replaceAll( '<unfluffmark class="unfluff-highlight">', '' ); 156 156 unhighlighted_content = unhighlighted_content.replaceAll( '</unfluffmark>', '' ); 157 tinymce.activeEditor.setContent(unhighlighted_content); // Update tinyMCE's content157 post_editor.setContent(unhighlighted_content); // Update tinyMCE's content 158 158 } 159 159 } … … 163 163 function unfluff_single_highlight(sentence){ 164 164 remove_highlights(); // remove previous highlights if any 165 let activeEditor = tinyMCE.get('content');166 let editor_content = activeEditor.getContent();165 let post_editor = tinyMCE.get('content'); 166 let editor_content = post_editor.getContent(); 167 167 let single_higlight = ''; 168 168 if (editor_content.indexOf(sentence) >= 0) { // text exists without html tags … … 175 175 single_higlight = editor_content.replaceAll( sentence_with_html, '<unfluffmark class="unfluff-highlight">' + sentence_with_html + '</unfluffmark>'); 176 176 } 177 tinymce.activeEditor.setContent(single_higlight); // Update tinyMCE's content178 $( tinymce.activeEditor.getBody()).find('unfluffmark').get(0).scrollIntoView({behavior: "smooth", block: "center", inline: "center"});177 post_editor.setContent(single_higlight); // Update tinyMCE's content 178 $(post_editor.getBody()).find('unfluffmark').get(0).scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); 179 179 } 180 180 … … 237 237 // remove highlights in update hover 238 238 $('#publishing-action').on('mouseover', '#publish',function(){ 239 let activeEditor = tinyMCE.get('content').getContent();239 let post_editor = tinyMCE.get('content').getContent(); 240 240 let highlight_mark = '<unfluffmark class="unfluff-highlight">' 241 if( activeEditor.indexOf(highlight_mark) >= 0) { // text exis241 if(post_editor.indexOf(highlight_mark) >= 0) { // text exis 242 242 remove_highlights(); 243 243 $('#unfluff-highlight-remove').addClass('unfluff-hide'); -
unfluff-io-content-optimization/trunk/readme.txt
r2769673 r2769687 3 3 Contributors: unfluff 4 4 Tags: content, optimization, readability 5 Requires at least: 4.55 Requires at least: 5.0 6 6 Tested up to: 6.0.1 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 40 40 == Changelog == 41 = 1.0.1 = 42 * classic editor fix 41 43 = 1.0.0 = 42 44 * Plugin released. -
unfluff-io-content-optimization/trunk/unfluff.php
r2769200 r2769687 6 6 Author: Unfluff.io 7 7 Author URI: https://unfluff.io/ 8 Version: 1.0. 08 Version: 1.0.1 9 9 */ 10 10
Note: See TracChangeset
for help on using the changeset viewer.