Changeset 8289
- Timestamp:
- 07/24/10 08:11:38 (22 months ago)
- Location:
- trunk/core
- Files:
-
- 5 edited
-
data/System/CommandAndCGIScripts.txt (modified) (1 diff)
-
data/System/JavascriptFiles.txt (modified) (2 diffs)
-
data/System/VarADDTOZONE.txt (modified) (3 diffs)
-
data/System/VarRENDERZONE.txt (modified) (1 diff)
-
lib/Foswiki.spec (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/data/System/CommandAndCGIScripts.txt
r7932 r8289 255 255 | =attachment= | Attachment to move | =none= | 256 256 | =currentwebonly= | if defined, searches current web only for links to this topic | | 257 | =newattachment= | (Optional) new name for attachment | =none=|257 | =newattachment= | New name for attachment | =attachment=, if given | 258 258 | =newtopic= | new topic name | | 259 259 | =newweb= | new web name | | -
trunk/core/data/System/JavascriptFiles.txt
r7989 r8289 6 6 user experience is significantly improved if it is enabled. 7 7 8 Foswiki Javascript support comprises a number of base Javascript files,8 Foswiki Javascript support includes a number of base Javascript files, 9 9 attached to this topic, that provide support for features in the basic screens, 10 10 and are used by most skins. These files are automatically included as required … … 15 15 user interface components. 16 16 17 *Related Topics:* SkinTemplates, [[Skins]] 17 You can use Javascript in the body of topics, but you are highly recommended 18 to use the [[VarADDTOZONE][%<nop>ADDTOZONE{"body" ...}%]] macro if you do so. 19 Bear in mind that inline Javascript represents a significant security risk to 20 Foswiki sites, and sites vulnerable to hackers should seriously consider 21 installing the =SafeWikiPlugin= to control it. 22 23 *Related Topics:* SkinTemplates, [[Skins]], [[VarADDTOZONE][ADDTOZONE]] 18 24 <!-- 19 25 * Set ALLOWTOPICCHANGE = %USERSWEB%.AdminGroup -
trunk/core/data/System/VarADDTOZONE.txt
r8211 r8289 11 11 </verbatim> 12 12 13 _Zones_ are specific places in the output HTML that are marked in the source templates using the [[VarRENDERZONE][RENDERZONE]] macro. Zones are used to collect various materials together, such as Javascript and CSS, that must be included in the output HTML in a specific order, and in a specific place. By default, skins define two zones, =head= and =body= which are in the HEAD tag and at the end of the BODY tag respectively.13 _Zones_ are specific places in the output HTML that are marked in the source templates using the [[VarRENDERZONE][RENDERZONE]] macro. Zones are used to collect various materials together, such as Javascript and CSS, that must be included in the output HTML in a specific order, and in a specific place. Each =ADDTOZONE= call can be identified by a _unique identifier_, and you can state dependencies on other identifiers. In this way you can constrain the order in which they are expanded in the output. 14 14 15 Each =ADDTOZONE= call can be identified by a _unique identifier_, and you can state dependencies on other identifiers. In this way you can constraint the order in which the text added by each call is expanded in the output. 15 There are always at least two zones, =head= and =body= - see [[#HeadAndBody][below]] for more information on how to use these standard zones. You can create as many additional zones as you like. Interesting use cases in wiki applications: 16 * create a =sidebar= zone to add widgets 17 * create a =toolbar= zone to add buttons icons 16 18 17 19 Parameters: … … 26 28 STOPINCLUDE 27 29 28 Note that using =topic= and =section= is actually a short form of30 Using =topic= and =section= is actually a short form of 29 31 <verbatim class="tml"> 30 32 %ADDTOZONE{ … … 34 36 </verbatim> 35 37 38 #HeadAndBody 39 *How to use the =head= and =body= zones* 40 41 Notionally the =head= and =body= zones correspond to the end of the HTML =<HEAD> tag and the end of the BODY tag respectively. Normally you should add CSS (and other HTML =<HEAD> content, such as =meta=) to the =head= zone, and Javascript to the =body= zone. There is a setting in =configure=, ={OptimizePageLayout}=, that controls what happens next. First, dependencies between the individual =ADDTOZONE= statements are resolved *within each zone*. Then, if ={OptimizePageLayout}= is enabled, the =head= content is added to the =<HEAD>, and the =body= content is added to the BODY. However, if ={OptimizePageLayout}= is _disabled_ (the default), both the =head= and =body= zones will be added to the HTML =<HEAD>. 42 43 For this reason you must be careful to: 44 1 Only add HTML to the body zone _that is also legal in the =<HEAD>_ 45 1 Ensure that no =head= content (and no inline Javascript) depends on =body= content. Any such dependency will be _silently ignored_. 46 1 Make sure that all inline JavaScript code in the topic (if it is allowed) 47 is added to the page using 48 =%<nop>ADDTOZONE{"body"...requires="library-tag"}%= 49 with the appropriate library-tag to guarantee a correct load order. 50 36 51 See also [[VarRENDERZONE][RENDERZONE]] -
trunk/core/data/System/VarRENDERZONE.txt
r8211 r8289 25 25 required in the templates. 26 26 27 Note that you can create as many zones as you like. You are not restricted 28 to just =body= and =head=. Interesting use cases in wiki applications: 29 30 * create a =sidebar= zone to add widgets 31 * create a =toolbar= zone to add buttons icons 32 33 See also [[VarADDTOZONE][ADDTOZONE]] 27 See also [[VarADDTOZONE][ADDTOZONE]] for more information on zones. -
trunk/core/lib/Foswiki.spec
r8198 r8289 565 565 # Used to disallow the use of SCRIPT and LITERAL tags in topics by removing 566 566 # them from the body of topics during rendering. 567 # <font color="red">This setting is now DEPRECATED</font> - use SafeWikiPlugin568 # instead.567 # <font color="red">This setting is fundamentally unsafe and is now 568 # DEPRECATED</font> - use SafeWikiPlugin instead. 569 569 $Foswiki::cfg{AllowInlineScript} = $TRUE; 570 570 … … 1066 1066 #---++ HTML Page Layout 1067 1067 # **BOOLEAN EXPERT** 1068 # Enable heuristics to optimize the HTML layout by placing all JavaScript files 1069 # at the bottom of the page, while leaving all CSS files at the top. Note, that 1070 # you will need to load JavaScript files using <code>%ADDTOZONE{"body" ...}%</code> 1071 # for content that should participate in this optimization step. Similarly, all 1072 # CSS files should be added to the page using <code>%ADDTOZONE{"head" ...}%</code>. 1073 # Note also, that placing JavaScript library files at the bottom of the page, JavaScript 1074 # code within the topic content area might potentially break when it relys on those libraries 1075 # being loaded before. So please make sure all JavaScript code is added to the page 1076 # using <code>%ADDTOZONE{"body"...requires="library-tag"}%</code> with the appropriate library tag 1077 # to guarantee a correct linear order of the files being loaded by the browser. 1068 # If this option is disabled then Foswiki will move all 1069 # <code>%ADDTOZONE{"body"...}%</code> statements to the end of the 1070 # HTML <HEAD> tag (immediately after the content added by 1071 # <code>%ADDTOZONE{"head"...}%</code>). If the option is enabled, then 1072 # <code>%ADDTOZONE{"body"...}%</code> statements are added to the end of 1073 # the <BODY> tag instead. This optimises the performance of browsers. 1074 # <strong>Warning</strong> enabling the optimisation might 1075 # <u>break</u> topics if Javascript code within the topic content has 1076 # a dependency on other code being loaded in the body zone. See 1077 # System.VarADDTOZONE for more information. There may also 1078 # be problems with plugins which post-process body content, such as 1079 # SafeWikiPlugin. 1078 1080 $Foswiki::cfg{OptimizePageLayout} = $FALSE; 1079 1081
Note: See TracChangeset
for help on using the changeset viewer.
