OddMuse¶
Notes and bookmarks.
CSS/HTML¶
Page structure and CSS classes:
- div.header
- span.gotobar.bar (a.local)
- h1
- p.subtitle
- img.logo
- div.wrapper
- the contents (and div.page, div.journal etc.)
- div.sidebar
- div.content.browse
- div.wrapper.close (no contents)
- div.footer
- hr
- span.gotobar.bar (a.local)
- span.edit.bar (<br/> + a.edit, a.history, …)
- span.time (<br/> + a.author)
- form.search (<p> <input…> … </p>)
- $FooterNote
Links¶
- http://www.emacswiki.org/scripts/
- Oddmuse:Writing_Extensions
- Oddmuse:New_Text_Formatting_Rules
- Oddmuse:Header_Markup_Extension
- Oddmuse:Text_Formatting_Rules
- Oddmuse:Login_Module
- Oddmuse:Passwords_Extension
- Oddmuse:Admin_Power_Extension
- Oddmuse:Hidden_Pages_Extension
- Oddmuse:Headlines_Extension
- Oddmuse:div_nav
- Oddmuse:Front_Page_Extension
- Oddmuse:Gotobar_Extension
- Oddmuse:Sidebar_Extension
- Oddmuse:Table_of_Contents_Extension
- Oddmuse:FAQ_Extension
- Oddmuse:Smarttitles_Extension
- Oddmuse:Markup_Extension
- Oddmuse:Usemod_Markup_Extension
- Oddmuse:Image_Extension
- Oddmuse:div_foo
- Oddmuse:Long_Table_Markup_Extension
- Oddmuse:Link_Pattern
- Oddmuse:URL_Abbreviations
- Oddmuse:Counter_Extension
- Oddmuse:Indexed_Search (tags und so)
- Oddmuse:Transclusion
- Perl Regular Expressions
Open links in new window¶
This adds a new rule which will produce links with the evil target="_new"
attribute. It understands
[new:URL]
and
[new:URL text]
The links will have the class newwindow (like outside for normal off-site links).
push(@MyRules, &newWindowLink); sub newWindowLink { # compare sub LinkRules in oddmuse.pl if ($BracketText && m/G([new:$FullUrlPatterns+([^]]+?)])/cog or m/G([new:$FullUrlPattern])/cog) { my ($url, $text) = ($2, $3); $url =~ /^($UrlProtocols)/; my $class = "url $1"; # get protocol (http, ftp, ...) $text = $url unless $text; # use url as link text if text empty $url = UnquoteHtml($url); # quote special chars $class .= ' newwindow'; # add newwindow to class # output link my $link = $q->a({-href=>$url, -class=>$class, -target=>"_new"}, $text); #Clean($link); # ?! #return ''; return $link; } return undef; }
Div rule¶
Á la http://www.oddmuse.org/cgi-bin/wiki/div_foo. Allows div and span tags with class and style attributes.
push(@MyRules, &divRule); sub divRule { if (m/G<((?:div|span)(?:s+(?:class|style)="[^"]+")+)>/cgi or m!G<(/(?:div|span))>!cgi) { return CloseHtmlEnvironments() . '<' . UrlDecode($1) . '>'; } return undef; }
Note: This might produce invalid HTML for span tags. Alex (the Oddmuse wizard) suggests a different treatment for span tags here.
Comments in page source code¶
push(@MyRules, &commentRule); $RuleOrder{&commentRule} = -100; sub commentRule { if (m/G^(%.*)$/cmog) { #return '<!-- ' . UnquoteHtml($1) . ' -->'; return ''; } return undef; }
Don't show username / IP addresses to anonymous¶
*OldGetAuthorLink = *GetAuthorLink; *GetAuthorLink = *NewGetAuthorLink; sub NewGetAuthorLink { if (UserIsAdmin()) { return OldGetAuthorLink(@_); } else { return "<em>Chiefrocker</em>"; } }
Allow Edit to Anonymous for Certain Pages¶
*OldUserIsEditor = *UserIsEditor; *UserIsEditor = *NewUserIsEditor; sub NewUserIsEditor { return 1 if $OpenPageName =~ m/^(test|meier|gugus)$/; OldUserIsEditor(); }
TODO¶
(merge with links above.. some day..)
- Wiki Configuration & Info
- http://www.oddmuse.org/cgi-bin/oddmuse/SiteMap?interface=en
- http://www.oddmuse.org/cgi-bin/oddmuse/What_Is_Oddmuse
- http://www.oddmuse.org/cgi-bin/oddmuse/The_First_Config_File
- http://www.oddmuse.org/cgi-bin/oddmuse/Site_Setup
- http://www.oddmuse.org/cgi-bin/wiki/Surge_Protection
- http://www.oddmuse.org/cgi-bin/wiki/Page_Locking
- Wiki Administration
- Links
- Markup
- Images
- CSS/HTML
- Apache
- TODO
created: 2008-03-08, updated: 2015-10-10