{
    "version": "https:\/\/jsonfeed.org\/version\/1",
    "title": "Блог Чуденкова Алексея, заметки с тегом: tinymce",
    "home_page_url": "https:\/\/blog.chudenkov.ru\/tags\/tinymce\/",
    "feed_url": "https:\/\/blog.chudenkov.ru\/tags\/tinymce\/json\/",
    "icon": "https:\/\/blog.chudenkov.ru\/user\/userpic@2x.jpg",
    "author": {
        "name": "Чуденков Алексей",
        "url": "https:\/\/blog.chudenkov.ru\/",
        "avatar": "https:\/\/blog.chudenkov.ru\/user\/userpic@2x.jpg"
    },
    "items": [
        {
            "id": "57",
            "url": "https:\/\/blog.chudenkov.ru\/all\/simplacms-obnovlyaem-tinymce-do-4-versii\/",
            "title": "SimplaCMS: обновляем TinyMCE до 4 версии",
            "content_html": "<p>Кривой TinyMCE 3 версии в 2019 году уже невозможно использовать. Он регулярно вставляет всякие спаны и непечатаемые пробелы, поэтому нужно было обновить его версию. <br \/><\/p>\n<ol start=\"1\">\n<li>Открываем \/simpla\/design\/js\/ и создаём папку tinymce<\/li>\n<li><a href=\"http:\/\/download.moxiecode.com\/tinymce\/tinymce_4.1.7_jquery.zip\">Скачаем<\/a> сам TinyMCE и положим содержимое папки js в папку tinymce. Краткая структура файлов и папок в папке tinymce должна быть такой:<\/li>\n<\/ol>\n<pre class=\"e2-text-code\"><code>-langs\r\n-plugins\r\n-skins\r\n-themes\r\n--jquery.tinymce.min.js\r\n--tinymce.min.js<\/code><\/pre><ol start=\"3\">\n<li>Открываем файл  \/simpla\/design\/html\/tinymce_init.tpl и меняем полностью его содержимое на:<\/li>\n<\/ol>\n<pre class=\"e2-text-code\"><code>&lt;script language=&quot;javascript&quot; type=&quot;text\/javascript&quot; src=&quot;design\/js\/tinymce\/tinymce.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script language=&quot;javascript&quot;&gt;\r\ntinymce.init({\r\n    selector: &quot;textarea.editor_large,textarea.editor_small&quot;,\r\n    language : &quot;ru&quot;,\r\n    plugins: [\r\n        &quot;advlist autosave autolink lists link image charmap print preview hr anchor pagebreak&quot;,\r\n        &quot;searchreplace wordcount charactercount charmap visualblocks visualchars code fullscreen&quot;,\r\n        &quot;insertdatetime media nonbreaking save table contextmenu directionality&quot;,\r\n        &quot;emoticons template paste textcolor colorpicker textpattern  &quot;\r\n   ],\r\n   toolbar1: &quot;undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link unlink anchor | image media charmap blockquote | forecolor backcolor | removeformat print preview code emoticons &quot;,\r\nmenubar: '',\r\n   verify_html: false, \r\n   image_advtab: true,\r\n        setup : function(ed) {\r\n        if(typeof set_meta == 'function')\r\n        {\r\n            ed.on('keyUp', function() {\r\n                set_meta();\r\n            });\r\n            ed.on('change', function() {\r\n                set_meta();\r\n            });\r\n        }\r\n    }\r\n    {literal}}{\/literal});\r\n    function myCustomGetContent( id ) {\r\n        if( typeof tinymce != &quot;undefined&quot; ) {\r\n            var editor = tinymce.get( id );\r\n            if( editor &amp;&amp; editor instanceof tinymce.Editor ) {\r\n                return editor.getContent{literal}({format : 'text'}{\/literal}).substr(0, 512);\r\n            } else {\r\n                return  jQuery('textarea[name='+id+']').val().replace(\/(&lt;([^&gt;]+)&gt;)\/ig,&quot; &quot;).replace(\/(\\&amp;nbsp;)\/ig,&quot; &quot;).replace(\/^\\s+|\\s+$\/g, '').substr(0, 255);\r\n            }\r\n        }\r\n        return '';\r\n    }\r\n&lt;\/script&gt;<\/code><\/pre><ol start=\"4\">\n<li>Далее необходимо поправить автогенерацию meta description в админке. Для этого нужно полностью заменить функцию generate_meta_description() в файлах:\n<ul>\n  <li>\/simpla\/design\/html\/product.tpl<\/li>\n  <li>\/simpla\/design\/html\/post.tpl<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<pre class=\"e2-text-code\"><code>\/\/ Обновлённая функция, которую нужно вставить в файлы\r\nfunction generate_meta_description()\r\n{\r\n\tif( typeof tinymce != &quot;undefined&quot; )\r\n\t{\r\n\t\treturn myCustomGetContent( &quot;annotation&quot; );\r\n\t}\r\n\telse\r\n\t\treturn $('textarea[name=annotation]').val().replace(\/(&lt;([^&gt;]+)&gt;)\/ig,&quot; &quot;).replace(\/(\\&amp;nbsp;)\/ig,&quot; &quot;).replace(\/^\\s+|\\s+$\/g, '').substr(0, 255);\r\n}<\/code><\/pre><p>В файле \/simpla\/design\/html\/category.tpl полностью обновляем функцию:<\/p>\n<pre class=\"e2-text-code\"><code>function generate_meta_description()\r\n{\r\n\tif( typeof tinymce != &quot;undefined&quot; )\r\n\t{\r\n\t\treturn myCustomGetContent( &quot;description&quot; );\r\n\t}\r\n\telse\r\n\t\treturn $('textarea[name=description]').val().replace(\/(&lt;([^&gt;]+)&gt;)\/ig,&quot; &quot;).replace(\/(\\&amp;nbsp;)\/ig,&quot; &quot;).replace(\/^\\s+|\\s+$\/g, '').substr(0, 255);\r\n}<\/code><\/pre><p>В файле \/simpla\/design\/html\/page.tpl полностью обновляем функцию:<\/p>\n<pre class=\"e2-text-code\"><code>function generate_meta_description()\r\n{\r\n\tif( typeof tinymce != &quot;undefined&quot; )\r\n\t{\r\n\t\treturn myCustomGetContent( &quot;body&quot; );\r\n\t}\r\n\telse\r\n\t\treturn $('textarea[name=body]').val().replace(\/(&lt;([^&gt;]+)&gt;)\/ig,&quot; &quot;).replace(\/(\\&amp;nbsp;)\/ig,&quot; &quot;).replace(\/^\\s+|\\s+$\/g, '').substr(0, 255);\r\n}<\/code><\/pre><p><b>Результат работы<\/b><\/p>\n<div class=\"e2-text-picture\">\n<img src=\"https:\/\/blog.chudenkov.ru\/pictures\/tinymcesimplacms.jpg\" width=\"1477\" height=\"795\" alt=\"\" \/>\n<\/div>\n",
            "date_published": "2019-05-14T19:37:36+03:00",
            "date_modified": "2019-05-14T19:41:23+03:00",
            "image": "https:\/\/blog.chudenkov.ru\/pictures\/tinymcesimplacms.jpg",
            "_date_published_rfc2822": "Tue, 14 May 2019 19:37:36 +0300",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "57",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css",
                    "system\/library\/highlight\/highlight.js",
                    "system\/library\/highlight\/highlight.css"
                ],
                "og_images": [
                    "https:\/\/blog.chudenkov.ru\/pictures\/tinymcesimplacms.jpg"
                ]
            }
        }
    ],
    "_e2_version": 3365,
    "_e2_ua_string": "E2 (v3365; Aegea)"
}