<textarea name="{{name}}" style="height:{{height}}px" cols="" rows="3" class="tiny_{{name}}">{{value}}</textarea>
<script type="text/javascript">
    jQuery = !jQuery ? $ : jQuery;
    jQuery(function () {


        var tinymce = jQuery('.tiny_{{name}}').tinymce({//.tinymce textarea
            // Location of TinyMCE script
            script_url: '/_diamond/widgets/assets/jquery/tinymce/tiny_mce.js',
            // General options
            theme: "advanced",
            skin: "themepixels",
            width: "{{width}}",
            height: "{{height}}",
            plugins: "autoresize,autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist,responsivefilemanager",
            inlinepopups_skin: "themepixels",
            // Theme options

{%if compact == true %}

            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,blockquote,formatselect,fontselect,fontsizeselect,",
            theme_advanced_buttons2: "pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,preview,|,forecolor,backcolor,removeformat,charmap,media,fullscreen,|,tablecontrols|link,unlink,image,code,",
            //theme_advanced_buttons3 : "charmap,media,fullscreen,|,tablecontrols|link,unlink,image,code,|,",
{% elseif mini == true %}
            menubar: false,
            toolbar_items_size: 'small',
            theme_advanced_buttons1: "pasteword,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
            theme_advanced_buttons2: "image,bullist,numlist,forecolor,backcolor,removeformat,outdent,indent,unlink,link,|,preview,code,fullscreen",
{%else%}
            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,blockquote,formatselect,fontselect,fontsizeselect,|,charmap,media,fullscreen,",
            theme_advanced_buttons2: "pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,preview,|,forecolor,backcolor,removeformat,|,link,unlink,image,code",
            theme_advanced_buttons3: "tablecontrols,",
{%endif%}            

            // theme_advanced_toolbar_location : \"top\",
            // theme_advanced_toolbar_align : \"left\",
            // theme_advanced_statusbar_location : \"bottom\",
            theme_advanced_resizing: true,
            //image_advtab: true,

            extended_valid_elements: "span[style]",
            // Example content CSS (should be your site CSS)
            content_css: "/_diamond/widgets/assets/jquery/tinymce/css/tinymce3.css",

            // Drop lists for link/image/assets/template dialogs
            template_external_list_url: "/_diamond/widgets/assets/jquery/tinymce/lists/template_list.js",
            external_link_list_url: "/_diamond/widgets/assets/jquery/tinymce/lists/link_list.js",
            external_image_list_url: "/_diamond/widgets/assets/jquery/tinymce/lists/image_list.js",
            media_external_list_url: "/_diamond/widgets/assets/jquery/tinymce/media_list.js",
            external_filemanager_path: "/_diamond/widgets/assets/jquery/filemanager/",
            external_plugins: {"filemanager": "/_diamond/widgets/assets/jquery/filemanager/plugin.min.js"},
            filemanager_title: "Filemanager",
            language: "ru",
            // Replace values for the template plugin
            // template_replace_values: {
            //     username: "Some User",
            //     staffid: "991234"
            // },
        {% if accessKey > '' %}
            filemanager_access_key: '{{ accessKey }}',
        {% endif %}

			convert_urls: false
        });


    });

</script>