if ($params{content}=~s!(<div class="toggleable(?:-open)?" id="[^"]+">)</div>!$1!g) {
$params{content}=~s/<div class="toggleableend">//g;
- if (! ($params{content}=~s!^<\/body>!$javascript</body>!m)) {
+ if (! ($params{content}=~s!^<body>!<body>$javascript!m)) {
# no </body> tag, probably in preview mode
- $params{content}.=$javascript;
+ $params{content}=$javascript.$params{content};
}
}
return $params{content};
uploads by default. (An anti-DOS measure.)
* toggle: Add support for toggles that are open by default.
* toggle: Fix to work in preview mode.
+ * toggle: Add javascript to top of page, not to end. This avoids flicker
+ since closed toggles will not be displayed as the page is loading.
-- Joey Hess <joeyh@debian.org> Mon, 30 Jun 2008 19:56:28 -0400
+<TMPL_VAR JAVASCRIPT>
<TMPL_IF NAME="PAGE_CONFLICT">
<p>
<b>Your changes conflict with other changes made to the page.</b>
<TMPL_VAR PAGE_PREVIEW>
</div>
</TMPL_IF>
-
-<TMPL_VAR JAVASCRIPT>