mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-17 16:28:19 +03:00
fix выделения текста для цитирования
This commit is contained in:
parent
6f568cbb77
commit
3724e20cf6
|
@ -24,7 +24,7 @@ function getMarkitupSettings() {
|
|||
{name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
|
||||
{name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'<s>', closeWith:'</s>' },
|
||||
{name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'<u>', closeWith:'</u>' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', openWith:'<blockquote>', closeWith:'</blockquote>' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return '<blockquote>'+m.selectionOuter+'</blockquote>'; else if (m.selection) return '<blockquote>'+m.selection+'</blockquote>'; else return '<blockquote></blockquote>' } },
|
||||
{name: ls.lang.get('panel_code'), className:'editor-code', openWith:'<code>', closeWith:'</code>' },
|
||||
{separator:'---------------' },
|
||||
{name: ls.lang.get('panel_list'), className:'editor-ul', openWith:'<ul>\n', closeWith:'</ul>\n' },
|
||||
|
|
|
@ -227,6 +227,14 @@ ls.tools = (function ($) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает выделенный текст на странице
|
||||
*/
|
||||
this.getSelectedText = function(){
|
||||
if ($.browser.msie) return document.selection.createRange().text;
|
||||
return document.getSelection();
|
||||
}
|
||||
|
||||
return this;
|
||||
}).call(ls.tools || {},jQuery);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ function getMarkitupSettings() {
|
|||
{name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
|
||||
{name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'<s>', closeWith:'</s>' },
|
||||
{name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'<u>', closeWith:'</u>' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', openWith:'<blockquote>', closeWith:'</blockquote>' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return '<blockquote>'+m.selectionOuter+'</blockquote>'; else if (m.selection) return '<blockquote>'+m.selection+'</blockquote>'; else return '<blockquote></blockquote>' } },
|
||||
{name: ls.lang.get('panel_code'), className:'editor-code', openWith:'<code>', closeWith:'</code>' },
|
||||
{separator:'---------------' },
|
||||
{name: ls.lang.get('panel_list'), className:'editor-ul', openWith:' <li>', closeWith:'</li>', multiline: true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>' },
|
||||
|
@ -51,7 +51,7 @@ function getMarkitupCommentSettings() {
|
|||
{name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'<s>', closeWith:'</s>' },
|
||||
{name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'<u>', closeWith:'</u>' },
|
||||
{separator:'---------------' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', openWith:'<blockquote>', closeWith:'</blockquote>' },
|
||||
{name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return '<blockquote>'+m.selectionOuter+'</blockquote>'; else if (m.selection) return '<blockquote>'+m.selection+'</blockquote>'; else return '<blockquote></blockquote>' } },
|
||||
{name: ls.lang.get('panel_code'), className:'editor-code', openWith:'<code>', closeWith:'</code>' },
|
||||
{name: ls.lang.get('panel_image'), className:'editor-picture', key:'P', beforeInsert: function(h) { $('#form_upload_img').jqmShow(); } },
|
||||
{name: ls.lang.get('panel_image'), className:'editor-image', replaceWith:'<img src="[!['+ls.lang.get('panel_image_promt')+':!:http://]!]" />' },
|
||||
|
|
Loading…
Reference in a new issue