1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 07:54:24 +03:00

Fixes #299: Переделать получение настроек для редактора MarkItUp!

This commit is contained in:
Denis Shakhov 2013-07-02 10:53:08 +07:00
parent 5049912aea
commit 2e2fa31049
3 changed files with 128 additions and 132 deletions

View file

@ -6,8 +6,11 @@ var ls = ls || {};
ls.settings = (function ($) {
this.getMarkitup = function() {
return {
this.get = function (sSettingsName) {
return this[sSettingsName];
};
this.markitup = {
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
onTab: {keepDefault:false, replaceWith:' '},
@ -35,11 +38,9 @@ ls.settings = (function ($) {
{name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
{name: ls.lang.get('panel_cut'), className:'editor-cut', replaceWith: function(markitup) { if (markitup.selection) return '<cut name="'+markitup.selection+'">'; else return '<cut>' }}
]
}
};
this.getMarkitupComment = function() {
return {
this.markitupComment = {
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
onTab: {keepDefault:false, replaceWith:' '},
markupSet: [
@ -56,11 +57,9 @@ ls.settings = (function ($) {
{separator:'---------------' },
{name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }
]
}
};
this.getTinymce = function() {
return {
this.tinymce = {
mode : "specific_textareas",
editor_selector : "mce-editor",
theme : "advanced",
@ -90,11 +89,9 @@ ls.settings = (function ($) {
underline : {inline : 'u', exact : true},
strikethrough : {inline : 's', exact : true}
}
}
};
this.getTinymceComment = function() {
return {
this.tinymceComment = {
mode : "textareas",
theme : "advanced",
skin : "livestreet",
@ -133,7 +130,6 @@ ls.settings = (function ($) {
}
});
}
}
};
return this;

View file

@ -26,12 +26,12 @@
{hookb run='editor_init_wysiwyg' sEditorType=$sEditorType sEditorSelector=$sEditorSelector}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getTinymceComment()'}
{$sSettings = 'ls.settings.get("tinymceComment")'}
{else}
{hook run='editor_init_wysiwyg_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.getTinymce()'}
{$sSettings = 'ls.settings.get("tinymce")'}
{/if}
{/if}
@ -53,12 +53,12 @@
{include file='modals/modal.upload_image.tpl'}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getMarkitupComment()'}
{$sSettings = 'ls.settings.get("markitupComment")'}
{else}
{hook run='editor_init_markup_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.getMarkitup()'}
{$sSettings = 'ls.settings.get("markitup")'}
{/if}
{/if}

View file

@ -26,12 +26,12 @@
{hookb run='editor_init_wysiwyg' sEditorType=$sEditorType sEditorSelector=$sEditorSelector}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getTinymceComment()'}
{$sSettings = 'ls.settings.get("tinymceComment")'}
{else}
{hook run='editor_init_wysiwyg_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.getTinymce()'}
{$sSettings = 'ls.settings.get("tinymce")'}
{/if}
{/if}
@ -53,12 +53,12 @@
{include file='modals/modal.upload_image.tpl'}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.getMarkitupComment()'}
{$sSettings = 'ls.settings.get("markitupComment")'}
{else}
{hook run='editor_init_markup_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.getMarkitup()'}
{$sSettings = 'ls.settings.get("markitup")'}
{/if}
{/if}