// ---------------------------------------------------------------------------- // markItUp! // ---------------------------------------------------------------------------- // Copyright (C) 2008 Jay Salvat // http://markitup.jaysalvat.com/ // ---------------------------------------------------------------------------- // BBCode tags example // http://en.wikipedia.org/wiki/Bbcode // ---------------------------------------------------------------------------- // Feel free to add more tags // ---------------------------------------------------------------------------- // we make our own parser and extend it with image functionality. var cmsparser = new BBCodeToHtmlParser(); cmsparser.arr_in.push(/\[img\="?([\s\S]*?)(?:\|width\=(.*?))?(?:\|height\=(.*?))?(?:\|position\=(.*?))?"?\]([\s\S]*?)\[\/img\]/mg); cmsparser.arr_out.push('$1'); moduleSettings = { nameSpace: 'bbcode', previewElementHidden: true, // should the element be hidden when not in use? (supply interface elements to toggle this) previewTemplatePath: '', previewAutoRefresh: true, previewPosition: 'before', previewParser: cmsparser, resizeHandle: false, // the markupSet needs to be defined as a whole because it overwrites the standardSettings.markupSet, it is not just appended markupSet: [ {name:'Tekst bold (vet) maken', className:'bold', key:'B', openWith:'[b]', closeWith:'[/b]'}, {name:'Tekst italic (cursief) maken', className:'italic', key:'I', openWith:'[i]', closeWith:'[/i]'}, {name:'Tekst onderstrepen', className:'underline', key:'U', openWith:'[u]', closeWith:'[/u]'}, {separator:'---------------' }, {name:'Ongenummerde lijst maken', className:'bulletlist', replaceWith:function(markItUp) { res = "[list]\n[*]";//start list and first listitem marker res += markItUp.selection.replace(/\n/mg, "\n[*]");//replace newlines with liststarters res += "\n[/list]";//end list return res; } }, {name:'Genummerde lijst maken', className:'numericlist', replaceWith:function(markItUp) { openOrderedListPrompt(markItUp); return ''; } }, //{name:'List item', className:'listitem', openWith:'[*] '}, {separator:'---------------' }, {name:'Hyperlink invoegen', className:'link', key:'L', replaceWith:function(markItUp) { openUrlPrompt(markItUp); return ''; } }, {name:'E-mail link invoegen', className:'mailto', key:'M', replaceWith:function(markItUp) { openEmailPrompt(markItUp); return ''; } }, {name:'Popup link invoegen', className:'popup', key:'P', replaceWith:function(markItUp) { openPopupPrompt(markItUp); return ''; } }, {separator:'---------------' }, {name:'Afbeelding in de tekst gebruiken', className:"pictureinsert", replaceWith:function(markItUp) { openImagePrompt(markItUp); return ''; } }, {separator:'---------------' }, {name:'Link naar doel', className:'anchorlink', replaceWith:function(markItUp) { openAnchorLinkPrompt(markItUp); return ''; } }, {name:'Doel', className:'anchortarget', replaceWith:function(markItUp) { openAnchorTargetPrompt(markItUp); return ''; } }, {name:'Preview (voorbeeldweergave) bekijken of vernieuwen', className:"preview", call:'preview' }, {rightseparator:'---------' }, {name:'Preview (voorbeeldweergave) sluiten', className:"closepreview", call:'closePreview' }, {rightseparator:'---------' }, {name:'Help openen of sluiten', className:"help", call:'help' } ] }