annotate static/js/markitup/sets/default/set.js @ 629:f4c043cf55ac

Wiki integration. Requests don't always have sessions. In particular this occurs when a request is made without a trailing slash. The Common middleware redirects when this happens, and the middleware process_request() processing stops before a session can get added. So just set an attribute on the request object for each operation. This seemed weird to me at first, but there are plenty of examples of this in the Django code base already.
author Brian Neal <bgneal@gmail.com>
date Tue, 13 Nov 2012 13:50:06 -0600
parents c78c6e007e61
children
rev   line source
bgneal@312 1 // ----------------------------------------------------------------------------
bgneal@312 2 // markItUp!
bgneal@312 3 // ----------------------------------------------------------------------------
bgneal@466 4 // Copyright (C) 2011 Jay Salvat
bgneal@312 5 // http://markitup.jaysalvat.com/
bgneal@312 6 // ----------------------------------------------------------------------------
bgneal@312 7 // Html tags
bgneal@312 8 // http://en.wikipedia.org/wiki/html
bgneal@312 9 // ----------------------------------------------------------------------------
bgneal@312 10 // Basic set. Feel free to add more tags
bgneal@312 11 // ----------------------------------------------------------------------------
bgneal@466 12 var mySettings = {
bgneal@312 13 onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
bgneal@312 14 onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
bgneal@312 15 onTab: {keepDefault:false, replaceWith:' '},
bgneal@312 16 markupSet: [
bgneal@312 17 {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
bgneal@312 18 {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
bgneal@312 19 {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
bgneal@312 20 {separator:'---------------' },
bgneal@466 21 {name:'Bulleted List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>'},
bgneal@466 22 {name:'Numeric List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ol>\n', closeBlockWith:'\n</ol>'},
bgneal@466 23 {separator:'---------------' },
bgneal@312 24 {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
bgneal@312 25 {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
bgneal@312 26 {separator:'---------------' },
bgneal@312 27 {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
bgneal@312 28 {name:'Preview', className:'preview', call:'preview'}
bgneal@312 29 ]
bgneal@466 30 }