1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 16:04:24 +03:00
ifhub.club/templates/skin/synio/editor_init.tpl
2013-05-24 00:15:54 +07:00

67 lines
2 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{**
* Инициализация редактора
*
* sEditorType - тип
* sEditorSelector - селектор textarea с редактором
*
* Настройки редакторов храняться в файле templates/framework/js/core/settings.js
*
* TODO: Исправить повторное подключение скрипта
* TODO: Локализация TinyMCE
*}
{* Дефолтный тип редактора *}
{if ! $sEditorType}
{$sEditorType = 'default'}
{/if}
{* Дефолтный селектор редактора *}
{if ! $sEditorSelector}
{$sEditorSelector = 'js-editor'}
{/if}
{* Инициализация *}
{if $oConfig->GetValue('view.wysiwyg')}
{* WYSIWYG редактор *}
{hookb run='editor_init_wysiwyg'}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getTinymceComment()'}
{else}
{$sSettings = 'ls.settings.getTinymce()'}
{/if}
{hook run='editor_init_wysiwyg_settings'}
<script src="{cfg name='path.static.framework'}/js/vendor/tinymce/tiny_mce.js"></script>
<script>
jQuery(function($) {
tinyMCE.init($.extend({ }, {$sSettings}, {
editor_selector : '{$sEditorSelector}',
language : {if $oConfig->GetValue('lang.current') == 'russian'}'ru'{else}'en'{/if}
}));
});
</script>
{/hookb}
{else}
{* Markup редактор *}
{hookb run='editor_init_markup'}
{include file='modals/modal.upload_image.tpl'}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getMarkitupComment()'}
{else}
{$sSettings = 'ls.settings.getMarkitup()'}
{/if}
<script>
jQuery(function($) {
ls.lang.load({lang_load name="panel_b,panel_i,panel_u,panel_s,panel_url,panel_url_promt,panel_code,panel_video,panel_image,panel_cut,panel_quote,panel_list,panel_list_ul,panel_list_ol,panel_title,panel_clear_tags,panel_video_promt,panel_list_li,panel_image_promt,panel_user,panel_user_promt"});
$('.{$sEditorSelector}').markItUp({$sSettings});
});
</script>
{/hookb}
{/if}