Jump to content

User:Rockerbaby/wikEd Local Install

From Wikipedia, the free encyclopedia

Installing wikEd on a wiki that does not connect to the internet

[edit]

Note: This is a Working version of this FAQ. Please, if you make any changes, notify me by message on the discussion page. That way I can keep any changes/suggestions synchronized with the version on my computer. I will remove this notice when the document is final. Thank you.

[This is in lieu of protection, since I cannot protect pages here.]

Sidenote: I use the term Admin/Administrator throughout this document. In a MediaWiki sense, this refers to the superuser created at the install of MediaWiki, or to any user with "Sysop" privileges. I'm a Windows sysadmin, so I'm used to that term. Sorry.

Any suggestions, modifications, would be appreciated. However, if you edit this page, please notify me, as I keep a copy of this documentation on my local computer and I would like to keep it up to date.

Quick Summary of Instructions

[edit]
  • Copy the code to your wiki
  • Get and upload the button images
  • Create the image customization code
  • Protect all code pages against changes by non-admin users
  • Install the code or give install instructions for your users
  • Create help [if you desire] and protect help pages if needed

Requirements

[edit]
  • Firefox (tested on v2.0.0.3 under Windows XP), see wikEd system_requirements. wikEd does currently not work for MS Internet Explorer.
  • Make sure your memory_limit in php.ini is set to at least 32 MB:
    memory_limit = 32M
    otherwise the installation of the script may fail with the default of 16, and produce the following error message when you click Save Page to install the code:
    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 279876 bytes) in /server-path-to-your-wiki/includes/Parser.php on line 496
    If you don't have physical access to your server, you may need to contact the system administrator of the machine to change that setting.
  • User JavaScript must be enabled in LocalSettings.php for this to work at all:
    $wgAllowUserJs = true;
    If you don't have physical access to your server, you may need to contact the system administrator of the machine to change that setting.
  • I tested this on a machine running MediaWiki 1.9.3 on Windows XP (my development/staging machine). Once I get my Linux machine running, I will update any server side steps that may need to be different.

Step by step instructions

[edit]
  • Determine if you want all users to automatically use wikEd, or if you want them to install it themselves. If you are installing on a corporate wiki, where your users are familiar with word processing programs like Microsoft Word, you may wish to make wikEd the default editing page.
  • Log into your wiki as a user with full rights (sysop/administrator/bureaucrat) [1]
  • Create a page to store the script: http://yourdomain/path-to-your-wiki/index.php?title=wikEd.js?action=edit
  • Copy the entire wikEd program code page to the page you just created.
    • If you get the Fatal Error message described above, check your php.ini settings or ask your system administrator to check them for you.
  • Protect the program code page from editing (edit:sysop, move:sysop) and enter a reason if your policy requires it.
  • Copy the images from the WikiMedia Commons to a folder on your desktop. You can get them from here: [1]
  • You can store the images either on a server accessible by your users (preferable) or manually upload them to your wiki (much work):
    • Either: upload them to the server and save the following lines in a file called Temp_ImagePaths.js:
      var wikEdUseLocalImages = true;
      var wikEdImagePathLocal = 'http://PATH-TO-YOUR-IMAGES/';
    • Or: use Special:Upload to upload the more than 100 images manually to your wiki.
      • As you upload the images, make note of what the web-accessible path to the image is. You will need the paths for the next step. It should look like PATH-TO-YOUR-WIKI/images/x/yy/WikEd_ImageName.png. You can get this path from the address bar after clicking the uploaded image.
      • Copy the code from User:HeathersAngel/wikEd_Local_Install/ImagePathTemplate into a blank text editor window (Notepad, Kate, insert-your-favorite-editor-here) and save it as Temp_ImagePaths.js.
      • Change each image path in that file to the ones you noted earlier.

Create the installation block, for users or for the whole system

[edit]
  • Create a project page on your wiki (You can put it wherever you want it, but I put it in project space.)
  • On that page, place whatever documentation you wish to provide
  • Create a subpage of that page called Installation
  • Insert the following exactly as is onto this new page:
<pre><nowiki>
// initialize image addresses


// install [http://en.wikipedia.org/wiki/User:Cacycle/wikEd] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://YOUR-DOMAIN.WHATEVER/PATH-TO-YOUR-WIKI/index.php?title=User:SCRIPTUSERNAME/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
</nowiki></pre>
    • DO NOT SAVE THE PAGE YET.
  • Change YOUR-DOMAIN.WHATEVER to your domain name
  • Change PATH-TO-YOUR-WIKI to the web-accessible path to your wiki (often simply 'w')
  • Change SCRIPTUSERNAME to the page name you used to put the source code into above
  • Paste the contents of the Temp_ImagePaths.js file you created earlier under "initialize changed images". This MUST appear BEFORE the actual install code.

To install wikEd as the default editor

[edit]
  • Go to MediaWiki:Common.js on your wiki, logged in as an administrator.
  • Paste the installation code you created earlier - including the corrected image paths - to this page.

To allow users to install wikEd on an individual basis

[edit]

Simply direct them to the project page with installation instructions.

Notes

[edit]
  1. ^ I have changed the default MediaWiki security settings on my wikis, renaming "Sysop" to "Administrator" and removing the bureaucrat group, as my users are familiar with Windows-style permissions and may not necessarily be familiar with Wikipedia or related projects.
[edit]