Changes To Cookbook
Not logged in

Changes to "Cookbook" between 2011-02-05 22:06:08 and 2011-02-10 12:56:37

12
13
14
15
16
17
18

19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26







+







  <li><a href="#css">Example CSS</a></li>
  <li><a href="#source-hilight">Source highlighting</a></li>
  <li><a href="#win32dev">Fossil Win32 Development Machine setup</a></li>
  <li>[compillingOnWindows| How to compile on windows]</li>
  <li><a href="#wysiwig">Javascript HTML WYSIWYG editor control</a>
    <ul>
      <li><a href="#tinymce">TinyMCE</a></li>
      <ul><li><a href='#js_local'>Locally installed javascript</a></li></ul>
      <li><a href="#markitup">markitup!</a></li>
    </ul>
  </li>
  <li><a href="#ticket-checkin-links">Link tickets to checkins</a></li>
  <li><a href="#th1-usage">Fossil and Th1</a></li>
  <li><a href="#versionCompressed">Versioning compressed files</a></li>
  <li><a href="#ColorPicker">Color selector in check-in properties</a></li>
626
627
628
629
630
631
632

633
634
635
636
637
638
639
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641







+








<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"><h4>TinyMCE</h4></a>
<p>
Source: <a href="http://tinymce.moxiecode.com/"> TinyMCE </a>
</p>
<h5> Example</h5>
<pre class="verbatim">
662
663
664
665
666
667
668




































669
670
671
672
673
674
675
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







       html " <script type='text/javascript'>\n"
       puts "tinyMCE.init({ mode : 'specific_textareas' , editor_selector : 'wikiedit', theme: 'advanced',width : '90%' } );"
       html "</script>\n"
   }
&lt;/th1&gt;
</pre>
and save.


<a name='js_local'><h3>Using local installed javascript libraries</h3></a>
<p>Under firefox with the extension locallink you can install javascript libraries locally.</p>

<p>It seems that it is also possible with IE7 because that allows local access. For chrome there is an extension <a href='https://chrome.google.com/extensions/detail/jllpkdkcdjndhggodimiphkghogcpida'>locallink</a> But I couldn't get it to work.
</p>
<p>The advantage of this is that your repository doesn't contains the javascript library. And for each project you only have to adjust the header</p>
<h5> Example under windows with firefox</h5>
<pre class="verbatim">
    C:
    mkdir js
    download tinymce
    unzip in c:\js
    install <a href='https://addons.mozilla.org/en-US/firefox/addon/locallink'>locallink</a> in firefox
    follow instructions on <a href='https://addons.mozilla.org/en-US/firefox/addon/locallink/'>page</a>
</pre>
start fossil ui
Select admin/headers add after the &lt;/link&gt;
<pre class="verbatim">
 &lt;th1&gt;
  if { &#91; string first $current_page "tktnew tktedit wikiedit wikiappend" ] } {
       html "<script type='text/javascript'\n"
       html "src='file:///c:/js/tinymce/jscripts/tiny_mce/tiny_mce.js'>\n"
       html "</script>\n"
       html " <script type='text/javascript'>\n"
       puts "tinyMCE.init({ mode : 'specific_textareas' , editor_selector : 'wikiedit', theme: 'advanced',width : '90%' } );"
       html "</script>\n"
   }
&lt;/th1&gt;
</pre>
and save.




<a name="markitup"><h3>markitup!</h3></a>
<p>
Source: <a href="http://markitup.jaysalvat.com/home/"> Markitup </a>
</p>
<h5> Example</h5>
<pre class="verbatim">
    mkdir markitup