>
> On 29 Oct 2009, at 14:13, Rene de Zwart wrote:
>
>> Twylite wrote
>>> Rene de Zwart wrote:
>>>> I just finished integrating tiny mce.
>>>> To start with the downside -;( 'You need to make tinyMce part of the
>>>> Repository!'
>>>>
>>> Please no! TinyMCE is a bloated monstrosity and produces _horrible_
>>> HTML. We're struggling to migrate an intranet system from Drupal to
>>> PmWiki on account of the terrible markup produced by TinyMCE.
>>>
>>> If some sort of edit helper is required, please consider MarkItUp
>>> (http://markitup.jaysalvat.com/home/) rather than a WYSIWYG.
>>> MarkItUp
>>> is built on jQuery, which provides the side benefit of giving
>>> Fossil and
>>> excellent JavaScript library for UI enhancement, AJAX features, etc.
>
> I agree with Twylite about TinyMCE generating horrible markup,
> although it does generate code that survives HTML email bodies - the
> most degrading place for CSS as email clients are restrictive and
> inconsistent. I reckon a limited feature WYSIWYG editor would be the
> best idea as it might not be programmers or people familiar with
> markup editing documentation or submitting tickets - users of software
> shouldn't need to learn syntax in order to contribute and communicate
> effectively. In addition to this, having an editor that could get out
> of the way for folk who can write markup would also be a good idea.
>
> Just my £0.02. Your thoughts?
>
> ~ James
Well if you agree with him then you probably want this :-).
mkdir markitup
mkdir markitup/javascript
fossil new markitup.fsl
fossil ui markitup.fsl {configure the project)
download markitup and jquery
unzip in markitup/javascript, cd latest, mv * .., rmdir latest
copy jquery-....js to javascript/jquery.js
cd markitup
fossil open ../markitup.fsl
fossil add javascript
fossil commit -m "added markitup an jquery to the project"
fossil ui
select admin/headers add after the </link> put
<link rel="stylesheet" type="text/css"
href="/doc/tip/javascript/markitup/skins/markitup/style.css" />
<link rel="stylesheet" type="text/css"
href="/doc/tip/javascript/markitup/sets/default/style.css" />
<script type="text/javascript"
src="/doc/tip/javascript/jquery.js"></script>
<script type="text/javascript"
src="/doc/tip/javascript/markitup/jquery.markitup.js">
</script>
and save
select admin/footer add above the first line
<script type='text/javascript'>
var m = document.getElementsByTagName('textarea')
var l = m.length
var n
var mySettings = {
nameSpace: "html", // Useful 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:'Heading 1', key:'1', openWith:'<h1(!(
class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your
title here...' },
{name:'Heading 2', key:'2', openWith:'<h2(!(
class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your
title here...' },
{name:'Heading 3', key:'3', openWith:'<h3(!(
class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your
title here...' },
{name:'Heading 4', key:'4', openWith:'<h4(!(
class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your
title here...' },
{name:'Heading 5', key:'5', openWith:'<h5(!(
class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your
title here...' },
{name:'Heading 6', key:'6', openWith:'<h6(!(
class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your
title here...' },
{name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>',
closeWith:'</p>' },
{separator:'---------------' },
{name:'Bold', key:'B', openWith:'<strong>', closeWith:'</strong>' },
{name:'Italic', key:'I', openWith:'<em>', closeWith:'</em>' },
{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:'Picture', key:'P', replaceWith:'<img
src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!(
title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text
to link...' },
{separator:'---------------' },
{name:'Clean', replaceWith:function(h) { return
h.selection.replace(/<(.*?)>/g, "") } },
{name:'Preview', call:'preview', className:'preview' }
]
}
for(var i=0 ;i < l;i++){
n = m[i].name
if( 'comment' == n || 'cmappnd' == n || "w" == n){
m[i].id = n
$(document).ready(function() {
$("#" + n).markItUp(mySettings);
});
}
}
</script>
and save and DONE.
Congratulations you have markit in fossil for ticket and wiki.
Rene
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users