~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/data/System/WysiwygPluginSettings.txt

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
---+ Settings for WysiwygPlugin that are common to most editor integrations
 
2
%STARTINCLUDE%
 
3
The *global* [[%SYSTEMWEB%.PreferenceSettings][preference setting]] =WYSIWYG_EXCLUDE= can be set to make the plugin sensitive to what is in a topic, before allowing it to be edited. You can set it up to veto an edit if the topic contains:
 
4
   * =html= - HTML tags (e.g. =<div>=, not including <br>), or 
 
5
   * =macros= - simple macros (e.g. =%<nop>VAR%=) or 
 
6
   * =calls= - macros with parameters e.g. =%<nop>MACRO{...}%=
 
7
   * =pre= blocks (=&lt;pre&gt;=)
 
8
   * HTML =comments= (=&lt;!--= ... =--&gt;=)
 
9
If the plugin detects an excluded construct in the topic, it will refuse to allow the edit and will redirect to the default editor.
 
10
 
 
11
If you excluded =calls= in =WYSIWYG_EXCLUDE=, you can still define a subset of macros that do *not* block edits. this is done in the *global* [[%SYSTEMWEB%.PreferenceSettings][preference setting]] =WYSIWYG_EDITABLE_CALLS=, which should be a list of macro names separated by vertical bars, with no spaces, e.g: =* Set WYSIWYG_EDITABLE_CALLS = COMMENT|CALENDAR|INCLUDE=
 
12
 
 
13
You should set =WYSIWYG_EXCLUDE= and =WYSIWYG_EDITABLE_CALLS= in %USERSWEB%.SitePreferences, or in %WEBPREFSTOPIC% for each web.
 
14
 
 
15
You can define the global preference =WYSIWYGPLUGIN_STICKYBITS= to stop the
 
16
plugin from ever trying to convert specific HTML tags into
 
17
HTML when certain specific attributes are present on the tag. This is most
 
18
useful when you have styling or alignment information in tags that must be
 
19
preserved.
 
20
 
 
21
This [[%SYSTEMWEB%.PreferenceSettings][preference setting]] is used to tell the translator which attributes, when present
 
22
on a tag, make it "stick" i.e. block conversion. For example, setting it to
 
23
=table=background,lang;tr=valign= will stop the translator from trying to
 
24
handle any =table= tag that has =background= or =lang= attributes, and any
 
25
=tr= tag that has a =valign= attribute.
 
26
 
 
27
You can use perl regular expressions to match tag and attribute names, so =.*=id,on.*= will ensure that any tag with an =on*= event handler is kept as HTML.
 
28
 
 
29
The default setting for this preference is:
 
30
<verbatim>
 
31
    .*=id,lang,title,dir,on.*;
 
32
    A=accesskey,coords,shape,target;
 
33
    BDO=dir;
 
34
    BR=clear;
 
35
    COL=char,charoff,span,valign,width;
 
36
    COLGROUP=align,char,charoff,span,valign,width;
 
37
    DIR=compact;
 
38
    DIV=align;
 
39
    DL=compact;
 
40
    FONT=size,face;
 
41
    H\d=align;
 
42
    HR=align,noshade,size,width;
 
43
    LEGEND=accesskey,align;
 
44
    LI=type,value;
 
45
    OL=compact,start,type;
 
46
    P=align;
 
47
    PARAM=name,type,value,valuetype;
 
48
    PRE=width;
 
49
    Q=cite;
 
50
    TABLE=align,bgcolor,border,cellpadding,cellspacing,frame,rules,summary,width;
 
51
    TBODY=align,char,charoff,valign;
 
52
    TD=abbr,align,axis,bgcolor,char,charoff,colspan,headers,height,nowrap,rowspan,scope,valign,width;
 
53
    TFOOT=align,char,charoff,valign;
 
54
    TH=abbr,align,axis,bgcolor,char,charoff,colspan,height,nowrap,rowspan,scope,valign,width,headers;
 
55
    THEAD=align,char,charoff,valign;
 
56
    TR=bgcolor,char,charoff,valign;
 
57
    UL=compact,type
 
58
</verbatim>
 
59
 
 
60
If you edit using the plain-text editor, you can use the &lt;sticky&gt;..&lt;/sticky&gt; tags to delimit HTML (or TML) that you do *not* want to be WYSIWYG edited.
 
61
 
 
62
%STOPINCLUDE%
 
 
b'\\ No newline at end of file'