35 lines
1.9 KiB
JavaScript
35 lines
1.9 KiB
JavaScript
// ----------------------------------------------------------------------------
|
|
// markItUp!
|
|
// ----------------------------------------------------------------------------
|
|
// Copyright (C) 2008 Jay Salvat
|
|
// http://markitup.jaysalvat.com/
|
|
// ----------------------------------------------------------------------------
|
|
// Html tags
|
|
// http://en.wikipedia.org/wiki/html
|
|
// ----------------------------------------------------------------------------
|
|
// Basic set. Feel free to add more tags
|
|
// ----------------------------------------------------------------------------
|
|
my_html = {
|
|
nameSpace: "my_html", // Used to prevent multi-instances CSS conflict
|
|
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
|
|
onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
|
|
onTab: {keepDefault:false, openWith:' '},
|
|
markupSet: [
|
|
{name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
|
|
{separator:'---------------' },
|
|
{name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
|
|
{name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
|
|
{name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
|
|
{separator:'---------------' },
|
|
{name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n' },
|
|
{name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n' },
|
|
{name:'Li', openWith:'<li>', closeWith:'</li>' },
|
|
{separator:'---------------' },
|
|
{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
|
|
{separator:'---------------' },
|
|
{name:'Quote block', openWith:'<blockquote>\n', closeWith:'</blockquote>\n' },
|
|
{name:'Code block', openWith:'<code>\n', closeWith:'</code>\n' },
|
|
{separator:'---------------' },
|
|
{name:'Clean', replaceWith:function(h) { return h.selection.replace(/<(.*?)>/g, "") } }
|
|
]
|
|
} |