User:CoolCornucopia

Hi! Welcome to my homepage where I am happy to share with you small pieces of code to improve the wonderful Mediawiki engine and its plugins...

ods2wiki (also named xls2wiki)
I did a script to convert tables from Microsoft Excel (ods format), OpenOffice or LibreOffice documents to the MediaWiki syntax. I know such scripts are already available here and here but in my case, I have the following requirements from my wiki users:
 * 1st: the conversion must handle vertically, horizontally and both.
 * 2nd: the conversion must like cell colors and sizes because the result is copy/paste in a wiki where tables "look-and-feel" must be homogeneous.
 * 3rd: the conversion must preserve all references, templates and links in cells.
 * 4th: the conversion should be as simple as possible.

Installation and usage

 * STEP 1 : Create your table spreadsheet with Microsoft Excel, LibreOffice or Apache OpenOffice and save it in the OpenDocument format (.ods extension). Do not hesitate to create a "complex" table, to merge rows or columns, to add links, images, templates like Yes ( Yes ) and references (simply add then

Feature description
I have added the "stayed opened" feature to the Mediawiki CategoryTree extension. Now, when "my" users browse the wiki, the sidebar category tree stayed opened and it was the major "complaint" of my wiki users and they are very happy now :)

Installation
On Mediawiki 1.17 and CategoryTree-MW1.17-r85033, Only the file CategoryTree.js has been modified so simply copy/paste the related source code (see the attached source code below). Should work on recent Mediawiki and CategoryTreee releases but a merge is required.

How does it work?

 * A cookie is created when the user expands a node (the cookie name is the category name).
 * This cookie is deleted when the user collapses the node.
 * When the page is loaded, the cookie are read and a jquery call simulates a user click on the related categories.

Tests
Tested: Not tested:
 * Mediawiki 1.17 and CategoryTree-MW1.17-r85033.
 * Category tree in the sidebar.
 * On several Mediawiki instances on the same server.
 * With category names containing spaces and special characters like "&".
 * Latest Chrome, latest Firefox, Internet Explorer 9
 * "in-page" category trees.
 * Old Internet Explorer versions, Internet Explorer 10

Extra technical comments
Cookie expiration:
 * By default in this js source code, cookies are session-based, means they are clean-up when ~the browser is closed. Uncomment and adjust "'expires': XX," if you want your cookie to be more "permanent"...

New feature: "CategoryTree in Sidebar stayed opened"
highlight all areas in grey when the image is loaded so it helps users to know where are the inter-active areas without searching them by using the mouse everywhere on the image (of course, yellow-highlighted areas are still there) because some users prefer searching areas on the image instead of using titles below the image

See discussion thread (show replies) https://www.mediawiki.org/wiki/Extension_talk:ImageMap#Imagemap_Area_highlight_script_11186

Here is the patch that works fine on my MediaWiki 1.17 (jQuery 1.4.2). The issue was linked to jQuery .data calls (see http://api.jquery.com/data/ for more details).