JavaScriptHelpers

Summary: Collection of simple JavaScript tools for wikis
Version:
Prerequisites:
Status: Planning
Maintainer: Petko
Users: (view? / edit)

Questions answered by this recipe

All sections are optional, you can remove those that do not apply to your recipe, and add new ones.

Description

Collection of simple JavaScript tools for wikis.

This page, and the Talk page? are here to coordinate the selection of a number of small JavaScript-based recipes for inclusion in the PmWiki core. At any rate, the first few releases will be as a cookbook recipe.

The idea is to have a single, compact JavaScript file (+ a CSS file) that is sent to the browser, and enhances the editing and reading experiences. Every function should be easy to enable and disable. A single file will load faster than the browser making many requests, and will be cached.

A single PHP file will include all server-side processing and configuration: it is also faster for the server to load a single PHP file than 5 or 10.

All JavaScript functions must be simple (no external dependencies) and short, non-essential, and unobtrusive (progressive enhancement): the wiki should be readable and editable with JavaScript disabled, without major inconveniences or layout problems, and should work fine with the functions disabled at some point.

Currently the PmWiki core uses JavaScript in the edit toolbar ($EnableGUIButtons), in the login form to focus the password field, and in other forms to focus a form field. These existing functions could be combined into the same JavaScript file (or not).

The following recipes are considered for inclusion:

  • AutoTOC   Unobtrusive Automatic Table of Contents links
  • DeObMail   Unobtrusive e-mail link (de)obfuscator
  • DragDropMultiUpload   Allow authors to upload files by simply dropping them into the wiki page
  • EditHelp   Easier editing with automatic detection and insertion of some wiki markups
  • FixURL   Encode special characters in link addresses
  • LocalTimes   Display RecentChanges and History timestamps in the local timezone of each visitor.
  • NotSavedWarning   Warn authors when they move away from a page without saving it; optionally request an edit summary or an author name
  • SortableTables   Create tables which can be sorted instantly by javascript

Please suggest and argument other recipes to the talk page.

The recipes DragDropMultiUpload, AutoTOC, SortableTables will have to be rewritten from scratch and simplified to their most essential function, removing external dependencies and files. For example, DragDropMultiUpload will not display a login form if the editor has no "upload" permissions, but a simple message box; AutoTOC will only have one way to set the anchors for the sections (no international folding).

Installation

Configuration

Usage

Notes

Change log / Release notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See also

Contributors

  • Recipe written and maintained by Petko.

Comments

See discussion at JavaScriptHelpers-Talk?