editor_markitupbbcode.html

 1   <!-- markitup -->
 2   <#macro initEditor skin="simple" emo="true" teditor="true">
 3   <!-- Load up the actual editor core -->
 4   <!-- markItUp! -->
 5   <script src="js/editors/markitup/jquery.markitup.js"></script>
 6   <!-- markItUp! toolbar settings -->
 7   <script src="js/editors/markitup/sets/bbcode/set.js"></script>
 8   <!-- markItUp! Init -->
 9   <script>
 10   $(document).ready(function(){
 11   	
 12   	<!-- markItUp! add css head skin -->
 13   	$("head").append("<link>");
 14       var css = $("head").children(":last");
 15   		css.attr({
 16   		rel:  "stylesheet",
 17   		type: "text/css",
 18   		href: "js/editors/markitup/skins/${skin}/style.css"
 19       });
 20   	<!--  markItUp! add css head  toolbar skin -->
 21   	$("head").append("<link>");
 22   		var css = $("head").children(":last");
 23   		css.attr({
 24   		rel:  "stylesheet",
 25   		type: "text/css",
 26   		href: "js/editors/markitup/sets/bbcode/style.css"
 27   		}); 
 28   
 29   	// Add markItUp! to your textarea in one line
 30   	// $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
 31   	$(".richtext").markItUp(mySettings);
 32   	
 33   	<#if emo == "true">
 34   	$("li.markItUpSeparator:last").after('<li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-happy.png"  title=":p"/></li><li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-unhappy.png" title=":("/></li><li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-surprised.png" title=":o"/></li><li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-tongue.png" title=":p"/></li><li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-wink.png" title=";)"/></li><li class="emoticon markItUpButton"><img src="js/editors/markitup/skins/${skin}/images/emoticon-smile.png" title=":D"/></li>');
 35   
 36   	$('.emoticon img').click(function() {
 37           emoticon = $(this).attr("title");
 38           $.markItUp( { replaceWith:emoticon } );
 39       });
 40   	</#if>
 41   	
 42   	// And you can add/remove markItUp! whenever you want
 43   	<#if teditor == "true">
 44   		$(".richtext").after('<p class="editor-toggle"><a href="#" class="toggle button"><span>#i18n{portal.admindashboard.editors.markitup.removeMarkitup}</span></a></p>');
 45   		$('.toggle').click(function() {
 46   		if ($('.richtext.markItUpEditor').length >= 1) {
 47    			$('.richtext').markItUpRemove();
 48   			$("span", this).text("#i18n{portal.admindashboard.editors.markitup.removeMarkitup}");
 49   		} else {
 50   			$('.richtext').markItUp(mySettings);
 51   			$("span", this).text("#i18n{portal.admindashboard.editors.markitup.addMarkitup}");
 52   		}
 53    		return false;
 54   	});
 55   	</#if>
 56   });
 57   </script>
 58   
 59   </#macro>