[dokuwiki] CSS caching and multible templates
- From: Michael Klier <chi@xxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Wed, 28 Jun 2006 11:46:21 +0200
Hi everybody,
I just came across this [1] post in the dokuwiki forum where someone
tries to run two wikis with a shared data directory and different
templates. However, thus the CSS gets cached sometimes you get the wrong
CSS for the template you`re viewing the pages with. I suggest this could
be avoided by using the template name withing the name for the cache
file so in /lib/exe/css.php
35 // The generated script depends on some dynamic options
36 $cache = getCacheName('styles'.$print,'.css');
would become
35 // The generated script depends on some dynamic options
36 $cache = getCacheName('styles'.$conf['template'].$print,'.css');
or something like that.
What do you think?
I attached a patch with the above solution.
Kind Regards
Michael
[1] http://forum.dokuwiki.org/post/226
--
Michael Klier
mail: chi@xxxxxxxxxxx
www: http://www.chimeric.de
icq: 206179334
jabber: chi@xxxxxxxxxxxxx
key: http://downloads.chimeric.de/chi.asc
key-id: 0x8308F551
New patches:
[use template name along with CSS cache file name
'Michael Klier <chi@xxxxxxxxxxx>'**20060628094419] {
hunk ./lib/exe/css.php 36
- $cache = getCacheName('styles'.$print,'.css');
+ $cache = getCacheName('styles'.$conf['template'].$print,'.css');
}
Context:
[fix for FS#810
Anika Henke <a.c.henke@xxxxxxxx>**20060624202448]
[GeSHi update to 1.0.7.11
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060621181256]
[removed deprecated admin_acl.php file
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060621174752]
[timeout for spell checker
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060620205616
This adds a timeout of 13 seconds to the spell checker. This doesn't
fix anything but ensures editing can be continued on a backend problem.
]
[fixed css of secedit button
Anika Henke <a.c.henke@xxxxxxxx>**20060619173846]
[back button tear down walls
matthiasgrimm@xxxxxxxxxxxxxxxxxxxxx**20060619171023
The 'back' currently works only inside a namespace and hide the
button, if the namespace startpage has been reached.
This patch tear down the namespace wall. Now the 'back' button
of the namespace startpage addresses the start page of the
parent namespace instead of being hidden.
With this patch the 'back' button works as before the 'startpage'
patch series.
]
[js.php fix
chris@xxxxxxxxxxxxx**20060619104613
- correct begin/end comment, plugin filename wasn't being used
- add file exists check, to avoid bloating js with comments for non-existent
plugin js.
Many (most?) plugins don't have javascript.
]
[pluginmgr independent from tpl style.ini
Anika Henke <a.c.henke@xxxxxxxx>**20060618173540]
[css cleanup and fixes
Anika Henke <a.c.henke@xxxxxxxx>**20060618144346]
[fixed stupid bug in search query parser
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060618134515]
[simplified tpl_getparent
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060618121521
4th part of the global start series
]
[updated hierarchical breadcrumbs
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060618113532
Third part of the global start series
]
[2006-06-12-plugins-zh-tw.patch
chinsan.tw@xxxxxxxxx**20060612032435]
[zh-tw-20060612.patch
chinsan.tw@xxxxxxxxx**20060612025041]
[fixing edit section bugs
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060617223723
- Final edit section now ignored when there is only one header.
- The configuration property 'maxseclevel' is now honored again.
- Instructions are not created by the handler for edit sections
that have a level higher than 'maxseclevel'. These ignored
edit sections are merged into the previous edit section.
]
[testcase for utf8_substr
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060617125202]
[create correct titles for namespace links
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060617111153
Second part of the global start patch series :-)
]
[aspell fix #836
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060616154906]
[greek language updates
Thanos Massias <tm@xxxxxxxxxxx>**20060616125101]
[added missing settings to config plugin
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060616124539]
[fixed transparency for IE in filetype icons
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060616120348]
[JavaScript fixes for media manger on IE
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060616113600
Fixes the display of the checkbox options
]
[better onload handling
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060616104539
This patch improves the way the window.oninit JavaScript function is
called. This function is used to initialiaze all JavaScript funcions
attached to the DOM so it needs to be executed **after** the full DOM
was parsed by the browser. Unfortunately currently only Mozilla supports
a DOMContentLoaded event. In all other browsers we had to wait for
the window.onload event which will only be called after **all** content
(including images) was loaded - this caused a visible delay on all
JavaScript generated content (like the toolbar) in non-Mozilla browsers.
Dean Edwards now presented a solution [1] which will work for all the bigger
Browsers and is used in this patch.
The following browsers now should fire the init event right after parsing
the DOM:
All Mozilla based browsers
Internet Explorer
Safari
Opera >= 9.0b2
All other browsers will continue to use the window.onload event.
[1] http://dean.edwards.name/weblog/2006/06/again/
]
[dummy file for meta dir
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060615202122
makes sure this directory is unpacked from the install tarball
by dumb windows clients
]
[register notify #826
Sebastian Harl <sh@xxxxxxxxxx>**20060615194419
A small patch for dokuwiki which enables dokuwiki to notify the
administrator about new user registrations
]
[greek language update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060615191700]
[$conf['fetchsize'] added
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060615184847
This patch adds an option to configure the maximum size for files the fetch.php
will ever download. Setting this to 0 completely turns of the caching of
external
media files.
Disadvantages of setting a low or zero fetchsize:
* fetch.php needs to download images to be able to resize them. When the used
fetchsize prevents the downloading the images can only be resized by the
browser which means the browser will need to download the fullsized image
first.
* If the linked external media files vanishes it will no longer display in
the
wiki because it is not cached.
Advantages of setting a low or zero fetchsize:
* fetch.php may be used for a possible denial of service attack by requesting
many big external files.
* The created cache files may take a lot of space on the server
I recommend to leave the setting at 2MB for internal and private wikis and
lower
the setting to about 200 to 500 Kb for bigger public Wikis.
Note: the caching of files uploaded through the media manager is not affected
by
this setting.
]
[namespace linking first part
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060611184453
This patch adds namespace linking - formerly known as globalstart patch.
It differs somewhat from the original patch. It is not implemented in getID()
but in resolve_pageid().
It is now possible to link to a "default" file of a namespace ending the linkid
with a colon: [[foo:bar:]]
To which page the link links is dependent on the xistance of certain named
files. For the above mentioned link [[foo:bar:]] the following pages are
checked:
foo:bar:start
foo:bar:bar
foo:bar
The pages are checked in the order above whatever page is found first will be
linked to. If no page is found foo:bar:start will be chosen. BTW: 'start' is
the value configured in $conf['start']
Note: autoplural linking is not done for those links
This is just the first patch. Several other locations of the code need to be
adjusted to reflect this change and some testing needs to be done (first test
cases are supplied within the patch bundle)
Things that maybe need adjustment:
- tpl_youarehere (hierarchical breadcrumbs)
- tpl_button back
- maybe others (search?)
Patches would be welcome. The best aproach to fix things that don't work is
probably making calls to resolve_pageid() instead of simple cleanID() calls.
]
[make sure UTF8 lookup tables are always global
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060611173240]
[changed inheritance for pgsql auth backend
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060611170748
Because of incompatible SQL syntax the postgres backend can no longer
inherit the retrieveUsers method from the MySQL backend
]
[MySQL 3.23 compatibility issue
matthiasgrimm@xxxxxxxxxxxxxxxxxxxxx**20060611164347
MySQL 3.23 doesn't support the keyword OFFSET in the LIMIT statement.
This patch changes the code to the second alternative syntax.
]
[update-zh-tw
chinsan.tw@xxxxxxxxx**20060610073758]
[fix media file permissions
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060609072434
Always chmod media because they may be saved with
different permissions than expected from the php umask.
]
[fix for utf8_strpos #827
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060608200438]
[Czech lang update, added czech to config
Bohumir Zamecnik <bohumir@xxxxxxxxxxxx>**20060608085236]
[mediamanager style fixes for IE
Anika Henke <a.c.henke@xxxxxxxx>**20060607211456]
[Updated SimplePie to beta2
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060607203012]
[more semantic alt values in media tree
Anika Henke <a.c.henke@xxxxxxxx>**20060607193424]
[reset title in metadata renderer
Andreas Gohr <gohr@xxxxxxxxxxxx>**20060607073358]
[user the MAILHEADER_EOL in quoted printable encoding
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060606191953]
[Fix for privilege escalation bug #825
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060606182742
This rechecks all ACLs a second time before the template is called,
avoiding similar problems in the future.
]
[bug#701 - partial fix
chris@xxxxxxxxxxxxx**20060606131200
This patch resolves issues with how call writers merge their instructions into
the main handler instruction list.
- writeCalls will now only merge instructions into the list of the next higher
call writer
- all call writers have been given a finalise() method to use when the call
writer needs to be terminated gracefully at the end of parsing when the wiki
markup didn't provide its expected exit syntax.
I have only tested finalise with lists. It still requires testing with wiki
markup
which results in improperly closed tables, quotes and preformatted text (it may
not be possible to improperly terminate some of these syntax modes).
]
[msg styles, minor update
chris@xxxxxxxxxxxxx**20060606083232
add overflow:hidden to the three msg styles. This will allow them
to display neatly adjacent to floated content. At present the background
colour will continue under the float (e.g. TOC).
]
[bug#775, fix access control of resend password page
chris@xxxxxxxxxxxxx**20060606083212]
[fixed newlines in english texts
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060605200414]
[fix for serious security bug #823
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060604175833]
[fix php warning in common.php during getRevisions
chris@xxxxxxxxxxxxx**20060601212928
A php warning can occur when the page name used in a revision check clashes
with
a namespace (sub-directory) in the same directory. The strpos() call generates
the warning as the offset used is longer than the directory name.
]
[tidy format patterns
chris@xxxxxxxxxxxxx**20060601101231
The bug preventing use of '<' & '>' in look ahead patterns was fixed
some time ago. This patch replaces the '\x3C' & '\x3E' in those syntax
pattern where they were still in use.
]
[XSS bugfix #820
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060531191114]
[fixed parse-error in feed.php
'Michael Klier <chi@xxxxxxxxxxx>'**20060530063009]
[bug#811
chris@xxxxxxxxxxxxx**20060530113123]
[bug#808, add RewriteBase to .htaccess.dist
chris@xxxxxxxxxxxxx**20060530114718]
[enhanced getBaseURL()
'Michael Klier <chi@xxxxxxxxxxx>'**20060529154201]
[fixed google sitemap pinging #815
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060529183003]
[Use meta data in RSS feed
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060528133552]
[usability enhancements for the loginform #803
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060527185238]
[fixed short open tag problem
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060527150702]
[small improvements on JS compressor (maybe fixes #807)
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060527140157]
[be clever about extensions on upload
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060527100310
This patch makes it possible to enter filenames without an
extension in the upload as field when the uploaded file it
self has a known extension.
It also prints a warning when an extension was changed by
the user.
]
[made text in mediamanger more clear
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060526233349]
[mediamanager focus fix
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060526232000]
[fix for sitemap creation #813
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060526223358]
[update header test cases 20060526
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060526170229
Also resolves a small p_close anomaly introduced when section edits were
given their own instruction.
]
[resolve darcs conflict 20060526
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060526144958]
[decouple section edit from header in renderer
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060522060004
This patch achieves a partial decoupling of the section edit buttons
from the header syntax. A new 'section_edit' instruction is added to the
instruction list. The default set of these instructions is generated from
the header handler and the _finalize function. A generic 'section_edit'
renderer is now part of the renderer.
To rewrite the section semantics, add, or remove section edit buttons the
header handler and renderer no longer need to be modified. Changes can be
dynamically made to the section edit buttons through the 'PARSER_HANDLER_DONE'
action event. An action plugin that registers this event can then modify
the calls list of the handler object before it is rendered.
In short, this patch makes it possible to change the behavior of the section
edit buttons without having to change unrelated code. This patch should be
entirely transparent to DokuWiki users and cleanly written plugins.
]
[added id to namespace headline
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060526144011
This makes the currently in the medaia manager selected namespace available
to any JavaScript files
]
[fixed an AJAX problem for the media manager
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525175501]
[validity fix in image meta edit form
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525173150]
[media manager validity fixes
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525172718]
[label for root of medianamespaces
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525160758]
[javascript to toggle editor wrapping
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525152357
This patch adds a way to sisable and enable the automating wrapping in the
editor textarea. Disabling the wrapping is especially useful when editing
large tables.
]
[more mediamanager fixes
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525144000
This fixes some styling issues, the cookie handling and a bug in the
JavaScript caching mechanism.
]
[media manager fixes
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060521213334]
[minor media manager tweaks
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060520172118]
[hide media details
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060520124854
This adds an option to hide the details (thumbnail, metadata) in the media
manager. The selected choice is remembered in a cookie.
]
[media manager enhancements
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060519202900
Separate scrolling for right and left side of the manager (like frames)
Show syntax example for simple copy'n'paste if no JavaScript available.
]
[link to media manager
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060519175959
This patch add a link to the media manager when no JavaScript is available.
Users can upload and browse for pictures now without the need for JavaScript
only inserting has to be done manually then.
]
[new mediamanager
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060519165023
This patch adds a completely rewritten media popup. The following noteworthy
changes were made:
- media manager uses a collapsible namespace tree
- media manager uses AJAX if available
- media manager popup can be kept open when selecting a media file
- only one template is used for the media manager :!: Template
- Editable image metadata is configured in conf/mediameta.php now
- The JS cookie mechanism was enhanced to store key/value pairs
- Language strings can be exported to JS in js.php
]
[getRevisionInfo much faster (cached)
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060525083202
Makes getRevisionInfo much faster when loading all the revisions of a page.
This is done by efficiently parsing the 'changes.log' data and caching the
results (in memory) so that future calls to getRevisionInfo return
immediately without reloading the 'changes.log' file.
(Note: the changelog system in DokuWiki should still be rewritten so
that changes are not logged into one huge file!)
]
[makes getRevisions faster
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060525030452
Makes inc/common.php#getRevisions a little faster.
Takes about half as much time as the preg_match.
]
[updated_localisation_sk_SK
ovegh@xxxxxxxxx**20060418090713]
[gzip_output defaults to 0 now
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060525113648]
[fixed rfc interwiki link
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060523191005]
[fix: wrong secedit when page changes
Denis Simakov <akinoame1@xxxxxxxxx>**20060522182043
Binds secedit buttons to file modification stamp ('lastmod'), so that if the
page changes in between, editing of the old revision starts.
]
[Lithuanian update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060522181314]
[GeShi update to 1.0.7.10
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060522175437]
[russian translation update
Denis Simakov <akinoame1@xxxxxxxxx>**20060522115828]
[MySQL Bug - PHP warning if query result is empty
matthiasgrimm@xxxxxxxxxxxxxxxxxxxxx**20060522162327
If a database query has no result, the returned array is not
valid. This caused a PHP warning in the user manager if the
filter is set in a way that the result list is empty.
]
[config plugin ui update 20060520
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060520103718
This patch hides settings that are missing config metadata and optionally
provides a list of warnings about settings that are not properly configured.
- Warnings about settings are listed if $conf['allowdebug'] is true.
- Warnings are listed by the $conf string as it appears in local.php.
- Warnings show the $meta string as it would appear in the correct
settings metadata file.
- There are 3 kinds of warnings.
- undefined
There is no $meta information defined for this setting.
- no class
The setting class specified in $meta can not be found.
This setting does have a $meta entry.
- no default
The setting is missing a default value.
The setting does have a $meta entry with a valid setting class.
- Note: Settings with metadata but other warnings are allowed to appear
in the normal config settings list.
Also...
- Templates can now define their own settings classes.
- Removed an XHTML validation error from the first patch.
- More language strings to go with the new warnings.
The warnings under the 'Undefined Settings' heading are intended to
provide developers with a list of any settings that they have forgotten to
finish preparing for the config plugin. This list should be blank for stable
releases.
]
[moved gzip compression to init.php
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060519212751]
[namespace-restricted fulltext-search part2
'Michael Klier <chi@xxxxxxxxxxx>'**20060518204647
- now its possible to restrict the fulltext-search to
multible namespaces
Examples:
searchword @ns1 @ns2 @ns3
"exact phrase" @ns1 @ns2 @ns3
]
[namespace restricted fulltext-search
'Michael Klier <chi@xxxxxxxxxxx>'**20060518161855
- The fulltext-search can now be restricted to a given
namespace seperated by an "@"
]
[avoid trolling in io_lock()
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060517165023]
[lt lang update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060517105635]
[gzip content-encoding option
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060516084132
- Enables gzip compression of output xhtml for browsers that support it.
For example the wiki:syntax page takes up 46.80KB raw, but only 9.88KB
gzip encoded.
- Setting is configurable through the config plugin.
]
[jpg quality option
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060516062321
- Adds a jpg quality setting for scaled images
(Some images were getting too many jpg artifacts
at the hard-coded compression setting.)
- Creates a group for the media settings in the
config plugin.
]
[fr update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060515190136]
[nl update
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060515185820]
[javascript fix to mak sumarry checking use addEvent
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060512073949]
[add config plugin support for plugin defined setting classes
chris@xxxxxxxxxxxxx**20060511083209]
[more info is gathered on metaupdate in background indexer
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060511191450
The background indexer now gathers info on contributors and modification
dates from the changelog when adding the missing meta info.
A new io_grep function was added which might be useful for other parts in
the Wiki as well.
]
[config plugin ui organization
Ben Coburn <btcoburn@xxxxxxxxxxxxx>**20060510065732
- organizes the configuration settings list into chunks
- provides a table of contents for the configuration chunks
- provides one chunk for each plugin with configurable settings
- provides one chunk for the active template (if it has settings)
- provides the config file setting as a tool-tip on the setting label
ex. $conf['start']
- provides for localization of useful strings
- generates a "smart" fallback name for plugins and templates
- plugin and template sections are only shown if they have settings
- current configuration list is organized into chunks
Note: There are NEW strings to translate into the non-english language files.
]
[TAG develsnap 2006-05-07
Andreas Gohr <andi@xxxxxxxxxxxxxx>**20060507173508]
Patch bundle hash:
19bc3839b1f73edcf0eb8dc074594617e0bf4d05
- Follow-Ups:
- [dokuwiki] Re: CSS caching and multible templates
- From: Andreas Gohr
Other related posts:
- » [dokuwiki] CSS caching and multible templates
- » [dokuwiki] Re: CSS caching and multible templates
- [dokuwiki] Re: CSS caching and multible templates
- From: Andreas Gohr