Apple Computer Hardware manual Adding JavaScript and XSL Files

Page 25

Adding JavaScript and XSL Files

The wiki server supports the use of custom JavaScript and Extensible Stylesheet Language (XSL) files. JavaScript and XSL change the content you’re displaying, whereas CSS controls the presentation of content. For example, you use could use JavaScript or XSL to add a “digg it” link to your blog entries, which would then tie the blog entries to digg.com.

Carefully choose whether you want to use JavaScript, XSL, or both.

JavaScript has these advantages:

ÂÂ Unlike custom XSL files, JavaScript files continue to work after doing a software update. The wiki server includes XSL files, which can be changed during a software update. If these files change, then an error occurs because the file versions of included files no longer match the file versions of custom XSL files.

ÂÂ JavaScript can allow you more control over a document than XSL if you have access to information on the server that isn’t provided in the XSL context.

XSL has this advantage:

ÂÂ XSL transformations are performed on the wiki server, so the user’s browser isn’t required to support and run it.

To add JavaScript files or XSL files to a theme:

1Put JavaScript (.js) files or XSL (.xsl) files in this folder:

/Library/Application Support/Apple/WikiServer/Themes/theme_name/ Replace theme_name with the name of the theme.

/Library/Application Support/Apple/WikiServer/Themes/

theme_name/

JavaScript files

XSL files

Chapter 1    Customizing How the Wiki Looks

25

Image 25
Contents Mac OS X Server 019-1252/2008-04-24 Contents Managing Wiki Content Preface Getting Additional InformationPreface About This Guide Theme File Structure Overview This chapter describes how to customize a wiki’s appearanceCustomizing How the Wiki Looks Variant Theme File Structure Overview File or Folder Name Purpose Wireframe Theme File Structure OverviewBorders, and positioning for comment entry Creating a Theme Terminal, enter the following commandsWebsite Editing CSS FilesAbout Property List Editor Editing Property List FilesAbout Property List Keys and Values About Property List FilesAbout Strings About DictionariesHere is the sidebars array in a plain text editor About ErrorsHere is an example of an array with a single string Here is an example of an array with multiple stringsKey Default Value Possible Values Changing General Theme SettingsDescription Understanding the Types of Sidebars Creating SidebarsShared Keys All sidebars require the following keysEach dictionary entry has the following keys Static Unique KeysKey Example Value Possible Values Optional or Required Search Unique Keys Calendar Unique Keys Tag Unique Keys Overview of the Example SidebarsRecent Activity Unique Keys Sidebar Name DescriptionTerminal, enter the following command Using the Example SidebarsTo comment out specific sidebars To this To add JavaScript files or XSL files to a theme Adding JavaScript and XSL FilesPut JavaScript .js files or XSL .xsl files in this folder Here are some published JavaScript guides About JavaScriptTopic JavaScript Example About XSLViewing Dynamic XML Create a plain text file with the following contentTo view context $ sudo serveradmin stop teams sudo serveradmin start teams Attributes Creating a Custom Whitelist Allowing Specific URL Protocols About the Custom Whitelist’s StructureAllowing Specific CSS Styles To allow specific Html tags and attributes Allowing Specific Html Tags and AttributesTag Attributes Protocols Allowed in the Built-in Whitelist About the Built-in WhitelistBuilt-in whitelist allows these protocols ProtocolHtml Tags and Attributes Allowed in the Built-in Whitelist CSS Styles Allowed in the Built-in WhitelistBuilt-in whitelist allows these CSS styles Built-in whitelist allows these Html tags and attributesNode Pre Cite Span Strong Tbody Tfoot Colspan, rowspan Thead Backing Up the Wiki Server Migrating Wiki Content From Other WebsitesManaging Wiki Content Wiki File Structure Overview File or Folder Name Purpose Manually Editing Raw ContentTo regenerate the index after editing raw wiki content Viewing a Wiki’s Administration SettingsFor more information about AtomPub, see Key Example Value Description Metadata.plist file includes the following keysTo manually edit wiki administration settings Pageuid Viewing a Page’s MetainformationManaging Attachments