518
519
520
521
522
523
524
|
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<h4>Visual Studio Express 2008+WiX</h4>
<h5>Setup TCL</h5>
<h5>Setup VS2008</h5>
<h5>Getting WiX Windows MSI tool </h5>
<h5>Getting Fossil source code</h5>
<h5>Build the code with Makefile.win32</h5>
<a name="wysiwig"><h2>Javascript HTML WYSIWYG editor control</h2></a>
<h3>Motivation</h3>
* You want to edit the wiki pages with a nice editor component, instead of using plain HTML.
<h3>Problem</h3>
Fossil by itself doesn't support it.
<h3>Solution</h3>
There are pure javascript editor components that can be used for this task.
The source for the editor component is added to the repository. The html header or footer is prepared to include a javascript file and/or a CSS.
<br>
These two tips are from the mailing list:
Rene de Zwart 30. Oct. 2009
<a name="tinymce"></a>
<h4>TinyMCE</h4>
<p>
Source: <a href="http://tinymce.moxiecode.com/"> TinyMCE </a>
</p>
<h5> Example</h5>
<pre class="verbatim">
mkdir tiny
mkdir tiny/javascript
fossil new tinymce.fsl
fossil ui tinymce.fsl {configure the project)
download tinymce
unzip in tiny/javascript
cd tiny
fossil open ../tinymce/fsl
fossil add javascript
fossil commit -m "added timymce to the project"
fossil ui
</pre>
Select admin/headers add after the </link>
<pre class="verbatim">
<script type="text/javascript"
src="/doc/tip/javascript/tinymce/jscripts/tiny_mce/tiny_mce.js">
</script>
</pre>
and save
select admin/footer add above the first line
<pre class="verbatim">
<script type='text/javascript'>
var m = document.getElementsByTagName('textarea')
var l = m.length
var n
for(var i=0 ;i < l;i++){
n = m[i].name
if( 'header' != n && 'footer' != n && 'css' != n){
tinyMCE.init({ mode : 'exact' , elements : n, theme: 'advanced'
,width : '90%' } );
}
}
</script>
</pre>
<a name="markitup"></a>
<h3>markitup!</h3>
<p>
Source: <a href="http://markitup.jaysalvat.com/home/"> Markitup </a>
</p>
<h5> Example</h5>
<pre class="verbatim">
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
</pre>
select admin/headers add after the </link> put
<pre class="verbatim">
<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>
</pre>
and save
select admin/footer add above the first line
<pre class="verbatim">
<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>
</pre>
|