Форматирование

Тема в разделе "Питання по роботі форуму REIBERT", создана пользователем zascok, 1 июн 2013.

  1. zascok

    zascok Stabsfeldwebel

    Сообщения:
    1.495
    Артем, я Вас очень прошу, скажите своим технарям пусть зайдут в темплайт editor_js_setup

    и поменяют там код на этот. Это лекарство от прямого копирования с веб-страниц. Глаза устают от разношёрстного форматирования текстов. То фонт маленький, то он очень большой, ссылки, картинки копируются в темы на форуме. Заходишь в темы, там такой бардак с форматированием, что читать невозможно.

    Лекарство с официального форума, http://xenforo.com/community/thread...not-rich-text-editor.10936/page-2#post-535898


    Код:
    <xen:require js="js/tinymce/tiny_mce.js" />
     
    <script>
     
    <xen:hook name="editor_js_setup" params="{xen:array 'editorId={$editorId}'}">
     
    !function($, window, document, _undefined)
    {
        var $editor = $("#{xen:jsescape $editorId}_html").hide();
        console.info('XenForo editor %s, %o', '{xen:jsescape {$editorId}}', $editor);
     
        window.tinyMCE && tinyMCE.addI18n(
        {
            xenforo:
            {
                common:
                {
                    apply: "{xen:jsescape {xen:phrase apply}}",
                    insert: "{xen:jsescape {xen:phrase insert}}",
                    update: "{xen:jsescape {xen:phrase update}}",
                    cancel: "{xen:jsescape {xen:phrase cancel}}",
                    close: "{xen:jsescape {xen:phrase close}}",
                    browse: "{xen:jsescape {xen:phrase browse}}",
                    class_name: "{xen:jsescape {xen:phrase class}}",
                    not_set: "-- {xen:jsescape {xen:phrase not_set}} --"
                },
     
                xenforo:
                {
     
                    bold_desc: "{xen:jsescape {xen:phrase bold_ctrl_b}}",
                    italic_desc: "{xen:jsescape {xen:phrase italic_ctrl_i}}",
                    bullist_desc: "{xen:jsescape {xen:phrase unordered_list}}",
                    image_desc: "{xen:jsescape {xen:phrase insert_edit_image}}",
                    removeformat_desc: "{xen:jsescape {xen:phrase remove_formatting}}",
                    smilies_desc: "{xen:jsescape {xen:phrase smilies}}",
                    media_desc: "{xen:jsescape {xen:phrase media}}",
                    quote: "{xen:jsescape {xen:phrase quote}}"
     
                }
            }
        });
     
        $(function()
        {
            $editor.css('visibility', '').show();
            if (window.tinyMCE)
            {
                var plugins = 'tabfocus,-xenforo_inline_popups,-xenforo_custom_bbcode,-xenforo_smilies,-xenforo_media,-xenforo_bbcode_switch,-xenforo_elastic,paste';
                // tinyMCE.dom.Event._pageInit(window); // for ajax loads. Removed for TinyMCE Fix
     
                $.fn.controlsToggle();
                tinyMCE.init(
                {
                <xen:hook name="editor_tinymce_init" params="{xen:array 'editorId={$editorId}'}">
                    mode: 'exact',
                    elements: $editor.attr('id'),
                    plugins: plugins,
                    cleanup: false,
                    theme: 'xenforo',
                    theme_xenforo_dialog_url: "{xen:jsescape 'index.php?editor/dialog&style={$visitorStyle.style_id}'}",
                    theme_xenforo_contents_css_url: "css.php?style={xen:urlencode $visitorStyle.style_id}&css=editor_contents&d={xen:urlencode $visitorStyle.last_modified_date}",
                    language: '',
                    directionality: '{$visitorLanguage.text_direction}',
                    paste_auto_cleanup_on_paste : true,
                    paste_remove_styles: true,
                    paste_remove_styles_if_webkit: true,
                    remove_linebreaks : true,
                    paste_strip_class_attributes: true,
                    setup : function(ed) {
                        ed.onInit.add(function(ed) {
                            ed.pasteAsPlainText = true;
                        });
                    },
             
                    document_base_url: "{xen:jsescape $requestPaths.fullBasePath}",
                    xenforo_smilies: {xen:helper json, $smilies},
                    xenforo_bbcode_switch_text: ["{xen:jsescape {xen:phrase use_bb_code_editor}}", "{xen:jsescape {xen:phrase use_rich_text_editor}}"]
                </xen:hook>
                });
            }
            else
            {
                <xen:if is="!{$message}">$editor.after($('<input type="hidden" name="_xfRteFailed" value="1" />'));</xen:if>
            }
     
            $editor.data('editorActivated', true);
     
        });
    }
    (jQuery, this, document);
    </xen:hook>
    </script>
     
  2. Интересные лоты

    1. Затвор гвинтівки Маузера К 98.
      266 грн.
    2. 150 грн.
    3. Продам комплект гаінтів для кріплення магазинної коробки гвинтівок Маузер. Гарний стан. Дивіться ус...
      1000 грн.
    4. Складской подаватель магазина Маузер из послевоенного ЗИПа, без клейм.
      400 грн.
    5. 280 грн.
  3. Artem

    Artem Адміністратор

    Рейтинг:
    5
    Отзывов:
    222
    Лоты
      на продаже:
    8
      проданные:
    356
    Сообщения:
    13.586
    В ближайшем обновлении 1.2, они будут менять визуальный редактор, это тоже должны вроде будут учесть.
     
  4. zascok

    zascok Stabsfeldwebel

    Сообщения:
    1.495
    Да я в курсе, но 1.2 на очень ранней стадии бета, позавчера объявили, пройдет еще месяцев 4 пока они ее выпустят, в лучшем случае.
     
  5. Artem

    Artem Адміністратор

    Рейтинг:
    5
    Отзывов:
    222
    Лоты
      на продаже:
    8
      проданные:
    356
    Сообщения:
    13.586
    Сделали.
     
    Cybermaster и zascok нравится это.