1 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 * Various helper scripts, using mootools.
9 var hash_init_done = 0;
12 * Sets hash part in URL, either calls itself in parent frame or does the
13 * work itself. The hash is not set directly if we did not yet process old
16 function setURLHash(hash) {
17 if (Browser.Engine.webkit) {
19 * Setting hash leads to reload in webkit:
20 * http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anomaly_with_windowlocationhref.html
24 if (window.parent != window && window.parent.setURLHash) {
25 window.parent.setURLHash(hash);
27 /* Do not set if we're not updating frameset */
28 if (window.location.pathname.substring(-9, 9) != "index.php") {
32 window.location.hash = "PMAURL:" + hash;
34 hash_to_set = "PMAURL:" + hash;
40 * Handler for changing url according to the hash part, which is updated
41 * on each page to allow bookmarks.
43 window.addEvent('load', function() {
44 /* Don't do anything if we're not root Window */
45 if (window.parent != window && window.parent.setURLHash) {
48 /* Check if hash contains parameters */
49 if (window.location.hash.substring(0, 8) == '#PMAURL:') {
50 window.location = 'index.php?' + window.location.hash.substring(8);
53 /* Check if we should set URL */
54 if (hash_to_set != "") {
55 window.location.hash = hash_to_set;
58 /* Indicate that we're done (and we are not going to change location */