Changeset 1967230
- Timestamp:
- 11/01/2018 03:19:32 PM (7 years ago)
- Location:
- savodxon
- Files:
-
- 7 added
- 2 edited
-
tags/1.1 (added)
-
tags/1.1/check.png (added)
-
tags/1.1/clear.png (added)
-
tags/1.1/readme.txt (added)
-
tags/1.1/savodxon.css (added)
-
tags/1.1/savodxon.js (added)
-
tags/1.1/savodxon.php (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/savodxon.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
savodxon/trunk/readme.txt
r1967080 r1967230 5 5 Requires at least: 4.6 6 6 Tested up to: 4.9.8 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
savodxon/trunk/savodxon.js
r1967077 r1967230 25 25 var html = editor.getContent({'format': 'html'}); 26 26 var html = html.replace(/<span class=\"error\">([^<]+)<\/span>/g, "$1"); 27 28 var html = autocorrectTree(html); 29 27 30 editor.setContent(html); 28 31 … … 123 126 })(); 124 127 128 autocorrectTree = function(html) { 129 var tmpElem = $('<div>'); 130 tmpElem.css({display: "none"}); 131 tmpElem.attr({id: "savodxonTempDiv"}); 132 tmpElem.html(html); 133 $("body").append(tmpElem); 134 var main = document.getElementById("savodxonTempDiv"); 135 var allNodes = main.getElementsByTagName("*"); 136 for (var key in allNodes) { 137 var el = allNodes[key]; 138 if (el.nodeName !== 'SCRIPT' && el.nodeName !== 'STYLE' && el.nodeName !== 'PRE'){ 139 var children = el.childNodes; 140 if (children !== undefined){ 141 x = children.length; 142 for (i=0; i<x; i++){ 143 if (children[i].nodeType == 3 && children[i].nodeValue !== "\n"){ 144 text = children[i].nodeValue; 145 children[i].nodeValue = autoCorrect(text); 146 } 147 } 148 } 149 } 150 } 151 var output = tmpElem.html(); 152 tmpElem.remove(); 153 return output; 154 }; 155 125 156 autoCorrect = function(text){ 126 157 var text = text.replace(/ʻ|‘|’|'|`/g,"ʼ");
Note: See TracChangeset
for help on using the changeset viewer.