{"id":162137,"date":"2012-12-11T07:33:03","date_gmt":"2012-12-11T03:33:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=162137"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=162137","title":{"rendered":"<span class=\"post_title\">TinyMCE 3.x: \u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u043e\u0432 \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0440\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 TinyMCE 3.x \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u043e\u0432, \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f? <br \/>  \u0421\u0430\u043c\u043e\u0435 \u0447\u0430\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435: \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (\u043a\u043e\u043f\u0438\u0440\u0430\u0439\u0442\u0435\u0440\u044b, \u0440\u0435\u0440\u0430\u0439\u0442\u0435\u0440\u044b, \u043a\u043e\u043d\u0442\u0435\u043d\u0442-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b \u0438 \u0442.\u0434.) \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  \u041f\u043b\u0430\u0433\u0438\u043d \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (\u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 HTML-\u0442\u0435\u0433\u043e\u0432). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u00ab\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430\u00bb.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"javascript\">\t$().ready(function() {              \/\/\/\/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c jQuery\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \t\t$('textarea.tinymce').tinymce({                         \/* .........................................................                         ..........\u043e\u043f\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.........                         .........................................................*\/   \t\t\tsetup : function(ed) {                          \/\/\/\/\/\/\/\/\/\/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\/\/\/\/\/\/\/\/\/\/\/\/                              var wordscount=function () {                                     content=tinyMCE.activeEditor.getContent({format : 'raw'});                                    \/\/\/\/\u0412\u0441\u0442\u0430\u0432\u043a\u0443 \u043a\u043e\u0434\u0430 (pre) - \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c\/\/\/\/\/\/\/\/\/\/\/       content = content.replace(\/(&lt;\\s*\\\/?\\s*)pre(\\s*([^&gt;]*)?\\s*&gt;)*(&lt;\\s*\\\/?\\s*)pre(\\s*([^&gt;]*)?\\s*&gt;)\/gi,&quot;&quot;);                                     content=content.replace(\/&lt;\\\/?[^&gt;]+(&gt;|$)\/g,' ');                                    content=content.replace(\/&(lt|gt);\/g, function (strMatch, p1){                                 \t\t\treturn (p1 == &quot;lt&quot;)? &quot;&lt;&quot; : &quot;&gt;&quot;;                                           });                                     content=content.replace(\/&nbsp;\/g,' ');                                   content=content.replace(\/\\n\/,&quot; &quot;);                                   content=content.replace(\/ +\/g,' ');                                   content=content.replace(\/\\s*((\\S+\\s*)*)\/,'$1');                                   content=content.replace(\/((\\s*\\S+)*)\\s*\/,'$1');                                   words=content.split(&quot; &quot;).length;                                   charsws=content.length;                                   chars=content.replace(\/ +\/g,'').length;                                   if (content=='') {words=0;chars=0;charsws=0;}                                   document.getElementById('wordscount').innerHTML=words;                                   document.getElementById('charscount').innerHTML=chars;                                   document.getElementById('charswscount').innerHTML=charsws;                                   \/\/alert(content);                               };                          \/\/\/\/\/\/\/\/\/\/\/\/\/\u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f\/\/\/\/\/\/\/\/\/\/                           \/\/\/\/\/\u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\/\/\/\/\/\/\/\/                            ed.onKeyUp.add(wordscount);                            ed.onChange.add(wordscount);                            ed.onInit.add(wordscount);                           } <\/code><\/pre>\n<p>  \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 (\u043d\u0438\u0436\u0435, \u0432 <code>&lt;body&gt;<\/code>):  <\/p>\n<pre><code>                    \u0421\u043b\u043e\u0432: &lt;span id=&quot;wordscount&quot;&gt;&lt;\/span&gt;                      \u0421\u0438\u043c\u0432\u043e\u043b\u043e\u0432: &lt;span id=&quot;charscount&quot;&gt;&lt;\/span&gt;                      \u0421\u0438\u043c\u0432. \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438: &lt;span id=&quot;charswscount&quot;&gt;&lt;\/span&gt; <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb \u043f\u0440\u0438 \u043d\u0430\u0431\u043e\u0440\u0435\/\u0432\u0441\u0442\u0430\u0432\u043a\u0435\/\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u0438.<br \/>  \u041a\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0442\u044d\u0433\u043e\u0432 \u2014 \u00ab\u0441\u044b\u0440\u043e\u0432\u0430\u0442\u00bb, \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"http:\/\/games.shotme.ru\/add\/article\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438<\/a><br \/>  \u0412\u0441\u0435\u043c \u0421\u043f\u0430\u0441\u0438\u0431\u043e!    \t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/162137\/\"> http:\/\/habrahabr.ru\/post\/162137\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 TinyMCE 3.x \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u043e\u0432, \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f? <br \/>  \u0421\u0430\u043c\u043e\u0435 \u0447\u0430\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435: \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (\u043a\u043e\u043f\u0438\u0440\u0430\u0439\u0442\u0435\u0440\u044b, \u0440\u0435\u0440\u0430\u0439\u0442\u0435\u0440\u044b, \u043a\u043e\u043d\u0442\u0435\u043d\u0442-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b \u0438 \u0442.\u0434.) \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  \u041f\u043b\u0430\u0433\u0438\u043d \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (\u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 HTML-\u0442\u0435\u0433\u043e\u0432). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u00ab\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430\u00bb.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-162137","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162137"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162137\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}