summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2022-03-12 03:33:00 +0000
committerYaco <franco@reevo.org>2022-03-12 03:33:00 +0000
commit29e9f0bc645d8534e06df9c2092bef49a59bb993 (patch)
tree9ee9daac07ed20a30e643c00c2e8582517c26a7d
adds crowdfunding test code
-rw-r--r--conf/acl.auth.php21
-rw-r--r--conf/acl.auth.php.save21
-rw-r--r--conf/local.php8
l---------conf/plugin1
-rw-r--r--conf/plugins.local.php8
l---------conf/users.auth.php1
-rw-r--r--data/attic/.gitkeep0
-rw-r--r--data/attic/c.1647047654.txt.gzbin0 -> 3421 bytes
-rw-r--r--data/attic/c.1647047742.txt.gzbin0 -> 3421 bytes
-rw-r--r--data/attic/c.1647047981.txt.gzbin0 -> 283 bytes
-rw-r--r--data/attic/c.1647048693.txt.gzbin0 -> 283 bytes
-rw-r--r--data/attic/es/index.1647042334.txt.gzbin0 -> 143 bytes
-rw-r--r--data/attic/es/index.1647043693.txt.gzbin0 -> 169 bytes
-rw-r--r--data/attic/es/index.1647043825.txt.gzbin0 -> 1964 bytes
-rw-r--r--data/attic/es/index.1647043919.txt.gzbin0 -> 1838 bytes
-rw-r--r--data/attic/es/index.1647045112.txt.gzbin0 -> 1859 bytes
-rw-r--r--data/attic/es/index.1647045170.txt.gzbin0 -> 1860 bytes
-rw-r--r--data/attic/es/index.1647045182.txt.gzbin0 -> 1854 bytes
-rw-r--r--data/attic/es/index.1647045604.txt.gzbin0 -> 1855 bytes
-rw-r--r--data/attic/es/index.1647046525.txt.gzbin0 -> 1861 bytes
-rw-r--r--data/attic/es/index.1647047892.txt.gzbin0 -> 2071 bytes
-rw-r--r--data/attic/es/index.1647047970.txt.gzbin0 -> 1861 bytes
-rw-r--r--data/attic/es/index.1647048729.txt.gzbin0 -> 1862 bytes
-rw-r--r--data/attic/es/index.1647048761.txt.gzbin0 -> 1843 bytes
-rw-r--r--data/attic/es/index.1647048832.txt.gzbin0 -> 1841 bytes
-rw-r--r--data/attic/es/index.1647048902.txt.gzbin0 -> 1850 bytes
-rw-r--r--data/attic/es/index.1647052948.txt.gzbin0 -> 1990 bytes
-rw-r--r--data/attic/es/index.1647054003.txt.gzbin0 -> 2034 bytes
-rw-r--r--data/attic/es/index.1647054072.txt.gzbin0 -> 2031 bytes
-rw-r--r--data/attic/es/index.1647054091.txt.gzbin0 -> 2031 bytes
-rw-r--r--data/attic/es/index.1647054127.txt.gzbin0 -> 2031 bytes
-rw-r--r--data/attic/es/index.1647054859.txt.gzbin0 -> 2028 bytes
-rw-r--r--data/attic/es/index.1647054885.txt.gzbin0 -> 2026 bytes
-rw-r--r--data/attic/es/index.1647054953.txt.gzbin0 -> 2026 bytes
-rw-r--r--data/attic/es/index.1647054999.txt.gzbin0 -> 2028 bytes
-rw-r--r--data/attic/es/index.1647055106.txt.gzbin0 -> 1960 bytes
-rw-r--r--data/attic/es/index.1647055199.txt.gzbin0 -> 1991 bytes
-rw-r--r--data/attic/es/index.1647055313.txt.gzbin0 -> 2000 bytes
-rw-r--r--data/attic/es/index.1647055329.txt.gzbin0 -> 1999 bytes
-rw-r--r--data/attic/es/index.1647055343.txt.gzbin0 -> 1998 bytes
-rw-r--r--data/attic/es/index.1647055352.txt.gzbin0 -> 2000 bytes
-rw-r--r--data/attic/es/index.1647055361.txt.gzbin0 -> 1993 bytes
-rw-r--r--data/attic/es/index.1647055444.txt.gzbin0 -> 2028 bytes
-rw-r--r--data/attic/es/index.1647055482.txt.gzbin0 -> 2028 bytes
-rw-r--r--data/attic/es/index.1647055493.txt.gzbin0 -> 2028 bytes
-rw-r--r--data/attic/es/index.1647055684.txt.gzbin0 -> 2654 bytes
-rw-r--r--data/attic/index.1647042269.txt.gzbin0 -> 143 bytes
-rw-r--r--data/attic/index.1647042317.txt.gzbin0 -> 47 bytes
-rw-r--r--data/attic/index.log.1647048926.txt.gzbin0 -> 293 bytes
-rw-r--r--data/attic/index.log.1647048960.txt.gzbin0 -> 293 bytes
-rw-r--r--data/cache/.gitkeep0
-rw-r--r--data/cache/0/0b27043e657bdac7717efb312ad23fe2.i1
-rw-r--r--data/cache/0/0b27043e657bdac7717efb312ad23fe2.xhtml4
-rw-r--r--data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.i1
-rw-r--r--data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.xhtml9
-rw-r--r--data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.ibin0 -> 38452 bytes
-rw-r--r--data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.metadata1
-rw-r--r--data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.i1
-rw-r--r--data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.xhtml9
-rw-r--r--data/cache/2/2b1fa32d70322b86ccc24e2575e329db.i1
-rw-r--r--data/cache/2/2b1fa32d70322b86ccc24e2575e329db.metadata1
-rw-r--r--data/cache/2/2b1fa32d70322b86ccc24e2575e329db.xhtml1
-rw-r--r--data/cache/3/37a88ba83c9ebbaabadac083928aee72.ibin0 -> 36166 bytes
-rw-r--r--data/cache/3/37a88ba83c9ebbaabadac083928aee72.metadata1
-rw-r--r--data/cache/3/397ac8fa2a9e46923a59933fc964184d.js1
-rw-r--r--data/cache/3/397ac8fa2a9e46923a59933fc964184d.js.gzbin0 -> 40963 bytes
-rw-r--r--data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js1
-rw-r--r--data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js.gzbin0 -> 41713 bytes
-rw-r--r--data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js1
-rw-r--r--data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js.gzbin0 -> 41424 bytes
-rw-r--r--data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.i1
-rw-r--r--data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.xhtml9
-rw-r--r--data/cache/8/84d7238169ba6d06500223cad03d6e45.js1
-rw-r--r--data/cache/8/84d7238169ba6d06500223cad03d6e45.js.gzbin0 -> 40318 bytes
-rw-r--r--data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.i1
-rw-r--r--data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.xhtml4
-rw-r--r--data/cache/8/8e8770d17b217426380bc56fce3b9f86.js1
-rw-r--r--data/cache/8/8e8770d17b217426380bc56fce3b9f86.js.gzbin0 -> 41076 bytes
-rw-r--r--data/cache/a/a48b774336774d83d50a86a857d310de.js1
-rw-r--r--data/cache/a/a48b774336774d83d50a86a857d310de.js.gzbin0 -> 42083 bytes
-rw-r--r--data/cache/b/b1b6161e181ba7bda82ccd74170823f7.js1
-rw-r--r--data/cache/b/b1b6161e181ba7bda82ccd74170823f7.js.gzbin0 -> 42083 bytes
-rw-r--r--data/cache/c/cba7300bd717c48e5a57b9c9a81b5c58.i1
-rw-r--r--data/cache/c/cba7300bd717c48e5a57b9c9a81b5c58.metadata1
-rw-r--r--data/cache/c/cba7300bd717c48e5a57b9c9a81b5c58.xhtml14
-rw-r--r--data/cache/c/cfa4a715c3973d544235c9a84e0b3101.js1
-rw-r--r--data/cache/c/cfa4a715c3973d544235c9a84e0b3101.js.gzbin0 -> 41424 bytes
-rw-r--r--data/cache/d/d223e1439188e478349d52476506c22e.js16
-rw-r--r--data/cache/d/d223e1439188e478349d52476506c22e.js.gzbin0 -> 97910 bytes
-rw-r--r--data/cache/d/df10cbe878cdbaf697704a7e04354267.updmsg0
-rw-r--r--data/cache/e/e09b1f52a8f168393164f35d2adceb9d.i1
-rw-r--r--data/cache/e/e09b1f52a8f168393164f35d2adceb9d.xhtml9
-rw-r--r--data/cache/e/e137b39a3029f7bc169586eb35b7cd9d.css1
-rw-r--r--data/cache/e/e137b39a3029f7bc169586eb35b7cd9d.css.gzbin0 -> 38664 bytes
-rw-r--r--data/cache/e/eb793191c7f20aab66f41e14fb128038.i1
-rw-r--r--data/cache/e/eb793191c7f20aab66f41e14fb128038.xhtml9
-rw-r--r--data/cache/f/f9044ac99f3b97ea8b28274bba3d3692.i1
-rw-r--r--data/cache/f/f9044ac99f3b97ea8b28274bba3d3692.xhtml9
-rw-r--r--data/cache/purgefile1
-rw-r--r--data/index/.gitkeep0
-rw-r--r--data/index/i1.idx2
-rw-r--r--data/index/i10.idx39
-rw-r--r--data/index/i11.idx28
-rw-r--r--data/index/i12.idx9
-rw-r--r--data/index/i13.idx5
-rw-r--r--data/index/i17.idx1
-rw-r--r--data/index/i2.idx54
-rw-r--r--data/index/i21.idx1
-rw-r--r--data/index/i28.idx1
-rw-r--r--data/index/i3.idx55
-rw-r--r--data/index/i4.idx90
-rw-r--r--data/index/i5.idx108
-rw-r--r--data/index/i6.idx121
-rw-r--r--data/index/i7.idx117
-rw-r--r--data/index/i8.idx88
-rw-r--r--data/index/i9.idx50
-rw-r--r--data/index/metadata.idx2
-rw-r--r--data/index/page.idx4
-rw-r--r--data/index/pageword.idx4
-rw-r--r--data/index/relation_media_i.idx1
-rw-r--r--data/index/relation_media_p.idx4
-rw-r--r--data/index/relation_media_w.idx1
-rw-r--r--data/index/relation_references_i.idx0
-rw-r--r--data/index/relation_references_p.idx4
-rw-r--r--data/index/title.idx4
-rw-r--r--data/index/w1.idx2
-rw-r--r--data/index/w10.idx39
-rw-r--r--data/index/w11.idx28
-rw-r--r--data/index/w12.idx9
-rw-r--r--data/index/w13.idx5
-rw-r--r--data/index/w17.idx1
-rw-r--r--data/index/w2.idx54
-rw-r--r--data/index/w21.idx1
-rw-r--r--data/index/w28.idx1
-rw-r--r--data/index/w3.idx55
-rw-r--r--data/index/w4.idx90
-rw-r--r--data/index/w5.idx108
-rw-r--r--data/index/w6.idx121
-rw-r--r--data/index/w7.idx117
-rw-r--r--data/index/w8.idx88
-rw-r--r--data/index/w9.idx50
-rw-r--r--data/locks/.gitkeep0
-rw-r--r--data/log/.gitkeep0
-rw-r--r--data/media/.gitkeep0
-rw-r--r--data/media_attic/.gitkeep0
-rw-r--r--data/media_meta/.gitkeep0
-rw-r--r--data/meta/.gitkeep0
-rw-r--r--data/meta/_dokuwiki.changes43
-rw-r--r--data/meta/_dokuwiki.changes.trimmed0
-rw-r--r--data/meta/_htcookiesalt21
-rw-r--r--data/meta/c.changes4
-rw-r--r--data/meta/c.meta1
-rw-r--r--data/meta/es/index.changes35
-rw-r--r--data/meta/es/index.indexed1
-rw-r--r--data/meta/es/index.meta1
-rw-r--r--data/meta/index.changes2
-rw-r--r--data/meta/index.indexed1
-rw-r--r--data/meta/index.log.changes2
-rw-r--r--data/meta/index.log.indexed1
-rw-r--r--data/meta/index.log.meta1
-rw-r--r--data/meta/index.meta1
-rw-r--r--data/pages/.gitkeep0
-rw-r--r--data/pages/es/index.txt32
-rw-r--r--data/pages/index.log.txt3
-rwxr-xr-xdata/pages/index.sh3
-rw-r--r--data/pages/index.txt1
-rw-r--r--data/tmp/.gitkeep0
167 files changed, 1872 insertions, 0 deletions
diff --git a/conf/acl.auth.php b/conf/acl.auth.php
new file mode 100644
index 0000000..c70af78
--- /dev/null
+++ b/conf/acl.auth.php
@@ -0,0 +1,21 @@
+# acl.auth.php
+# <?php exit()?>
+# Don't modify the lines above
+#
+# Access Control Lists
+#
+# Editing this file by hand shouldn't be necessary. Use the ACL
+# Manager interface instead.
+#
+# If your auth backend allows special char like spaces in groups
+# or user names you need to urlencode them (only chars <128, leave
+# UTF-8 multibyte chars as is)
+#
+# none 0
+# read 1
+# edit 2
+# create 4
+# upload 8
+# delete 16
+
+* @ALL 1
diff --git a/conf/acl.auth.php.save b/conf/acl.auth.php.save
new file mode 100644
index 0000000..c70af78
--- /dev/null
+++ b/conf/acl.auth.php.save
@@ -0,0 +1,21 @@
+# acl.auth.php
+# <?php exit()?>
+# Don't modify the lines above
+#
+# Access Control Lists
+#
+# Editing this file by hand shouldn't be necessary. Use the ACL
+# Manager interface instead.
+#
+# If your auth backend allows special char like spaces in groups
+# or user names you need to urlencode them (only chars <128, leave
+# UTF-8 multibyte chars as is)
+#
+# none 0
+# read 1
+# edit 2
+# create 4
+# upload 8
+# delete 16
+
+* @ALL 1
diff --git a/conf/local.php b/conf/local.php
new file mode 100644
index 0000000..bb9a203
--- /dev/null
+++ b/conf/local.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Minimal local config
+ */
+$conf['useacl'] = 1;
+$conf['superuser'] = '@admin';
+
+$conf['title'] = 'Gustavo Esteva';
diff --git a/conf/plugin b/conf/plugin
new file mode 120000
index 0000000..e23e968
--- /dev/null
+++ b/conf/plugin
@@ -0,0 +1 @@
+../../../platform/www/conf/plugin/ \ No newline at end of file
diff --git a/conf/plugins.local.php b/conf/plugins.local.php
new file mode 100644
index 0000000..4f256a9
--- /dev/null
+++ b/conf/plugins.local.php
@@ -0,0 +1,8 @@
+<?php
+/*
+ * Local plugin enable/disable settings
+ * Auto-generated through plugin/extension manager
+ *
+ * NOTE: Plugins will not be added to this file unless there is a need to override a default setting. Plugins are
+ * enabled by default.
+ */
diff --git a/conf/users.auth.php b/conf/users.auth.php
new file mode 120000
index 0000000..648705f
--- /dev/null
+++ b/conf/users.auth.php
@@ -0,0 +1 @@
+../../../platform/www/conf/users.auth.php \ No newline at end of file
diff --git a/data/attic/.gitkeep b/data/attic/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/data/attic/.gitkeep
diff --git a/data/attic/c.1647047654.txt.gz b/data/attic/c.1647047654.txt.gz
new file mode 100644
index 0000000..a45c10d
--- /dev/null
+++ b/data/attic/c.1647047654.txt.gz
Binary files differ
diff --git a/data/attic/c.1647047742.txt.gz b/data/attic/c.1647047742.txt.gz
new file mode 100644
index 0000000..a45c10d
--- /dev/null
+++ b/data/attic/c.1647047742.txt.gz
Binary files differ
diff --git a/data/attic/c.1647047981.txt.gz b/data/attic/c.1647047981.txt.gz
new file mode 100644
index 0000000..4f9256d
--- /dev/null
+++ b/data/attic/c.1647047981.txt.gz
Binary files differ
diff --git a/data/attic/c.1647048693.txt.gz b/data/attic/c.1647048693.txt.gz
new file mode 100644
index 0000000..4f9256d
--- /dev/null
+++ b/data/attic/c.1647048693.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647042334.txt.gz b/data/attic/es/index.1647042334.txt.gz
new file mode 100644
index 0000000..f7e2226
--- /dev/null
+++ b/data/attic/es/index.1647042334.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647043693.txt.gz b/data/attic/es/index.1647043693.txt.gz
new file mode 100644
index 0000000..7f0efcd
--- /dev/null
+++ b/data/attic/es/index.1647043693.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647043825.txt.gz b/data/attic/es/index.1647043825.txt.gz
new file mode 100644
index 0000000..7e47e72
--- /dev/null
+++ b/data/attic/es/index.1647043825.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647043919.txt.gz b/data/attic/es/index.1647043919.txt.gz
new file mode 100644
index 0000000..653a7a1
--- /dev/null
+++ b/data/attic/es/index.1647043919.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647045112.txt.gz b/data/attic/es/index.1647045112.txt.gz
new file mode 100644
index 0000000..c5c234d
--- /dev/null
+++ b/data/attic/es/index.1647045112.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647045170.txt.gz b/data/attic/es/index.1647045170.txt.gz
new file mode 100644
index 0000000..af786b6
--- /dev/null
+++ b/data/attic/es/index.1647045170.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647045182.txt.gz b/data/attic/es/index.1647045182.txt.gz
new file mode 100644
index 0000000..b873e7d
--- /dev/null
+++ b/data/attic/es/index.1647045182.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647045604.txt.gz b/data/attic/es/index.1647045604.txt.gz
new file mode 100644
index 0000000..56bcdd6
--- /dev/null
+++ b/data/attic/es/index.1647045604.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647046525.txt.gz b/data/attic/es/index.1647046525.txt.gz
new file mode 100644
index 0000000..39eba6c
--- /dev/null
+++ b/data/attic/es/index.1647046525.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647047892.txt.gz b/data/attic/es/index.1647047892.txt.gz
new file mode 100644
index 0000000..d9b3e25
--- /dev/null
+++ b/data/attic/es/index.1647047892.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647047970.txt.gz b/data/attic/es/index.1647047970.txt.gz
new file mode 100644
index 0000000..39eba6c
--- /dev/null
+++ b/data/attic/es/index.1647047970.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647048729.txt.gz b/data/attic/es/index.1647048729.txt.gz
new file mode 100644
index 0000000..10e2545
--- /dev/null
+++ b/data/attic/es/index.1647048729.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647048761.txt.gz b/data/attic/es/index.1647048761.txt.gz
new file mode 100644
index 0000000..89d491c
--- /dev/null
+++ b/data/attic/es/index.1647048761.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647048832.txt.gz b/data/attic/es/index.1647048832.txt.gz
new file mode 100644
index 0000000..1172da2
--- /dev/null
+++ b/data/attic/es/index.1647048832.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647048902.txt.gz b/data/attic/es/index.1647048902.txt.gz
new file mode 100644
index 0000000..23d1361
--- /dev/null
+++ b/data/attic/es/index.1647048902.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647052948.txt.gz b/data/attic/es/index.1647052948.txt.gz
new file mode 100644
index 0000000..f6af6de
--- /dev/null
+++ b/data/attic/es/index.1647052948.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054003.txt.gz b/data/attic/es/index.1647054003.txt.gz
new file mode 100644
index 0000000..f9bde9e
--- /dev/null
+++ b/data/attic/es/index.1647054003.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054072.txt.gz b/data/attic/es/index.1647054072.txt.gz
new file mode 100644
index 0000000..388f310
--- /dev/null
+++ b/data/attic/es/index.1647054072.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054091.txt.gz b/data/attic/es/index.1647054091.txt.gz
new file mode 100644
index 0000000..f1412cb
--- /dev/null
+++ b/data/attic/es/index.1647054091.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054127.txt.gz b/data/attic/es/index.1647054127.txt.gz
new file mode 100644
index 0000000..e015010
--- /dev/null
+++ b/data/attic/es/index.1647054127.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054859.txt.gz b/data/attic/es/index.1647054859.txt.gz
new file mode 100644
index 0000000..16403d9
--- /dev/null
+++ b/data/attic/es/index.1647054859.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054885.txt.gz b/data/attic/es/index.1647054885.txt.gz
new file mode 100644
index 0000000..c75b2ff
--- /dev/null
+++ b/data/attic/es/index.1647054885.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054953.txt.gz b/data/attic/es/index.1647054953.txt.gz
new file mode 100644
index 0000000..6ad2975
--- /dev/null
+++ b/data/attic/es/index.1647054953.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647054999.txt.gz b/data/attic/es/index.1647054999.txt.gz
new file mode 100644
index 0000000..aebb071
--- /dev/null
+++ b/data/attic/es/index.1647054999.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055106.txt.gz b/data/attic/es/index.1647055106.txt.gz
new file mode 100644
index 0000000..a4dfd31
--- /dev/null
+++ b/data/attic/es/index.1647055106.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055199.txt.gz b/data/attic/es/index.1647055199.txt.gz
new file mode 100644
index 0000000..2c99c81
--- /dev/null
+++ b/data/attic/es/index.1647055199.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055313.txt.gz b/data/attic/es/index.1647055313.txt.gz
new file mode 100644
index 0000000..ae1c013
--- /dev/null
+++ b/data/attic/es/index.1647055313.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055329.txt.gz b/data/attic/es/index.1647055329.txt.gz
new file mode 100644
index 0000000..0343c5d
--- /dev/null
+++ b/data/attic/es/index.1647055329.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055343.txt.gz b/data/attic/es/index.1647055343.txt.gz
new file mode 100644
index 0000000..2026aab
--- /dev/null
+++ b/data/attic/es/index.1647055343.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055352.txt.gz b/data/attic/es/index.1647055352.txt.gz
new file mode 100644
index 0000000..18a062d
--- /dev/null
+++ b/data/attic/es/index.1647055352.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055361.txt.gz b/data/attic/es/index.1647055361.txt.gz
new file mode 100644
index 0000000..0c34604
--- /dev/null
+++ b/data/attic/es/index.1647055361.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055444.txt.gz b/data/attic/es/index.1647055444.txt.gz
new file mode 100644
index 0000000..d30e736
--- /dev/null
+++ b/data/attic/es/index.1647055444.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055482.txt.gz b/data/attic/es/index.1647055482.txt.gz
new file mode 100644
index 0000000..8514844
--- /dev/null
+++ b/data/attic/es/index.1647055482.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055493.txt.gz b/data/attic/es/index.1647055493.txt.gz
new file mode 100644
index 0000000..430c75e
--- /dev/null
+++ b/data/attic/es/index.1647055493.txt.gz
Binary files differ
diff --git a/data/attic/es/index.1647055684.txt.gz b/data/attic/es/index.1647055684.txt.gz
new file mode 100644
index 0000000..e51a6ae
--- /dev/null
+++ b/data/attic/es/index.1647055684.txt.gz
Binary files differ
diff --git a/data/attic/index.1647042269.txt.gz b/data/attic/index.1647042269.txt.gz
new file mode 100644
index 0000000..f7e2226
--- /dev/null
+++ b/data/attic/index.1647042269.txt.gz
Binary files differ
diff --git a/data/attic/index.1647042317.txt.gz b/data/attic/index.1647042317.txt.gz
new file mode 100644
index 0000000..3ad594b
--- /dev/null
+++ b/data/attic/index.1647042317.txt.gz
Binary files differ
diff --git a/data/attic/index.log.1647048926.txt.gz b/data/attic/index.log.1647048926.txt.gz
new file mode 100644
index 0000000..688865a
--- /dev/null
+++ b/data/attic/index.log.1647048926.txt.gz
Binary files differ
diff --git a/data/attic/index.log.1647048960.txt.gz b/data/attic/index.log.1647048960.txt.gz
new file mode 100644
index 0000000..688865a
--- /dev/null
+++ b/data/attic/index.log.1647048960.txt.gz
Binary files differ
diff --git a/data/cache/.gitkeep b/data/cache/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/data/cache/.gitkeep
diff --git a/data/cache/0/0b27043e657bdac7717efb312ad23fe2.i b/data/cache/0/0b27043e657bdac7717efb312ad23fe2.i
new file mode 100644
index 0000000..887741e
--- /dev/null
+++ b/data/cache/0/0b27043e657bdac7717efb312ad23fe2.i
@@ -0,0 +1 @@
+a:17:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:0;}i:2;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:22:"Edit the page and hit ";}i:2;i:1;}i:3;a:3:{i:0;s:14:"monospace_open";i:1;a:0:{}i:2;i:23;}i:4;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:4:"Save";}i:2;i:25;}i:5;a:3:{i:0;s:15:"monospace_close";i:1;a:0:{}i:2;i:29;}i:6;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:6:". See ";}i:2;i:31;}i:7;a:3:{i:0;s:12:"internallink";i:1;a:2:{i:0;s:11:"wiki:syntax";i:1;N;}i:2;i:37;}i:8;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:55:" for Wiki syntax. Please edit the page only if you can ";}i:2;i:52;}i:9;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:1;i:1;s:2:"**";}i:2;i:1;i:3;s:2:"**";}i:2;i:107;}i:10;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:3;i:1;s:7:"improve";}i:2;i:3;i:3;s:7:"improve";}i:2;i:109;}i:11;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:4;i:1;s:2:"**";}i:2;i:4;i:3;s:2:"**";}i:2;i:116;}i:12;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:76:" it. If you want to test some things, learn to make your first steps on the ";}i:2;i:118;}i:13;a:3:{i:0;s:12:"internallink";i:1;a:2:{i:0;s:21:"playground:playground";i:1;s:10:"playground";}i:2;i:194;}i:14;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:1:".";}i:2;i:230;}i:15;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:231;}i:16;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:231;}} \ No newline at end of file
diff --git a/data/cache/0/0b27043e657bdac7717efb312ad23fe2.xhtml b/data/cache/0/0b27043e657bdac7717efb312ad23fe2.xhtml
new file mode 100644
index 0000000..034477f
--- /dev/null
+++ b/data/cache/0/0b27043e657bdac7717efb312ad23fe2.xhtml
@@ -0,0 +1,4 @@
+
+<p>
+Edit the page and hit <code>Save</code>. See <a href="/wiki:syntax" class="wikilink2" title="wiki:syntax" rel="nofollow" data-wiki-id="wiki:syntax">syntax</a> for Wiki syntax. Please edit the page only if you can <strong>improve</strong> it. If you want to test some things, learn to make your first steps on the <a href="/playground:playground" class="wikilink2" title="playground:playground" rel="nofollow" data-wiki-id="playground:playground">playground</a>.
+</p>
diff --git a/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.i b/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.i
new file mode 100644
index 0000000..c1af82f
--- /dev/null
+++ b/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.i
@@ -0,0 +1 @@
+a:10:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:32:"This page does not exist anymore";i:1;i:1;i:2;i:1;}i:2;i:1;}i:2;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:1;}i:2;i:1;}i:3;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:1;}i:4;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:82:"You've followed a link to a page that no longer exists. You can check the list of ";}i:2;i:50;}i:5;a:3:{i:0;s:12:"internallink";i:1;a:2:{i:0;s:13:"?do=revisions";i:1;s:13:"old revisions";}i:2;i:132;}i:6;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:72:" to see when and why it was deleted, access old revisions or restore it.";}i:2;i:163;}i:7;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:235;}i:8;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:235;}i:9;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:235;}} \ No newline at end of file
diff --git a/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.xhtml b/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.xhtml
new file mode 100644
index 0000000..bf5c52d
--- /dev/null
+++ b/data/cache/1/1d3af4928f32bfa05f718593f8b9dc76.xhtml
@@ -0,0 +1,9 @@
+
+<h1 class="sectionedit1" id="this_page_does_not_exist_anymore">This page does not exist anymore</h1>
+<div class="level1">
+
+<p>
+You&#039;ve followed a link to a page that no longer exists. You can check the list of <a href="/c?do=revisions" class="wikilink2" title="c" rel="nofollow" data-wiki-id="c">old revisions</a> to see when and why it was deleted, access old revisions or restore it.
+</p>
+
+</div>
diff --git a/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.i b/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.i
new file mode 100644
index 0000000..abcd901
--- /dev/null
+++ b/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.i
Binary files differ
diff --git a/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.metadata b/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.metadata
new file mode 100644
index 0000000..491ad27
--- /dev/null
+++ b/data/cache/2/2062f0f8c03f373441403c48f7f4ae4c.metadata
@@ -0,0 +1 @@
+1647048686 \ No newline at end of file
diff --git a/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.i b/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.i
new file mode 100644
index 0000000..79de5a5
--- /dev/null
+++ b/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.i
@@ -0,0 +1 @@
+a:8:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:5:"Login";i:1;i:1;i:2;i:1;}i:2;i:1;}i:2;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:1;}i:2;i:1;}i:3;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:1;}i:4;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:131:"You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.";}i:2;i:22;}i:5;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:153;}i:6;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:154;}i:7;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:154;}} \ No newline at end of file
diff --git a/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.xhtml b/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.xhtml
new file mode 100644
index 0000000..b9b46b2
--- /dev/null
+++ b/data/cache/2/281c46d51182fe3a14a60bc95c40ec9a.xhtml
@@ -0,0 +1,9 @@
+
+<h1 class="sectionedit1" id="login">Login</h1>
+<div class="level1">
+
+<p>
+You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.
+</p>
+
+</div>
diff --git a/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.i b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.i
new file mode 100644
index 0000000..bd6024c
--- /dev/null
+++ b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.i
@@ -0,0 +1 @@
+a:3:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:12:"pageredirect";i:1;a:2:{i:0;s:8:"es:index";i:1;i:0;}i:2;i:5;i:3;s:21:"~~REDIRECT>es:index~~";}i:2;i:1;}i:2;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:1;}} \ No newline at end of file
diff --git a/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.metadata b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.metadata
new file mode 100644
index 0000000..585baf2
--- /dev/null
+++ b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.metadata
@@ -0,0 +1 @@
+1647055846 \ No newline at end of file
diff --git a/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.xhtml b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.xhtml
new file mode 100644
index 0000000..3d891f8
--- /dev/null
+++ b/data/cache/2/2b1fa32d70322b86ccc24e2575e329db.xhtml
@@ -0,0 +1 @@
+<div class="noteredirect">This page has been moved, the new location is <a href="/es:index" class="wikilink2" title="es:index" rel="nofollow" data-wiki-id="es:index">es</a>.</div> \ No newline at end of file
diff --git a/data/cache/3/37a88ba83c9ebbaabadac083928aee72.i b/data/cache/3/37a88ba83c9ebbaabadac083928aee72.i
new file mode 100644
index 0000000..a3c0f03
--- /dev/null
+++ b/data/cache/3/37a88ba83c9ebbaabadac083928aee72.i
Binary files differ
diff --git a/data/cache/3/37a88ba83c9ebbaabadac083928aee72.metadata b/data/cache/3/37a88ba83c9ebbaabadac083928aee72.metadata
new file mode 100644
index 0000000..585baf2
--- /dev/null
+++ b/data/cache/3/37a88ba83c9ebbaabadac083928aee72.metadata
@@ -0,0 +1 @@
+1647055846 \ No newline at end of file
diff --git a/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js b/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js
new file mode 100644
index 0000000..8f0465d
--- /dev/null
+++ b/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Alternar herramientas de b\u00fasqueda","willexpire":"El bloqueo para la edici\u00f3n de esta p\u00e1gina expira en un minuto.\\nPAra prevenir conflictos uso el bot\u00f3n Previsualizar para restaurar el contador de bloqueo.","notsavedyet":"Los cambios que no se han guardado se perder\u00e1n.\n\u00bfRealmente quieres continuar?","searchmedia":"Buscar archivos","keepopen":"Mantener la ventana abierta luego de seleccionar","hidedetails":"Ocultar detalles","mediatitle":"Configuraci\u00f3n del v\u00ednculo","mediadisplay":"Tipo de v\u00ednculo","mediaalign":"Alineaci\u00f3n","mediasize":"Tama\u00f1o de la imagen","mediatarget":"Destino del v\u00ednculo","mediaclose":"Cerrar","mediainsert":"Insertar","mediadisplayimg":"Mostrar la imagen.","mediadisplaylnk":"Mostrar solo el v\u00ednculo.","mediasmall":"Versi\u00f3n en tama\u00f1o peque\u00f1o","mediamedium":"Versi\u00f3n en tama\u00f1o medio","medialarge":"Versi\u00f3n en tama\u00f1o grande","mediaoriginal":"Versi\u00f3n original","medialnk":"V\u00ednculo a la pagina de descripci\u00f3n","mediadirect":"V\u00ednculo al original","medianolnk":"Sin v\u00ednculo","medianolink":"No vincular la imagen","medialeft":"Alinear imagen a la izquierda","mediaright":"Alinear imagen a la derecha.","mediacenter":"Alinear imagen en el centro.","medianoalign":"No use alineaci\u00f3n.","nosmblinks":"El enlace a recursos compartidos de Windows s\u00f3lo funciona en Microsoft Internet Explorer.\nLo que s\u00ed puedes hacer es copiar y pegar el enlace.","linkwiz":"Asistente de enlaces","linkto":"Enlazar a:","del_confirm":"\u00bfQuieres realmente borrar lo seleccionado?","restore_confirm":"\u00bfEst\u00e1s seguro de querer restaurar esta versi\u00f3n?","media_diff":"Ver diferencias:","media_diff_both":"Lado por lado","media_diff_opacity":"A trav\u00e9s de Shine","media_diff_portions":"Pasar","media_select":"Seleccionar ficheros","media_upload_btn":"Cargar","media_done_btn":"Hecho","media_drop":"Arrastra los ficheros aqu\u00ed para cargar","media_cancel":"Eliminar","media_overwrt":"Sobreescribir ficheros exitentes","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Negrita","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"It\u00e1lica","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Subrayado","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"C\u00f3digo","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Tachado","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"T\u00edtulo del mismo nivel","icon":"hequal.png","key":"8","text":"T\u00edtulo","mod":0,"block":true},{"type":"autohead","title":"T\u00edtulo bajo","icon":"hminus.png","key":"9","text":"T\u00edtulo","mod":1,"block":true},{"type":"autohead","title":"T\u00edtulo alto","icon":"hplus.png","key":"0","text":"T\u00edtulo","mod":-1,"block":true},{"type":"picker","title":"Selecciona el t\u00edtulo","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"T\u00edtulo 1","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"T\u00edtulo 2","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"T\u00edtulo 3","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"T\u00edtulo 4","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"T\u00edtulo 5","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Enlace interno","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"Enlace externo","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|Enlace externo","block":false},{"type":"formatln","title":"\u00cdtem de lista ordenada","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"\u00cdtem de lista desordenada","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"L\u00ednea horizontal","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"A\u00f1adir Im\u00e1genes u otros ficheros","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Sonrisas","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Caracteres especiales","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insertar firma","icon":"sig.png","key":"y","block":false}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));(function(factory){if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory);}else{factory(jQuery.datepicker);}}(function(datepicker){datepicker.regional.es={closeText:"Cerrar",prevText:"&#x3C;Ant",nextText:"Sig&#x3E;",currentText:"Hoy",monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","jue","vie","sáb"],dayNamesMin:["D","L","M","X","J","V","S"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.es);return datepicker.regional.es;}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_text=function(){return $('<div/>').text($.trim(this.search_field.val())).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');no_results_html.find("span").first().html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}return this.pending_backstroke=null;};Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;stroke=(_ref1=evt.which)!=null?_ref1:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}switch(stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}break;case 32:if(this.disable_search){evt.preventDefault();}break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){h=0;w=0;style_block="position:absolute; left: -1000px; top: -1000px; display:none;";styles=['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'];for(_i=0,_len=styles.length;_i<_len;_i++){style=styles[_i];style_block+=style+":"+this.search_field.css(style)+";";}div=$('<div />',{'style':style_block});div.text(this.search_field.val());$('body').append(div);w=div.width()+25;div.remove();f_width=this.container.outerWidth();if(w>f_width-10){w=f_width-10;}return this.search_field.css({'width':w+'px'});}};return Chosen;})(AbstractChosen);}).call(this);(function(){'use strict';jQuery(function(){var $animalSelect=jQuery('select.farmer_chosen_animals');$animalSelect.chosen({width:'100%',search_contains:true,allow_single_deselect:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});jQuery('select.acl_chosen').chosen({disable_search:true,width:'100%'});var $formAllAnimals=jQuery('#farmer__pluginsforall');$formAllAnimals.find('select').change(function(){$formAllAnimals.find('button').prop('disabled',false);}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.pluginSelect});var $formSingleAnimal=jQuery('#farmer__pluginsforone');$formSingleAnimal.find('select').change(function(){var animal=jQuery(this).val();$formSingleAnimal.find('button').prop('disabled',true);jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPlugins_'+animal},function(data){$formSingleAnimal.find('div.output').html(data);$formSingleAnimal.find('button').prop('disabled',false);},'html')}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});var $formPluginMatrix=jQuery('#farmer__pluginmatrix').hide();$formPluginMatrix.on('click','td',function(){var $td=jQuery(this);$td.html('⌛').css('background-color','transparent');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_modPlugin',plugin:$td.data('plugin'),ani:$td.data('animal')},function(data){$td.replaceWith(data);},'html');});function showMatrix(){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPluginMatrix'},function(data){$formPluginMatrix.html(data);$formPluginMatrix.show();},'html')}$animalSelect.on('chosen:showing_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'20em'},400);}).on('chosen:hiding_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'7px'},400);});var $aclPolicyFieldset=jQuery('#aclPolicyFieldset');if($aclPolicyFieldset.length){$animalSelect.on('change',function(evt,params){var $this=jQuery(this);if($this.val()===''){$aclPolicyFieldset.slideDown();}else{$aclPolicyFieldset.slideUp();}});}jQuery("input[name=bulkSingleSwitch]:radio").change(function(){if(jQuery('#farmer__bulk').prop("checked")){$formAllAnimals.show();$formSingleAnimal.hide();$formPluginMatrix.hide();}else if(jQuery('#farmer__single').prop("checked")){$formAllAnimals.hide();$formSingleAnimal.show();$formPluginMatrix.hide();}else{$formAllAnimals.hide();$formSingleAnimal.hide();showMatrix();}});jQuery('#farmer__bulk').click();});})();var plugin_fastwiki=(function($){var m_viewMode,m_origViewMode,m_prevView;var m_isSecedit,m_wasSecedit;var m_hasDraft;var m_pageObjs={};var m_content;var m_initialId;var m_debug=document.location.host=='localhost';var m_cache=new CPageCache(JSINFO.fastwiki.preload_per_page,JSINFO.fastwiki.preload_batchsize,m_debug);var m_supportedActions={'':1,edit:1,draft:1,history:1,recent:1,revisions:1,show:1,subscribe:1,backlink:1,index:1,profile:1,media:1,diff:1,save:1};var m_modeClassElt;var m_browserHistory=new CBrowserHistory();$(function(){if(document.location.href.indexOf("detail.php")>=0)m_viewMode='unsupported';else{var urlParams=_urlToObj(document.location.href);m_viewMode=urlParams['do']||'show';if(!m_supportedActions[m_viewMode])m_viewMode='unsupported';else if(window.tpl_fastwiki_startmode_support&&!(m_viewMode in tpl_fastwiki_startmode_support))m_viewMode='unsupported';}m_origViewMode=m_viewMode;m_content=$('.plugin_fastwiki_marker').parent();m_content.addClass('content_initial');m_initialId=m_content.attr('id');m_modeClassElt=m_content.hasClass('dokuwiki')?m_content:$(m_content.parents('.dokuwiki')[0]||document.body);$(window).trigger('fastwiki:init',[m_viewMode]);if(JSINFO.fastwiki.fastpages)fixActionLinks(document.body);if(JSINFO.fastwiki.fastshow&&(m_origViewMode!='show'||!window.history||!history.pushState))JSINFO.fastwiki.fastshow=false;if(JSINFO.fastwiki.fastshow)m_browserHistory.init(load);});function fixActionLinks(elt){if(m_origViewMode=='unsupported')return;var formActions={search:1};var supportedFields={'do':1,rev:1,id:1};$('a[href *= "?do="]',elt).click(function(e){var curPathId=JSINFO.id.replace(/:/g,'/');var aPathId=this.href.replace(/\?.*$/,'').replace(/:/g,'/');if(aPathId.substr(-curPathId.length)==curPathId){var params=_urlToObj(this.href);if(!params['do'])params['do']='show';if(params['do']in m_supportedActions){e.preventDefault();load(params['do'],null,params);}}});$('input[type="submit"], input[type="button"], button',elt).click(function(e){var form=$(this).parents('form');if(form.length>0&&form[0]['do']&&form[0]['do'].value in m_supportedActions){var supported=true;$('input[type != "submit"]',form).each(function(idx,elt){if(elt.type!='button'&&(elt.type!='hidden'||!(elt.name in supportedFields)))supported=false;});if(supported){e.preventDefault();var params=_formToObj(form[0]);if(!params['do'])params['do']='show';load(params['do'],null,params);}}});if(m_origViewMode=='show'&&window.JSINFO){var pathId=JSINFO.id.replace(/:/g,'/');$('a',elt).click(function(e){var href=this.getAttribute('href');if(href&&href.indexOf('://')<0){if(href.match(m_browserHistory.getSelfRefRegex())){load('show');e.preventDefault();}else if(JSINFO.fastwiki.fastshow){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){if(m_browserHistory.switchBasePath(href)){m_viewMode=null;e.preventDefault();}}}}});}if(JSINFO.fastwiki.secedit){$('.editbutton_section .btn_secedit input[type=submit], .editbutton_section .btn_secedit button',elt).click(function(e){e.preventDefault();var form=$(this).parents('form');load('edit',form,_formToObj(form));});}if(JSINFO.fastwiki.preload)m_cache.load(elt,m_browserHistory);}function _preview(sectionForm){var body=$(document.body);var params=_formToObj($('#dw__editform'));params['do']='preview';_sendPartial(params,$('.dokuwiki .editBox'),function(data){var preview=$('<div id="preview_container">'+data+'</div>');var pvEditor=preview.find('#dw__editform');var editor=$('#dw__editform')[0];pvEditor.find('input[type=hidden]').each(function(idx,elt){editor[elt.name].value=elt.value;});preview.find('#scroll__here').prevAll().remove();var oldpreview=$('#preview_container');if(oldpreview.length>0)oldpreview.replaceWith(preview);else $('.content_partial').append(preview);setTimeout(function(){$('html,body').animate({scrollTop:$('#scroll__here').offset().top+'px'},300);},1);},'text');}function _getSection(sectionForm){var pieces=$();var target=sectionForm.parent();var nr=target.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];while(target.length>0&&!(target.hasClass('sectionedit'+nr)||target.find('.sectionedit'+nr).length)){target=target.prev();if(target.hasClass('section_highlight'))pieces=pieces.add(target.children());pieces=pieces.add(target);}return pieces;}function _focusEdit(){var $edit_text=$('#wiki__text');if($edit_text.length>0&&!$edit_text.attr('readOnly')){var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;try{DWsetSelection(sel);}catch(e){setTimeout(function(){try{DWsetSelection(sel);}catch(e){}},500);}$edit_text.focus();}}function _initEdit(){if(!window.doku_summaryCheck){window.doku_summaryCheck=window.summaryCheck;}dw_editor.init();dw_locktimer.init(JSINFO.fastwiki.locktime,JSINFO.fastwiki.usedraft);var $editform=$('#dw__editform');if($editform.length==0)return;var $edit_text=$('#wiki__text');$editform.on("change keydown",function(e){window.textChanged=true;doku_summaryCheck();});m_pageObjs.content=$edit_text.val();window.onbeforeunload=function(){if(window.textChanged&&m_pageObjs.content!=$edit_text.val())return LANG.notsavedyet;};window.onunload=deleteDraft;$('#edbtn__preview').click(function(e){if(JSINFO.fastwiki.preview){e.preventDefault();_preview(m_pageObjs.sectionForm);m_hasDraft=true;dw_locktimer.reset();}else{window.onbeforeunload='';textChanged=false;window.keepDraft=true;}});$('#edit__summary').on("change keyup",doku_summaryCheck);if(textChanged)doku_summaryCheck();initToolbar('tool__bar','wiki__text',toolbar);$('#tool__bar').attr('role','toolbar');$('#edbtn__save').click(function(e){textChanged=false;if(JSINFO.fastwiki.save&&m_origViewMode=='show'&&$edit_text.val().length>0&&m_pageObjs.content.length>0){e.preventDefault();load('save',null,_formToObj($('#dw__editform')));}else m_cache.remove(JSINFO.id);window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[draftdel]"]',$editform).click(function(e){e.preventDefault();var id=$editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});$('input[name="do[show]"]',$editform).click(function(e){e.preventDefault();load('show');});$('.picker.pk_hl').addClass('dokuwiki');}function _setBodyClass(action,target){for(var k in m_supportedActions)m_modeClassElt.removeClass('mode_'+k);m_modeClassElt.addClass('mode_'+action);if(target=='section')m_modeClassElt.removeClass('mode_edit').addClass('mode_show mode_secedit');$('.content_partial').toggle(m_viewMode!=m_origViewMode);$('.content_initial').toggle(m_viewMode==m_origViewMode||target=='section');}function _updatePageObjsOnSwitch(){if(m_pageObjs.showOnSwitch)m_pageObjs.showOnSwitch.show();delete m_pageObjs.showOnSwitch;delete m_pageObjs.content;delete m_pageObjs.sectionForm;var hasToc={show:1,admin:1};$("#dw__toc, #dw_toc_head, #dw_toc").css('display',m_viewMode in hasToc?'':'none');}function _formToObj(form){var obj={};$(form).serializeArray().map(function(item){obj[item.name]=item.value;});return obj;}function _urlToObj(url){var obj={};var a=url.replace(/.*\?/,'').split('&');for(var x=0;x<a.length;x++){var parts=unescape(a[x]).split('=');var name=parts.shift();obj[name]=parts.join('=');}return obj;}var m_actionEffects={subscribe:function(params,extraData){function subscribeAction(sparams){_sendPartial(sparams,_getVisibleContent(),function(data){load(m_origViewMode);var body=$('<div class="message_partial"></div>').append(data);$('.content_initial').before(body);},'text');}var form=$('#subscribe__form');$('input[name="do[subscribe]"]',form).click(function(e){e.preventDefault();subscribeAction(_formToObj(form));});$('.content_partial .unsubscribe').click(function(e){e.preventDefault();subscribeAction(_urlToObj(this.href));});},index:function(params,extraData){dw_index.$obj=$('#index__tree');dw_index.init();},edit:function(params,extraData){var draft=params['do']=='draft';if(m_hasDraft===true)draft=true;else if(m_hasDraft===false)draft=params.rev=null;if(extraData.sectionForm){m_pageObjs.sectionForm=extraData.sectionForm;extraData.sectionParts=extraData.sectionParts.add('.editbutton_section');m_pageObjs.showOnSwitch=extraData.sectionParts;m_pageObjs.showOnSwitch.hide();_initEdit();_focusEdit();}else _initEdit();setTimeout(function(){_focusEdit();if(document.body.scrollTop>0)$('html,body').animate({scrollTop:Math.max(0,Math.floor($('.content_partial').offset().top)-20)+'px'},300);},1);},revisions:function(params,extraData){$('.content_partial form').each(function(idx,form){$('input[name="do[diff]"]',form).click(function(e){e.preventDefault();load('diff',null,_formToObj(form));});});},save:function(params,extraData){if($('.content_partial #a_newer_version_exists').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});var editform=$('#dw__editform');$('input[name="do[save]"]',editform).click(function(e){e.preventDefault();load('save',null,_formToObj(editform));window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[cancel]"]',editform).click(function(e){e.preventDefault();var id=editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});}else if($('.content_partial #dw__editform').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});}else if($('.content_partial #preview').length>0){load('show');}else{$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));m_browserHistory.refreshPageTitle(false);load('show');dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}},show:function(params,extraData){$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}};m_actionEffects.draft=m_actionEffects.edit;m_actionEffects.diff=m_actionEffects.revisions;function _action(action,params,callback,insertLoc,extraData){params['do']=action;function cb(data){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);var body=$('<div class="content_partial"></div>').append(data);if(insertLoc&&action=='edit'){var newform=$('#dw__editform',body);if(newform.find('input[name=prefix]').val()=='.'&&newform.find('input[name=suffix]').val()==''){delete m_pageObjs.sectionForm;if(extraData)delete extraData.sectionForm;insertLoc=null;}}if(insertLoc)$(insertLoc[insertLoc.length-1]).after(body);else{var initial=$('.content_initial');body.addClass(initial[0].className.replace(/content_initial/,'')).attr('id',m_initialId);initial.attr('id','').after(body);}var newToc=$('.content_partial #dw__toc').addClass('fwJustincase');var hasNewToc=newToc.length>0;_updatePageObjsOnSwitch();if(callback)callback(data,extraData);if(m_actionEffects[action])m_actionEffects[action](params,extraData||{});newToc=$('.fwJustincase').removeClass('fwJustincase');if(m_viewMode=='show')$(window).trigger('fastwiki:updateToc',[newToc]);if(hasNewToc)dw_page.makeToggle('#dw__toc h3','#dw__toc > div');fixActionLinks($('.content_partial'));_setBodyClass(m_viewMode,m_pageObjs.sectionForm?"section":null);if(m_viewMode=='show')m_cache.add(JSINFO.id,data,true);if(!insertLoc)dw_behaviour.init();$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm,m_prevView]);if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}}if(action=='show'&&m_cache.get(JSINFO.id)){m_debug&&console.log("Getting from cache: "+JSINFO.id);cb(m_cache.get(JSINFO.id));}else _sendPartial(params,_getVisibleContent(),cb,'text');}function _sendPartial(params,spinnerParent,callback){if($('.partialsLoading').length==0){var spinnerCss=spinnerParent.height()+spinnerParent.offset().top>$(window).height()?{top:$(window).height()/2}:{top:'50%'};spinnerParent.append($('<div class="partialsLoading"></div>').css('display','none').css(spinnerCss));setTimeout(function(){$('.partialsLoading').css('display','');},500);}params.partial=1;jQuery[!params['do']||params['do']=='show'?'get':'post'](m_browserHistory.getBaseUrl(),params,function(data){if(data=='PERMISSION_CHANGE'){delete params.partial;delete params.fastwiki_compareid;var url=m_browserHistory.getBaseUrl()+'?'+$.param(params);document.location.href=url;}else callback(data);$('.partialsLoading').remove();},'text');}function _getVisibleContent(){var parentElt=$('.content_partial');if(parentElt.length==0)parentElt=$('.content_initial');return parentElt;}function load(page,sectionForm,params,force,callback){if((m_viewMode=='edit'||m_viewMode=='draft')&&(page!='save'&&page!='preview')&&m_pageObjs.content!=$('#wiki__text').val()){if(!confirm(LANG.notsavedyet))return;}m_prevView=m_viewMode;m_wasSecedit=m_isSecedit;m_isSecedit=!!sectionForm||(m_wasSecedit&&page=='save');m_viewMode=page;if(!params)params={};window.onbeforeunload='';dw_locktimer.clear();_updatePageObjsOnSwitch();if(page==m_origViewMode&&!force){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);if(m_prevView!=page){if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}_setBodyClass(page);$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm]);}if(callback)callback();}else if((page=='draft'||page=='edit')&&sectionForm){var sectionParts=_getSection(sectionForm);_action(page,params,callback,sectionParts,{sectionForm:sectionForm,sectionParts:sectionParts});}else _action(page,params,callback);}return{load:load,fixActionLinks:fixActionLinks};function CPageCache(maxSize,batchSize,debug){var m_queue=[];var m_p1Queue=[];var m_pages={},m_p1Ids={};var m_maxSize=maxSize;var m_batchSize=batchSize;var m_maxP1Size=10;if(debug){window.cpagecache_pages=m_pages;window.cpagecache_queue=m_queue;}this.add=function(id,data,p1){if(p1)_addPage(id,m_p1Queue,m_p1Ids,1,m_maxP1Size);_addPage(id,m_queue,m_pages,data,m_maxSize,m_p1Queue);};this.remove=function(id){if(id in m_pages){m_queue.splice(m_queue.indexOf(id),1);delete m_pages[id];var p1Idx=m_p1Queue.indexOf(id);if(p1Idx>=0){m_queue.splice(p1Idx,1);delete m_p1Ids[id];}}};this.get=function(id){if(id in m_pages){_pushToFront(id,m_queue);_pushToFront(id,m_p1Queue);return m_pages[id];}return null;};this.has=function(id){return id in m_pages;};this.load=function(elt,history){var self=this;var ids={};$('a',elt).each(function(idx,a){var href=a.getAttribute('href');if(href&&href.indexOf('://')<0){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){var pageinfo=history.getSwitchId(href);if(pageinfo&&!m_cache.has(pageinfo.id))ids[pageinfo.id]=1;}}});var idsA=[];for(var id in ids)idsA.push(id);if(idsA.length>m_maxSize){}else if(idsA.length>0){if(idsA.length>m_maxSize)idsA.length=m_maxSize;var batchSize=m_batchSize;if(idsA.length/batchSize<4)batchSize=Math.ceil(idsA.length/4);var requests=[];for(var x=0;x<Math.ceil(idsA.length/batchSize);x++){var sublist=idsA.slice(x*batchSize,(x+1)*batchSize);var params={partial:1};params['do']='fastwiki_preload';params.fastwiki_preload_pages=sublist.join(',');requests.push(params);}function doPost(params){m_debug&&console.log("Preloading "+params.fastwiki_preload_pages);$.post(DOKU_BASE+'doku.php',params,function(data){var pages=data.split(JSINFO.fastwiki.preload_head);for(var p=0;p<pages.length;p++){var line1End=pages[p].indexOf('\n');var id=pages[p].substr(0,line1End);pages[p]=pages[p].substr(line1End+1);m_debug&&console.log("Loaded "+[id,pages[p].length]);if(pages[p].indexOf('<body')>=0)m_debug&&console.log("ERROR: Body found!");else self.add(id,pages[p]);}if(requests.length>0)doPost(requests.shift());},'text');}for(var x=0;x<Math.min(4,requests.length);x++)doPost(requests.shift());}};function _pushToFront(id,queue){var idx=queue.indexOf(id);if(idx>=0){queue.splice(idx,1);queue.push(id);}}function _addPage(id,queue,hash,data,maxSize,exclude){if(id in hash)_pushToFront(id,queue);else if(data){if(queue.length>maxSize){if(exclude){for(var x=0;x<queue.length;x++){if(!exclude[queue[x]]){delete hash[queue[x]];queue.splice(x,1);}}}else delete hash[queue.shift()];}queue.push(id);}if(data)hash[id]=data;}}function CBrowserHistory(){var m_inPopState=false;var m_curBaseUrl=document.location.pathname;var m_prevTitle='__UNDEFINED__';var m_loadPageFunc=null;var self=this;function base(url,withId){if(withId){var id=url.replace(/.*id=([^&]+).*/,'$1');if(id.match(/^[a-zA-Z0-9_\-:]+$/))return url.replace(/\?.*/,'')+'?id='+id;}return url.replace(/\?.*/,'');}function _getWikiTitle(){var titleElt;$('h1, h2, h3, h4, h5, h6',$('.content_initial')).each(function(idx,elt){if(elt.className.indexOf('sectionedit')>=0){titleElt=elt;return false;}});return titleElt?$(titleElt).text():'';}this.init=function(loadFunc){m_prevTitle=_getWikiTitle()||'__UNDEFINED__';m_loadPageFunc=loadFunc;window.addEventListener('popstate',function(e){document.title=e.state.title;m_inPopState=true;self.switchBasePath(e.state.url);});};this.getSwitchId=function(newpage,force){var pageid=newpage.substr(1).replace(/.*doku.php(\?id=|\/)/,'').replace(/\//g,':');var ns=pageid.replace(/:[^:]+$/,'');if(!force){if(JSINFO.fastwiki.fastshow_same_ns&&ns!=JSINFO.namespace)return false;var incl=JSINFO.fastwiki.fastshow_include,excl=JSINFO.fastwiki.fastshow_exclude;if(incl&&!pageid.match('^('+incl.split(/\s*,\s*/).join('|')+')'))return false;if(excl&&pageid.match('^('+excl.split(/\s*,\s*/).join('|')+')'))return false;}return{id:pageid,ns:ns};};this.getSelfRefRegex=function(){var path=document.location.pathname;var idPath=JSINFO.id.replace(/:/g,'/');if(path.indexOf('doku.php')>=0)return new RegExp('doku\\.php\\?id='+JSINFO.id+'$|doku\\.php/'+idPath+'$');return new RegExp('^'+path+'$|://'+document.location.host+path+'$');};this.getBaseUrl=function(){return m_curBaseUrl;};this.switchBasePath=function(newpage){var pageinfo=this.getSwitchId(newpage);if(!pageinfo)return false;var oldid=JSINFO.id;JSINFO.id=pageinfo.id;JSINFO.namespace=pageinfo.ns;$('form').each(function(idx,form){if($(form).find('input[name="do"]').length>0){var input=$('input[name="id"]',form);if(input.val()==oldid)input.val(pageinfo.id);}});m_curBaseUrl=base(newpage);var prevpage=document.location.href;m_loadPageFunc('show',null,{fastwiki_compareid:oldid},true,function(){setTimeout(function(){if(!m_inPopState){history.replaceState({url:prevpage,title:document.title},"",prevpage);history.pushState({url:newpage,title:document.title},"",newpage);$(window).trigger('fastwiki:afterIdChange',[prevpage,m_curBaseUrl]);}m_inPopState=false;self.refreshPageTitle(true);},1);});return true;};this.refreshPageTitle=function(fromIdSwitch){var title=_getWikiTitle();document.title=title;if(!fromIdSwitch){$('a').each(function(idx,elt){var $this=$(this);var href=$this.attr('href');if(href&&href.match(self.getSelfRefRegex())&&$this.text()==m_prevTitle)$this.text(document.title);});}m_prevTitle=title;};}})(jQuery);if(!window.tpl_fastwiki_support){(function($){var m_showRow,m_editRow;var m_utils={makeShowLink:function(url){url=url.replace(/\?do=.*$/,'');return'<a href="'+url+'" class="action show" accesskey="v" rel="nofollow" title="'+JSINFO.fastwiki.text_btn_show+' [V]"><span>'+JSINFO.fastwiki.text_btn_show+'</span></a>';},makeShowRowLI:function(pagetools,mode){var showLink=$("a[href $= 'do=']",pagetools);if(showLink.length>0)m_showRow=$(showLink.parents('li')[0]);else{var link=$("a[href *= 'do=']",pagetools)[0];if(link){m_showRow=$('<li>'+m_utils.makeShowLink(link.href)+'</li>').toggle(mode!='show');pagetools.prepend(m_showRow);}}},fixButtons:function(showParent,allButtons,mode){var showBtn=$('.button.btn_show',showParent);if(showBtn.length==0){var url=$('form.button',allButtons)[0].action;showBtnHtml='<form class="button btn_show" method="get" action="'+url+'"><div class="no"><input type="hidden" name="do" value=""><input type="submit" value="'+JSINFO.fastwiki.text_btn_show+'" class="button" accesskey="v" title="'+JSINFO.fastwiki.text_btn_show+' [V]"></div></form>';showParent.each(function(idx,elt){var newBtn=$(showBtnHtml);showBtn=showBtn.add(newBtn);$(elt).prepend(newBtn.toggle(mode!='show'));});}var editBtn=$('.button.btn_edit',allButtons);if(editBtn.length>0)m_editRow=m_editRow?m_editRow.add(editBtn):editBtn;m_showRow=m_showRow?m_showRow.add(showBtn):showBtn;}};if($('#dokuwiki__pagetools').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){m_utils.makeShowRowLI($("#dokuwiki__pagetools ul"),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$("#dokuwiki__top").toggleClass("showSidebar hasSidebar",mode=='show');$("#dokuwiki__aside").css('display',mode=='show'?'':'none');m_showRow.toggle(mode!='show');}});}else if(JSINFO.fastwiki.templatename=='arctic'){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var buttonBars=$('#bar__bottom, #bar__top');if($('.button',buttonBars).length>0)m_utils.fixButtons($('.bar-left'),buttonBars,mode);else{var pagetools=$('.bar-left');m_editRow=$("a[href *= 'do=edit']",pagetools);m_showRow=$("a[href $= 'do=']",pagetools[0]);if(m_showRow.length==0){var url=$("a[href *= 'do=']")[0].href;m_showRow=$();pagetools.each(function(idx,elt){var show=$(m_utils.makeShowLink(url)).toggle(mode!='show');m_showRow=m_showRow.add(show);$(elt).prepend(show);});}}},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');$(".left_sidebar, .right_sidebar").css('display',mode=='show'?'':'none');}});}else if($('ul.nav.navbar-nav').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var pagetools=$("ul.nav.navbar-nav");m_utils.makeShowRowLI(pagetools,mode);m_editRow=$($('li',pagetools)[0]);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');},'fastwiki:updateToc':function(e,tocObj){$('#dw_toc').remove();if(tocObj.length>0)$('.content_initial').prepend($('<div id="dw_toc"></div>').append(tocObj.html()));tocObj.remove();}});}else if($('.stylehead .bar_top .bar_top_content').length>0){$(window).on({'fastwiki:init':function(e,mode){var toolbox=$(".sidebar_content .li_toolbox ul");m_utils.makeShowRowLI(toolbox,mode);m_editRow=$('.action.edit',toolbox).parent();m_utils.fixButtons($('.bar_bottom_content .bar-right'),$('.bar_bottom_content .bar-right'),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$(".right_sidebar, .left_sidebar").css('display',mode=='edit'?'none':'');m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');if(mode=='edit'||mode=='draft'){$('.page_720').css({border:0,textAlign:'inherit'});$('.left_page, .right_page').css({float:'none',width:'auto'});}else{$('.page_720').css({border:'',textAlign:''});$('.left_page, .right_page').css({float:'',width:''});}}});}})(jQuery);}if(window.installPluginHiddenJS){jQuery(window).on('fastwiki:afterSwitch',function(evt,viewMode,isSectionEdit,prevViewMode){jQuery(".hiddenActive, .hiddenSwitch").each(function(){jQuery(this).off('click');});if(viewMode=="show")installPluginHiddenJS();});}jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery('<div id="plugin__styling_loader">'+LANG.plugins.styling.loader+'</div>');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('<button>'+LANG.plugins.styling.popup+'</button>');$form.prepend($btn);$btn.on('click',function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('<p></p>');return;}window.onunload=function(e){if(doreload){DokuCookie.setValue('styling_plugin',0);if(window.opener)window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});if(window.opener)applyPreview(window.opener);DokuCookie.setValue('styling_plugin',1);});jQuery(function(){var $frm=jQuery('#translation__dropdown');if(!$frm.length)return;$frm.find('input[name=go]').hide();$frm.find('select[name=id]').change(function(){var id=jQuery(this).val();var action=$frm.attr('action');if(action.substr(action.length-1)=='/'){var link=action+id;}else{var link=action+'?id='+id;}window.location.href=link;});});jQuery(function(){jQuery('#usrmgr__del').on('click',function(){return confirm(LANG.del_confirm);});});jQuery(function(){dw_locktimer.init(840,1);});
diff --git a/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js.gz b/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js.gz
new file mode 100644
index 0000000..5d44f67
--- /dev/null
+++ b/data/cache/3/397ac8fa2a9e46923a59933fc964184d.js.gz
Binary files differ
diff --git a/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js b/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js
new file mode 100644
index 0000000..3f100fa
--- /dev/null
+++ b/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Alternar herramientas de b\u00fasqueda","willexpire":"El bloqueo para la edici\u00f3n de esta p\u00e1gina expira en un minuto.\\nPAra prevenir conflictos uso el bot\u00f3n Previsualizar para restaurar el contador de bloqueo.","notsavedyet":"Los cambios que no se han guardado se perder\u00e1n.\n\u00bfRealmente quieres continuar?","searchmedia":"Buscar archivos","keepopen":"Mantener la ventana abierta luego de seleccionar","hidedetails":"Ocultar detalles","mediatitle":"Configuraci\u00f3n del v\u00ednculo","mediadisplay":"Tipo de v\u00ednculo","mediaalign":"Alineaci\u00f3n","mediasize":"Tama\u00f1o de la imagen","mediatarget":"Destino del v\u00ednculo","mediaclose":"Cerrar","mediainsert":"Insertar","mediadisplayimg":"Mostrar la imagen.","mediadisplaylnk":"Mostrar solo el v\u00ednculo.","mediasmall":"Versi\u00f3n en tama\u00f1o peque\u00f1o","mediamedium":"Versi\u00f3n en tama\u00f1o medio","medialarge":"Versi\u00f3n en tama\u00f1o grande","mediaoriginal":"Versi\u00f3n original","medialnk":"V\u00ednculo a la pagina de descripci\u00f3n","mediadirect":"V\u00ednculo al original","medianolnk":"Sin v\u00ednculo","medianolink":"No vincular la imagen","medialeft":"Alinear imagen a la izquierda","mediaright":"Alinear imagen a la derecha.","mediacenter":"Alinear imagen en el centro.","medianoalign":"No use alineaci\u00f3n.","nosmblinks":"El enlace a recursos compartidos de Windows s\u00f3lo funciona en Microsoft Internet Explorer.\nLo que s\u00ed puedes hacer es copiar y pegar el enlace.","linkwiz":"Asistente de enlaces","linkto":"Enlazar a:","del_confirm":"\u00bfQuieres realmente borrar lo seleccionado?","restore_confirm":"\u00bfEst\u00e1s seguro de querer restaurar esta versi\u00f3n?","media_diff":"Ver diferencias:","media_diff_both":"Lado por lado","media_diff_opacity":"A trav\u00e9s de Shine","media_diff_portions":"Pasar","media_select":"Seleccionar ficheros","media_upload_btn":"Cargar","media_done_btn":"Hecho","media_drop":"Arrastra los ficheros aqu\u00ed para cargar","media_cancel":"Eliminar","media_overwrt":"Sobreescribir ficheros exitentes","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Negrita","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"It\u00e1lica","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Subrayado","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"C\u00f3digo","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Tachado","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"T\u00edtulo del mismo nivel","icon":"hequal.png","key":"8","text":"T\u00edtulo","mod":0,"block":true},{"type":"autohead","title":"T\u00edtulo bajo","icon":"hminus.png","key":"9","text":"T\u00edtulo","mod":1,"block":true},{"type":"autohead","title":"T\u00edtulo alto","icon":"hplus.png","key":"0","text":"T\u00edtulo","mod":-1,"block":true},{"type":"picker","title":"Selecciona el t\u00edtulo","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"T\u00edtulo 1","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"T\u00edtulo 2","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"T\u00edtulo 3","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"T\u00edtulo 4","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"T\u00edtulo 5","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Enlace interno","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"Enlace externo","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|Enlace externo","block":false},{"type":"formatln","title":"\u00cdtem de lista ordenada","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"\u00cdtem de lista desordenada","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"L\u00ednea horizontal","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"A\u00f1adir Im\u00e1genes u otros ficheros","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Sonrisas","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Caracteres especiales","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insertar firma","icon":"sig.png","key":"y","block":false}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));(function(factory){if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory);}else{factory(jQuery.datepicker);}}(function(datepicker){datepicker.regional.es={closeText:"Cerrar",prevText:"&#x3C;Ant",nextText:"Sig&#x3E;",currentText:"Hoy",monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","jue","vie","sáb"],dayNamesMin:["D","L","M","X","J","V","S"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.es);return datepicker.regional.es;}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);jQuery(function(){jQuery('form.bureaucracy__plugin').each(function(){function updateFieldset(input){jQuery.each(jQuery(input).data('dparray'),function(i,dp){var showOrHide=input.parentNode.parentNode.style.display!=='none'&&((input.checked===dp.tval)||(input.type!=='checkbox'&&(dp.tval===true&&input.value!==''))||input.value===dp.tval);dp.fset.toggle(showOrHide);dp.fset.find('input,select').each(function(){var $inputelem=jQuery(this);if($inputelem.hasClass('required')){if(showOrHide){$inputelem.attr('required','required');}else{$inputelem.removeAttr('required')}}if($inputelem.data('dparray')){$inputelem.change();}});});}jQuery('p.bureaucracy_depends',this).each(function(){var fname=jQuery(this).find('span.bureaucracy_depends_fname').html(),fvalue=jQuery(this).find('span.bureaucracy_depends_fvalue');fvalue=(fvalue.length?fvalue.html():true);var fieldsetinfo={fset:jQuery(this).parent(),tval:fvalue};jQuery("label").has(":first-child:contains('"+fname+"')").first().find("select,input:last").each(function(){if(!jQuery(this).data('dparray')){jQuery(this).data('dparray',[fieldsetinfo]);}else{jQuery(this).data('dparray').push(fieldsetinfo);}}).bind('change keyup',function(){updateFieldset(this);}).change();}).hide();});});jQuery(function(){function ajaxsource(request,response,getterm){jQuery.getJSON(DOKU_BASE+'lib/exe/ajax.php',{call:'bureaucracy_user_field',search:getterm(request)},function(data){response(jQuery.map(data,function(name,user){return{label:name+' ('+user+')',value:user}}))});}function split(val){return val.split(/,\s*/);}function extractLast(term){return split(term).pop();}jQuery(".userpicker").autocomplete({source:function(request,response){ajaxsource(request,response,function(req){return req.term})}});jQuery(".userspicker").bind("keydown",function(event){if(event.keyCode===jQuery.ui.keyCode.TAB&&jQuery(this).data("ui-autocomplete").menu.active){event.preventDefault();}}).autocomplete({minLength:0,source:function(request,response){ajaxsource(request,response,function(req){return extractLast(req.term)})},search:function(){var term=extractLast(this.value);return term.length>=2;},focus:function(){return false;},select:function(event,ui){var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");return false;}});});jQuery(function(){jQuery('.bureaucracy__plugin .datepicker').datepicker({dateFormat:"yy-mm-dd",changeMonth:true,changeYear:true});});(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_text=function(){return $('<div/>').text($.trim(this.search_field.val())).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');no_results_html.find("span").first().html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}return this.pending_backstroke=null;};Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;stroke=(_ref1=evt.which)!=null?_ref1:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}switch(stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}break;case 32:if(this.disable_search){evt.preventDefault();}break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){h=0;w=0;style_block="position:absolute; left: -1000px; top: -1000px; display:none;";styles=['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'];for(_i=0,_len=styles.length;_i<_len;_i++){style=styles[_i];style_block+=style+":"+this.search_field.css(style)+";";}div=$('<div />',{'style':style_block});div.text(this.search_field.val());$('body').append(div);w=div.width()+25;div.remove();f_width=this.container.outerWidth();if(w>f_width-10){w=f_width-10;}return this.search_field.css({'width':w+'px'});}};return Chosen;})(AbstractChosen);}).call(this);(function(){'use strict';jQuery(function(){var $animalSelect=jQuery('select.farmer_chosen_animals');$animalSelect.chosen({width:'100%',search_contains:true,allow_single_deselect:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});jQuery('select.acl_chosen').chosen({disable_search:true,width:'100%'});var $formAllAnimals=jQuery('#farmer__pluginsforall');$formAllAnimals.find('select').change(function(){$formAllAnimals.find('button').prop('disabled',false);}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.pluginSelect});var $formSingleAnimal=jQuery('#farmer__pluginsforone');$formSingleAnimal.find('select').change(function(){var animal=jQuery(this).val();$formSingleAnimal.find('button').prop('disabled',true);jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPlugins_'+animal},function(data){$formSingleAnimal.find('div.output').html(data);$formSingleAnimal.find('button').prop('disabled',false);},'html')}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});var $formPluginMatrix=jQuery('#farmer__pluginmatrix').hide();$formPluginMatrix.on('click','td',function(){var $td=jQuery(this);$td.html('⌛').css('background-color','transparent');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_modPlugin',plugin:$td.data('plugin'),ani:$td.data('animal')},function(data){$td.replaceWith(data);},'html');});function showMatrix(){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPluginMatrix'},function(data){$formPluginMatrix.html(data);$formPluginMatrix.show();},'html')}$animalSelect.on('chosen:showing_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'20em'},400);}).on('chosen:hiding_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'7px'},400);});var $aclPolicyFieldset=jQuery('#aclPolicyFieldset');if($aclPolicyFieldset.length){$animalSelect.on('change',function(evt,params){var $this=jQuery(this);if($this.val()===''){$aclPolicyFieldset.slideDown();}else{$aclPolicyFieldset.slideUp();}});}jQuery("input[name=bulkSingleSwitch]:radio").change(function(){if(jQuery('#farmer__bulk').prop("checked")){$formAllAnimals.show();$formSingleAnimal.hide();$formPluginMatrix.hide();}else if(jQuery('#farmer__single').prop("checked")){$formAllAnimals.hide();$formSingleAnimal.show();$formPluginMatrix.hide();}else{$formAllAnimals.hide();$formSingleAnimal.hide();showMatrix();}});jQuery('#farmer__bulk').click();});})();var plugin_fastwiki=(function($){var m_viewMode,m_origViewMode,m_prevView;var m_isSecedit,m_wasSecedit;var m_hasDraft;var m_pageObjs={};var m_content;var m_initialId;var m_debug=document.location.host=='localhost';var m_cache=new CPageCache(JSINFO.fastwiki.preload_per_page,JSINFO.fastwiki.preload_batchsize,m_debug);var m_supportedActions={'':1,edit:1,draft:1,history:1,recent:1,revisions:1,show:1,subscribe:1,backlink:1,index:1,profile:1,media:1,diff:1,save:1};var m_modeClassElt;var m_browserHistory=new CBrowserHistory();$(function(){if(document.location.href.indexOf("detail.php")>=0)m_viewMode='unsupported';else{var urlParams=_urlToObj(document.location.href);m_viewMode=urlParams['do']||'show';if(!m_supportedActions[m_viewMode])m_viewMode='unsupported';else if(window.tpl_fastwiki_startmode_support&&!(m_viewMode in tpl_fastwiki_startmode_support))m_viewMode='unsupported';}m_origViewMode=m_viewMode;m_content=$('.plugin_fastwiki_marker').parent();m_content.addClass('content_initial');m_initialId=m_content.attr('id');m_modeClassElt=m_content.hasClass('dokuwiki')?m_content:$(m_content.parents('.dokuwiki')[0]||document.body);$(window).trigger('fastwiki:init',[m_viewMode]);if(JSINFO.fastwiki.fastpages)fixActionLinks(document.body);if(JSINFO.fastwiki.fastshow&&(m_origViewMode!='show'||!window.history||!history.pushState))JSINFO.fastwiki.fastshow=false;if(JSINFO.fastwiki.fastshow)m_browserHistory.init(load);});function fixActionLinks(elt){if(m_origViewMode=='unsupported')return;var formActions={search:1};var supportedFields={'do':1,rev:1,id:1};$('a[href *= "?do="]',elt).click(function(e){var curPathId=JSINFO.id.replace(/:/g,'/');var aPathId=this.href.replace(/\?.*$/,'').replace(/:/g,'/');if(aPathId.substr(-curPathId.length)==curPathId){var params=_urlToObj(this.href);if(!params['do'])params['do']='show';if(params['do']in m_supportedActions){e.preventDefault();load(params['do'],null,params);}}});$('input[type="submit"], input[type="button"], button',elt).click(function(e){var form=$(this).parents('form');if(form.length>0&&form[0]['do']&&form[0]['do'].value in m_supportedActions){var supported=true;$('input[type != "submit"]',form).each(function(idx,elt){if(elt.type!='button'&&(elt.type!='hidden'||!(elt.name in supportedFields)))supported=false;});if(supported){e.preventDefault();var params=_formToObj(form[0]);if(!params['do'])params['do']='show';load(params['do'],null,params);}}});if(m_origViewMode=='show'&&window.JSINFO){var pathId=JSINFO.id.replace(/:/g,'/');$('a',elt).click(function(e){var href=this.getAttribute('href');if(href&&href.indexOf('://')<0){if(href.match(m_browserHistory.getSelfRefRegex())){load('show');e.preventDefault();}else if(JSINFO.fastwiki.fastshow){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){if(m_browserHistory.switchBasePath(href)){m_viewMode=null;e.preventDefault();}}}}});}if(JSINFO.fastwiki.secedit){$('.editbutton_section .btn_secedit input[type=submit], .editbutton_section .btn_secedit button',elt).click(function(e){e.preventDefault();var form=$(this).parents('form');load('edit',form,_formToObj(form));});}if(JSINFO.fastwiki.preload)m_cache.load(elt,m_browserHistory);}function _preview(sectionForm){var body=$(document.body);var params=_formToObj($('#dw__editform'));params['do']='preview';_sendPartial(params,$('.dokuwiki .editBox'),function(data){var preview=$('<div id="preview_container">'+data+'</div>');var pvEditor=preview.find('#dw__editform');var editor=$('#dw__editform')[0];pvEditor.find('input[type=hidden]').each(function(idx,elt){editor[elt.name].value=elt.value;});preview.find('#scroll__here').prevAll().remove();var oldpreview=$('#preview_container');if(oldpreview.length>0)oldpreview.replaceWith(preview);else $('.content_partial').append(preview);setTimeout(function(){$('html,body').animate({scrollTop:$('#scroll__here').offset().top+'px'},300);},1);},'text');}function _getSection(sectionForm){var pieces=$();var target=sectionForm.parent();var nr=target.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];while(target.length>0&&!(target.hasClass('sectionedit'+nr)||target.find('.sectionedit'+nr).length)){target=target.prev();if(target.hasClass('section_highlight'))pieces=pieces.add(target.children());pieces=pieces.add(target);}return pieces;}function _focusEdit(){var $edit_text=$('#wiki__text');if($edit_text.length>0&&!$edit_text.attr('readOnly')){var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;try{DWsetSelection(sel);}catch(e){setTimeout(function(){try{DWsetSelection(sel);}catch(e){}},500);}$edit_text.focus();}}function _initEdit(){if(!window.doku_summaryCheck){window.doku_summaryCheck=window.summaryCheck;}dw_editor.init();dw_locktimer.init(JSINFO.fastwiki.locktime,JSINFO.fastwiki.usedraft);var $editform=$('#dw__editform');if($editform.length==0)return;var $edit_text=$('#wiki__text');$editform.on("change keydown",function(e){window.textChanged=true;doku_summaryCheck();});m_pageObjs.content=$edit_text.val();window.onbeforeunload=function(){if(window.textChanged&&m_pageObjs.content!=$edit_text.val())return LANG.notsavedyet;};window.onunload=deleteDraft;$('#edbtn__preview').click(function(e){if(JSINFO.fastwiki.preview){e.preventDefault();_preview(m_pageObjs.sectionForm);m_hasDraft=true;dw_locktimer.reset();}else{window.onbeforeunload='';textChanged=false;window.keepDraft=true;}});$('#edit__summary').on("change keyup",doku_summaryCheck);if(textChanged)doku_summaryCheck();initToolbar('tool__bar','wiki__text',toolbar);$('#tool__bar').attr('role','toolbar');$('#edbtn__save').click(function(e){textChanged=false;if(JSINFO.fastwiki.save&&m_origViewMode=='show'&&$edit_text.val().length>0&&m_pageObjs.content.length>0){e.preventDefault();load('save',null,_formToObj($('#dw__editform')));}else m_cache.remove(JSINFO.id);window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[draftdel]"]',$editform).click(function(e){e.preventDefault();var id=$editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});$('input[name="do[show]"]',$editform).click(function(e){e.preventDefault();load('show');});$('.picker.pk_hl').addClass('dokuwiki');}function _setBodyClass(action,target){for(var k in m_supportedActions)m_modeClassElt.removeClass('mode_'+k);m_modeClassElt.addClass('mode_'+action);if(target=='section')m_modeClassElt.removeClass('mode_edit').addClass('mode_show mode_secedit');$('.content_partial').toggle(m_viewMode!=m_origViewMode);$('.content_initial').toggle(m_viewMode==m_origViewMode||target=='section');}function _updatePageObjsOnSwitch(){if(m_pageObjs.showOnSwitch)m_pageObjs.showOnSwitch.show();delete m_pageObjs.showOnSwitch;delete m_pageObjs.content;delete m_pageObjs.sectionForm;var hasToc={show:1,admin:1};$("#dw__toc, #dw_toc_head, #dw_toc").css('display',m_viewMode in hasToc?'':'none');}function _formToObj(form){var obj={};$(form).serializeArray().map(function(item){obj[item.name]=item.value;});return obj;}function _urlToObj(url){var obj={};var a=url.replace(/.*\?/,'').split('&');for(var x=0;x<a.length;x++){var parts=unescape(a[x]).split('=');var name=parts.shift();obj[name]=parts.join('=');}return obj;}var m_actionEffects={subscribe:function(params,extraData){function subscribeAction(sparams){_sendPartial(sparams,_getVisibleContent(),function(data){load(m_origViewMode);var body=$('<div class="message_partial"></div>').append(data);$('.content_initial').before(body);},'text');}var form=$('#subscribe__form');$('input[name="do[subscribe]"]',form).click(function(e){e.preventDefault();subscribeAction(_formToObj(form));});$('.content_partial .unsubscribe').click(function(e){e.preventDefault();subscribeAction(_urlToObj(this.href));});},index:function(params,extraData){dw_index.$obj=$('#index__tree');dw_index.init();},edit:function(params,extraData){var draft=params['do']=='draft';if(m_hasDraft===true)draft=true;else if(m_hasDraft===false)draft=params.rev=null;if(extraData.sectionForm){m_pageObjs.sectionForm=extraData.sectionForm;extraData.sectionParts=extraData.sectionParts.add('.editbutton_section');m_pageObjs.showOnSwitch=extraData.sectionParts;m_pageObjs.showOnSwitch.hide();_initEdit();_focusEdit();}else _initEdit();setTimeout(function(){_focusEdit();if(document.body.scrollTop>0)$('html,body').animate({scrollTop:Math.max(0,Math.floor($('.content_partial').offset().top)-20)+'px'},300);},1);},revisions:function(params,extraData){$('.content_partial form').each(function(idx,form){$('input[name="do[diff]"]',form).click(function(e){e.preventDefault();load('diff',null,_formToObj(form));});});},save:function(params,extraData){if($('.content_partial #a_newer_version_exists').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});var editform=$('#dw__editform');$('input[name="do[save]"]',editform).click(function(e){e.preventDefault();load('save',null,_formToObj(editform));window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[cancel]"]',editform).click(function(e){e.preventDefault();var id=editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});}else if($('.content_partial #dw__editform').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});}else if($('.content_partial #preview').length>0){load('show');}else{$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));m_browserHistory.refreshPageTitle(false);load('show');dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}},show:function(params,extraData){$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}};m_actionEffects.draft=m_actionEffects.edit;m_actionEffects.diff=m_actionEffects.revisions;function _action(action,params,callback,insertLoc,extraData){params['do']=action;function cb(data){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);var body=$('<div class="content_partial"></div>').append(data);if(insertLoc&&action=='edit'){var newform=$('#dw__editform',body);if(newform.find('input[name=prefix]').val()=='.'&&newform.find('input[name=suffix]').val()==''){delete m_pageObjs.sectionForm;if(extraData)delete extraData.sectionForm;insertLoc=null;}}if(insertLoc)$(insertLoc[insertLoc.length-1]).after(body);else{var initial=$('.content_initial');body.addClass(initial[0].className.replace(/content_initial/,'')).attr('id',m_initialId);initial.attr('id','').after(body);}var newToc=$('.content_partial #dw__toc').addClass('fwJustincase');var hasNewToc=newToc.length>0;_updatePageObjsOnSwitch();if(callback)callback(data,extraData);if(m_actionEffects[action])m_actionEffects[action](params,extraData||{});newToc=$('.fwJustincase').removeClass('fwJustincase');if(m_viewMode=='show')$(window).trigger('fastwiki:updateToc',[newToc]);if(hasNewToc)dw_page.makeToggle('#dw__toc h3','#dw__toc > div');fixActionLinks($('.content_partial'));_setBodyClass(m_viewMode,m_pageObjs.sectionForm?"section":null);if(m_viewMode=='show')m_cache.add(JSINFO.id,data,true);if(!insertLoc)dw_behaviour.init();$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm,m_prevView]);if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}}if(action=='show'&&m_cache.get(JSINFO.id)){m_debug&&console.log("Getting from cache: "+JSINFO.id);cb(m_cache.get(JSINFO.id));}else _sendPartial(params,_getVisibleContent(),cb,'text');}function _sendPartial(params,spinnerParent,callback){if($('.partialsLoading').length==0){var spinnerCss=spinnerParent.height()+spinnerParent.offset().top>$(window).height()?{top:$(window).height()/2}:{top:'50%'};spinnerParent.append($('<div class="partialsLoading"></div>').css('display','none').css(spinnerCss));setTimeout(function(){$('.partialsLoading').css('display','');},500);}params.partial=1;jQuery[!params['do']||params['do']=='show'?'get':'post'](m_browserHistory.getBaseUrl(),params,function(data){if(data=='PERMISSION_CHANGE'){delete params.partial;delete params.fastwiki_compareid;var url=m_browserHistory.getBaseUrl()+'?'+$.param(params);document.location.href=url;}else callback(data);$('.partialsLoading').remove();},'text');}function _getVisibleContent(){var parentElt=$('.content_partial');if(parentElt.length==0)parentElt=$('.content_initial');return parentElt;}function load(page,sectionForm,params,force,callback){if((m_viewMode=='edit'||m_viewMode=='draft')&&(page!='save'&&page!='preview')&&m_pageObjs.content!=$('#wiki__text').val()){if(!confirm(LANG.notsavedyet))return;}m_prevView=m_viewMode;m_wasSecedit=m_isSecedit;m_isSecedit=!!sectionForm||(m_wasSecedit&&page=='save');m_viewMode=page;if(!params)params={};window.onbeforeunload='';dw_locktimer.clear();_updatePageObjsOnSwitch();if(page==m_origViewMode&&!force){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);if(m_prevView!=page){if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}_setBodyClass(page);$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm]);}if(callback)callback();}else if((page=='draft'||page=='edit')&&sectionForm){var sectionParts=_getSection(sectionForm);_action(page,params,callback,sectionParts,{sectionForm:sectionForm,sectionParts:sectionParts});}else _action(page,params,callback);}return{load:load,fixActionLinks:fixActionLinks};function CPageCache(maxSize,batchSize,debug){var m_queue=[];var m_p1Queue=[];var m_pages={},m_p1Ids={};var m_maxSize=maxSize;var m_batchSize=batchSize;var m_maxP1Size=10;if(debug){window.cpagecache_pages=m_pages;window.cpagecache_queue=m_queue;}this.add=function(id,data,p1){if(p1)_addPage(id,m_p1Queue,m_p1Ids,1,m_maxP1Size);_addPage(id,m_queue,m_pages,data,m_maxSize,m_p1Queue);};this.remove=function(id){if(id in m_pages){m_queue.splice(m_queue.indexOf(id),1);delete m_pages[id];var p1Idx=m_p1Queue.indexOf(id);if(p1Idx>=0){m_queue.splice(p1Idx,1);delete m_p1Ids[id];}}};this.get=function(id){if(id in m_pages){_pushToFront(id,m_queue);_pushToFront(id,m_p1Queue);return m_pages[id];}return null;};this.has=function(id){return id in m_pages;};this.load=function(elt,history){var self=this;var ids={};$('a',elt).each(function(idx,a){var href=a.getAttribute('href');if(href&&href.indexOf('://')<0){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){var pageinfo=history.getSwitchId(href);if(pageinfo&&!m_cache.has(pageinfo.id))ids[pageinfo.id]=1;}}});var idsA=[];for(var id in ids)idsA.push(id);if(idsA.length>m_maxSize){}else if(idsA.length>0){if(idsA.length>m_maxSize)idsA.length=m_maxSize;var batchSize=m_batchSize;if(idsA.length/batchSize<4)batchSize=Math.ceil(idsA.length/4);var requests=[];for(var x=0;x<Math.ceil(idsA.length/batchSize);x++){var sublist=idsA.slice(x*batchSize,(x+1)*batchSize);var params={partial:1};params['do']='fastwiki_preload';params.fastwiki_preload_pages=sublist.join(',');requests.push(params);}function doPost(params){m_debug&&console.log("Preloading "+params.fastwiki_preload_pages);$.post(DOKU_BASE+'doku.php',params,function(data){var pages=data.split(JSINFO.fastwiki.preload_head);for(var p=0;p<pages.length;p++){var line1End=pages[p].indexOf('\n');var id=pages[p].substr(0,line1End);pages[p]=pages[p].substr(line1End+1);m_debug&&console.log("Loaded "+[id,pages[p].length]);if(pages[p].indexOf('<body')>=0)m_debug&&console.log("ERROR: Body found!");else self.add(id,pages[p]);}if(requests.length>0)doPost(requests.shift());},'text');}for(var x=0;x<Math.min(4,requests.length);x++)doPost(requests.shift());}};function _pushToFront(id,queue){var idx=queue.indexOf(id);if(idx>=0){queue.splice(idx,1);queue.push(id);}}function _addPage(id,queue,hash,data,maxSize,exclude){if(id in hash)_pushToFront(id,queue);else if(data){if(queue.length>maxSize){if(exclude){for(var x=0;x<queue.length;x++){if(!exclude[queue[x]]){delete hash[queue[x]];queue.splice(x,1);}}}else delete hash[queue.shift()];}queue.push(id);}if(data)hash[id]=data;}}function CBrowserHistory(){var m_inPopState=false;var m_curBaseUrl=document.location.pathname;var m_prevTitle='__UNDEFINED__';var m_loadPageFunc=null;var self=this;function base(url,withId){if(withId){var id=url.replace(/.*id=([^&]+).*/,'$1');if(id.match(/^[a-zA-Z0-9_\-:]+$/))return url.replace(/\?.*/,'')+'?id='+id;}return url.replace(/\?.*/,'');}function _getWikiTitle(){var titleElt;$('h1, h2, h3, h4, h5, h6',$('.content_initial')).each(function(idx,elt){if(elt.className.indexOf('sectionedit')>=0){titleElt=elt;return false;}});return titleElt?$(titleElt).text():'';}this.init=function(loadFunc){m_prevTitle=_getWikiTitle()||'__UNDEFINED__';m_loadPageFunc=loadFunc;window.addEventListener('popstate',function(e){document.title=e.state.title;m_inPopState=true;self.switchBasePath(e.state.url);});};this.getSwitchId=function(newpage,force){var pageid=newpage.substr(1).replace(/.*doku.php(\?id=|\/)/,'').replace(/\//g,':');var ns=pageid.replace(/:[^:]+$/,'');if(!force){if(JSINFO.fastwiki.fastshow_same_ns&&ns!=JSINFO.namespace)return false;var incl=JSINFO.fastwiki.fastshow_include,excl=JSINFO.fastwiki.fastshow_exclude;if(incl&&!pageid.match('^('+incl.split(/\s*,\s*/).join('|')+')'))return false;if(excl&&pageid.match('^('+excl.split(/\s*,\s*/).join('|')+')'))return false;}return{id:pageid,ns:ns};};this.getSelfRefRegex=function(){var path=document.location.pathname;var idPath=JSINFO.id.replace(/:/g,'/');if(path.indexOf('doku.php')>=0)return new RegExp('doku\\.php\\?id='+JSINFO.id+'$|doku\\.php/'+idPath+'$');return new RegExp('^'+path+'$|://'+document.location.host+path+'$');};this.getBaseUrl=function(){return m_curBaseUrl;};this.switchBasePath=function(newpage){var pageinfo=this.getSwitchId(newpage);if(!pageinfo)return false;var oldid=JSINFO.id;JSINFO.id=pageinfo.id;JSINFO.namespace=pageinfo.ns;$('form').each(function(idx,form){if($(form).find('input[name="do"]').length>0){var input=$('input[name="id"]',form);if(input.val()==oldid)input.val(pageinfo.id);}});m_curBaseUrl=base(newpage);var prevpage=document.location.href;m_loadPageFunc('show',null,{fastwiki_compareid:oldid},true,function(){setTimeout(function(){if(!m_inPopState){history.replaceState({url:prevpage,title:document.title},"",prevpage);history.pushState({url:newpage,title:document.title},"",newpage);$(window).trigger('fastwiki:afterIdChange',[prevpage,m_curBaseUrl]);}m_inPopState=false;self.refreshPageTitle(true);},1);});return true;};this.refreshPageTitle=function(fromIdSwitch){var title=_getWikiTitle();document.title=title;if(!fromIdSwitch){$('a').each(function(idx,elt){var $this=$(this);var href=$this.attr('href');if(href&&href.match(self.getSelfRefRegex())&&$this.text()==m_prevTitle)$this.text(document.title);});}m_prevTitle=title;};}})(jQuery);if(!window.tpl_fastwiki_support){(function($){var m_showRow,m_editRow;var m_utils={makeShowLink:function(url){url=url.replace(/\?do=.*$/,'');return'<a href="'+url+'" class="action show" accesskey="v" rel="nofollow" title="'+JSINFO.fastwiki.text_btn_show+' [V]"><span>'+JSINFO.fastwiki.text_btn_show+'</span></a>';},makeShowRowLI:function(pagetools,mode){var showLink=$("a[href $= 'do=']",pagetools);if(showLink.length>0)m_showRow=$(showLink.parents('li')[0]);else{var link=$("a[href *= 'do=']",pagetools)[0];if(link){m_showRow=$('<li>'+m_utils.makeShowLink(link.href)+'</li>').toggle(mode!='show');pagetools.prepend(m_showRow);}}},fixButtons:function(showParent,allButtons,mode){var showBtn=$('.button.btn_show',showParent);if(showBtn.length==0){var url=$('form.button',allButtons)[0].action;showBtnHtml='<form class="button btn_show" method="get" action="'+url+'"><div class="no"><input type="hidden" name="do" value=""><input type="submit" value="'+JSINFO.fastwiki.text_btn_show+'" class="button" accesskey="v" title="'+JSINFO.fastwiki.text_btn_show+' [V]"></div></form>';showParent.each(function(idx,elt){var newBtn=$(showBtnHtml);showBtn=showBtn.add(newBtn);$(elt).prepend(newBtn.toggle(mode!='show'));});}var editBtn=$('.button.btn_edit',allButtons);if(editBtn.length>0)m_editRow=m_editRow?m_editRow.add(editBtn):editBtn;m_showRow=m_showRow?m_showRow.add(showBtn):showBtn;}};if($('#dokuwiki__pagetools').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){m_utils.makeShowRowLI($("#dokuwiki__pagetools ul"),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$("#dokuwiki__top").toggleClass("showSidebar hasSidebar",mode=='show');$("#dokuwiki__aside").css('display',mode=='show'?'':'none');m_showRow.toggle(mode!='show');}});}else if(JSINFO.fastwiki.templatename=='arctic'){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var buttonBars=$('#bar__bottom, #bar__top');if($('.button',buttonBars).length>0)m_utils.fixButtons($('.bar-left'),buttonBars,mode);else{var pagetools=$('.bar-left');m_editRow=$("a[href *= 'do=edit']",pagetools);m_showRow=$("a[href $= 'do=']",pagetools[0]);if(m_showRow.length==0){var url=$("a[href *= 'do=']")[0].href;m_showRow=$();pagetools.each(function(idx,elt){var show=$(m_utils.makeShowLink(url)).toggle(mode!='show');m_showRow=m_showRow.add(show);$(elt).prepend(show);});}}},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');$(".left_sidebar, .right_sidebar").css('display',mode=='show'?'':'none');}});}else if($('ul.nav.navbar-nav').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var pagetools=$("ul.nav.navbar-nav");m_utils.makeShowRowLI(pagetools,mode);m_editRow=$($('li',pagetools)[0]);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');},'fastwiki:updateToc':function(e,tocObj){$('#dw_toc').remove();if(tocObj.length>0)$('.content_initial').prepend($('<div id="dw_toc"></div>').append(tocObj.html()));tocObj.remove();}});}else if($('.stylehead .bar_top .bar_top_content').length>0){$(window).on({'fastwiki:init':function(e,mode){var toolbox=$(".sidebar_content .li_toolbox ul");m_utils.makeShowRowLI(toolbox,mode);m_editRow=$('.action.edit',toolbox).parent();m_utils.fixButtons($('.bar_bottom_content .bar-right'),$('.bar_bottom_content .bar-right'),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$(".right_sidebar, .left_sidebar").css('display',mode=='edit'?'none':'');m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');if(mode=='edit'||mode=='draft'){$('.page_720').css({border:0,textAlign:'inherit'});$('.left_page, .right_page').css({float:'none',width:'auto'});}else{$('.page_720').css({border:'',textAlign:''});$('.left_page, .right_page').css({float:'',width:''});}}});}})(jQuery);}if(window.installPluginHiddenJS){jQuery(window).on('fastwiki:afterSwitch',function(evt,viewMode,isSectionEdit,prevViewMode){jQuery(".hiddenActive, .hiddenSwitch").each(function(){jQuery(this).off('click');});if(viewMode=="show")installPluginHiddenJS();});}jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery('<div id="plugin__styling_loader">'+LANG.plugins.styling.loader+'</div>');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('<button>'+LANG.plugins.styling.popup+'</button>');$form.prepend($btn);$btn.on('click',function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('<p></p>');return;}window.onunload=function(e){if(doreload){DokuCookie.setValue('styling_plugin',0);if(window.opener)window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});if(window.opener)applyPreview(window.opener);DokuCookie.setValue('styling_plugin',1);});jQuery(function(){var $frm=jQuery('#translation__dropdown');if(!$frm.length)return;$frm.find('input[name=go]').hide();$frm.find('select[name=id]').change(function(){var id=jQuery(this).val();var action=$frm.attr('action');if(action.substr(action.length-1)=='/'){var link=action+id;}else{var link=action+'?id='+id;}window.location.href=link;});});jQuery(function(){jQuery('#usrmgr__del').on('click',function(){return confirm(LANG.del_confirm);});});jQuery(function(){dw_locktimer.init(840,1);});
diff --git a/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js.gz b/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js.gz
new file mode 100644
index 0000000..15f6d7a
--- /dev/null
+++ b/data/cache/4/4521685561b8fcd31faeca97c9afd4d3.js.gz
Binary files differ
diff --git a/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js b/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js
new file mode 100644
index 0000000..f1a75e2
--- /dev/null
+++ b/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Toggle Search Tools","willexpire":"Your lock for editing this page is about to expire in a minute.\\nTo avoid conflicts use the preview button to reset the locktimer.","notsavedyet":"Unsaved changes will be lost.","searchmedia":"Search for files","keepopen":"Keep window open on selection","hidedetails":"Hide Details","mediatitle":"Link settings","mediadisplay":"Link type","mediaalign":"Alignment","mediasize":"Image size","mediatarget":"Link target","mediaclose":"Close","mediainsert":"Insert","mediadisplayimg":"Show the image.","mediadisplaylnk":"Show only the link.","mediasmall":"Small version","mediamedium":"Medium version","medialarge":"Large version","mediaoriginal":"Original version","medialnk":"Link to detail page","mediadirect":"Direct link to original","medianolnk":"No link","medianolink":"Do not link the image","medialeft":"Align the image on the left.","mediaright":"Align the image on the right.","mediacenter":"Align the image in the middle.","medianoalign":"Use no align.","nosmblinks":"Linking to Windows shares only works in Microsoft Internet Explorer.\\nYou still can copy and paste the link.","linkwiz":"Link Wizard","linkto":"Link to:","del_confirm":"Really delete selected item(s)?","restore_confirm":"Really restore this version?","media_diff":"View differences:","media_diff_both":"Side by Side","media_diff_opacity":"Shine-through","media_diff_portions":"Swipe","media_select":"Select files\u2026","media_upload_btn":"Upload","media_done_btn":"Done","media_drop":"Drop files here to upload","media_cancel":"remove","media_overwrt":"Overwrite existing files","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Bold Text","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"Italic Text","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Underlined Text","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"Monospaced Text","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Strike-through Text","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"Same Level Headline","icon":"hequal.png","key":"8","text":"Headline","mod":0,"block":true},{"type":"autohead","title":"Lower Headline","icon":"hminus.png","key":"9","text":"Headline","mod":1,"block":true},{"type":"autohead","title":"Higher Headline","icon":"hplus.png","key":"0","text":"Headline","mod":-1,"block":true},{"type":"picker","title":"Select Headline","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"Level 1 Headline","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"Level 2 Headline","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"Level 3 Headline","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"Level 4 Headline","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"Level 5 Headline","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Internal Link","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"External Link","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|External Link","block":false},{"type":"formatln","title":"Ordered List Item","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"Unordered List Item","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"Horizontal Rule","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"Add Images and other files (opens in a new window)","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Smileys","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Special Chars","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insert Signature","icon":"sig.png","key":"y","block":false},{"type":"picker","title":"Wrap Plugin","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/picker.png","list":[{"type":"format","title":"columns","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/column.png","open":"<WRAP group>\\n<WRAP half column>\\n","close":"\\n<\/WRAP>\\n\\n<WRAP half column>\\n\\n<\/WRAP>\\n<\/WRAP>\\n"},{"type":"format","title":"simple centered box","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/box.png","open":"<WRAP center round box 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"info box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/info.png","open":"<WRAP center round info 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"tip box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/tip.png","open":"<WRAP center round tip 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"important box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/important.png","open":"<WRAP center round important 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"alert box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/alert.png","open":"<WRAP center round alert 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"help box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/help.png","open":"<WRAP center round help 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"download box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/download.png","open":"<WRAP center round download 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"todo box","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/todo.png","open":"<WRAP center round todo 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"insert","title":"clear floats","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/clear.png","insert":"<WRAP clear\/>\\n"},{"type":"format","title":"especially emphasised","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/em.png","open":"<wrap em>","close":"<\/wrap>"},{"type":"format","title":"highlighted","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/hi.png","open":"<wrap hi>","close":"<\/wrap>"},{"type":"format","title":"less significant","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/lo.png","open":"<wrap lo>","close":"<\/wrap>"}]}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);jQuery(function(){jQuery('form.bureaucracy__plugin').each(function(){function updateFieldset(input){jQuery.each(jQuery(input).data('dparray'),function(i,dp){var showOrHide=input.parentNode.parentNode.style.display!=='none'&&((input.checked===dp.tval)||(input.type!=='checkbox'&&(dp.tval===true&&input.value!==''))||input.value===dp.tval);dp.fset.toggle(showOrHide);dp.fset.find('input,select').each(function(){var $inputelem=jQuery(this);if($inputelem.hasClass('required')){if(showOrHide){$inputelem.attr('required','required');}else{$inputelem.removeAttr('required')}}if($inputelem.data('dparray')){$inputelem.change();}});});}jQuery('p.bureaucracy_depends',this).each(function(){var fname=jQuery(this).find('span.bureaucracy_depends_fname').html(),fvalue=jQuery(this).find('span.bureaucracy_depends_fvalue');fvalue=(fvalue.length?fvalue.html():true);var fieldsetinfo={fset:jQuery(this).parent(),tval:fvalue};jQuery("label").has(":first-child:contains('"+fname+"')").first().find("select,input:last").each(function(){if(!jQuery(this).data('dparray')){jQuery(this).data('dparray',[fieldsetinfo]);}else{jQuery(this).data('dparray').push(fieldsetinfo);}}).bind('change keyup',function(){updateFieldset(this);}).change();}).hide();});});jQuery(function(){function ajaxsource(request,response,getterm){jQuery.getJSON(DOKU_BASE+'lib/exe/ajax.php',{call:'bureaucracy_user_field',search:getterm(request)},function(data){response(jQuery.map(data,function(name,user){return{label:name+' ('+user+')',value:user}}))});}function split(val){return val.split(/,\s*/);}function extractLast(term){return split(term).pop();}jQuery(".userpicker").autocomplete({source:function(request,response){ajaxsource(request,response,function(req){return req.term})}});jQuery(".userspicker").bind("keydown",function(event){if(event.keyCode===jQuery.ui.keyCode.TAB&&jQuery(this).data("ui-autocomplete").menu.active){event.preventDefault();}}).autocomplete({minLength:0,source:function(request,response){ajaxsource(request,response,function(req){return extractLast(req.term)})},search:function(){var term=extractLast(this.value);return term.length>=2;},focus:function(){return false;},select:function(event,ui){var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");return false;}});});jQuery(function(){jQuery('.bureaucracy__plugin .datepicker').datepicker({dateFormat:"yy-mm-dd",changeMonth:true,changeYear:true});});(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_text=function(){return $('<div/>').text($.trim(this.search_field.val())).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');no_results_html.find("span").first().html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}return this.pending_backstroke=null;};Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;stroke=(_ref1=evt.which)!=null?_ref1:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}switch(stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}break;case 32:if(this.disable_search){evt.preventDefault();}break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){h=0;w=0;style_block="position:absolute; left: -1000px; top: -1000px; display:none;";styles=['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'];for(_i=0,_len=styles.length;_i<_len;_i++){style=styles[_i];style_block+=style+":"+this.search_field.css(style)+";";}div=$('<div />',{'style':style_block});div.text(this.search_field.val());$('body').append(div);w=div.width()+25;div.remove();f_width=this.container.outerWidth();if(w>f_width-10){w=f_width-10;}return this.search_field.css({'width':w+'px'});}};return Chosen;})(AbstractChosen);}).call(this);(function(){'use strict';jQuery(function(){var $animalSelect=jQuery('select.farmer_chosen_animals');$animalSelect.chosen({width:'100%',search_contains:true,allow_single_deselect:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});jQuery('select.acl_chosen').chosen({disable_search:true,width:'100%'});var $formAllAnimals=jQuery('#farmer__pluginsforall');$formAllAnimals.find('select').change(function(){$formAllAnimals.find('button').prop('disabled',false);}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.pluginSelect});var $formSingleAnimal=jQuery('#farmer__pluginsforone');$formSingleAnimal.find('select').change(function(){var animal=jQuery(this).val();$formSingleAnimal.find('button').prop('disabled',true);jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPlugins_'+animal},function(data){$formSingleAnimal.find('div.output').html(data);$formSingleAnimal.find('button').prop('disabled',false);},'html')}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});var $formPluginMatrix=jQuery('#farmer__pluginmatrix').hide();$formPluginMatrix.on('click','td',function(){var $td=jQuery(this);$td.html('⌛').css('background-color','transparent');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_modPlugin',plugin:$td.data('plugin'),ani:$td.data('animal')},function(data){$td.replaceWith(data);},'html');});function showMatrix(){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPluginMatrix'},function(data){$formPluginMatrix.html(data);$formPluginMatrix.show();},'html')}$animalSelect.on('chosen:showing_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'20em'},400);}).on('chosen:hiding_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'7px'},400);});var $aclPolicyFieldset=jQuery('#aclPolicyFieldset');if($aclPolicyFieldset.length){$animalSelect.on('change',function(evt,params){var $this=jQuery(this);if($this.val()===''){$aclPolicyFieldset.slideDown();}else{$aclPolicyFieldset.slideUp();}});}jQuery("input[name=bulkSingleSwitch]:radio").change(function(){if(jQuery('#farmer__bulk').prop("checked")){$formAllAnimals.show();$formSingleAnimal.hide();$formPluginMatrix.hide();}else if(jQuery('#farmer__single').prop("checked")){$formAllAnimals.hide();$formSingleAnimal.show();$formPluginMatrix.hide();}else{$formAllAnimals.hide();$formSingleAnimal.hide();showMatrix();}});jQuery('#farmer__bulk').click();});})();var plugin_fastwiki=(function($){var m_viewMode,m_origViewMode,m_prevView;var m_isSecedit,m_wasSecedit;var m_hasDraft;var m_pageObjs={};var m_content;var m_initialId;var m_debug=document.location.host=='localhost';var m_cache=new CPageCache(JSINFO.fastwiki.preload_per_page,JSINFO.fastwiki.preload_batchsize,m_debug);var m_supportedActions={'':1,edit:1,draft:1,history:1,recent:1,revisions:1,show:1,subscribe:1,backlink:1,index:1,profile:1,media:1,diff:1,save:1};var m_modeClassElt;var m_browserHistory=new CBrowserHistory();$(function(){if(document.location.href.indexOf("detail.php")>=0)m_viewMode='unsupported';else{var urlParams=_urlToObj(document.location.href);m_viewMode=urlParams['do']||'show';if(!m_supportedActions[m_viewMode])m_viewMode='unsupported';else if(window.tpl_fastwiki_startmode_support&&!(m_viewMode in tpl_fastwiki_startmode_support))m_viewMode='unsupported';}m_origViewMode=m_viewMode;m_content=$('.plugin_fastwiki_marker').parent();m_content.addClass('content_initial');m_initialId=m_content.attr('id');m_modeClassElt=m_content.hasClass('dokuwiki')?m_content:$(m_content.parents('.dokuwiki')[0]||document.body);$(window).trigger('fastwiki:init',[m_viewMode]);if(JSINFO.fastwiki.fastpages)fixActionLinks(document.body);if(JSINFO.fastwiki.fastshow&&(m_origViewMode!='show'||!window.history||!history.pushState))JSINFO.fastwiki.fastshow=false;if(JSINFO.fastwiki.fastshow)m_browserHistory.init(load);});function fixActionLinks(elt){if(m_origViewMode=='unsupported')return;var formActions={search:1};var supportedFields={'do':1,rev:1,id:1};$('a[href *= "?do="]',elt).click(function(e){var curPathId=JSINFO.id.replace(/:/g,'/');var aPathId=this.href.replace(/\?.*$/,'').replace(/:/g,'/');if(aPathId.substr(-curPathId.length)==curPathId){var params=_urlToObj(this.href);if(!params['do'])params['do']='show';if(params['do']in m_supportedActions){e.preventDefault();load(params['do'],null,params);}}});$('input[type="submit"], input[type="button"], button',elt).click(function(e){var form=$(this).parents('form');if(form.length>0&&form[0]['do']&&form[0]['do'].value in m_supportedActions){var supported=true;$('input[type != "submit"]',form).each(function(idx,elt){if(elt.type!='button'&&(elt.type!='hidden'||!(elt.name in supportedFields)))supported=false;});if(supported){e.preventDefault();var params=_formToObj(form[0]);if(!params['do'])params['do']='show';load(params['do'],null,params);}}});if(m_origViewMode=='show'&&window.JSINFO){var pathId=JSINFO.id.replace(/:/g,'/');$('a',elt).click(function(e){var href=this.getAttribute('href');if(href&&href.indexOf('://')<0){if(href.match(m_browserHistory.getSelfRefRegex())){load('show');e.preventDefault();}else if(JSINFO.fastwiki.fastshow){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){if(m_browserHistory.switchBasePath(href)){m_viewMode=null;e.preventDefault();}}}}});}if(JSINFO.fastwiki.secedit){$('.editbutton_section .btn_secedit input[type=submit], .editbutton_section .btn_secedit button',elt).click(function(e){e.preventDefault();var form=$(this).parents('form');load('edit',form,_formToObj(form));});}if(JSINFO.fastwiki.preload)m_cache.load(elt,m_browserHistory);}function _preview(sectionForm){var body=$(document.body);var params=_formToObj($('#dw__editform'));params['do']='preview';_sendPartial(params,$('.dokuwiki .editBox'),function(data){var preview=$('<div id="preview_container">'+data+'</div>');var pvEditor=preview.find('#dw__editform');var editor=$('#dw__editform')[0];pvEditor.find('input[type=hidden]').each(function(idx,elt){editor[elt.name].value=elt.value;});preview.find('#scroll__here').prevAll().remove();var oldpreview=$('#preview_container');if(oldpreview.length>0)oldpreview.replaceWith(preview);else $('.content_partial').append(preview);setTimeout(function(){$('html,body').animate({scrollTop:$('#scroll__here').offset().top+'px'},300);},1);},'text');}function _getSection(sectionForm){var pieces=$();var target=sectionForm.parent();var nr=target.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];while(target.length>0&&!(target.hasClass('sectionedit'+nr)||target.find('.sectionedit'+nr).length)){target=target.prev();if(target.hasClass('section_highlight'))pieces=pieces.add(target.children());pieces=pieces.add(target);}return pieces;}function _focusEdit(){var $edit_text=$('#wiki__text');if($edit_text.length>0&&!$edit_text.attr('readOnly')){var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;try{DWsetSelection(sel);}catch(e){setTimeout(function(){try{DWsetSelection(sel);}catch(e){}},500);}$edit_text.focus();}}function _initEdit(){if(!window.doku_summaryCheck){window.doku_summaryCheck=window.summaryCheck;}dw_editor.init();dw_locktimer.init(JSINFO.fastwiki.locktime,JSINFO.fastwiki.usedraft);var $editform=$('#dw__editform');if($editform.length==0)return;var $edit_text=$('#wiki__text');$editform.on("change keydown",function(e){window.textChanged=true;doku_summaryCheck();});m_pageObjs.content=$edit_text.val();window.onbeforeunload=function(){if(window.textChanged&&m_pageObjs.content!=$edit_text.val())return LANG.notsavedyet;};window.onunload=deleteDraft;$('#edbtn__preview').click(function(e){if(JSINFO.fastwiki.preview){e.preventDefault();_preview(m_pageObjs.sectionForm);m_hasDraft=true;dw_locktimer.reset();}else{window.onbeforeunload='';textChanged=false;window.keepDraft=true;}});$('#edit__summary').on("change keyup",doku_summaryCheck);if(textChanged)doku_summaryCheck();initToolbar('tool__bar','wiki__text',toolbar);$('#tool__bar').attr('role','toolbar');$('#edbtn__save').click(function(e){textChanged=false;if(JSINFO.fastwiki.save&&m_origViewMode=='show'&&$edit_text.val().length>0&&m_pageObjs.content.length>0){e.preventDefault();load('save',null,_formToObj($('#dw__editform')));}else m_cache.remove(JSINFO.id);window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[draftdel]"]',$editform).click(function(e){e.preventDefault();var id=$editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});$('input[name="do[show]"]',$editform).click(function(e){e.preventDefault();load('show');});$('.picker.pk_hl').addClass('dokuwiki');}function _setBodyClass(action,target){for(var k in m_supportedActions)m_modeClassElt.removeClass('mode_'+k);m_modeClassElt.addClass('mode_'+action);if(target=='section')m_modeClassElt.removeClass('mode_edit').addClass('mode_show mode_secedit');$('.content_partial').toggle(m_viewMode!=m_origViewMode);$('.content_initial').toggle(m_viewMode==m_origViewMode||target=='section');}function _updatePageObjsOnSwitch(){if(m_pageObjs.showOnSwitch)m_pageObjs.showOnSwitch.show();delete m_pageObjs.showOnSwitch;delete m_pageObjs.content;delete m_pageObjs.sectionForm;var hasToc={show:1,admin:1};$("#dw__toc, #dw_toc_head, #dw_toc").css('display',m_viewMode in hasToc?'':'none');}function _formToObj(form){var obj={};$(form).serializeArray().map(function(item){obj[item.name]=item.value;});return obj;}function _urlToObj(url){var obj={};var a=url.replace(/.*\?/,'').split('&');for(var x=0;x<a.length;x++){var parts=unescape(a[x]).split('=');var name=parts.shift();obj[name]=parts.join('=');}return obj;}var m_actionEffects={subscribe:function(params,extraData){function subscribeAction(sparams){_sendPartial(sparams,_getVisibleContent(),function(data){load(m_origViewMode);var body=$('<div class="message_partial"></div>').append(data);$('.content_initial').before(body);},'text');}var form=$('#subscribe__form');$('input[name="do[subscribe]"]',form).click(function(e){e.preventDefault();subscribeAction(_formToObj(form));});$('.content_partial .unsubscribe').click(function(e){e.preventDefault();subscribeAction(_urlToObj(this.href));});},index:function(params,extraData){dw_index.$obj=$('#index__tree');dw_index.init();},edit:function(params,extraData){var draft=params['do']=='draft';if(m_hasDraft===true)draft=true;else if(m_hasDraft===false)draft=params.rev=null;if(extraData.sectionForm){m_pageObjs.sectionForm=extraData.sectionForm;extraData.sectionParts=extraData.sectionParts.add('.editbutton_section');m_pageObjs.showOnSwitch=extraData.sectionParts;m_pageObjs.showOnSwitch.hide();_initEdit();_focusEdit();}else _initEdit();setTimeout(function(){_focusEdit();if(document.body.scrollTop>0)$('html,body').animate({scrollTop:Math.max(0,Math.floor($('.content_partial').offset().top)-20)+'px'},300);},1);},revisions:function(params,extraData){$('.content_partial form').each(function(idx,form){$('input[name="do[diff]"]',form).click(function(e){e.preventDefault();load('diff',null,_formToObj(form));});});},save:function(params,extraData){if($('.content_partial #a_newer_version_exists').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});var editform=$('#dw__editform');$('input[name="do[save]"]',editform).click(function(e){e.preventDefault();load('save',null,_formToObj(editform));window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[cancel]"]',editform).click(function(e){e.preventDefault();var id=editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});}else if($('.content_partial #dw__editform').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});}else if($('.content_partial #preview').length>0){load('show');}else{$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));m_browserHistory.refreshPageTitle(false);load('show');dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}},show:function(params,extraData){$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}};m_actionEffects.draft=m_actionEffects.edit;m_actionEffects.diff=m_actionEffects.revisions;function _action(action,params,callback,insertLoc,extraData){params['do']=action;function cb(data){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);var body=$('<div class="content_partial"></div>').append(data);if(insertLoc&&action=='edit'){var newform=$('#dw__editform',body);if(newform.find('input[name=prefix]').val()=='.'&&newform.find('input[name=suffix]').val()==''){delete m_pageObjs.sectionForm;if(extraData)delete extraData.sectionForm;insertLoc=null;}}if(insertLoc)$(insertLoc[insertLoc.length-1]).after(body);else{var initial=$('.content_initial');body.addClass(initial[0].className.replace(/content_initial/,'')).attr('id',m_initialId);initial.attr('id','').after(body);}var newToc=$('.content_partial #dw__toc').addClass('fwJustincase');var hasNewToc=newToc.length>0;_updatePageObjsOnSwitch();if(callback)callback(data,extraData);if(m_actionEffects[action])m_actionEffects[action](params,extraData||{});newToc=$('.fwJustincase').removeClass('fwJustincase');if(m_viewMode=='show')$(window).trigger('fastwiki:updateToc',[newToc]);if(hasNewToc)dw_page.makeToggle('#dw__toc h3','#dw__toc > div');fixActionLinks($('.content_partial'));_setBodyClass(m_viewMode,m_pageObjs.sectionForm?"section":null);if(m_viewMode=='show')m_cache.add(JSINFO.id,data,true);if(!insertLoc)dw_behaviour.init();$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm,m_prevView]);if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}}if(action=='show'&&m_cache.get(JSINFO.id)){m_debug&&console.log("Getting from cache: "+JSINFO.id);cb(m_cache.get(JSINFO.id));}else _sendPartial(params,_getVisibleContent(),cb,'text');}function _sendPartial(params,spinnerParent,callback){if($('.partialsLoading').length==0){var spinnerCss=spinnerParent.height()+spinnerParent.offset().top>$(window).height()?{top:$(window).height()/2}:{top:'50%'};spinnerParent.append($('<div class="partialsLoading"></div>').css('display','none').css(spinnerCss));setTimeout(function(){$('.partialsLoading').css('display','');},500);}params.partial=1;jQuery[!params['do']||params['do']=='show'?'get':'post'](m_browserHistory.getBaseUrl(),params,function(data){if(data=='PERMISSION_CHANGE'){delete params.partial;delete params.fastwiki_compareid;var url=m_browserHistory.getBaseUrl()+'?'+$.param(params);document.location.href=url;}else callback(data);$('.partialsLoading').remove();},'text');}function _getVisibleContent(){var parentElt=$('.content_partial');if(parentElt.length==0)parentElt=$('.content_initial');return parentElt;}function load(page,sectionForm,params,force,callback){if((m_viewMode=='edit'||m_viewMode=='draft')&&(page!='save'&&page!='preview')&&m_pageObjs.content!=$('#wiki__text').val()){if(!confirm(LANG.notsavedyet))return;}m_prevView=m_viewMode;m_wasSecedit=m_isSecedit;m_isSecedit=!!sectionForm||(m_wasSecedit&&page=='save');m_viewMode=page;if(!params)params={};window.onbeforeunload='';dw_locktimer.clear();_updatePageObjsOnSwitch();if(page==m_origViewMode&&!force){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);if(m_prevView!=page){if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}_setBodyClass(page);$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm]);}if(callback)callback();}else if((page=='draft'||page=='edit')&&sectionForm){var sectionParts=_getSection(sectionForm);_action(page,params,callback,sectionParts,{sectionForm:sectionForm,sectionParts:sectionParts});}else _action(page,params,callback);}return{load:load,fixActionLinks:fixActionLinks};function CPageCache(maxSize,batchSize,debug){var m_queue=[];var m_p1Queue=[];var m_pages={},m_p1Ids={};var m_maxSize=maxSize;var m_batchSize=batchSize;var m_maxP1Size=10;if(debug){window.cpagecache_pages=m_pages;window.cpagecache_queue=m_queue;}this.add=function(id,data,p1){if(p1)_addPage(id,m_p1Queue,m_p1Ids,1,m_maxP1Size);_addPage(id,m_queue,m_pages,data,m_maxSize,m_p1Queue);};this.remove=function(id){if(id in m_pages){m_queue.splice(m_queue.indexOf(id),1);delete m_pages[id];var p1Idx=m_p1Queue.indexOf(id);if(p1Idx>=0){m_queue.splice(p1Idx,1);delete m_p1Ids[id];}}};this.get=function(id){if(id in m_pages){_pushToFront(id,m_queue);_pushToFront(id,m_p1Queue);return m_pages[id];}return null;};this.has=function(id){return id in m_pages;};this.load=function(elt,history){var self=this;var ids={};$('a',elt).each(function(idx,a){var href=a.getAttribute('href');if(href&&href.indexOf('://')<0){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){var pageinfo=history.getSwitchId(href);if(pageinfo&&!m_cache.has(pageinfo.id))ids[pageinfo.id]=1;}}});var idsA=[];for(var id in ids)idsA.push(id);if(idsA.length>m_maxSize){}else if(idsA.length>0){if(idsA.length>m_maxSize)idsA.length=m_maxSize;var batchSize=m_batchSize;if(idsA.length/batchSize<4)batchSize=Math.ceil(idsA.length/4);var requests=[];for(var x=0;x<Math.ceil(idsA.length/batchSize);x++){var sublist=idsA.slice(x*batchSize,(x+1)*batchSize);var params={partial:1};params['do']='fastwiki_preload';params.fastwiki_preload_pages=sublist.join(',');requests.push(params);}function doPost(params){m_debug&&console.log("Preloading "+params.fastwiki_preload_pages);$.post(DOKU_BASE+'doku.php',params,function(data){var pages=data.split(JSINFO.fastwiki.preload_head);for(var p=0;p<pages.length;p++){var line1End=pages[p].indexOf('\n');var id=pages[p].substr(0,line1End);pages[p]=pages[p].substr(line1End+1);m_debug&&console.log("Loaded "+[id,pages[p].length]);if(pages[p].indexOf('<body')>=0)m_debug&&console.log("ERROR: Body found!");else self.add(id,pages[p]);}if(requests.length>0)doPost(requests.shift());},'text');}for(var x=0;x<Math.min(4,requests.length);x++)doPost(requests.shift());}};function _pushToFront(id,queue){var idx=queue.indexOf(id);if(idx>=0){queue.splice(idx,1);queue.push(id);}}function _addPage(id,queue,hash,data,maxSize,exclude){if(id in hash)_pushToFront(id,queue);else if(data){if(queue.length>maxSize){if(exclude){for(var x=0;x<queue.length;x++){if(!exclude[queue[x]]){delete hash[queue[x]];queue.splice(x,1);}}}else delete hash[queue.shift()];}queue.push(id);}if(data)hash[id]=data;}}function CBrowserHistory(){var m_inPopState=false;var m_curBaseUrl=document.location.pathname;var m_prevTitle='__UNDEFINED__';var m_loadPageFunc=null;var self=this;function base(url,withId){if(withId){var id=url.replace(/.*id=([^&]+).*/,'$1');if(id.match(/^[a-zA-Z0-9_\-:]+$/))return url.replace(/\?.*/,'')+'?id='+id;}return url.replace(/\?.*/,'');}function _getWikiTitle(){var titleElt;$('h1, h2, h3, h4, h5, h6',$('.content_initial')).each(function(idx,elt){if(elt.className.indexOf('sectionedit')>=0){titleElt=elt;return false;}});return titleElt?$(titleElt).text():'';}this.init=function(loadFunc){m_prevTitle=_getWikiTitle()||'__UNDEFINED__';m_loadPageFunc=loadFunc;window.addEventListener('popstate',function(e){document.title=e.state.title;m_inPopState=true;self.switchBasePath(e.state.url);});};this.getSwitchId=function(newpage,force){var pageid=newpage.substr(1).replace(/.*doku.php(\?id=|\/)/,'').replace(/\//g,':');var ns=pageid.replace(/:[^:]+$/,'');if(!force){if(JSINFO.fastwiki.fastshow_same_ns&&ns!=JSINFO.namespace)return false;var incl=JSINFO.fastwiki.fastshow_include,excl=JSINFO.fastwiki.fastshow_exclude;if(incl&&!pageid.match('^('+incl.split(/\s*,\s*/).join('|')+')'))return false;if(excl&&pageid.match('^('+excl.split(/\s*,\s*/).join('|')+')'))return false;}return{id:pageid,ns:ns};};this.getSelfRefRegex=function(){var path=document.location.pathname;var idPath=JSINFO.id.replace(/:/g,'/');if(path.indexOf('doku.php')>=0)return new RegExp('doku\\.php\\?id='+JSINFO.id+'$|doku\\.php/'+idPath+'$');return new RegExp('^'+path+'$|://'+document.location.host+path+'$');};this.getBaseUrl=function(){return m_curBaseUrl;};this.switchBasePath=function(newpage){var pageinfo=this.getSwitchId(newpage);if(!pageinfo)return false;var oldid=JSINFO.id;JSINFO.id=pageinfo.id;JSINFO.namespace=pageinfo.ns;$('form').each(function(idx,form){if($(form).find('input[name="do"]').length>0){var input=$('input[name="id"]',form);if(input.val()==oldid)input.val(pageinfo.id);}});m_curBaseUrl=base(newpage);var prevpage=document.location.href;m_loadPageFunc('show',null,{fastwiki_compareid:oldid},true,function(){setTimeout(function(){if(!m_inPopState){history.replaceState({url:prevpage,title:document.title},"",prevpage);history.pushState({url:newpage,title:document.title},"",newpage);$(window).trigger('fastwiki:afterIdChange',[prevpage,m_curBaseUrl]);}m_inPopState=false;self.refreshPageTitle(true);},1);});return true;};this.refreshPageTitle=function(fromIdSwitch){var title=_getWikiTitle();document.title=title;if(!fromIdSwitch){$('a').each(function(idx,elt){var $this=$(this);var href=$this.attr('href');if(href&&href.match(self.getSelfRefRegex())&&$this.text()==m_prevTitle)$this.text(document.title);});}m_prevTitle=title;};}})(jQuery);if(!window.tpl_fastwiki_support){(function($){var m_showRow,m_editRow;var m_utils={makeShowLink:function(url){url=url.replace(/\?do=.*$/,'');return'<a href="'+url+'" class="action show" accesskey="v" rel="nofollow" title="'+JSINFO.fastwiki.text_btn_show+' [V]"><span>'+JSINFO.fastwiki.text_btn_show+'</span></a>';},makeShowRowLI:function(pagetools,mode){var showLink=$("a[href $= 'do=']",pagetools);if(showLink.length>0)m_showRow=$(showLink.parents('li')[0]);else{var link=$("a[href *= 'do=']",pagetools)[0];if(link){m_showRow=$('<li>'+m_utils.makeShowLink(link.href)+'</li>').toggle(mode!='show');pagetools.prepend(m_showRow);}}},fixButtons:function(showParent,allButtons,mode){var showBtn=$('.button.btn_show',showParent);if(showBtn.length==0){var url=$('form.button',allButtons)[0].action;showBtnHtml='<form class="button btn_show" method="get" action="'+url+'"><div class="no"><input type="hidden" name="do" value=""><input type="submit" value="'+JSINFO.fastwiki.text_btn_show+'" class="button" accesskey="v" title="'+JSINFO.fastwiki.text_btn_show+' [V]"></div></form>';showParent.each(function(idx,elt){var newBtn=$(showBtnHtml);showBtn=showBtn.add(newBtn);$(elt).prepend(newBtn.toggle(mode!='show'));});}var editBtn=$('.button.btn_edit',allButtons);if(editBtn.length>0)m_editRow=m_editRow?m_editRow.add(editBtn):editBtn;m_showRow=m_showRow?m_showRow.add(showBtn):showBtn;}};if($('#dokuwiki__pagetools').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){m_utils.makeShowRowLI($("#dokuwiki__pagetools ul"),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$("#dokuwiki__top").toggleClass("showSidebar hasSidebar",mode=='show');$("#dokuwiki__aside").css('display',mode=='show'?'':'none');m_showRow.toggle(mode!='show');}});}else if(JSINFO.fastwiki.templatename=='arctic'){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var buttonBars=$('#bar__bottom, #bar__top');if($('.button',buttonBars).length>0)m_utils.fixButtons($('.bar-left'),buttonBars,mode);else{var pagetools=$('.bar-left');m_editRow=$("a[href *= 'do=edit']",pagetools);m_showRow=$("a[href $= 'do=']",pagetools[0]);if(m_showRow.length==0){var url=$("a[href *= 'do=']")[0].href;m_showRow=$();pagetools.each(function(idx,elt){var show=$(m_utils.makeShowLink(url)).toggle(mode!='show');m_showRow=m_showRow.add(show);$(elt).prepend(show);});}}},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');$(".left_sidebar, .right_sidebar").css('display',mode=='show'?'':'none');}});}else if($('ul.nav.navbar-nav').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var pagetools=$("ul.nav.navbar-nav");m_utils.makeShowRowLI(pagetools,mode);m_editRow=$($('li',pagetools)[0]);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');},'fastwiki:updateToc':function(e,tocObj){$('#dw_toc').remove();if(tocObj.length>0)$('.content_initial').prepend($('<div id="dw_toc"></div>').append(tocObj.html()));tocObj.remove();}});}else if($('.stylehead .bar_top .bar_top_content').length>0){$(window).on({'fastwiki:init':function(e,mode){var toolbox=$(".sidebar_content .li_toolbox ul");m_utils.makeShowRowLI(toolbox,mode);m_editRow=$('.action.edit',toolbox).parent();m_utils.fixButtons($('.bar_bottom_content .bar-right'),$('.bar_bottom_content .bar-right'),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$(".right_sidebar, .left_sidebar").css('display',mode=='edit'?'none':'');m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');if(mode=='edit'||mode=='draft'){$('.page_720').css({border:0,textAlign:'inherit'});$('.left_page, .right_page').css({float:'none',width:'auto'});}else{$('.page_720').css({border:'',textAlign:''});$('.left_page, .right_page').css({float:'',width:''});}}});}})(jQuery);}if(window.installPluginHiddenJS){jQuery(window).on('fastwiki:afterSwitch',function(evt,viewMode,isSectionEdit,prevViewMode){jQuery(".hiddenActive, .hiddenSwitch").each(function(){jQuery(this).off('click');});if(viewMode=="show")installPluginHiddenJS();});}jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery('<div id="plugin__styling_loader">'+LANG.plugins.styling.loader+'</div>');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('<button>'+LANG.plugins.styling.popup+'</button>');$form.prepend($btn);$btn.on('click',function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('<p></p>');return;}window.onunload=function(e){if(doreload){DokuCookie.setValue('styling_plugin',0);if(window.opener)window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});if(window.opener)applyPreview(window.opener);DokuCookie.setValue('styling_plugin',1);});jQuery(function(){var $frm=jQuery('#translation__dropdown');if(!$frm.length)return;$frm.find('input[name=go]').hide();$frm.find('select[name=id]').change(function(){var id=jQuery(this).val();var action=$frm.attr('action');if(action.substr(action.length-1)=='/'){var link=action+id;}else{var link=action+'?id='+id;}window.location.href=link;});});jQuery(function(){jQuery('#usrmgr__del').on('click',function(){return confirm(LANG.del_confirm);});});jQuery(function(){dw_locktimer.init(840,1);});
diff --git a/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js.gz b/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js.gz
new file mode 100644
index 0000000..e4c06d9
--- /dev/null
+++ b/data/cache/4/4ce6c6fe80d140e3e269ea6fa3dae69d.js.gz
Binary files differ
diff --git a/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.i b/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.i
new file mode 100644
index 0000000..4c05217
--- /dev/null
+++ b/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.i
@@ -0,0 +1 @@
+a:12:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"header";i:1;a:3:{i:0;s:28:"Este tema no existe todavía";i:1;i:1;i:2;i:1;}i:2;i:1;}i:2;a:3:{i:0;s:12:"section_open";i:1;a:1:{i:0;i:1;}i:2;i:1;}i:3;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:1;}i:4;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:88:"Has seguido un enlace a un tema que no existe todavía. Puedes crearlo usando el botón ";}i:2;i:45;}i:5;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:1;i:1;s:2:"**";}i:2;i:1;i:3;s:2:"**";}i:2;i:133;}i:6;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:3;i:1;s:17:"Crea esta página";}i:2;i:3;i:3;s:17:"Crea esta página";}i:2;i:135;}i:7;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:4;i:1;s:2:"**";}i:2;i:4;i:3;s:2:"**";}i:2;i:152;}i:8;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:1:".";}i:2;i:154;}i:9;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:155;}i:10;a:3:{i:0;s:13:"section_close";i:1;a:0:{}i:2;i:156;}i:11;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:156;}} \ No newline at end of file
diff --git a/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.xhtml b/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.xhtml
new file mode 100644
index 0000000..1b637c0
--- /dev/null
+++ b/data/cache/5/50cf1ab748583950b0f6ed7a20c7dffd.xhtml
@@ -0,0 +1,9 @@
+
+<h1 class="sectionedit1" id="este_tema_no_existe_todavia">Este tema no existe todavía</h1>
+<div class="level1">
+
+<p>
+Has seguido un enlace a un tema que no existe todavía. Puedes crearlo usando el botón <strong>Crea esta página</strong>.
+</p>
+
+</div>
diff --git a/data/cache/8/84d7238169ba6d06500223cad03d6e45.js b/data/cache/8/84d7238169ba6d06500223cad03d6e45.js
new file mode 100644
index 0000000..16e66ea
--- /dev/null
+++ b/data/cache/8/84d7238169ba6d06500223cad03d6e45.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Toggle Search Tools","willexpire":"Your lock for editing this page is about to expire in a minute.\\nTo avoid conflicts use the preview button to reset the locktimer.","notsavedyet":"Unsaved changes will be lost.","searchmedia":"Search for files","keepopen":"Keep window open on selection","hidedetails":"Hide Details","mediatitle":"Link settings","mediadisplay":"Link type","mediaalign":"Alignment","mediasize":"Image size","mediatarget":"Link target","mediaclose":"Close","mediainsert":"Insert","mediadisplayimg":"Show the image.","mediadisplaylnk":"Show only the link.","mediasmall":"Small version","mediamedium":"Medium version","medialarge":"Large version","mediaoriginal":"Original version","medialnk":"Link to detail page","mediadirect":"Direct link to original","medianolnk":"No link","medianolink":"Do not link the image","medialeft":"Align the image on the left.","mediaright":"Align the image on the right.","mediacenter":"Align the image in the middle.","medianoalign":"Use no align.","nosmblinks":"Linking to Windows shares only works in Microsoft Internet Explorer.\\nYou still can copy and paste the link.","linkwiz":"Link Wizard","linkto":"Link to:","del_confirm":"Really delete selected item(s)?","restore_confirm":"Really restore this version?","media_diff":"View differences:","media_diff_both":"Side by Side","media_diff_opacity":"Shine-through","media_diff_portions":"Swipe","media_select":"Select files\u2026","media_upload_btn":"Upload","media_done_btn":"Done","media_drop":"Drop files here to upload","media_cancel":"remove","media_overwrt":"Overwrite existing files","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Bold Text","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"Italic Text","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Underlined Text","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"Monospaced Text","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Strike-through Text","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"Same Level Headline","icon":"hequal.png","key":"8","text":"Headline","mod":0,"block":true},{"type":"autohead","title":"Lower Headline","icon":"hminus.png","key":"9","text":"Headline","mod":1,"block":true},{"type":"autohead","title":"Higher Headline","icon":"hplus.png","key":"0","text":"Headline","mod":-1,"block":true},{"type":"picker","title":"Select Headline","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"Level 1 Headline","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"Level 2 Headline","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"Level 3 Headline","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"Level 4 Headline","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"Level 5 Headline","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Internal Link","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"External Link","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|External Link","block":false},{"type":"formatln","title":"Ordered List Item","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"Unordered List Item","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"Horizontal Rule","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"Add Images and other files (opens in a new window)","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Smileys","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Special Chars","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insert Signature","icon":"sig.png","key":"y","block":false}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_text=function(){return $('<div/>').text($.trim(this.search_field.val())).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');no_results_html.find("span").first().html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}return this.pending_backstroke=null;};Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;stroke=(_ref1=evt.which)!=null?_ref1:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}switch(stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}break;case 32:if(this.disable_search){evt.preventDefault();}break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){h=0;w=0;style_block="position:absolute; left: -1000px; top: -1000px; display:none;";styles=['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'];for(_i=0,_len=styles.length;_i<_len;_i++){style=styles[_i];style_block+=style+":"+this.search_field.css(style)+";";}div=$('<div />',{'style':style_block});div.text(this.search_field.val());$('body').append(div);w=div.width()+25;div.remove();f_width=this.container.outerWidth();if(w>f_width-10){w=f_width-10;}return this.search_field.css({'width':w+'px'});}};return Chosen;})(AbstractChosen);}).call(this);(function(){'use strict';jQuery(function(){var $animalSelect=jQuery('select.farmer_chosen_animals');$animalSelect.chosen({width:'100%',search_contains:true,allow_single_deselect:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});jQuery('select.acl_chosen').chosen({disable_search:true,width:'100%'});var $formAllAnimals=jQuery('#farmer__pluginsforall');$formAllAnimals.find('select').change(function(){$formAllAnimals.find('button').prop('disabled',false);}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.pluginSelect});var $formSingleAnimal=jQuery('#farmer__pluginsforone');$formSingleAnimal.find('select').change(function(){var animal=jQuery(this).val();$formSingleAnimal.find('button').prop('disabled',true);jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPlugins_'+animal},function(data){$formSingleAnimal.find('div.output').html(data);$formSingleAnimal.find('button').prop('disabled',false);},'html')}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});var $formPluginMatrix=jQuery('#farmer__pluginmatrix').hide();$formPluginMatrix.on('click','td',function(){var $td=jQuery(this);$td.html('⌛').css('background-color','transparent');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_modPlugin',plugin:$td.data('plugin'),ani:$td.data('animal')},function(data){$td.replaceWith(data);},'html');});function showMatrix(){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPluginMatrix'},function(data){$formPluginMatrix.html(data);$formPluginMatrix.show();},'html')}$animalSelect.on('chosen:showing_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'20em'},400);}).on('chosen:hiding_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'7px'},400);});var $aclPolicyFieldset=jQuery('#aclPolicyFieldset');if($aclPolicyFieldset.length){$animalSelect.on('change',function(evt,params){var $this=jQuery(this);if($this.val()===''){$aclPolicyFieldset.slideDown();}else{$aclPolicyFieldset.slideUp();}});}jQuery("input[name=bulkSingleSwitch]:radio").change(function(){if(jQuery('#farmer__bulk').prop("checked")){$formAllAnimals.show();$formSingleAnimal.hide();$formPluginMatrix.hide();}else if(jQuery('#farmer__single').prop("checked")){$formAllAnimals.hide();$formSingleAnimal.show();$formPluginMatrix.hide();}else{$formAllAnimals.hide();$formSingleAnimal.hide();showMatrix();}});jQuery('#farmer__bulk').click();});})();var plugin_fastwiki=(function($){var m_viewMode,m_origViewMode,m_prevView;var m_isSecedit,m_wasSecedit;var m_hasDraft;var m_pageObjs={};var m_content;var m_initialId;var m_debug=document.location.host=='localhost';var m_cache=new CPageCache(JSINFO.fastwiki.preload_per_page,JSINFO.fastwiki.preload_batchsize,m_debug);var m_supportedActions={'':1,edit:1,draft:1,history:1,recent:1,revisions:1,show:1,subscribe:1,backlink:1,index:1,profile:1,media:1,diff:1,save:1};var m_modeClassElt;var m_browserHistory=new CBrowserHistory();$(function(){if(document.location.href.indexOf("detail.php")>=0)m_viewMode='unsupported';else{var urlParams=_urlToObj(document.location.href);m_viewMode=urlParams['do']||'show';if(!m_supportedActions[m_viewMode])m_viewMode='unsupported';else if(window.tpl_fastwiki_startmode_support&&!(m_viewMode in tpl_fastwiki_startmode_support))m_viewMode='unsupported';}m_origViewMode=m_viewMode;m_content=$('.plugin_fastwiki_marker').parent();m_content.addClass('content_initial');m_initialId=m_content.attr('id');m_modeClassElt=m_content.hasClass('dokuwiki')?m_content:$(m_content.parents('.dokuwiki')[0]||document.body);$(window).trigger('fastwiki:init',[m_viewMode]);if(JSINFO.fastwiki.fastpages)fixActionLinks(document.body);if(JSINFO.fastwiki.fastshow&&(m_origViewMode!='show'||!window.history||!history.pushState))JSINFO.fastwiki.fastshow=false;if(JSINFO.fastwiki.fastshow)m_browserHistory.init(load);});function fixActionLinks(elt){if(m_origViewMode=='unsupported')return;var formActions={search:1};var supportedFields={'do':1,rev:1,id:1};$('a[href *= "?do="]',elt).click(function(e){var curPathId=JSINFO.id.replace(/:/g,'/');var aPathId=this.href.replace(/\?.*$/,'').replace(/:/g,'/');if(aPathId.substr(-curPathId.length)==curPathId){var params=_urlToObj(this.href);if(!params['do'])params['do']='show';if(params['do']in m_supportedActions){e.preventDefault();load(params['do'],null,params);}}});$('input[type="submit"], input[type="button"], button',elt).click(function(e){var form=$(this).parents('form');if(form.length>0&&form[0]['do']&&form[0]['do'].value in m_supportedActions){var supported=true;$('input[type != "submit"]',form).each(function(idx,elt){if(elt.type!='button'&&(elt.type!='hidden'||!(elt.name in supportedFields)))supported=false;});if(supported){e.preventDefault();var params=_formToObj(form[0]);if(!params['do'])params['do']='show';load(params['do'],null,params);}}});if(m_origViewMode=='show'&&window.JSINFO){var pathId=JSINFO.id.replace(/:/g,'/');$('a',elt).click(function(e){var href=this.getAttribute('href');if(href&&href.indexOf('://')<0){if(href.match(m_browserHistory.getSelfRefRegex())){load('show');e.preventDefault();}else if(JSINFO.fastwiki.fastshow){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){if(m_browserHistory.switchBasePath(href)){m_viewMode=null;e.preventDefault();}}}}});}if(JSINFO.fastwiki.secedit){$('.editbutton_section .btn_secedit input[type=submit], .editbutton_section .btn_secedit button',elt).click(function(e){e.preventDefault();var form=$(this).parents('form');load('edit',form,_formToObj(form));});}if(JSINFO.fastwiki.preload)m_cache.load(elt,m_browserHistory);}function _preview(sectionForm){var body=$(document.body);var params=_formToObj($('#dw__editform'));params['do']='preview';_sendPartial(params,$('.dokuwiki .editBox'),function(data){var preview=$('<div id="preview_container">'+data+'</div>');var pvEditor=preview.find('#dw__editform');var editor=$('#dw__editform')[0];pvEditor.find('input[type=hidden]').each(function(idx,elt){editor[elt.name].value=elt.value;});preview.find('#scroll__here').prevAll().remove();var oldpreview=$('#preview_container');if(oldpreview.length>0)oldpreview.replaceWith(preview);else $('.content_partial').append(preview);setTimeout(function(){$('html,body').animate({scrollTop:$('#scroll__here').offset().top+'px'},300);},1);},'text');}function _getSection(sectionForm){var pieces=$();var target=sectionForm.parent();var nr=target.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];while(target.length>0&&!(target.hasClass('sectionedit'+nr)||target.find('.sectionedit'+nr).length)){target=target.prev();if(target.hasClass('section_highlight'))pieces=pieces.add(target.children());pieces=pieces.add(target);}return pieces;}function _focusEdit(){var $edit_text=$('#wiki__text');if($edit_text.length>0&&!$edit_text.attr('readOnly')){var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;try{DWsetSelection(sel);}catch(e){setTimeout(function(){try{DWsetSelection(sel);}catch(e){}},500);}$edit_text.focus();}}function _initEdit(){if(!window.doku_summaryCheck){window.doku_summaryCheck=window.summaryCheck;}dw_editor.init();dw_locktimer.init(JSINFO.fastwiki.locktime,JSINFO.fastwiki.usedraft);var $editform=$('#dw__editform');if($editform.length==0)return;var $edit_text=$('#wiki__text');$editform.on("change keydown",function(e){window.textChanged=true;doku_summaryCheck();});m_pageObjs.content=$edit_text.val();window.onbeforeunload=function(){if(window.textChanged&&m_pageObjs.content!=$edit_text.val())return LANG.notsavedyet;};window.onunload=deleteDraft;$('#edbtn__preview').click(function(e){if(JSINFO.fastwiki.preview){e.preventDefault();_preview(m_pageObjs.sectionForm);m_hasDraft=true;dw_locktimer.reset();}else{window.onbeforeunload='';textChanged=false;window.keepDraft=true;}});$('#edit__summary').on("change keyup",doku_summaryCheck);if(textChanged)doku_summaryCheck();initToolbar('tool__bar','wiki__text',toolbar);$('#tool__bar').attr('role','toolbar');$('#edbtn__save').click(function(e){textChanged=false;if(JSINFO.fastwiki.save&&m_origViewMode=='show'&&$edit_text.val().length>0&&m_pageObjs.content.length>0){e.preventDefault();load('save',null,_formToObj($('#dw__editform')));}else m_cache.remove(JSINFO.id);window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[draftdel]"]',$editform).click(function(e){e.preventDefault();var id=$editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});$('input[name="do[show]"]',$editform).click(function(e){e.preventDefault();load('show');});$('.picker.pk_hl').addClass('dokuwiki');}function _setBodyClass(action,target){for(var k in m_supportedActions)m_modeClassElt.removeClass('mode_'+k);m_modeClassElt.addClass('mode_'+action);if(target=='section')m_modeClassElt.removeClass('mode_edit').addClass('mode_show mode_secedit');$('.content_partial').toggle(m_viewMode!=m_origViewMode);$('.content_initial').toggle(m_viewMode==m_origViewMode||target=='section');}function _updatePageObjsOnSwitch(){if(m_pageObjs.showOnSwitch)m_pageObjs.showOnSwitch.show();delete m_pageObjs.showOnSwitch;delete m_pageObjs.content;delete m_pageObjs.sectionForm;var hasToc={show:1,admin:1};$("#dw__toc, #dw_toc_head, #dw_toc").css('display',m_viewMode in hasToc?'':'none');}function _formToObj(form){var obj={};$(form).serializeArray().map(function(item){obj[item.name]=item.value;});return obj;}function _urlToObj(url){var obj={};var a=url.replace(/.*\?/,'').split('&');for(var x=0;x<a.length;x++){var parts=unescape(a[x]).split('=');var name=parts.shift();obj[name]=parts.join('=');}return obj;}var m_actionEffects={subscribe:function(params,extraData){function subscribeAction(sparams){_sendPartial(sparams,_getVisibleContent(),function(data){load(m_origViewMode);var body=$('<div class="message_partial"></div>').append(data);$('.content_initial').before(body);},'text');}var form=$('#subscribe__form');$('input[name="do[subscribe]"]',form).click(function(e){e.preventDefault();subscribeAction(_formToObj(form));});$('.content_partial .unsubscribe').click(function(e){e.preventDefault();subscribeAction(_urlToObj(this.href));});},index:function(params,extraData){dw_index.$obj=$('#index__tree');dw_index.init();},edit:function(params,extraData){var draft=params['do']=='draft';if(m_hasDraft===true)draft=true;else if(m_hasDraft===false)draft=params.rev=null;if(extraData.sectionForm){m_pageObjs.sectionForm=extraData.sectionForm;extraData.sectionParts=extraData.sectionParts.add('.editbutton_section');m_pageObjs.showOnSwitch=extraData.sectionParts;m_pageObjs.showOnSwitch.hide();_initEdit();_focusEdit();}else _initEdit();setTimeout(function(){_focusEdit();if(document.body.scrollTop>0)$('html,body').animate({scrollTop:Math.max(0,Math.floor($('.content_partial').offset().top)-20)+'px'},300);},1);},revisions:function(params,extraData){$('.content_partial form').each(function(idx,form){$('input[name="do[diff]"]',form).click(function(e){e.preventDefault();load('diff',null,_formToObj(form));});});},save:function(params,extraData){if($('.content_partial #a_newer_version_exists').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});var editform=$('#dw__editform');$('input[name="do[save]"]',editform).click(function(e){e.preventDefault();load('save',null,_formToObj(editform));window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[cancel]"]',editform).click(function(e){e.preventDefault();var id=editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});}else if($('.content_partial #dw__editform').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});}else if($('.content_partial #preview').length>0){load('show');}else{$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));m_browserHistory.refreshPageTitle(false);load('show');dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}},show:function(params,extraData){$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}};m_actionEffects.draft=m_actionEffects.edit;m_actionEffects.diff=m_actionEffects.revisions;function _action(action,params,callback,insertLoc,extraData){params['do']=action;function cb(data){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);var body=$('<div class="content_partial"></div>').append(data);if(insertLoc&&action=='edit'){var newform=$('#dw__editform',body);if(newform.find('input[name=prefix]').val()=='.'&&newform.find('input[name=suffix]').val()==''){delete m_pageObjs.sectionForm;if(extraData)delete extraData.sectionForm;insertLoc=null;}}if(insertLoc)$(insertLoc[insertLoc.length-1]).after(body);else{var initial=$('.content_initial');body.addClass(initial[0].className.replace(/content_initial/,'')).attr('id',m_initialId);initial.attr('id','').after(body);}var newToc=$('.content_partial #dw__toc').addClass('fwJustincase');var hasNewToc=newToc.length>0;_updatePageObjsOnSwitch();if(callback)callback(data,extraData);if(m_actionEffects[action])m_actionEffects[action](params,extraData||{});newToc=$('.fwJustincase').removeClass('fwJustincase');if(m_viewMode=='show')$(window).trigger('fastwiki:updateToc',[newToc]);if(hasNewToc)dw_page.makeToggle('#dw__toc h3','#dw__toc > div');fixActionLinks($('.content_partial'));_setBodyClass(m_viewMode,m_pageObjs.sectionForm?"section":null);if(m_viewMode=='show')m_cache.add(JSINFO.id,data,true);if(!insertLoc)dw_behaviour.init();$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm,m_prevView]);if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}}if(action=='show'&&m_cache.get(JSINFO.id)){m_debug&&console.log("Getting from cache: "+JSINFO.id);cb(m_cache.get(JSINFO.id));}else _sendPartial(params,_getVisibleContent(),cb,'text');}function _sendPartial(params,spinnerParent,callback){if($('.partialsLoading').length==0){var spinnerCss=spinnerParent.height()+spinnerParent.offset().top>$(window).height()?{top:$(window).height()/2}:{top:'50%'};spinnerParent.append($('<div class="partialsLoading"></div>').css('display','none').css(spinnerCss));setTimeout(function(){$('.partialsLoading').css('display','');},500);}params.partial=1;jQuery[!params['do']||params['do']=='show'?'get':'post'](m_browserHistory.getBaseUrl(),params,function(data){if(data=='PERMISSION_CHANGE'){delete params.partial;delete params.fastwiki_compareid;var url=m_browserHistory.getBaseUrl()+'?'+$.param(params);document.location.href=url;}else callback(data);$('.partialsLoading').remove();},'text');}function _getVisibleContent(){var parentElt=$('.content_partial');if(parentElt.length==0)parentElt=$('.content_initial');return parentElt;}function load(page,sectionForm,params,force,callback){if((m_viewMode=='edit'||m_viewMode=='draft')&&(page!='save'&&page!='preview')&&m_pageObjs.content!=$('#wiki__text').val()){if(!confirm(LANG.notsavedyet))return;}m_prevView=m_viewMode;m_wasSecedit=m_isSecedit;m_isSecedit=!!sectionForm||(m_wasSecedit&&page=='save');m_viewMode=page;if(!params)params={};window.onbeforeunload='';dw_locktimer.clear();_updatePageObjsOnSwitch();if(page==m_origViewMode&&!force){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);if(m_prevView!=page){if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}_setBodyClass(page);$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm]);}if(callback)callback();}else if((page=='draft'||page=='edit')&&sectionForm){var sectionParts=_getSection(sectionForm);_action(page,params,callback,sectionParts,{sectionForm:sectionForm,sectionParts:sectionParts});}else _action(page,params,callback);}return{load:load,fixActionLinks:fixActionLinks};function CPageCache(maxSize,batchSize,debug){var m_queue=[];var m_p1Queue=[];var m_pages={},m_p1Ids={};var m_maxSize=maxSize;var m_batchSize=batchSize;var m_maxP1Size=10;if(debug){window.cpagecache_pages=m_pages;window.cpagecache_queue=m_queue;}this.add=function(id,data,p1){if(p1)_addPage(id,m_p1Queue,m_p1Ids,1,m_maxP1Size);_addPage(id,m_queue,m_pages,data,m_maxSize,m_p1Queue);};this.remove=function(id){if(id in m_pages){m_queue.splice(m_queue.indexOf(id),1);delete m_pages[id];var p1Idx=m_p1Queue.indexOf(id);if(p1Idx>=0){m_queue.splice(p1Idx,1);delete m_p1Ids[id];}}};this.get=function(id){if(id in m_pages){_pushToFront(id,m_queue);_pushToFront(id,m_p1Queue);return m_pages[id];}return null;};this.has=function(id){return id in m_pages;};this.load=function(elt,history){var self=this;var ids={};$('a',elt).each(function(idx,a){var href=a.getAttribute('href');if(href&&href.indexOf('://')<0){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){var pageinfo=history.getSwitchId(href);if(pageinfo&&!m_cache.has(pageinfo.id))ids[pageinfo.id]=1;}}});var idsA=[];for(var id in ids)idsA.push(id);if(idsA.length>m_maxSize){}else if(idsA.length>0){if(idsA.length>m_maxSize)idsA.length=m_maxSize;var batchSize=m_batchSize;if(idsA.length/batchSize<4)batchSize=Math.ceil(idsA.length/4);var requests=[];for(var x=0;x<Math.ceil(idsA.length/batchSize);x++){var sublist=idsA.slice(x*batchSize,(x+1)*batchSize);var params={partial:1};params['do']='fastwiki_preload';params.fastwiki_preload_pages=sublist.join(',');requests.push(params);}function doPost(params){m_debug&&console.log("Preloading "+params.fastwiki_preload_pages);$.post(DOKU_BASE+'doku.php',params,function(data){var pages=data.split(JSINFO.fastwiki.preload_head);for(var p=0;p<pages.length;p++){var line1End=pages[p].indexOf('\n');var id=pages[p].substr(0,line1End);pages[p]=pages[p].substr(line1End+1);m_debug&&console.log("Loaded "+[id,pages[p].length]);if(pages[p].indexOf('<body')>=0)m_debug&&console.log("ERROR: Body found!");else self.add(id,pages[p]);}if(requests.length>0)doPost(requests.shift());},'text');}for(var x=0;x<Math.min(4,requests.length);x++)doPost(requests.shift());}};function _pushToFront(id,queue){var idx=queue.indexOf(id);if(idx>=0){queue.splice(idx,1);queue.push(id);}}function _addPage(id,queue,hash,data,maxSize,exclude){if(id in hash)_pushToFront(id,queue);else if(data){if(queue.length>maxSize){if(exclude){for(var x=0;x<queue.length;x++){if(!exclude[queue[x]]){delete hash[queue[x]];queue.splice(x,1);}}}else delete hash[queue.shift()];}queue.push(id);}if(data)hash[id]=data;}}function CBrowserHistory(){var m_inPopState=false;var m_curBaseUrl=document.location.pathname;var m_prevTitle='__UNDEFINED__';var m_loadPageFunc=null;var self=this;function base(url,withId){if(withId){var id=url.replace(/.*id=([^&]+).*/,'$1');if(id.match(/^[a-zA-Z0-9_\-:]+$/))return url.replace(/\?.*/,'')+'?id='+id;}return url.replace(/\?.*/,'');}function _getWikiTitle(){var titleElt;$('h1, h2, h3, h4, h5, h6',$('.content_initial')).each(function(idx,elt){if(elt.className.indexOf('sectionedit')>=0){titleElt=elt;return false;}});return titleElt?$(titleElt).text():'';}this.init=function(loadFunc){m_prevTitle=_getWikiTitle()||'__UNDEFINED__';m_loadPageFunc=loadFunc;window.addEventListener('popstate',function(e){document.title=e.state.title;m_inPopState=true;self.switchBasePath(e.state.url);});};this.getSwitchId=function(newpage,force){var pageid=newpage.substr(1).replace(/.*doku.php(\?id=|\/)/,'').replace(/\//g,':');var ns=pageid.replace(/:[^:]+$/,'');if(!force){if(JSINFO.fastwiki.fastshow_same_ns&&ns!=JSINFO.namespace)return false;var incl=JSINFO.fastwiki.fastshow_include,excl=JSINFO.fastwiki.fastshow_exclude;if(incl&&!pageid.match('^('+incl.split(/\s*,\s*/).join('|')+')'))return false;if(excl&&pageid.match('^('+excl.split(/\s*,\s*/).join('|')+')'))return false;}return{id:pageid,ns:ns};};this.getSelfRefRegex=function(){var path=document.location.pathname;var idPath=JSINFO.id.replace(/:/g,'/');if(path.indexOf('doku.php')>=0)return new RegExp('doku\\.php\\?id='+JSINFO.id+'$|doku\\.php/'+idPath+'$');return new RegExp('^'+path+'$|://'+document.location.host+path+'$');};this.getBaseUrl=function(){return m_curBaseUrl;};this.switchBasePath=function(newpage){var pageinfo=this.getSwitchId(newpage);if(!pageinfo)return false;var oldid=JSINFO.id;JSINFO.id=pageinfo.id;JSINFO.namespace=pageinfo.ns;$('form').each(function(idx,form){if($(form).find('input[name="do"]').length>0){var input=$('input[name="id"]',form);if(input.val()==oldid)input.val(pageinfo.id);}});m_curBaseUrl=base(newpage);var prevpage=document.location.href;m_loadPageFunc('show',null,{fastwiki_compareid:oldid},true,function(){setTimeout(function(){if(!m_inPopState){history.replaceState({url:prevpage,title:document.title},"",prevpage);history.pushState({url:newpage,title:document.title},"",newpage);$(window).trigger('fastwiki:afterIdChange',[prevpage,m_curBaseUrl]);}m_inPopState=false;self.refreshPageTitle(true);},1);});return true;};this.refreshPageTitle=function(fromIdSwitch){var title=_getWikiTitle();document.title=title;if(!fromIdSwitch){$('a').each(function(idx,elt){var $this=$(this);var href=$this.attr('href');if(href&&href.match(self.getSelfRefRegex())&&$this.text()==m_prevTitle)$this.text(document.title);});}m_prevTitle=title;};}})(jQuery);if(!window.tpl_fastwiki_support){(function($){var m_showRow,m_editRow;var m_utils={makeShowLink:function(url){url=url.replace(/\?do=.*$/,'');return'<a href="'+url+'" class="action show" accesskey="v" rel="nofollow" title="'+JSINFO.fastwiki.text_btn_show+' [V]"><span>'+JSINFO.fastwiki.text_btn_show+'</span></a>';},makeShowRowLI:function(pagetools,mode){var showLink=$("a[href $= 'do=']",pagetools);if(showLink.length>0)m_showRow=$(showLink.parents('li')[0]);else{var link=$("a[href *= 'do=']",pagetools)[0];if(link){m_showRow=$('<li>'+m_utils.makeShowLink(link.href)+'</li>').toggle(mode!='show');pagetools.prepend(m_showRow);}}},fixButtons:function(showParent,allButtons,mode){var showBtn=$('.button.btn_show',showParent);if(showBtn.length==0){var url=$('form.button',allButtons)[0].action;showBtnHtml='<form class="button btn_show" method="get" action="'+url+'"><div class="no"><input type="hidden" name="do" value=""><input type="submit" value="'+JSINFO.fastwiki.text_btn_show+'" class="button" accesskey="v" title="'+JSINFO.fastwiki.text_btn_show+' [V]"></div></form>';showParent.each(function(idx,elt){var newBtn=$(showBtnHtml);showBtn=showBtn.add(newBtn);$(elt).prepend(newBtn.toggle(mode!='show'));});}var editBtn=$('.button.btn_edit',allButtons);if(editBtn.length>0)m_editRow=m_editRow?m_editRow.add(editBtn):editBtn;m_showRow=m_showRow?m_showRow.add(showBtn):showBtn;}};if($('#dokuwiki__pagetools').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){m_utils.makeShowRowLI($("#dokuwiki__pagetools ul"),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$("#dokuwiki__top").toggleClass("showSidebar hasSidebar",mode=='show');$("#dokuwiki__aside").css('display',mode=='show'?'':'none');m_showRow.toggle(mode!='show');}});}else if(JSINFO.fastwiki.templatename=='arctic'){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var buttonBars=$('#bar__bottom, #bar__top');if($('.button',buttonBars).length>0)m_utils.fixButtons($('.bar-left'),buttonBars,mode);else{var pagetools=$('.bar-left');m_editRow=$("a[href *= 'do=edit']",pagetools);m_showRow=$("a[href $= 'do=']",pagetools[0]);if(m_showRow.length==0){var url=$("a[href *= 'do=']")[0].href;m_showRow=$();pagetools.each(function(idx,elt){var show=$(m_utils.makeShowLink(url)).toggle(mode!='show');m_showRow=m_showRow.add(show);$(elt).prepend(show);});}}},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');$(".left_sidebar, .right_sidebar").css('display',mode=='show'?'':'none');}});}else if($('ul.nav.navbar-nav').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var pagetools=$("ul.nav.navbar-nav");m_utils.makeShowRowLI(pagetools,mode);m_editRow=$($('li',pagetools)[0]);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');},'fastwiki:updateToc':function(e,tocObj){$('#dw_toc').remove();if(tocObj.length>0)$('.content_initial').prepend($('<div id="dw_toc"></div>').append(tocObj.html()));tocObj.remove();}});}else if($('.stylehead .bar_top .bar_top_content').length>0){$(window).on({'fastwiki:init':function(e,mode){var toolbox=$(".sidebar_content .li_toolbox ul");m_utils.makeShowRowLI(toolbox,mode);m_editRow=$('.action.edit',toolbox).parent();m_utils.fixButtons($('.bar_bottom_content .bar-right'),$('.bar_bottom_content .bar-right'),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$(".right_sidebar, .left_sidebar").css('display',mode=='edit'?'none':'');m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');if(mode=='edit'||mode=='draft'){$('.page_720').css({border:0,textAlign:'inherit'});$('.left_page, .right_page').css({float:'none',width:'auto'});}else{$('.page_720').css({border:'',textAlign:''});$('.left_page, .right_page').css({float:'',width:''});}}});}})(jQuery);}if(window.installPluginHiddenJS){jQuery(window).on('fastwiki:afterSwitch',function(evt,viewMode,isSectionEdit,prevViewMode){jQuery(".hiddenActive, .hiddenSwitch").each(function(){jQuery(this).off('click');});if(viewMode=="show")installPluginHiddenJS();});}jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery('<div id="plugin__styling_loader">'+LANG.plugins.styling.loader+'</div>');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('<button>'+LANG.plugins.styling.popup+'</button>');$form.prepend($btn);$btn.on('click',function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('<p></p>');return;}window.onunload=function(e){if(doreload){DokuCookie.setValue('styling_plugin',0);if(window.opener)window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});if(window.opener)applyPreview(window.opener);DokuCookie.setValue('styling_plugin',1);});jQuery(function(){var $frm=jQuery('#translation__dropdown');if(!$frm.length)return;$frm.find('input[name=go]').hide();$frm.find('select[name=id]').change(function(){var id=jQuery(this).val();var action=$frm.attr('action');if(action.substr(action.length-1)=='/'){var link=action+id;}else{var link=action+'?id='+id;}window.location.href=link;});});jQuery(function(){jQuery('#usrmgr__del').on('click',function(){return confirm(LANG.del_confirm);});});jQuery(function(){dw_locktimer.init(840,1);});
diff --git a/data/cache/8/84d7238169ba6d06500223cad03d6e45.js.gz b/data/cache/8/84d7238169ba6d06500223cad03d6e45.js.gz
new file mode 100644
index 0000000..4c724e6
--- /dev/null
+++ b/data/cache/8/84d7238169ba6d06500223cad03d6e45.js.gz
Binary files differ
diff --git a/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.i b/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.i
new file mode 100644
index 0000000..6a8d6d0
--- /dev/null
+++ b/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.i
@@ -0,0 +1 @@
+a:17:{i:0;a:3:{i:0;s:14:"document_start";i:1;a:0:{}i:2;i:0;}i:1;a:3:{i:0;s:6:"p_open";i:1;a:0:{}i:2;i:0;}i:2;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:25:"Edita la página y pulsa ";}i:2;i:1;}i:3;a:3:{i:0;s:14:"monospace_open";i:1;a:0:{}i:2;i:26;}i:4;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:7:"Guardar";}i:2;i:28;}i:5;a:3:{i:0;s:15:"monospace_close";i:1;a:0:{}i:2;i:35;}i:6;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:9:". Vaya a ";}i:2;i:37;}i:7;a:3:{i:0;s:12:"internallink";i:1;a:2:{i:0;s:11:"wiki:syntax";i:1;N;}i:2;i:46;}i:8;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:74:" para ver la sintaxis del Wiki. Por favor edite la página solo si puedes ";}i:2;i:61;}i:9;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:1;i:1;s:2:"**";}i:2;i:1;i:3;s:2:"**";}i:2;i:135;}i:10;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:3;i:1;s:9:"mejorarla";}i:2;i:3;i:3;s:9:"mejorarla";}i:2;i:137;}i:11;a:3:{i:0;s:6:"plugin";i:1;a:4:{i:0;s:22:"markdowku_boldasterisk";i:1;a:2:{i:0;i:4;i:1;s:2:"**";}i:2;i:4;i:3;s:2:"**";}i:2;i:146;}i:12;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:91:". Si quieres probar algo relacionado a la sintaxis, aprende a dar tus primeros pasos en el ";}i:2;i:148;}i:13;a:3:{i:0;s:12:"internallink";i:1;a:2:{i:0;s:21:"playground:playground";i:1;N;}i:2;i:239;}i:14;a:3:{i:0;s:5:"cdata";i:1;a:1:{i:0;s:1:".";}i:2;i:264;}i:15;a:3:{i:0;s:7:"p_close";i:1;a:0:{}i:2;i:265;}i:16;a:3:{i:0;s:12:"document_end";i:1;a:0:{}i:2;i:265;}} \ No newline at end of file
diff --git a/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.xhtml b/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.xhtml
new file mode 100644
index 0000000..e64f42c
--- /dev/null
+++ b/data/cache/8/8b8b1d5838ba55d255901bcafaa402bc.xhtml
@@ -0,0 +1,4 @@
+
+<p>
+Edita la página y pulsa <code>Guardar</code>. Vaya a <a href="/wiki:syntax" class="wikilink2" title="wiki:syntax" rel="nofollow" data-wiki-id="wiki:syntax">syntax</a> para ver la sintaxis del Wiki. Por favor edite la página solo si puedes <strong>mejorarla</strong>. Si quieres probar algo relacionado a la sintaxis, aprende a dar tus primeros pasos en el <a href="/playground:playground" class="wikilink2" title="playground:playground" rel="nofollow" data-wiki-id="playground:playground">playground</a>.
+</p>
diff --git a/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js b/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js
new file mode 100644
index 0000000..70fae7e
--- /dev/null
+++ b/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Toggle Search Tools","willexpire":"Your lock for editing this page is about to expire in a minute.\\nTo avoid conflicts use the preview button to reset the locktimer.","notsavedyet":"Unsaved changes will be lost.","searchmedia":"Search for files","keepopen":"Keep window open on selection","hidedetails":"Hide Details","mediatitle":"Link settings","mediadisplay":"Link type","mediaalign":"Alignment","mediasize":"Image size","mediatarget":"Link target","mediaclose":"Close","mediainsert":"Insert","mediadisplayimg":"Show the image.","mediadisplaylnk":"Show only the link.","mediasmall":"Small version","mediamedium":"Medium version","medialarge":"Large version","mediaoriginal":"Original version","medialnk":"Link to detail page","mediadirect":"Direct link to original","medianolnk":"No link","medianolink":"Do not link the image","medialeft":"Align the image on the left.","mediaright":"Align the image on the right.","mediacenter":"Align the image in the middle.","medianoalign":"Use no align.","nosmblinks":"Linking to Windows shares only works in Microsoft Internet Explorer.\\nYou still can copy and paste the link.","linkwiz":"Link Wizard","linkto":"Link to:","del_confirm":"Really delete selected item(s)?","restore_confirm":"Really restore this version?","media_diff":"View differences:","media_diff_both":"Side by Side","media_diff_opacity":"Shine-through","media_diff_portions":"Swipe","media_select":"Select files\u2026","media_upload_btn":"Upload","media_done_btn":"Done","media_drop":"Drop files here to upload","media_cancel":"remove","media_overwrt":"Overwrite existing files","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Bold Text","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"Italic Text","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Underlined Text","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"Monospaced Text","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Strike-through Text","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"Same Level Headline","icon":"hequal.png","key":"8","text":"Headline","mod":0,"block":true},{"type":"autohead","title":"Lower Headline","icon":"hminus.png","key":"9","text":"Headline","mod":1,"block":true},{"type":"autohead","title":"Higher Headline","icon":"hplus.png","key":"0","text":"Headline","mod":-1,"block":true},{"type":"picker","title":"Select Headline","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"Level 1 Headline","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"Level 2 Headline","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"Level 3 Headline","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"Level 4 Headline","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"Level 5 Headline","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Internal Link","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"External Link","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|External Link","block":false},{"type":"formatln","title":"Ordered List Item","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"Unordered List Item","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"Horizontal Rule","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"Add Images and other files (opens in a new window)","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Smileys","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Special Chars","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insert Signature","icon":"sig.png","key":"y","block":false}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);jQuery(function(){jQuery('form.bureaucracy__plugin').each(function(){function updateFieldset(input){jQuery.each(jQuery(input).data('dparray'),function(i,dp){var showOrHide=input.parentNode.parentNode.style.display!=='none'&&((input.checked===dp.tval)||(input.type!=='checkbox'&&(dp.tval===true&&input.value!==''))||input.value===dp.tval);dp.fset.toggle(showOrHide);dp.fset.find('input,select').each(function(){var $inputelem=jQuery(this);if($inputelem.hasClass('required')){if(showOrHide){$inputelem.attr('required','required');}else{$inputelem.removeAttr('required')}}if($inputelem.data('dparray')){$inputelem.change();}});});}jQuery('p.bureaucracy_depends',this).each(function(){var fname=jQuery(this).find('span.bureaucracy_depends_fname').html(),fvalue=jQuery(this).find('span.bureaucracy_depends_fvalue');fvalue=(fvalue.length?fvalue.html():true);var fieldsetinfo={fset:jQuery(this).parent(),tval:fvalue};jQuery("label").has(":first-child:contains('"+fname+"')").first().find("select,input:last").each(function(){if(!jQuery(this).data('dparray')){jQuery(this).data('dparray',[fieldsetinfo]);}else{jQuery(this).data('dparray').push(fieldsetinfo);}}).bind('change keyup',function(){updateFieldset(this);}).change();}).hide();});});jQuery(function(){function ajaxsource(request,response,getterm){jQuery.getJSON(DOKU_BASE+'lib/exe/ajax.php',{call:'bureaucracy_user_field',search:getterm(request)},function(data){response(jQuery.map(data,function(name,user){return{label:name+' ('+user+')',value:user}}))});}function split(val){return val.split(/,\s*/);}function extractLast(term){return split(term).pop();}jQuery(".userpicker").autocomplete({source:function(request,response){ajaxsource(request,response,function(req){return req.term})}});jQuery(".userspicker").bind("keydown",function(event){if(event.keyCode===jQuery.ui.keyCode.TAB&&jQuery(this).data("ui-autocomplete").menu.active){event.preventDefault();}}).autocomplete({minLength:0,source:function(request,response){ajaxsource(request,response,function(req){return extractLast(req.term)})},search:function(){var term=extractLast(this.value);return term.length>=2;},focus:function(){return false;},select:function(event,ui){var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");return false;}});});jQuery(function(){jQuery('.bureaucracy__plugin .datepicker').datepicker({dateFormat:"yy-mm-dd",changeMonth:true,changeYear:true});});(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.selected_item.removeClass("chosen-default");}return this.selected_item.find("span").html(text);};Chosen.prototype.result_deselect=function(pos){var result_data;result_data=this.results_data[pos];if(!this.form_field.options[result_data.options_index].disabled){result_data.selected=false;this.form_field.options[result_data.options_index].selected=false;this.selected_option_count=null;this.result_clear_highlight();if(this.results_showing){this.winnow_results();}this.form_field_jq.trigger("change",{deselected:this.form_field.options[result_data.options_index].value});this.search_field_scale();return true;}else{return false;}};Chosen.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect){return;}if(!this.selected_item.find("abbr").length){this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");}return this.selected_item.addClass("chosen-single-with-deselect");};Chosen.prototype.get_search_text=function(){return $('<div/>').text($.trim(this.search_field.val())).html();};Chosen.prototype.winnow_results_set_highlight=function(){var do_high,selected_results;selected_results=!this.is_multiple?this.search_results.find(".result-selected.active-result"):[];do_high=selected_results.length?selected_results.first():this.search_results.find(".active-result").first();if(do_high!=null){return this.result_do_highlight(do_high);}};Chosen.prototype.no_results=function(terms){var no_results_html;no_results_html=$('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');no_results_html.find("span").first().html(terms);this.search_results.append(no_results_html);return this.form_field_jq.trigger("chosen:no_results",{chosen:this});};Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove();};Chosen.prototype.keydown_arrow=function(){var next_sib;if(this.results_showing&&this.result_highlight){next_sib=this.result_highlight.nextAll("li.active-result").first();if(next_sib){return this.result_do_highlight(next_sib);}}else{return this.results_show();}};Chosen.prototype.keyup_arrow=function(){var prev_sibs;if(!this.results_showing&&!this.is_multiple){return this.results_show();}else if(this.result_highlight){prev_sibs=this.result_highlight.prevAll("li.active-result");if(prev_sibs.length){return this.result_do_highlight(prev_sibs.first());}else{if(this.choices_count()>0){this.results_hide();}return this.result_clear_highlight();}}};Chosen.prototype.keydown_backstroke=function(){var next_available_destroy;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke();}else{next_available_destroy=this.search_container.siblings("li.search-choice").last();if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){this.pending_backstroke=next_available_destroy;if(this.single_backstroke_delete){return this.keydown_backstroke();}else{return this.pending_backstroke.addClass("search-choice-focus");}}}};Chosen.prototype.clear_backstroke=function(){if(this.pending_backstroke){this.pending_backstroke.removeClass("search-choice-focus");}return this.pending_backstroke=null;};Chosen.prototype.keydown_checker=function(evt){var stroke,_ref1;stroke=(_ref1=evt.which)!=null?_ref1:evt.keyCode;this.search_field_scale();if(stroke!==8&&this.pending_backstroke){this.clear_backstroke();}switch(stroke){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:if(this.results_showing&&!this.is_multiple){this.result_select(evt);}this.mouse_on_container=false;break;case 13:if(this.results_showing){evt.preventDefault();}break;case 32:if(this.disable_search){evt.preventDefault();}break;case 38:evt.preventDefault();this.keyup_arrow();break;case 40:evt.preventDefault();this.keydown_arrow();break;}};Chosen.prototype.search_field_scale=function(){var div,f_width,h,style,style_block,styles,w,_i,_len;if(this.is_multiple){h=0;w=0;style_block="position:absolute; left: -1000px; top: -1000px; display:none;";styles=['font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing'];for(_i=0,_len=styles.length;_i<_len;_i++){style=styles[_i];style_block+=style+":"+this.search_field.css(style)+";";}div=$('<div />',{'style':style_block});div.text(this.search_field.val());$('body').append(div);w=div.width()+25;div.remove();f_width=this.container.outerWidth();if(w>f_width-10){w=f_width-10;}return this.search_field.css({'width':w+'px'});}};return Chosen;})(AbstractChosen);}).call(this);(function(){'use strict';jQuery(function(){var $animalSelect=jQuery('select.farmer_chosen_animals');$animalSelect.chosen({width:'100%',search_contains:true,allow_single_deselect:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});jQuery('select.acl_chosen').chosen({disable_search:true,width:'100%'});var $formAllAnimals=jQuery('#farmer__pluginsforall');$formAllAnimals.find('select').change(function(){$formAllAnimals.find('button').prop('disabled',false);}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.pluginSelect});var $formSingleAnimal=jQuery('#farmer__pluginsforone');$formSingleAnimal.find('select').change(function(){var animal=jQuery(this).val();$formSingleAnimal.find('button').prop('disabled',true);jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPlugins_'+animal},function(data){$formSingleAnimal.find('div.output').html(data);$formSingleAnimal.find('button').prop('disabled',false);},'html')}).chosen({width:'100%',search_contains:true,"placeholder_text_single":LANG.plugins.farmer.animalSelect});var $formPluginMatrix=jQuery('#farmer__pluginmatrix').hide();$formPluginMatrix.on('click','td',function(){var $td=jQuery(this);$td.html('⌛').css('background-color','transparent');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_modPlugin',plugin:$td.data('plugin'),ani:$td.data('animal')},function(data){$td.replaceWith(data);},'html');});function showMatrix(){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_farmer_getPluginMatrix'},function(data){$formPluginMatrix.html(data);$formPluginMatrix.show();},'html')}$animalSelect.on('chosen:showing_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'20em'},400);}).on('chosen:hiding_dropdown',function(evt,params){jQuery(evt.target).parent('fieldset').animate({"padding-bottom":'7px'},400);});var $aclPolicyFieldset=jQuery('#aclPolicyFieldset');if($aclPolicyFieldset.length){$animalSelect.on('change',function(evt,params){var $this=jQuery(this);if($this.val()===''){$aclPolicyFieldset.slideDown();}else{$aclPolicyFieldset.slideUp();}});}jQuery("input[name=bulkSingleSwitch]:radio").change(function(){if(jQuery('#farmer__bulk').prop("checked")){$formAllAnimals.show();$formSingleAnimal.hide();$formPluginMatrix.hide();}else if(jQuery('#farmer__single').prop("checked")){$formAllAnimals.hide();$formSingleAnimal.show();$formPluginMatrix.hide();}else{$formAllAnimals.hide();$formSingleAnimal.hide();showMatrix();}});jQuery('#farmer__bulk').click();});})();var plugin_fastwiki=(function($){var m_viewMode,m_origViewMode,m_prevView;var m_isSecedit,m_wasSecedit;var m_hasDraft;var m_pageObjs={};var m_content;var m_initialId;var m_debug=document.location.host=='localhost';var m_cache=new CPageCache(JSINFO.fastwiki.preload_per_page,JSINFO.fastwiki.preload_batchsize,m_debug);var m_supportedActions={'':1,edit:1,draft:1,history:1,recent:1,revisions:1,show:1,subscribe:1,backlink:1,index:1,profile:1,media:1,diff:1,save:1};var m_modeClassElt;var m_browserHistory=new CBrowserHistory();$(function(){if(document.location.href.indexOf("detail.php")>=0)m_viewMode='unsupported';else{var urlParams=_urlToObj(document.location.href);m_viewMode=urlParams['do']||'show';if(!m_supportedActions[m_viewMode])m_viewMode='unsupported';else if(window.tpl_fastwiki_startmode_support&&!(m_viewMode in tpl_fastwiki_startmode_support))m_viewMode='unsupported';}m_origViewMode=m_viewMode;m_content=$('.plugin_fastwiki_marker').parent();m_content.addClass('content_initial');m_initialId=m_content.attr('id');m_modeClassElt=m_content.hasClass('dokuwiki')?m_content:$(m_content.parents('.dokuwiki')[0]||document.body);$(window).trigger('fastwiki:init',[m_viewMode]);if(JSINFO.fastwiki.fastpages)fixActionLinks(document.body);if(JSINFO.fastwiki.fastshow&&(m_origViewMode!='show'||!window.history||!history.pushState))JSINFO.fastwiki.fastshow=false;if(JSINFO.fastwiki.fastshow)m_browserHistory.init(load);});function fixActionLinks(elt){if(m_origViewMode=='unsupported')return;var formActions={search:1};var supportedFields={'do':1,rev:1,id:1};$('a[href *= "?do="]',elt).click(function(e){var curPathId=JSINFO.id.replace(/:/g,'/');var aPathId=this.href.replace(/\?.*$/,'').replace(/:/g,'/');if(aPathId.substr(-curPathId.length)==curPathId){var params=_urlToObj(this.href);if(!params['do'])params['do']='show';if(params['do']in m_supportedActions){e.preventDefault();load(params['do'],null,params);}}});$('input[type="submit"], input[type="button"], button',elt).click(function(e){var form=$(this).parents('form');if(form.length>0&&form[0]['do']&&form[0]['do'].value in m_supportedActions){var supported=true;$('input[type != "submit"]',form).each(function(idx,elt){if(elt.type!='button'&&(elt.type!='hidden'||!(elt.name in supportedFields)))supported=false;});if(supported){e.preventDefault();var params=_formToObj(form[0]);if(!params['do'])params['do']='show';load(params['do'],null,params);}}});if(m_origViewMode=='show'&&window.JSINFO){var pathId=JSINFO.id.replace(/:/g,'/');$('a',elt).click(function(e){var href=this.getAttribute('href');if(href&&href.indexOf('://')<0){if(href.match(m_browserHistory.getSelfRefRegex())){load('show');e.preventDefault();}else if(JSINFO.fastwiki.fastshow){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){if(m_browserHistory.switchBasePath(href)){m_viewMode=null;e.preventDefault();}}}}});}if(JSINFO.fastwiki.secedit){$('.editbutton_section .btn_secedit input[type=submit], .editbutton_section .btn_secedit button',elt).click(function(e){e.preventDefault();var form=$(this).parents('form');load('edit',form,_formToObj(form));});}if(JSINFO.fastwiki.preload)m_cache.load(elt,m_browserHistory);}function _preview(sectionForm){var body=$(document.body);var params=_formToObj($('#dw__editform'));params['do']='preview';_sendPartial(params,$('.dokuwiki .editBox'),function(data){var preview=$('<div id="preview_container">'+data+'</div>');var pvEditor=preview.find('#dw__editform');var editor=$('#dw__editform')[0];pvEditor.find('input[type=hidden]').each(function(idx,elt){editor[elt.name].value=elt.value;});preview.find('#scroll__here').prevAll().remove();var oldpreview=$('#preview_container');if(oldpreview.length>0)oldpreview.replaceWith(preview);else $('.content_partial').append(preview);setTimeout(function(){$('html,body').animate({scrollTop:$('#scroll__here').offset().top+'px'},300);},1);},'text');}function _getSection(sectionForm){var pieces=$();var target=sectionForm.parent();var nr=target.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];while(target.length>0&&!(target.hasClass('sectionedit'+nr)||target.find('.sectionedit'+nr).length)){target=target.prev();if(target.hasClass('section_highlight'))pieces=pieces.add(target.children());pieces=pieces.add(target);}return pieces;}function _focusEdit(){var $edit_text=$('#wiki__text');if($edit_text.length>0&&!$edit_text.attr('readOnly')){var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;try{DWsetSelection(sel);}catch(e){setTimeout(function(){try{DWsetSelection(sel);}catch(e){}},500);}$edit_text.focus();}}function _initEdit(){if(!window.doku_summaryCheck){window.doku_summaryCheck=window.summaryCheck;}dw_editor.init();dw_locktimer.init(JSINFO.fastwiki.locktime,JSINFO.fastwiki.usedraft);var $editform=$('#dw__editform');if($editform.length==0)return;var $edit_text=$('#wiki__text');$editform.on("change keydown",function(e){window.textChanged=true;doku_summaryCheck();});m_pageObjs.content=$edit_text.val();window.onbeforeunload=function(){if(window.textChanged&&m_pageObjs.content!=$edit_text.val())return LANG.notsavedyet;};window.onunload=deleteDraft;$('#edbtn__preview').click(function(e){if(JSINFO.fastwiki.preview){e.preventDefault();_preview(m_pageObjs.sectionForm);m_hasDraft=true;dw_locktimer.reset();}else{window.onbeforeunload='';textChanged=false;window.keepDraft=true;}});$('#edit__summary').on("change keyup",doku_summaryCheck);if(textChanged)doku_summaryCheck();initToolbar('tool__bar','wiki__text',toolbar);$('#tool__bar').attr('role','toolbar');$('#edbtn__save').click(function(e){textChanged=false;if(JSINFO.fastwiki.save&&m_origViewMode=='show'&&$edit_text.val().length>0&&m_pageObjs.content.length>0){e.preventDefault();load('save',null,_formToObj($('#dw__editform')));}else m_cache.remove(JSINFO.id);window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[draftdel]"]',$editform).click(function(e){e.preventDefault();var id=$editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});$('input[name="do[show]"]',$editform).click(function(e){e.preventDefault();load('show');});$('.picker.pk_hl').addClass('dokuwiki');}function _setBodyClass(action,target){for(var k in m_supportedActions)m_modeClassElt.removeClass('mode_'+k);m_modeClassElt.addClass('mode_'+action);if(target=='section')m_modeClassElt.removeClass('mode_edit').addClass('mode_show mode_secedit');$('.content_partial').toggle(m_viewMode!=m_origViewMode);$('.content_initial').toggle(m_viewMode==m_origViewMode||target=='section');}function _updatePageObjsOnSwitch(){if(m_pageObjs.showOnSwitch)m_pageObjs.showOnSwitch.show();delete m_pageObjs.showOnSwitch;delete m_pageObjs.content;delete m_pageObjs.sectionForm;var hasToc={show:1,admin:1};$("#dw__toc, #dw_toc_head, #dw_toc").css('display',m_viewMode in hasToc?'':'none');}function _formToObj(form){var obj={};$(form).serializeArray().map(function(item){obj[item.name]=item.value;});return obj;}function _urlToObj(url){var obj={};var a=url.replace(/.*\?/,'').split('&');for(var x=0;x<a.length;x++){var parts=unescape(a[x]).split('=');var name=parts.shift();obj[name]=parts.join('=');}return obj;}var m_actionEffects={subscribe:function(params,extraData){function subscribeAction(sparams){_sendPartial(sparams,_getVisibleContent(),function(data){load(m_origViewMode);var body=$('<div class="message_partial"></div>').append(data);$('.content_initial').before(body);},'text');}var form=$('#subscribe__form');$('input[name="do[subscribe]"]',form).click(function(e){e.preventDefault();subscribeAction(_formToObj(form));});$('.content_partial .unsubscribe').click(function(e){e.preventDefault();subscribeAction(_urlToObj(this.href));});},index:function(params,extraData){dw_index.$obj=$('#index__tree');dw_index.init();},edit:function(params,extraData){var draft=params['do']=='draft';if(m_hasDraft===true)draft=true;else if(m_hasDraft===false)draft=params.rev=null;if(extraData.sectionForm){m_pageObjs.sectionForm=extraData.sectionForm;extraData.sectionParts=extraData.sectionParts.add('.editbutton_section');m_pageObjs.showOnSwitch=extraData.sectionParts;m_pageObjs.showOnSwitch.hide();_initEdit();_focusEdit();}else _initEdit();setTimeout(function(){_focusEdit();if(document.body.scrollTop>0)$('html,body').animate({scrollTop:Math.max(0,Math.floor($('.content_partial').offset().top)-20)+'px'},300);},1);},revisions:function(params,extraData){$('.content_partial form').each(function(idx,form){$('input[name="do[diff]"]',form).click(function(e){e.preventDefault();load('diff',null,_formToObj(form));});});},save:function(params,extraData){if($('.content_partial #a_newer_version_exists').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});var editform=$('#dw__editform');$('input[name="do[save]"]',editform).click(function(e){e.preventDefault();load('save',null,_formToObj(editform));window.onbeforeunload='';dw_locktimer.clear();});$('input[name="do[cancel]"]',editform).click(function(e){e.preventDefault();var id=editform.find('input[name=id]').val();load('show');if(!window.keepDraft){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:id,success:function(data,textStatus,jqXHR){m_hasDraft=false;}});}});}else if($('.content_partial #dw__editform').length>0){m_viewMode='edit';m_actionEffects.edit(params,m_pageObjs.sectionForm?{sectionForm:m_pageObjs.sectionForm,sectionParts:_getSection(m_pageObjs.sectionForm)}:{});}else if($('.content_partial #preview').length>0){load('show');}else{$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));m_browserHistory.refreshPageTitle(false);load('show');dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}},show:function(params,extraData){$('.content_initial').html($('.content_partial').html());$('.content_partial').remove();fixActionLinks($('.content_initial'));dw_page.sectionHighlight();jQuery('a.fn_top').mouseover(dw_page.footnoteDisplay);}};m_actionEffects.draft=m_actionEffects.edit;m_actionEffects.diff=m_actionEffects.revisions;function _action(action,params,callback,insertLoc,extraData){params['do']=action;function cb(data){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);var body=$('<div class="content_partial"></div>').append(data);if(insertLoc&&action=='edit'){var newform=$('#dw__editform',body);if(newform.find('input[name=prefix]').val()=='.'&&newform.find('input[name=suffix]').val()==''){delete m_pageObjs.sectionForm;if(extraData)delete extraData.sectionForm;insertLoc=null;}}if(insertLoc)$(insertLoc[insertLoc.length-1]).after(body);else{var initial=$('.content_initial');body.addClass(initial[0].className.replace(/content_initial/,'')).attr('id',m_initialId);initial.attr('id','').after(body);}var newToc=$('.content_partial #dw__toc').addClass('fwJustincase');var hasNewToc=newToc.length>0;_updatePageObjsOnSwitch();if(callback)callback(data,extraData);if(m_actionEffects[action])m_actionEffects[action](params,extraData||{});newToc=$('.fwJustincase').removeClass('fwJustincase');if(m_viewMode=='show')$(window).trigger('fastwiki:updateToc',[newToc]);if(hasNewToc)dw_page.makeToggle('#dw__toc h3','#dw__toc > div');fixActionLinks($('.content_partial'));_setBodyClass(m_viewMode,m_pageObjs.sectionForm?"section":null);if(m_viewMode=='show')m_cache.add(JSINFO.id,data,true);if(!insertLoc)dw_behaviour.init();$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm,m_prevView]);if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}}if(action=='show'&&m_cache.get(JSINFO.id)){m_debug&&console.log("Getting from cache: "+JSINFO.id);cb(m_cache.get(JSINFO.id));}else _sendPartial(params,_getVisibleContent(),cb,'text');}function _sendPartial(params,spinnerParent,callback){if($('.partialsLoading').length==0){var spinnerCss=spinnerParent.height()+spinnerParent.offset().top>$(window).height()?{top:$(window).height()/2}:{top:'50%'};spinnerParent.append($('<div class="partialsLoading"></div>').css('display','none').css(spinnerCss));setTimeout(function(){$('.partialsLoading').css('display','');},500);}params.partial=1;jQuery[!params['do']||params['do']=='show'?'get':'post'](m_browserHistory.getBaseUrl(),params,function(data){if(data=='PERMISSION_CHANGE'){delete params.partial;delete params.fastwiki_compareid;var url=m_browserHistory.getBaseUrl()+'?'+$.param(params);document.location.href=url;}else callback(data);$('.partialsLoading').remove();},'text');}function _getVisibleContent(){var parentElt=$('.content_partial');if(parentElt.length==0)parentElt=$('.content_initial');return parentElt;}function load(page,sectionForm,params,force,callback){if((m_viewMode=='edit'||m_viewMode=='draft')&&(page!='save'&&page!='preview')&&m_pageObjs.content!=$('#wiki__text').val()){if(!confirm(LANG.notsavedyet))return;}m_prevView=m_viewMode;m_wasSecedit=m_isSecedit;m_isSecedit=!!sectionForm||(m_wasSecedit&&page=='save');m_viewMode=page;if(!params)params={};window.onbeforeunload='';dw_locktimer.clear();_updatePageObjsOnSwitch();if(page==m_origViewMode&&!force){$('.content_partial, .message_partial').remove();$('.content_initial').attr('id',m_initialId);if(m_prevView!=page){if(!m_isSecedit&&!m_wasSecedit){setTimeout(function(){$('html,body').animate({scrollTop:0},300);},1);}_setBodyClass(page);$(window).trigger('fastwiki:afterSwitch',[m_pageObjs.sectionForm?'show':m_viewMode,!!m_pageObjs.sectionForm]);}if(callback)callback();}else if((page=='draft'||page=='edit')&&sectionForm){var sectionParts=_getSection(sectionForm);_action(page,params,callback,sectionParts,{sectionForm:sectionForm,sectionParts:sectionParts});}else _action(page,params,callback);}return{load:load,fixActionLinks:fixActionLinks};function CPageCache(maxSize,batchSize,debug){var m_queue=[];var m_p1Queue=[];var m_pages={},m_p1Ids={};var m_maxSize=maxSize;var m_batchSize=batchSize;var m_maxP1Size=10;if(debug){window.cpagecache_pages=m_pages;window.cpagecache_queue=m_queue;}this.add=function(id,data,p1){if(p1)_addPage(id,m_p1Queue,m_p1Ids,1,m_maxP1Size);_addPage(id,m_queue,m_pages,data,m_maxSize,m_p1Queue);};this.remove=function(id){if(id in m_pages){m_queue.splice(m_queue.indexOf(id),1);delete m_pages[id];var p1Idx=m_p1Queue.indexOf(id);if(p1Idx>=0){m_queue.splice(p1Idx,1);delete m_p1Ids[id];}}};this.get=function(id){if(id in m_pages){_pushToFront(id,m_queue);_pushToFront(id,m_p1Queue);return m_pages[id];}return null;};this.has=function(id){return id in m_pages;};this.load=function(elt,history){var self=this;var ids={};$('a',elt).each(function(idx,a){var href=a.getAttribute('href');if(href&&href.indexOf('://')<0){var numParams=href.split('=').length;if(href.indexOf('id=')>=0)numParams--;if(numParams==1){var pageinfo=history.getSwitchId(href);if(pageinfo&&!m_cache.has(pageinfo.id))ids[pageinfo.id]=1;}}});var idsA=[];for(var id in ids)idsA.push(id);if(idsA.length>m_maxSize){}else if(idsA.length>0){if(idsA.length>m_maxSize)idsA.length=m_maxSize;var batchSize=m_batchSize;if(idsA.length/batchSize<4)batchSize=Math.ceil(idsA.length/4);var requests=[];for(var x=0;x<Math.ceil(idsA.length/batchSize);x++){var sublist=idsA.slice(x*batchSize,(x+1)*batchSize);var params={partial:1};params['do']='fastwiki_preload';params.fastwiki_preload_pages=sublist.join(',');requests.push(params);}function doPost(params){m_debug&&console.log("Preloading "+params.fastwiki_preload_pages);$.post(DOKU_BASE+'doku.php',params,function(data){var pages=data.split(JSINFO.fastwiki.preload_head);for(var p=0;p<pages.length;p++){var line1End=pages[p].indexOf('\n');var id=pages[p].substr(0,line1End);pages[p]=pages[p].substr(line1End+1);m_debug&&console.log("Loaded "+[id,pages[p].length]);if(pages[p].indexOf('<body')>=0)m_debug&&console.log("ERROR: Body found!");else self.add(id,pages[p]);}if(requests.length>0)doPost(requests.shift());},'text');}for(var x=0;x<Math.min(4,requests.length);x++)doPost(requests.shift());}};function _pushToFront(id,queue){var idx=queue.indexOf(id);if(idx>=0){queue.splice(idx,1);queue.push(id);}}function _addPage(id,queue,hash,data,maxSize,exclude){if(id in hash)_pushToFront(id,queue);else if(data){if(queue.length>maxSize){if(exclude){for(var x=0;x<queue.length;x++){if(!exclude[queue[x]]){delete hash[queue[x]];queue.splice(x,1);}}}else delete hash[queue.shift()];}queue.push(id);}if(data)hash[id]=data;}}function CBrowserHistory(){var m_inPopState=false;var m_curBaseUrl=document.location.pathname;var m_prevTitle='__UNDEFINED__';var m_loadPageFunc=null;var self=this;function base(url,withId){if(withId){var id=url.replace(/.*id=([^&]+).*/,'$1');if(id.match(/^[a-zA-Z0-9_\-:]+$/))return url.replace(/\?.*/,'')+'?id='+id;}return url.replace(/\?.*/,'');}function _getWikiTitle(){var titleElt;$('h1, h2, h3, h4, h5, h6',$('.content_initial')).each(function(idx,elt){if(elt.className.indexOf('sectionedit')>=0){titleElt=elt;return false;}});return titleElt?$(titleElt).text():'';}this.init=function(loadFunc){m_prevTitle=_getWikiTitle()||'__UNDEFINED__';m_loadPageFunc=loadFunc;window.addEventListener('popstate',function(e){document.title=e.state.title;m_inPopState=true;self.switchBasePath(e.state.url);});};this.getSwitchId=function(newpage,force){var pageid=newpage.substr(1).replace(/.*doku.php(\?id=|\/)/,'').replace(/\//g,':');var ns=pageid.replace(/:[^:]+$/,'');if(!force){if(JSINFO.fastwiki.fastshow_same_ns&&ns!=JSINFO.namespace)return false;var incl=JSINFO.fastwiki.fastshow_include,excl=JSINFO.fastwiki.fastshow_exclude;if(incl&&!pageid.match('^('+incl.split(/\s*,\s*/).join('|')+')'))return false;if(excl&&pageid.match('^('+excl.split(/\s*,\s*/).join('|')+')'))return false;}return{id:pageid,ns:ns};};this.getSelfRefRegex=function(){var path=document.location.pathname;var idPath=JSINFO.id.replace(/:/g,'/');if(path.indexOf('doku.php')>=0)return new RegExp('doku\\.php\\?id='+JSINFO.id+'$|doku\\.php/'+idPath+'$');return new RegExp('^'+path+'$|://'+document.location.host+path+'$');};this.getBaseUrl=function(){return m_curBaseUrl;};this.switchBasePath=function(newpage){var pageinfo=this.getSwitchId(newpage);if(!pageinfo)return false;var oldid=JSINFO.id;JSINFO.id=pageinfo.id;JSINFO.namespace=pageinfo.ns;$('form').each(function(idx,form){if($(form).find('input[name="do"]').length>0){var input=$('input[name="id"]',form);if(input.val()==oldid)input.val(pageinfo.id);}});m_curBaseUrl=base(newpage);var prevpage=document.location.href;m_loadPageFunc('show',null,{fastwiki_compareid:oldid},true,function(){setTimeout(function(){if(!m_inPopState){history.replaceState({url:prevpage,title:document.title},"",prevpage);history.pushState({url:newpage,title:document.title},"",newpage);$(window).trigger('fastwiki:afterIdChange',[prevpage,m_curBaseUrl]);}m_inPopState=false;self.refreshPageTitle(true);},1);});return true;};this.refreshPageTitle=function(fromIdSwitch){var title=_getWikiTitle();document.title=title;if(!fromIdSwitch){$('a').each(function(idx,elt){var $this=$(this);var href=$this.attr('href');if(href&&href.match(self.getSelfRefRegex())&&$this.text()==m_prevTitle)$this.text(document.title);});}m_prevTitle=title;};}})(jQuery);if(!window.tpl_fastwiki_support){(function($){var m_showRow,m_editRow;var m_utils={makeShowLink:function(url){url=url.replace(/\?do=.*$/,'');return'<a href="'+url+'" class="action show" accesskey="v" rel="nofollow" title="'+JSINFO.fastwiki.text_btn_show+' [V]"><span>'+JSINFO.fastwiki.text_btn_show+'</span></a>';},makeShowRowLI:function(pagetools,mode){var showLink=$("a[href $= 'do=']",pagetools);if(showLink.length>0)m_showRow=$(showLink.parents('li')[0]);else{var link=$("a[href *= 'do=']",pagetools)[0];if(link){m_showRow=$('<li>'+m_utils.makeShowLink(link.href)+'</li>').toggle(mode!='show');pagetools.prepend(m_showRow);}}},fixButtons:function(showParent,allButtons,mode){var showBtn=$('.button.btn_show',showParent);if(showBtn.length==0){var url=$('form.button',allButtons)[0].action;showBtnHtml='<form class="button btn_show" method="get" action="'+url+'"><div class="no"><input type="hidden" name="do" value=""><input type="submit" value="'+JSINFO.fastwiki.text_btn_show+'" class="button" accesskey="v" title="'+JSINFO.fastwiki.text_btn_show+' [V]"></div></form>';showParent.each(function(idx,elt){var newBtn=$(showBtnHtml);showBtn=showBtn.add(newBtn);$(elt).prepend(newBtn.toggle(mode!='show'));});}var editBtn=$('.button.btn_edit',allButtons);if(editBtn.length>0)m_editRow=m_editRow?m_editRow.add(editBtn):editBtn;m_showRow=m_showRow?m_showRow.add(showBtn):showBtn;}};if($('#dokuwiki__pagetools').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){m_utils.makeShowRowLI($("#dokuwiki__pagetools ul"),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$("#dokuwiki__top").toggleClass("showSidebar hasSidebar",mode=='show');$("#dokuwiki__aside").css('display',mode=='show'?'':'none');m_showRow.toggle(mode!='show');}});}else if(JSINFO.fastwiki.templatename=='arctic'){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var buttonBars=$('#bar__bottom, #bar__top');if($('.button',buttonBars).length>0)m_utils.fixButtons($('.bar-left'),buttonBars,mode);else{var pagetools=$('.bar-left');m_editRow=$("a[href *= 'do=edit']",pagetools);m_showRow=$("a[href $= 'do=']",pagetools[0]);if(m_showRow.length==0){var url=$("a[href *= 'do=']")[0].href;m_showRow=$();pagetools.each(function(idx,elt){var show=$(m_utils.makeShowLink(url)).toggle(mode!='show');m_showRow=m_showRow.add(show);$(elt).prepend(show);});}}},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');$(".left_sidebar, .right_sidebar").css('display',mode=='show'?'':'none');}});}else if($('ul.nav.navbar-nav').length>0){window.tpl_fastwiki_startmode_support={show:1};$(window).on({'fastwiki:init':function(e,mode){var pagetools=$("ul.nav.navbar-nav");m_utils.makeShowRowLI(pagetools,mode);m_editRow=$($('li',pagetools)[0]);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');},'fastwiki:updateToc':function(e,tocObj){$('#dw_toc').remove();if(tocObj.length>0)$('.content_initial').prepend($('<div id="dw_toc"></div>').append(tocObj.html()));tocObj.remove();}});}else if($('.stylehead .bar_top .bar_top_content').length>0){$(window).on({'fastwiki:init':function(e,mode){var toolbox=$(".sidebar_content .li_toolbox ul");m_utils.makeShowRowLI(toolbox,mode);m_editRow=$('.action.edit',toolbox).parent();m_utils.fixButtons($('.bar_bottom_content .bar-right'),$('.bar_bottom_content .bar-right'),mode);},'fastwiki:afterSwitch':function(e,mode,isSectionEdit,prevMode){$(".right_sidebar, .left_sidebar").css('display',mode=='edit'?'none':'');m_showRow.toggle(mode!='show');m_editRow.toggle(mode!='edit'&&mode!='draft');if(mode=='edit'||mode=='draft'){$('.page_720').css({border:0,textAlign:'inherit'});$('.left_page, .right_page').css({float:'none',width:'auto'});}else{$('.page_720').css({border:'',textAlign:''});$('.left_page, .right_page').css({float:'',width:''});}}});}})(jQuery);}if(window.installPluginHiddenJS){jQuery(window).on('fastwiki:afterSwitch',function(evt,viewMode,isSectionEdit,prevViewMode){jQuery(".hiddenActive, .hiddenSwitch").each(function(){jQuery(this).off('click');});if(viewMode=="show")installPluginHiddenJS();});}jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery('<div id="plugin__styling_loader">'+LANG.plugins.styling.loader+'</div>');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('<button>'+LANG.plugins.styling.popup+'</button>');$form.prepend($btn);$btn.on('click',function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('<p></p>');return;}window.onunload=function(e){if(doreload){DokuCookie.setValue('styling_plugin',0);if(window.opener)window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});if(window.opener)applyPreview(window.opener);DokuCookie.setValue('styling_plugin',1);});jQuery(function(){var $frm=jQuery('#translation__dropdown');if(!$frm.length)return;$frm.find('input[name=go]').hide();$frm.find('select[name=id]').change(function(){var id=jQuery(this).val();var action=$frm.attr('action');if(action.substr(action.length-1)=='/'){var link=action+id;}else{var link=action+'?id='+id;}window.location.href=link;});});jQuery(function(){jQuery('#usrmgr__del').on('click',function(){return confirm(LANG.del_confirm);});});jQuery(function(){dw_locktimer.init(840,1);});
diff --git a/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js.gz b/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js.gz
new file mode 100644
index 0000000..c4d18f4
--- /dev/null
+++ b/data/cache/8/8e8770d17b217426380bc56fce3b9f86.js.gz
Binary files differ
diff --git a/data/cache/a/a48b774336774d83d50a86a857d310de.js b/data/cache/a/a48b774336774d83d50a86a857d310de.js
new file mode 100644
index 0000000..df0cd12
--- /dev/null
+++ b/data/cache/a/a48b774336774d83d50a86a857d310de.js
@@ -0,0 +1 @@
+var DOKU_BASE='/';var DOKU_TPL='/lib/tpl/acervus/';var DOKU_COOKIE_PARAM={"path":"\/","secure":false};Object.defineProperty(window,'DOKU_UHN',{get:function(){console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');return JSINFO.useHeadingNavigation;}});Object.defineProperty(window,'DOKU_UHC',{get:function(){console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');return JSINFO.useHeadingContent;}});LANG={"search_toggle_tools":"Alternar herramientas de b\u00fasqueda","willexpire":"El bloqueo para la edici\u00f3n de esta p\u00e1gina expira en un minuto.\\nPAra prevenir conflictos uso el bot\u00f3n Previsualizar para restaurar el contador de bloqueo.","notsavedyet":"Los cambios que no se han guardado se perder\u00e1n.\n\u00bfRealmente quieres continuar?","searchmedia":"Buscar archivos","keepopen":"Mantener la ventana abierta luego de seleccionar","hidedetails":"Ocultar detalles","mediatitle":"Configuraci\u00f3n del v\u00ednculo","mediadisplay":"Tipo de v\u00ednculo","mediaalign":"Alineaci\u00f3n","mediasize":"Tama\u00f1o de la imagen","mediatarget":"Destino del v\u00ednculo","mediaclose":"Cerrar","mediainsert":"Insertar","mediadisplayimg":"Mostrar la imagen.","mediadisplaylnk":"Mostrar solo el v\u00ednculo.","mediasmall":"Versi\u00f3n en tama\u00f1o peque\u00f1o","mediamedium":"Versi\u00f3n en tama\u00f1o medio","medialarge":"Versi\u00f3n en tama\u00f1o grande","mediaoriginal":"Versi\u00f3n original","medialnk":"V\u00ednculo a la pagina de descripci\u00f3n","mediadirect":"V\u00ednculo al original","medianolnk":"Sin v\u00ednculo","medianolink":"No vincular la imagen","medialeft":"Alinear imagen a la izquierda","mediaright":"Alinear imagen a la derecha.","mediacenter":"Alinear imagen en el centro.","medianoalign":"No use alineaci\u00f3n.","nosmblinks":"El enlace a recursos compartidos de Windows s\u00f3lo funciona en Microsoft Internet Explorer.\nLo que s\u00ed puedes hacer es copiar y pegar el enlace.","linkwiz":"Asistente de enlaces","linkto":"Enlazar a:","del_confirm":"\u00bfQuieres realmente borrar lo seleccionado?","restore_confirm":"\u00bfEst\u00e1s seguro de querer restaurar esta versi\u00f3n?","media_diff":"Ver diferencias:","media_diff_both":"Lado por lado","media_diff_opacity":"A trav\u00e9s de Shine","media_diff_portions":"Pasar","media_select":"Seleccionar ficheros","media_upload_btn":"Cargar","media_done_btn":"Hecho","media_drop":"Arrastra los ficheros aqu\u00ed para cargar","media_cancel":"Eliminar","media_overwrt":"Sobreescribir ficheros exitentes","plugins":{"farmer":{"animalSelect":"Select an animal","pluginSelect":"Select a plugin"},"styling":{"loader":"Preview is loading...<br \/>if this does not goes away, your values may be faulty","popup":"Open as a popup"}}};var toolbar=[{"type":"format","title":"Negrita","icon":"bold.png","key":"b","open":"**","close":"**","block":false},{"type":"format","title":"It\u00e1lica","icon":"italic.png","key":"i","open":"\/\/","close":"\/\/","block":false},{"type":"format","title":"Subrayado","icon":"underline.png","key":"u","open":"__","close":"__","block":false},{"type":"format","title":"C\u00f3digo","icon":"mono.png","key":"m","open":"''","close":"''","block":false},{"type":"format","title":"Tachado","icon":"strike.png","key":"d","open":"<del>","close":"<\/del>","block":false},{"type":"autohead","title":"T\u00edtulo del mismo nivel","icon":"hequal.png","key":"8","text":"T\u00edtulo","mod":0,"block":true},{"type":"autohead","title":"T\u00edtulo bajo","icon":"hminus.png","key":"9","text":"T\u00edtulo","mod":1,"block":true},{"type":"autohead","title":"T\u00edtulo alto","icon":"hplus.png","key":"0","text":"T\u00edtulo","mod":-1,"block":true},{"type":"picker","title":"Selecciona el t\u00edtulo","icon":"h.png","class":"pk_hl","list":[{"type":"format","title":"T\u00edtulo 1","icon":"h1.png","key":"1","open":"====== ","close":" ======\\n"},{"type":"format","title":"T\u00edtulo 2","icon":"h2.png","key":"2","open":"===== ","close":" =====\\n"},{"type":"format","title":"T\u00edtulo 3","icon":"h3.png","key":"3","open":"==== ","close":" ====\\n"},{"type":"format","title":"T\u00edtulo 4","icon":"h4.png","key":"4","open":"=== ","close":" ===\\n"},{"type":"format","title":"T\u00edtulo 5","icon":"h5.png","key":"5","open":"== ","close":" ==\\n"}],"block":true},{"type":"linkwiz","title":"Enlace interno","icon":"link.png","key":"l","open":"[[","close":"]]","block":false},{"type":"format","title":"Enlace externo","icon":"linkextern.png","open":"[[","close":"]]","sample":"http:\/\/example.com|Enlace externo","block":false},{"type":"formatln","title":"\u00cdtem de lista ordenada","icon":"ol.png","open":" - ","close":"","key":"-","block":true},{"type":"formatln","title":"\u00cdtem de lista desordenada","icon":"ul.png","open":" * ","close":"","key":".","block":true},{"type":"insert","title":"L\u00ednea horizontal","icon":"hr.png","insert":"\\n----\\n","block":true},{"type":"mediapopup","title":"A\u00f1adir Im\u00e1genes u otros ficheros","icon":"image.png","url":"lib\/exe\/mediamanager.php?ns=","name":"mediaselect","options":"width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes","block":false},{"type":"picker","title":"Sonrisas","icon":"smiley.png","list":{"8-)":"icon_cool.gif","8-O":"icon_eek.gif","8-o":"icon_eek.gif",":-(":"icon_sad.gif",":-)":"icon_smile.gif","=)":"icon_smile2.gif",":-\/":"icon_doubt.gif",":-\\":"icon_doubt2.gif",":-?":"icon_confused.gif",":-D":"icon_biggrin.gif",":-P":"icon_razz.gif",":-o":"icon_surprised.gif",":-O":"icon_surprised.gif",":-x":"icon_silenced.gif",":-X":"icon_silenced.gif",":-|":"icon_neutral.gif",";-)":"icon_wink.gif","m(":"facepalm.gif","^_^":"icon_fun.gif",":?:":"icon_question.gif",":!:":"icon_exclaim.gif","LOL":"icon_lol.gif","FIXME":"fixme.gif","DELETEME":"delete.gif"},"icobase":"smileys","block":false},{"type":"picker","title":"Caracteres especiales","icon":"chars.png","list":["\u00c0","\u00e0","\u00c1","\u00e1","\u00c2","\u00e2","\u00c3","\u00e3","\u00c4","\u00e4","\u01cd","\u01ce","\u0102","\u0103","\u00c5","\u00e5","\u0100","\u0101","\u0104","\u0105","\u00c6","\u00e6","\u0106","\u0107","\u00c7","\u00e7","\u010c","\u010d","\u0108","\u0109","\u010a","\u010b","\u00d0","\u0111","\u00f0","\u010e","\u010f","\u00c8","\u00e8","\u00c9","\u00e9","\u00ca","\u00ea","\u00cb","\u00eb","\u011a","\u011b","\u0112","\u0113","\u0116","\u0117","\u0118","\u0119","\u0122","\u0123","\u011c","\u011d","\u011e","\u011f","\u0120","\u0121","\u0124","\u0125","\u00cc","\u00ec","\u00cd","\u00ed","\u00ce","\u00ee","\u00cf","\u00ef","\u01cf","\u01d0","\u012a","\u012b","\u0130","\u0131","\u012e","\u012f","\u0134","\u0135","\u0136","\u0137","\u0139","\u013a","\u013b","\u013c","\u013d","\u013e","\u0141","\u0142","\u013f","\u0140","\u0143","\u0144","\u00d1","\u00f1","\u0145","\u0146","\u0147","\u0148","\u00d2","\u00f2","\u00d3","\u00f3","\u00d4","\u00f4","\u00d5","\u00f5","\u00d6","\u00f6","\u01d1","\u01d2","\u014c","\u014d","\u0150","\u0151","\u0152","\u0153","\u00d8","\u00f8","\u0154","\u0155","\u0156","\u0157","\u0158","\u0159","\u015a","\u015b","\u015e","\u015f","\u0160","\u0161","\u015c","\u015d","\u0162","\u0163","\u0164","\u0165","\u00d9","\u00f9","\u00da","\u00fa","\u00db","\u00fb","\u00dc","\u00fc","\u01d3","\u01d4","\u016c","\u016d","\u016a","\u016b","\u016e","\u016f","\u01d6","\u01d8","\u01da","\u01dc","\u0172","\u0173","\u0170","\u0171","\u0174","\u0175","\u00dd","\u00fd","\u0178","\u00ff","\u0176","\u0177","\u0179","\u017a","\u017d","\u017e","\u017b","\u017c","\u00de","\u00fe","\u00df","\u0126","\u0127","\u00bf","\u00a1","\u00a2","\u00a3","\u00a4","\u00a5","\u20ac","\u00a6","\u00a7","\u00aa","\u00ac","\u00af","\u00b0","\u00b1","\u00f7","\u2030","\u00bc","\u00bd","\u00be","\u00b9","\u00b2","\u00b3","\u00b5","\u00b6","\u2020","\u2021","\u00b7","\u2022","\u00ba","\u2200","\u2202","\u2203","\u018f","\u0259","\u2205","\u2207","\u2208","\u2209","\u220b","\u220f","\u2211","\u203e","\u2212","\u2217","\u00d7","\u2044","\u221a","\u221d","\u221e","\u2220","\u2227","\u2228","\u2229","\u222a","\u222b","\u2234","\u223c","\u2245","\u2248","\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u2284","\u2286","\u2287","\u2295","\u2297","\u22a5","\u22c5","\u25ca","\u2118","\u2111","\u211c","\u2135","\u2660","\u2663","\u2665","\u2666","\u03b1","\u03b2","\u0393","\u03b3","\u0394","\u03b4","\u03b5","\u03b6","\u03b7","\u0398","\u03b8","\u03b9","\u03ba","\u039b","\u03bb","\u03bc","\u039e","\u03be","\u03a0","\u03c0","\u03c1","\u03a3","\u03c3","\u03a4","\u03c4","\u03c5","\u03a6","\u03c6","\u03c7","\u03a8","\u03c8","\u03a9","\u03c9","\u2605","\u2606","\u260e","\u261a","\u261b","\u261c","\u261d","\u261e","\u261f","\u2639","\u263a","\u2714","\u2718","\u201e","\u201c","\u201d","\u201a","\u2018","\u2019","\u00ab","\u00bb","\u2039","\u203a","\u2014","\u2013","\u2026","\u2190","\u2191","\u2192","\u2193","\u2194","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u00a9","\u2122","\u00ae","\u2032","\u2033","[","]","{","}","~","(",")","%","\u00a7","$","#","|","@"],"block":false},{"type":"signature","title":"Insertar firma","icon":"sig.png","key":"y","block":false},{"type":"picker","title":"Wrap Plugin","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/picker.png","list":[{"type":"format","title":"columnas","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/column.png","open":"<WRAP group>\\n<WRAP half column>\\n","close":"\\n<\/WRAP>\\n\\n<WRAP half column>\\n\\n<\/WRAP>\\n<\/WRAP>\\n"},{"type":"format","title":"caja simple centrada","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/box.png","open":"<WRAP center round box 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de informaci\u00f3n","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/info.png","open":"<WRAP center round info 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de consejo","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/tip.png","open":"<WRAP center round tip 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja importante","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/important.png","open":"<WRAP center round important 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de alerta","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/alert.png","open":"<WRAP center round alert 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de ayuda","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/help.png","open":"<WRAP center round help 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de descarga","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/download.png","open":"<WRAP center round download 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"format","title":"caja de TODO","icon":"..\/..\/plugins\/wrap\/images\/note\/16\/todo.png","open":"<WRAP center round todo 60%>\\n","close":"\\n<\/WRAP>\\n"},{"type":"insert","title":"limpiar float","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/clear.png","insert":"<WRAP clear\/>\\n"},{"type":"format","title":"especialmente enfatizado","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/em.png","open":"<wrap em>","close":"<\/wrap>"},{"type":"format","title":"destacado","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/hi.png","open":"<wrap hi>","close":"<\/wrap>"},{"type":"format","title":"menos significativo","icon":"..\/..\/plugins\/wrap\/images\/toolbar\/lo.png","open":"<wrap lo>","close":"<\/wrap>"}]}];(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}function decode(s){return config.raw?s:decodeURIComponent(s);}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5);}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));(function(factory){if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory);}else{factory(jQuery.datepicker);}}(function(datepicker){datepicker.regional.es={closeText:"Cerrar",prevText:"&#x3C;Ant",nextText:"Sig&#x3E;",currentText:"Hoy",monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","jue","vie","sáb"],dayNamesMin:["D","L","M","X","J","V","S"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.es);return datepicker.regional.es;}));var qq=qq||{};qq.extend=function(first,second){for(var prop in second){first[prop]=second[prop];}};qq.indexOf=function(arr,elt,from){if(arr.indexOf)return arr.indexOf(elt,from);from=from||0;var len=arr.length;if(from<0)from+=len;for(;from<len;from++){if(from in arr&&arr[from]===elt){return from;}}return-1;};qq.getUniqueId=(function(){var id=0;return function(){return id++;};})();qq.attach=function(element,type,fn){if(element.addEventListener){element.addEventListener(type,fn,false);}else if(element.attachEvent){element.attachEvent('on'+type,fn);}};qq.detach=function(element,type,fn){if(element.removeEventListener){element.removeEventListener(type,fn,false);}else if(element.attachEvent){element.detachEvent('on'+type,fn);}};qq.preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}};qq.insertBefore=function(a,b){b.parentNode.insertBefore(a,b);};qq.remove=function(element){element.parentNode.removeChild(element);};qq.contains=function(parent,descendant){if(parent==descendant)return true;if(parent.contains){return parent.contains(descendant);}else{return!!(descendant.compareDocumentPosition(parent)&8);}};qq.toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var element=div.firstChild;div.removeChild(element);return element;};})();qq.css=function(element,styles){if(styles.opacity!=null){if(typeof element.style.opacity!='string'&&typeof(element.filters)!='undefined'){styles.filter='alpha(opacity='+Math.round(100*styles.opacity)+')';}}qq.extend(element.style,styles);};qq.hasClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');return re.test(element.className);};qq.addClass=function(element,name){if(!qq.hasClass(element,name)){element.className+=' '+name;}};qq.removeClass=function(element,name){var re=new RegExp('(^| )'+name+'( |$)');element.className=element.className.replace(re,' ').replace(/^\s+|\s+$/g,"");};qq.setText=function(element,text){element.innerText=text;element.textContent=text;};qq.children=function(element){var children=[],child=element.firstChild;while(child){if(child.nodeType==1){children.push(child);}child=child.nextSibling;}return children;};qq.getByClass=function(element,className){if(element.querySelectorAll){return element.querySelectorAll('.'+className);}var result=[];var candidates=element.getElementsByTagName("*");var len=candidates.length;for(var i=0;i<len;i++){if(qq.hasClass(candidates[i],className)){result.push(candidates[i]);}}return result;};qq.obj2url=function(obj,temp,prefixDone){var uristrings=[],prefix='&',add=function(nextObj,i){var nextTemp=temp?(/\[\]$/.test(temp))?temp:temp+'['+i+']':i;if((nextTemp!='undefined')&&(i!='undefined')){uristrings.push((typeof nextObj==='object')?qq.obj2url(nextObj,nextTemp,true):(Object.prototype.toString.call(nextObj)==='[object Function]')?encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj()):encodeURIComponent(nextTemp)+'='+encodeURIComponent(nextObj));}};if(!prefixDone&&temp){prefix=(/\?/.test(temp))?(/\?$/.test(temp))?'':'&':'?';uristrings.push(temp);uristrings.push(qq.obj2url(obj));}else if((Object.prototype.toString.call(obj)==='[object Array]')&&(typeof obj!='undefined')){for(var i=0,len=obj.length;i<len;++i){add(obj[i],i);}}else if((typeof obj!='undefined')&&(obj!==null)&&(typeof obj==="object")){for(var i in obj){if(obj.hasOwnProperty(i)&&typeof obj[i]!='function'){add(obj[i],i);}}}else{uristrings.push(encodeURIComponent(temp)+'='+encodeURIComponent(obj));}return uristrings.join(prefix).replace(/^&/,'').replace(/%20/g,'+');};var qq=qq||{};qq.FileUploaderBasic=function(o){this._options={debug:false,action:'/server/upload',params:{},button:null,multiple:true,maxConnections:3,allowedExtensions:[],sizeLimit:0,minSizeLimit:0,onSubmit:function(id,fileName){},onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,responseJSON){},onCancel:function(id,fileName){},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."},showMessage:function(message){alert(message);}};qq.extend(this._options,o);this._filesInProgress=0;this._handler=this._createUploadHandler();if(this._options.button){this._button=this._createUploadButton(this._options.button);}this._preventLeaveInProgress();};qq.FileUploaderBasic.prototype={setParams:function(params){this._options.params=params;},getInProgress:function(){return this._filesInProgress;},_createUploadButton:function(element){var self=this;return new qq.UploadButton({element:element,multiple:this._options.multiple&&qq.UploadHandlerXhr.isSupported(),onChange:function(input){self._onInputChange(input);}});},_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);}});return handler;},_preventLeaveInProgress:function(){var self=this;qq.attach(window,'beforeunload',function(e){if(!self._filesInProgress){return;}var e=e||window.event;e.returnValue=self._options.messages.onLeave;return self._options.messages.onLeave;});},_onSubmit:function(id,fileName){this._filesInProgress++;},_onProgress:function(id,fileName,loaded,total){},_onComplete:function(id,fileName,result){this._filesInProgress--;if(result.error){this._options.showMessage(result.error);}},_onCancel:function(id,fileName){this._filesInProgress--;},_onInputChange:function(input){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(input.files);}else{if(this._validateFile(input)){this._uploadFile(input);}}this._button.reset();},_uploadFileList:function(files){for(var i=0;i<files.length;i++){if(!this._validateFile(files[i])){return;}}for(var i=0;i<files.length;i++){this._uploadFile(files[i]);}},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);this._handler.upload(id,this._options.params);}},_validateFile:function(file){var name,size;if(file.value){name=file.value.replace(/.*(\/|\\)/,"");}else{name=file.fileName!=null?file.fileName:file.name;size=file.fileSize!=null?file.fileSize:file.size;}if(!this._isAllowedExtension(name)){this._error('typeError',name);return false;}else if(size===0){this._error('emptyError',name);return false;}else if(size&&this._options.sizeLimit&&size>this._options.sizeLimit){this._error('sizeError',name);return false;}else if(size&&size<this._options.minSizeLimit){this._error('minSizeError',name);return false;}return true;},_error:function(code,fileName){var message=this._options.messages[code];function r(name,replacement){message=message.replace(name,replacement);}r('{file}',this._formatFileName(fileName));r('{extensions}',this._options.allowedExtensions.join(', '));r('{sizeLimit}',this._formatSize(this._options.sizeLimit));r('{minSizeLimit}',this._formatSize(this._options.minSizeLimit));this._options.showMessage(message);},_formatFileName:function(name){if(name.length>33){name=name.slice(0,19)+'...'+name.slice(-13);}return name;},_isAllowedExtension:function(fileName){var ext=(-1!==fileName.indexOf('.'))?fileName.replace(/.*[.]/,'').toLowerCase():'';var allowed=this._options.allowedExtensions;if(!allowed.length){return true;}for(var i=0;i<allowed.length;i++){if(allowed[i].toLowerCase()==ext){return true;}}return false;},_formatSize:function(bytes){var i=-1;do{bytes=bytes/1024;i++;}while(bytes>99);return Math.max(bytes,0.1).toFixed(1)+['kB','MB','GB','TB','PB','EB'][i];}};qq.FileUploader=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>'+'<div class="qq-upload-button">Upload a file</div>'+'<ul class="qq-upload-list"></ul>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file"></span>'+'<span class="qq-upload-spinner"></span>'+'<span class="qq-upload-size"></span>'+'<a class="qq-upload-cancel" href="#">Cancel</a>'+'<span class="qq-upload-failed-text">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._setupDragDrop();};qq.extend(qq.FileUploader.prototype,qq.FileUploaderBasic.prototype);qq.extend(qq.FileUploader.prototype,{_find:function(parent,type){var element=qq.getByClass(parent,this._options.classes[type])[0];if(!element){throw new Error('element not found '+type);}return element;},_setupDragDrop:function(){var self=this,dropArea=this._find(this._element,'drop');var dz=new qq.UploadDropZone({element:dropArea,onEnter:function(e){qq.addClass(dropArea,self._classes.dropActive);e.stopPropagation();},onLeave:function(e){e.stopPropagation();},onLeaveNotDescendants:function(e){qq.removeClass(dropArea,self._classes.dropActive);},onDrop:function(e){dropArea.style.display='none';qq.removeClass(dropArea,self._classes.dropActive);self._uploadFileList(e.dataTransfer.files);}});dropArea.style.display='none';qq.attach(document,'dragenter',function(e){if(!dz._isValidFileDrag(e))return;dropArea.style.display='block';});qq.attach(document,'dragleave',function(e){if(!dz._isValidFileDrag(e))return;var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(!relatedTarget||relatedTarget.nodeName=="HTML"){dropArea.style.display='none';}});},_onSubmit:function(id,fileName){qq.FileUploaderBasic.prototype._onSubmit.apply(this,arguments);this._addToList(id,fileName);},_onProgress:function(id,fileName,loaded,total){qq.FileUploaderBasic.prototype._onProgress.apply(this,arguments);var item=this._getItemByFileId(id);var size=this._find(item,'size');size.style.display='inline';var text;if(loaded!=total){text=Math.round(loaded/total*100)+'% from '+this._formatSize(total);}else{text=this._formatSize(total);}qq.setText(size,text);},_onComplete:function(id,fileName,result){qq.FileUploaderBasic.prototype._onComplete.apply(this,arguments);var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));if(result.success){qq.addClass(item,this._classes.success);}else{qq.addClass(item,this._classes.fail);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,this._formatFileName(fileName));this._find(item,'size').style.display='none';this._listElement.appendChild(item);},_getItemByFileId:function(id){var item=this._listElement.firstChild;while(item){if(item.qqFileId==id)return item;item=item.nextSibling;}},_bindCancelEvent:function(){var self=this,list=this._listElement;qq.attach(list,'click',function(e){e=e||window.event;var target=e.target||e.srcElement;if(qq.hasClass(target,self._classes.cancel)){qq.preventDefault(e);var item=target.parentNode;self._handler.cancel(item.qqFileId);qq.remove(item);}});}});qq.UploadDropZone=function(o){this._options={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}};qq.extend(this._options,o);this._element=this._options.element;this._disableDropOutside();this._attachEvents();};qq.UploadDropZone.prototype={_disableDropOutside:function(e){if(!qq.UploadDropZone.dropOutsideDisabled){qq.attach(document,'dragover',function(e){if(e.dataTransfer){e.dataTransfer.dropEffect='none';e.preventDefault();}});qq.UploadDropZone.dropOutsideDisabled=true;}},_attachEvents:function(){var self=this;qq.attach(self._element,'dragover',function(e){if(!self._isValidFileDrag(e))return;var effect=e.dataTransfer.effectAllowed;if(effect=='move'||effect=='linkMove'){e.dataTransfer.dropEffect='move';}else{e.dataTransfer.dropEffect='copy';}e.stopPropagation();e.preventDefault();});qq.attach(self._element,'dragenter',function(e){if(!self._isValidFileDrag(e))return;self._options.onEnter(e);});qq.attach(self._element,'dragleave',function(e){if(!self._isValidFileDrag(e))return;self._options.onLeave(e);var relatedTarget=document.elementFromPoint(e.clientX,e.clientY);if(qq.contains(this,relatedTarget))return;self._options.onLeaveNotDescendants(e);});qq.attach(self._element,'drop',function(e){if(!self._isValidFileDrag(e))return;e.preventDefault();self._options.onDrop(e);});},_isValidFileDrag:function(e){var dt=e.dataTransfer,isWebkit=navigator.userAgent.indexOf("AppleWebKit")>-1;return dt&&dt.effectAllowed!='none'&&(dt.files||(!isWebkit&&dt.types.contains&&dt.types.contains('Files')));}};qq.UploadButton=function(o){this._options={element:null,multiple:false,name:'file',onChange:function(input){},hoverClass:'qq-upload-button-hover',focusClass:'qq-upload-button-focus'};qq.extend(this._options,o);this._element=this._options.element;qq.css(this._element,{position:'relative',overflow:'hidden',direction:'ltr'});this._input=this._createInput();};qq.UploadButton.prototype={getInput:function(){return this._input;},reset:function(){if(this._input.parentNode){qq.remove(this._input);}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput();},_createInput:function(){var input=document.createElement("input");if(this._options.multiple){input.setAttribute("multiple","multiple");}input.setAttribute("type","file");input.setAttribute("name",this._options.name);qq.css(input,{position:'absolute',right:0,top:0,fontFamily:'Arial',fontSize:'118px',margin:0,padding:0,cursor:'pointer',opacity:0});this._element.appendChild(input);var self=this;qq.attach(input,'change',function(){self._options.onChange(input);});qq.attach(input,'mouseover',function(){qq.addClass(self._element,self._options.hoverClass);});qq.attach(input,'mouseout',function(){qq.removeClass(self._element,self._options.hoverClass);});qq.attach(input,'focus',function(){qq.addClass(self._element,self._options.focusClass);});qq.attach(input,'blur',function(){qq.removeClass(self._element,self._options.focusClass);});if(window.attachEvent){input.setAttribute('tabIndex',"-1");}return input;}};qq.UploadHandlerAbstract=function(o){this._options={debug:false,action:'/upload.php',maxConnections:999,onProgress:function(id,fileName,loaded,total){},onComplete:function(id,fileName,response){},onCancel:function(id,fileName){}};qq.extend(this._options,o);this._queue=[];this._params=[];};qq.UploadHandlerAbstract.prototype={log:function(str){if(this._options.debug&&window.console)console.log('[uploader] '+str);},add:function(file){},upload:function(id,params){var len=this._queue.push(id);var copy={};qq.extend(copy,params);this._params[id]=copy;if(len<=this._options.maxConnections){this._upload(id,this._params[id]);}},cancel:function(id){this._cancel(id);this._dequeue(id);},cancelAll:function(){for(var i=0;i<this._queue.length;i++){this._cancel(this._queue[i]);}this._queue=[];},getName:function(id){},getSize:function(id){},getQueue:function(){return this._queue;},_upload:function(id){},_cancel:function(id){},_dequeue:function(id){var i=qq.indexOf(this._queue,id);this._queue.splice(i,1);var max=this._options.maxConnections;if(this._queue.length>=max&&i<max){var nextId=this._queue[max-1];this._upload(nextId,this._params[nextId]);}}};qq.UploadHandlerForm=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._inputs={};};qq.extend(qq.UploadHandlerForm.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerForm.prototype,{add:function(fileInput){fileInput.setAttribute('name','qqfile');var id='qq-upload-handler-iframe'+qq.getUniqueId();this._inputs[id]=fileInput;if(fileInput.parentNode){qq.remove(fileInput);}return id;},getName:function(id){return this._inputs[id].value.replace(/.*(\/|\\)/,"");},_cancel:function(id){this._options.onCancel(id,this.getName(id));delete this._inputs[id];var iframe=document.getElementById(id);if(iframe){iframe.setAttribute('src','javascript:false;');qq.remove(iframe);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;},_attachLoadEvent:function(iframe,callback){qq.attach(iframe,'load',function(){if(!iframe.parentNode){return;}if(iframe.contentDocument&&iframe.contentDocument.body&&iframe.contentDocument.body.innerHTML=="false"){return;}callback();});},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;this.log("converting iframe's innerHTML to JSON");this.log("innerHTML = "+doc.body.innerHTML);try{response=eval("("+doc.body.innerHTML+")");}catch(err){response={};}return response;},_createIframe:function(id){var iframe=qq.toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.setAttribute('id',id);iframe.style.display='none';document.body.appendChild(iframe);return iframe;},_createForm:function(iframe,params){var form=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var queryString=qq.obj2url(params,this._options.action);form.setAttribute('action',queryString);form.setAttribute('target',iframe.name);form.style.display='none';document.body.appendChild(form);return form;}});qq.UploadHandlerXhr=function(o){qq.UploadHandlerAbstract.apply(this,arguments);this._files=[];this._xhrs=[];this._loaded=[];};qq.UploadHandlerXhr.isSupported=function(){var input=document.createElement('input');input.type='file';return('multiple'in input&&typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined");};qq.extend(qq.UploadHandlerXhr.prototype,qq.UploadHandlerAbstract.prototype);qq.extend(qq.UploadHandlerXhr.prototype,{add:function(file){if(!(file instanceof File)){throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');}return this._files.push(file)-1;},getName:function(id){var file=this._files[id];return file.fileName!=null?file.fileName:file.name;},getSize:function(id){var file=this._files[id];return file.fileSize!=null?file.fileSize:file.size;},getLoaded:function(id){return this._loaded[id]||0;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_onComplete:function(id,xhr){if(!this._files[id])return;var name=this.getName(id);var size=this.getSize(id);this._options.onProgress(id,name,size,size);if(xhr.status==200){this.log("xhr - server response received");this.log("responseText = "+xhr.responseText);var response;try{response=eval("("+xhr.responseText+")");}catch(err){response={};}this._options.onComplete(id,name,response);}else{this._options.onComplete(id,name,{});}this._files[id]=null;this._xhrs[id]=null;this._dequeue(id);},_cancel:function(id){this._options.onCancel(id,this.getName(id));this._files[id]=null;if(this._xhrs[id]){this._xhrs[id].abort();this._xhrs[id]=null;}}});qq.extend(qq.FileUploader.prototype,{_createUploadHandler:function(){var self=this,handlerClass;if(qq.UploadHandlerXhr.isSupported()){handlerClass='UploadHandlerXhr';}else{handlerClass='UploadHandlerForm';}var handler=new qq[handlerClass]({debug:this._options.debug,action:this._options.action,maxConnections:this._options.maxConnections,onProgress:function(id,fileName,loaded,total){self._onProgress(id,fileName,loaded,total);self._options.onProgress(id,fileName,loaded,total);},onComplete:function(id,fileName,result){self._onComplete(id,fileName,result);self._options.onComplete(id,fileName,result);},onCancel:function(id,fileName){self._onCancel(id,fileName);self._options.onCancel(id,fileName);},onUpload:function(){self._onUpload();}});return handler;},_onUpload:function(){this._handler.uploadAll(this._options.params);},_uploadFile:function(fileContainer){var id=this._handler.add(fileContainer);var fileName=this._handler.getName(id);if(this._options.onSubmit(id,fileName)!==false){this._onSubmit(id,fileName);}},_addToList:function(id,fileName){var item=qq.toElement(this._options.fileTemplate);item.qqFileId=id;var fileElement=this._find(item,'file');qq.setText(fileElement,fileName);this._find(item,'size').style.display='none';var nameElement=this._find(item,'nameInput');fileName=fileName.toLowerCase();fileName=fileName.replace(/([ !"#$%&\'()+,\/;<=>?@[\]^`{|}~:]+)/g,'_');fileName=fileName.replace(/^_+/,'');nameElement.value=fileName;nameElement.id='mediamanager__upload_item'+id;this._listElement.appendChild(item);}});qq.FileUploaderExtended=function(o){qq.FileUploaderBasic.apply(this,arguments);qq.extend(this._options,{element:null,listElement:null,template:'<div class="qq-uploader">'+'<div class="qq-upload-drop-area"><span>'+LANG.media_drop+'</span></div>'+'<div class="qq-upload-button">'+LANG.media_select+'</div>'+'<ul class="qq-upload-list"></ul>'+'<div class="qq-action-container">'+' <button class="qq-upload-action" type="submit" id="mediamanager__upload_button">'+LANG.media_upload_btn+'</button>'+' <label class="qq-overwrite-check"><input type="checkbox" value="1" name="ow" class="dw__ow"> <span>'+LANG.media_overwrt+'</span></label>'+'</div>'+'</div>',fileTemplate:'<li>'+'<span class="qq-upload-file hidden"></span>'+' <input class="qq-upload-name-input edit" type="text" value="" />'+' <span class="qq-upload-spinner hidden"></span>'+' <span class="qq-upload-size"></span>'+' <a class="qq-upload-cancel" href="#">'+LANG.media_cancel+'</a>'+' <span class="qq-upload-failed-text error">Failed</span>'+'</li>',classes:{button:'qq-upload-button',drop:'qq-upload-drop-area',dropActive:'qq-upload-drop-area-active',list:'qq-upload-list',nameInput:'qq-upload-name-input',overwriteInput:'qq-overwrite-check',uploadButton:'qq-upload-action',file:'qq-upload-file',spinner:'qq-upload-spinner',size:'qq-upload-size',cancel:'qq-upload-cancel',success:'qq-upload-success',fail:'qq-upload-fail',failedText:'qq-upload-failed-text'}});qq.extend(this._options,o);this._element=this._options.element;this._element.innerHTML=this._options.template;this._listElement=this._options.listElement||this._find(this._element,'list');this._classes=this._options.classes;this._button=this._createUploadButton(this._find(this._element,'button'));this._bindCancelEvent();this._bindUploadEvent();this._setupDragDrop();};qq.extend(qq.FileUploaderExtended.prototype,qq.FileUploader.prototype);qq.extend(qq.FileUploaderExtended.prototype,{_bindUploadEvent:function(){var self=this,list=this._listElement;qq.attach(document.getElementById('mediamanager__upload_button'),'click',function(e){e=e||window.event;var target=e.target||e.srcElement;qq.preventDefault(e);self._handler._options.onUpload();jQuery(".qq-upload-name-input").each(function(i){jQuery(this).prop('disabled',true);});});},_onComplete:function(id,fileName,result){this._filesInProgress--;var item=this._getItemByFileId(id);qq.remove(this._find(item,'cancel'));qq.remove(this._find(item,'spinner'));var nameInput=this._find(item,'nameInput');var fileElement=this._find(item,'file');qq.setText(fileElement,nameInput.value);qq.removeClass(fileElement,'hidden');qq.remove(nameInput);jQuery('.qq-upload-button, #mediamanager__upload_button').remove();jQuery('.dw__ow').parent().hide();jQuery('.qq-upload-drop-area').remove();if(result.success){qq.addClass(item,this._classes.success);$link='<a href="'+result.link+'" id="h_:'+result.id+'" class="select">'+nameInput.value+'</a>';jQuery(fileElement).html($link);}else{qq.addClass(item,this._classes.fail);var fail=this._find(item,'failedText');if(result.error)qq.setText(fail,result.error);}if(document.getElementById('media__content')&&!document.getElementById('mediamanager__done_form')){var action=document.location.href;var i=action.indexOf('?');if(i)action=action.substr(0,i);var button='<form method="post" action="'+action+'" id="mediamanager__done_form"><div>';button+='<input type="hidden" value="'+result.ns+'" name="ns">';button+='<input type="hidden" value="1" name="recent">';button+='<button type="submit">'+LANG.media_done_btn+'</button></div></form>';jQuery('#mediamanager__uploader').append(button);}}});qq.extend(qq.UploadHandlerForm.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._inputs[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.value.replace(/.*(\/|\\)/,"");}else{return null;}}},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._inputs){this.upload(key,params);}},_upload:function(id,params){var input=this._inputs[id];if(!input){throw new Error('file with passed id was not added, or already uploaded or cancelled');}var fileName=this.getName(id);var iframe=this._createIframe(id);var form=this._createForm(iframe,params);form.appendChild(input);var nameInput=qq.toElement('<input name="mediaid" value="'+fileName+'" type="text">');form.appendChild(nameInput);var checked=jQuery('.dw__ow').is(':checked');var owCheckbox=jQuery('.dw__ow').clone();owCheckbox.attr('checked',checked);jQuery(form).append(owCheckbox);var self=this;this._attachLoadEvent(iframe,function(){self.log('iframe loaded');var response=self._getIframeContentJSON(iframe);self._options.onComplete(id,fileName,response);self._dequeue(id);delete self._inputs[id];setTimeout(function(){qq.remove(iframe);},1);});form.submit();qq.remove(form);return id;}});qq.extend(qq.UploadHandlerXhr.prototype,{uploadAll:function(params){this._uploadAll(params);},getName:function(id){var file=this._files[id];var name=document.getElementById('mediamanager__upload_item'+id);if(name!=null){return name.value;}else{if(file!=null){return file.fileName!=null?file.fileName:file.name;}else{return null;}}},getSize:function(id){var file=this._files[id];if(file==null)return null;return file.fileSize!=null?file.fileSize:file.size;},_upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(name==null||size==null)return;this._loaded[id]=0;var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._loaded[id]=e.loaded;self._options.onProgress(id,name,e.loaded,e.total);}};xhr.onreadystatechange=function(){if(xhr.readyState==4){self._onComplete(id,xhr);}};params=params||{};params['qqfile']=name;params['ow']=jQuery('.dw__ow').is(':checked');var queryString=qq.obj2url(params,this._options.action);xhr.open("POST",queryString,true);xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("X-File-Name",encodeURIComponent(name));xhr.setRequestHeader("Content-Type","application/octet-stream");xhr.send(file);},_uploadAll:function(params){jQuery(".qq-upload-spinner").each(function(i){jQuery(this).removeClass('hidden');});for(key in this._files){this.upload(key,params);}}});function substr_replace(str,replace,start,length){var a2,b1;a2=(start<0?str.length:0)+start;if(typeof length==='undefined'){length=str.length-a2;}else if(length<0&&start<0&&length<=start){length=0;}b1=(length<0?str.length:a2)+length;return str.substring(0,a2)+replace+str.substring(b1);}function bind(fnc){var Aps=Array.prototype.slice,static_args=Aps.call(arguments,1);return function(){return fnc.apply(this,static_args.concat(Aps.call(arguments,0)));};}function logError(e,file){if(window.console&&console.error){console.error('The error "%s: %s" occurred in file "%s". '+'If this is in a plugin try updating or disabling the plugin, '+'if this is in a template try updating the template or switching to the "dokuwiki" template.',e.name,e.message,file);if(e.stack){console.error(e.stack);}}}var timer={_cur_id:0,_handlers:{},execDispatch:function(id){timer._handlers[id]();},add:function(func,timeout){var id=++timer._cur_id;timer._handlers[id]=func;return window.setTimeout('timer.execDispatch('+id+')',timeout);}};function Delay(func,timeout){this.func=func;if(timeout){this.timeout=timeout;}}Delay.prototype={func:null,timeout:500,delTimer:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null;}},start:function(){DEPRECATED('don\'t use the Delay object, use window.timeout with a callback instead');this.delTimer();var _this=this;this.timer=timer.add(function(){_this.exec.call(_this);},this.timeout);this._data={_this:arguments[0],_params:Array.prototype.slice.call(arguments,2)};},exec:function(){this.delTimer();this.func.call(this._data._this,this._data._params);}};var DokuCookie={data:{},name:'DOKU_PREFS',setValue:function(key,val){var text=[],_this=this;this.init();if(val===false){delete this.data[key];}else{val=val+"";this.data[key]=val;}jQuery.each(_this.data,function(key,val){if(_this.data.hasOwnProperty(key)){text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val));}});jQuery.cookie(this.name,text.join('#'),{expires:365,path:DOKU_COOKIE_PARAM.path,secure:DOKU_COOKIE_PARAM.secure});},getValue:function(key,def){this.init();return this.data.hasOwnProperty(key)?this.data[key]:def;},init:function(){var text,parts,i;if(!jQuery.isEmptyObject(this.data)){return;}text=jQuery.cookie(this.name);if(text){parts=text.split('#');for(i=0;i<parts.length;i+=2){this.data[decodeURIComponent(parts[i])]=decodeURIComponent(parts[i+1]);}}}};if('function'===typeof jQuery&&'function'===typeof jQuery.noConflict){jQuery.noConflict();}var clientPC=navigator.userAgent.toLowerCase();var is_macos=navigator.appVersion.indexOf('Mac')!=-1;var is_gecko=((clientPC.indexOf('gecko')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('khtml')==-1)&&(clientPC.indexOf('netscape/7.0')==-1));var is_safari=((clientPC.indexOf('applewebkit')!=-1)&&(clientPC.indexOf('spoofer')==-1));var is_khtml=(navigator.vendor=='KDE'||(document.childNodes&&!document.all&&!navigator.taintEnabled));if(clientPC.indexOf('opera')!=-1){var is_opera=true;var is_opera_preseven=(window.opera&&!document.childNodes);var is_opera_seven=(window.opera&&document.childNodes);}function closePopups(){jQuery('div.JSpopup').hide();}jQuery(function(){jQuery(document).on('click',closePopups);});jQuery.fn.dw_qsearch=function(overrides){var dw_qsearch={output:'#qsearch__out',$inObj:this,$outObj:null,timer:null,curRequest:null,init:function(){var do_qsearch;dw_qsearch.$outObj=jQuery(dw_qsearch.output);if(dw_qsearch.$inObj.length===0||dw_qsearch.$outObj.length===0){return;}do_qsearch=function(){if(dw_qsearch.curRequest!=null){dw_qsearch.curRequest.abort();}var value=dw_qsearch.getSearchterm();if(value===''){dw_qsearch.clear_results();return;}dw_qsearch.$inObj.parents('form').addClass('searching');dw_qsearch.curRequest=jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'qsearch',q:encodeURI(value)},dw_qsearch.onCompletion,'html');};dw_qsearch.$inObj.on('keyup',function(){if(dw_qsearch.timer){window.clearTimeout(dw_qsearch.timer);dw_qsearch.timer=null;}dw_qsearch.timer=window.setTimeout(do_qsearch,500);});dw_qsearch.$outObj.on('click',dw_qsearch.clear_results);},getSearchterm:function(){return dw_qsearch.$inObj.val();},clear_results:function(){dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.$outObj.hide();dw_qsearch.$outObj.text('');},onCompletion:function(data){var max,$links,too_big;dw_qsearch.$inObj.parents('form').removeClass('searching');dw_qsearch.curRequest=null;if(data===''){dw_qsearch.clear_results();return;}dw_qsearch.$outObj .html(data).show().css('white-space','nowrap');dw_qsearch.$outObj.find('li').css('overflow','visible');$links=dw_qsearch.$outObj.find('a');max=dw_qsearch.$outObj[0].clientWidth;if(document.documentElement.dir==='rtl'){max-=parseInt(dw_qsearch.$outObj.css('padding-left'));too_big=function(l){return l.offsetLeft<0;};}else{max-=parseInt(dw_qsearch.$outObj.css('padding-right'));too_big=function(l){return l.offsetWidth+l.offsetLeft>max;};}$links.each(function(){var start,length,replace,nsL,nsR,eli,runaway;if(!too_big(this)){return;}nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');eli=0;runaway=0;while((nsR-nsL>3)&&too_big(this)&&runaway++<500){if(eli!==0){if((eli-nsL)>(nsR-eli)){start=eli-2;length=2;}else{start=eli+1;length=1;}replace='';}else{start=Math.floor(nsL+((nsR-nsL)/2));length=1;replace='…';}this.textContent=substr_replace(this.textContent,replace,start,length);eli=this.textContent.indexOf('…');nsL=this.textContent.indexOf('(');nsR=this.textContent.indexOf(')');}});dw_qsearch.$outObj.find('li').css('overflow','hidden').css('text-overflow','ellipsis');}};jQuery.extend(dw_qsearch,overrides);if(!overrides.deferInit){dw_qsearch.init();}return dw_qsearch;};jQuery(function(){jQuery('#qsearch__in').dw_qsearch({output:'#qsearch__out'});});jQuery(function(){'use strict';var $searchForm=jQuery('.search-results-form');if(!$searchForm.length){return;}var $toggleAssistanceButton=jQuery('<button>').addClass('toggleAssistant').attr('type','button').attr('aria-expanded','false').text(LANG.search_toggle_tools).prependTo($searchForm.find('fieldset'));$toggleAssistanceButton.on('click',function(){jQuery('.advancedOptions').toggle(0,function(){var $me=jQuery(this);if($me.attr('aria-hidden')){$me.removeAttr('aria-hidden');$toggleAssistanceButton.attr('aria-expanded','true');DokuCookie.setValue('sa','on');}else{$me.attr('aria-hidden','true');$toggleAssistanceButton.attr('aria-expanded','false');DokuCookie.setValue('sa','off');}});});if(DokuCookie.getValue('sa')==='on'){$toggleAssistanceButton.trigger('click');}$searchForm.find('.advancedOptions .toggle div.current').on('click',function(){var $me=jQuery(this);$me.parent().siblings().removeClass('open');$me.parent().siblings().find('ul:first').attr('aria-expanded','false');$me.parent().toggleClass('open');if($me.parent().hasClass('open')){$me.parent().find('ul:first').attr('aria-expanded','true');}else{$me.parent().find('ul:first').attr('aria-expanded','false');}});});jQuery.fn.dw_tree=function(overrides){var dw_tree={throbber_delay:500,$obj:this,toggle_selector:'a.idx_dir',init:function(){this.$obj.on('click',this.toggle_selector,this,this.toggle);jQuery('ul:first',this.$obj).attr('role','tree');jQuery('ul',this.$obj).not(':first').attr('role','group');jQuery('li',this.$obj).attr('role','treeitem');jQuery('li.open > ul',this.$obj).attr('aria-expanded','true');jQuery('li.closed > ul',this.$obj).attr('aria-expanded','false');jQuery('li.closed',this.$obj).attr('aria-live','assertive');},toggle:function(e){var $listitem,$sublist,timeout,$clicky,show_sublist,dw_tree,opening;e.preventDefault();dw_tree=e.data;$clicky=jQuery(this);$listitem=$clicky.closest('li');$sublist=$listitem.find('ul').first();opening=$listitem.hasClass('closed');dw_tree.toggle_display($clicky,opening);if($sublist.is(':visible')){$listitem.removeClass('open').addClass('closed');$sublist.attr('aria-expanded','false');}else{$listitem.removeClass('closed').addClass('open');$sublist.attr('aria-expanded','true');}if(!opening){$sublist.dw_hide();return;}show_sublist=function(data){$sublist.hide();if(typeof data!=='undefined'){$sublist.html(data);$sublist.parent().attr('aria-busy','false').removeAttr('aria-live');jQuery('li.closed',$sublist).attr('aria-live','assertive');}if($listitem.hasClass('open')){$sublist.dw_show();}};if($sublist.length>0){show_sublist();return;}$sublist=jQuery('<ul class="idx" role="group"/>');$listitem.append($sublist);timeout=window.setTimeout(bind(show_sublist,'<li aria-busy="true"><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'),dw_tree.throbber_delay);dw_tree.load_data(function(data){window.clearTimeout(timeout);show_sublist(data);},$clicky);},toggle_display:function($clicky,opening){},load_data:function(show_data,$clicky){show_data();}};jQuery.extend(dw_tree,overrides);if(!overrides.deferInit){dw_tree.init();}return dw_tree;};var dw_index=jQuery('#index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#index__tree');dw_index.$obj=$tree;dw_index.init();});function selection_class(){this.start=0;this.end=0;this.obj=null;this.scroll=0;this.fix=0;this.getLength=function(){return this.end-this.start;};this.getText=function(){return(!this.obj)?'':this.obj.value.substring(this.start,this.end);};}function DWgetSelection(textArea){var sel=new selection_class();textArea.focus();sel.obj=textArea;sel.start=textArea.selectionStart;sel.end=textArea.selectionEnd;sel.scroll=textArea.scrollTop;return sel;}function DWsetSelection(selection){selection.obj.setSelectionRange(selection.start,selection.end);if(selection.scroll)selection.obj.scrollTop=selection.scroll;}function pasteText(selection,text,opts){if(!opts)opts={};selection.obj.value=selection.obj.value.substring(0,selection.start)+text+selection.obj.value.substring(selection.end,selection.obj.value.length);if(is_opera){selection.end=selection.start+text.replace(/\r?\n/g,'\r\n').length;}else{selection.end=selection.start+text.length;}if(opts.startofs)selection.start+=opts.startofs;if(opts.endofs)selection.end-=opts.endofs;if(opts.nosel)selection.start=selection.end;DWsetSelection(selection);}function insertTags(textAreaID,tagOpen,tagClose,sampleText){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);var text=selection.getText();var opts;if(text.charAt(text.length-1)==' '){selection.end--;text=selection.getText();}if(!text){text=sampleText;opts={startofs:tagOpen.length,endofs:tagClose.length};}else{opts={nosel:true};}text=tagOpen+text+tagClose;pasteText(selection,text,opts);}function insertAtCarret(textAreaID,text){var txtarea=jQuery('#'+textAreaID)[0];var selection=DWgetSelection(txtarea);pasteText(selection,text,{nosel:true});}var pickercounter=0;function initToolbar(tbid,edid,tb,allowblock){var $toolbar,$edit;if(typeof tbid=='string'){$toolbar=jQuery('#'+tbid);}else{$toolbar=jQuery(tbid);}$edit=jQuery('#'+edid);if($toolbar.length==0||$edit.length==0||$edit.attr('readOnly')){return;}if(typeof allowblock==='undefined'){allowblock=true;}$toolbar.html('');jQuery.each(tb,function(k,val){if(!tb.hasOwnProperty(k)||(!allowblock&&val.block===true)){return;}var actionFunc,$btn;$btn=jQuery(createToolButton(val.icon,val.title,val.key,val.id,val['class']));actionFunc='tb_'+val.type;if(jQuery.isFunction(window[actionFunc])){$btn.on('click',bind(window[actionFunc],$btn,val,edid));$toolbar.append($btn);return;}actionFunc='addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);if(jQuery.isFunction(window[actionFunc])){var pickerid=window[actionFunc]($btn,val,edid);if(pickerid!==''){$toolbar.append($btn);$btn.attr('aria-controls',pickerid);if(actionFunc==='addBtnActionPicker'){$btn.attr('aria-haspopup','true');}}return;}alert('unknown toolbar type: '+val.type+' '+actionFunc);});}function tb_format(btn,props,edid){var sample=props.sample||props.title;insertTags(edid,fixtxt(props.open),fixtxt(props.close),fixtxt(sample));pickerClose();return false;}function tb_formatln(btn,props,edid){var sample=props.sample||props.title,opts,selection=DWgetSelection(jQuery('#'+edid)[0]);sample=fixtxt(sample);props.open=fixtxt(props.open);props.close=fixtxt(props.close);if(selection.getLength()){sample=selection.getText();opts={nosel:true};}else{opts={startofs:props.open.length,endofs:props.close.length};}sample=sample.split("\n").join(props.close+"\n"+props.open);sample=props.open+sample+props.close;pasteText(selection,sample,opts);pickerClose();return false;}function tb_insert(btn,props,edid){insertAtCarret(edid,fixtxt(props.insert));pickerClose();return false;}function tb_mediapopup(btn,props,edid){window.open(DOKU_BASE+props.url+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),props.name,props.options);return false;}function tb_autohead(btn,props,edid){var lvl=currentHeadlineLevel(edid),tags;lvl+=props.mod;if(lvl<1)lvl=1;if(lvl>5)lvl=5;tags=(new Array(8-lvl)).join('=');insertTags(edid,tags+' ',' '+tags+"\n",props.text);pickerClose();return false;}function addBtnActionPicker($btn,props,edid){var pickerid='picker'+(pickercounter++);var picker=createPicker(pickerid,props,edid);jQuery(picker).attr('aria-hidden','true');$btn.click(function(e){pickerToggle(pickerid,$btn);e.preventDefault();return'';});return pickerid;}function addBtnActionLinkwiz($btn,props,edid){dw_linkwiz.init(jQuery('#'+edid));jQuery($btn).click(function(e){dw_linkwiz.val=props;dw_linkwiz.toggle();e.preventDefault();return'';});return'link__wiz';}function pickerToggle(pickerid,$btn){var $picker=jQuery('#'+pickerid),pos=$btn.offset();if($picker.hasClass('a11y')){$picker.removeClass('a11y').attr('aria-hidden','false');}else{$picker.addClass('a11y').attr('aria-hidden','true');}var picker_left=pos.left+3,picker_width=$picker.width(),window_width=jQuery(window).width();if(picker_width>300){$picker.css("max-width","300");picker_width=300;}if((picker_left+picker_width+40)>window_width){picker_left=window_width-picker_width-40;}if(picker_left<0){picker_left=0;}$picker.offset({left:picker_left,top:pos.top+$btn[0].offsetHeight+3});}function pickerClose(){jQuery('.picker').addClass('a11y');}function fixtxt(str){return str.replace(/\\n/g,"\n");}jQuery(function(){initToolbar('tool__bar','wiki__text',toolbar);jQuery('#tool__bar').attr('role','toolbar');});function createToolButton(icon,label,key,id,classname){var $btn=jQuery(document.createElement('button')),$ico=jQuery(document.createElement('img'));$btn.addClass('toolbutton');if(classname){$btn.addClass(classname);}$btn.attr('title',label).attr('aria-controls','wiki__text');if(key){$btn.attr('title',label+' ['+key.toUpperCase()+']').attr('accessKey',key);}if(id){$btn.attr('id',id);$ico.attr('id',id+'_ico');}if(icon.substr(0,1)!=='/'){icon=DOKU_BASE+'lib/images/toolbar/'+icon;}$ico.attr('src',icon);$ico.attr('alt','');$ico.attr('width',16);$ico.attr('height',16);$btn.append($ico);return $btn[0];}function createPicker(id,props,edid){var $picker=jQuery(document.createElement('div'));$picker.addClass('picker a11y');if(props['class']){$picker.addClass(props['class']);}$picker.attr('id',id).css('position','absolute');function $makebutton(title){var $btn=jQuery(document.createElement('button')).addClass('pickerbutton').attr('title',title).attr('aria-controls',edid).on('click',bind(pickerInsert,title,edid)).appendTo($picker);return $btn;}jQuery.each(props.list,function(key,item){if(!props.list.hasOwnProperty(key)){return;}if(isNaN(key)){if(item.substr(0,1)!=='/'){item=DOKU_BASE+'lib/images/'+props.icobase+'/'+item;}jQuery(document.createElement('img')).attr('src',item).attr('alt','').appendTo($makebutton(key));}else if(typeof item=='string'){$makebutton(item).text(item);}else{initToolbar($picker,edid,props.list);return false;}});jQuery('body').append($picker);return $picker[0];}function pickerInsert(text,edid){insertAtCarret(edid,text);pickerClose();}function addBtnActionSignature($btn,props,edid){if(typeof SIG!='undefined'&&SIG!=''){$btn.on('click',function(e){insertAtCarret(edid,SIG);e.preventDefault();});return edid;}return'';}function currentHeadlineLevel(textboxId){var field=jQuery('#'+textboxId)[0],s=false,opts=[field.value.substr(0,DWgetSelection(field).start)];if(field.form&&field.form.prefix){opts.push(field.form.prefix.value);}jQuery.each(opts,function(_,opt){var str="\n"+opt,lasthl=str.lastIndexOf("\n==");if(lasthl!==-1){s=str.substr(lasthl+1,6);return false;}});if(s===false){return 0;}return 7-s.match(/^={2,6}/)[0].length;}window.textChanged=false;window.doku_edit_text_content='';function deleteDraft(){if(is_opera||window.keepDraft){return;}var $dwform=jQuery('#dw__editform');if($dwform.length===0){return;}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',{call:'draftdel',id:$dwform.find('input[name=id]').val()});}jQuery(function(){var $editform=jQuery('#dw__editform');if($editform.length==0){return;}var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){if($edit_text.attr('readOnly')){return;}var sel=DWgetSelection($edit_text[0]);sel.start=0;sel.end=0;DWsetSelection(sel);$edit_text.trigger('focus');doku_edit_text_content=$edit_text.val();}var changeHandler=function(){doku_hasTextBeenModified();doku_summaryCheck();};$editform.change(changeHandler);$editform.keydown(changeHandler);window.onbeforeunload=function(){if(window.textChanged){return LANG.notsavedyet;}};window.onunload=deleteDraft;jQuery('#edbtn__save').on('click',function(){window.onbeforeunload='';textChanged=false;});jQuery('#edbtn__preview').on('click',function(){window.onbeforeunload='';textChanged=false;window.keepDraft=true;});var $summary=jQuery('#edit__summary');$summary.on('change keyup',doku_summaryCheck);if(textChanged)doku_summaryCheck();});function doku_hasTextBeenModified(){if(!textChanged){var $edit_text=jQuery('#wiki__text');if($edit_text.length>0){textChanged=doku_edit_text_content!=$edit_text.val();}else{textChanged=true;}}}function doku_summaryCheck(){var $sum=jQuery('#edit__summary'),missing=$sum.val()==='';$sum.toggleClass('missing',missing).toggleClass('edit',!missing);}var dw_editor={init:function(){var $editor=jQuery('#wiki__text');if($editor.length===0){return;}dw_editor.initSizeCtl('#size__ctl',$editor);if($editor.attr('readOnly')){return;}$editor.keydown(dw_editor.keyHandler);},initSizeCtl:function(ctlarea,editor){var $ctl=jQuery(ctlarea),$textarea=jQuery(editor);if($ctl.length===0||$textarea.length===0){return;}$textarea.css('height',DokuCookie.getValue('sizeCtl')||'300px');var wrp=DokuCookie.getValue('wrapCtl');if(wrp){dw_editor.setWrap($textarea[0],wrp);}jQuery.each([['larger',function(){dw_editor.sizeCtl(editor,100);}],['smaller',function(){dw_editor.sizeCtl(editor,-100);}],['wrap',function(){dw_editor.toggleWrap(editor);}]],function(_,img){jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/'+img[0]+'.gif').attr('alt','').on('click',img[1]).appendTo($ctl);});},sizeCtl:function(editor,val){var $textarea=jQuery(editor),height=parseInt($textarea.css('height'))+val;$textarea.css('height',height+'px');DokuCookie.setValue('sizeCtl',$textarea.css('height'));},toggleWrap:function(editor){var $textarea=jQuery(editor),wrap=$textarea.attr('wrap');dw_editor.setWrap($textarea[0],(wrap&&wrap.toLowerCase()=='off')?'soft':'off');DokuCookie.setValue('wrapCtl',$textarea.attr('wrap'));},setWrap:function(textarea,wrapAttrValue){textarea.setAttribute('wrap',wrapAttrValue);var parNod=textarea.parentNode;var nxtSib=textarea.nextSibling;parNod.removeChild(textarea);parNod.insertBefore(textarea,nxtSib);},keyHandler:function(e){if(jQuery.inArray(e.keyCode,[8,10,13,32])===-1){return;}var selection=DWgetSelection(this);if(selection.getLength()>0){return;}var search="\n"+this.value.substr(0,selection.start);var linestart=Math.max(search.lastIndexOf("\n"),search.lastIndexOf("\r"));search=search.substr(linestart);if((e.keyCode==13||e.keyCode==10)&&e.ctrlKey){jQuery('#edbtn__save').trigger('click');e.preventDefault();return false;}else if(e.keyCode==13){var match=search.match(/(\n +([\*-] ?)?)/);if(match){var scroll=this.scrollHeight;var match2=search.match(/^\n +[\*-]\s*$/);if(match2&&this.value.substr(selection.start).match(/^($|\r?\n)/)){this.value=this.value.substr(0,linestart)+"\n"+this.value.substr(selection.start);selection.start=linestart+1;selection.end=linestart+1;DWsetSelection(selection);}else{insertAtCarret(this.id,match[1]);}this.scrollTop+=(this.scrollHeight-scroll);e.preventDefault();return false;}}else if(e.keyCode==8){var match=search.match(/(\n +)([*-] ?)$/);if(match){var spaces=match[1].length-1;if(spaces>3){this.value=this.value.substr(0,linestart)+this.value.substr(linestart+2);selection.start=selection.start-2;selection.end=selection.start;}else{this.value=this.value.substr(0,linestart)+this.value.substr(selection.start);selection.start=linestart;selection.end=linestart;}DWsetSelection(selection);e.preventDefault();return false;}}else if(e.keyCode==32){var match=search.match(/(\n +)([*-] )$/);if(match){this.value=this.value.substr(0,linestart)+' '+this.value.substr(linestart);selection.start=selection.start+2;selection.end=selection.start;DWsetSelection(selection);e.preventDefault();return false;}}}};jQuery(dw_editor.init);var dw_locktimer={timeout:0,draft:false,timerID:null,lasttime:null,msg:LANG.willexpire,pageid:'',fieldsToSaveAsDraft:['input[name=prefix]','textarea[name=wikitext]','input[name=suffix]','input[name=date]',],callbacks:[],init:function(timeout,draft,edid){var $edit;edid=edid||'wiki__text';$edit=jQuery('#'+edid);if($edit.length===0||$edit.attr('readonly')){return;}dw_locktimer.timeout=timeout*1000;dw_locktimer.draft=draft;dw_locktimer.lasttime=new Date();dw_locktimer.pageid=jQuery('#dw__editform').find('input[name=id]').val();if(!dw_locktimer.pageid){return;}$edit.keypress(dw_locktimer.refresh);dw_locktimer.reset();},addField:function(selector){dw_locktimer.fieldsToSaveAsDraft.push(selector);},addRefreshCallback:function(callback){dw_locktimer.callbacks.push(callback);},reset:function(){dw_locktimer.clear();dw_locktimer.timerID=window.setTimeout(dw_locktimer.warning,dw_locktimer.timeout);},warning:function(){dw_locktimer.clear();alert(fixtxt(dw_locktimer.msg));},clear:function(){if(dw_locktimer.timerID!==null){window.clearTimeout(dw_locktimer.timerID);dw_locktimer.timerID=null;}},refresh:function(){var now=new Date(),params='call=lock&id='+dw_locktimer.pageid+'&';if(now.getTime()-dw_locktimer.lasttime.getTime()<=30*1000){return;}if(dw_locktimer.draft&&jQuery('#dw__editform').find('textarea[name=wikitext]').length>0){params+=jQuery('#dw__editform').find(dw_locktimer.fieldsToSaveAsDraft.join(', ')).serialize();}jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,null,'json').done(function dwLocktimerRefreshDoneHandler(data){dw_locktimer.callbacks.forEach(function(callback){callback(data);});});dw_locktimer.lasttime=now;},refreshed:function(data){if(data.errors.length){data.errors.forEach(function(error){jQuery('#draft__status').after(jQuery('<div class="error"></div>').text(error));})}jQuery('#draft__status').html(data.draft);if(data.lock!=='1'){return;}dw_locktimer.reset();}};dw_locktimer.callbacks.push(dw_locktimer.refreshed);var dw_linkwiz={$wiz:null,$entry:null,result:null,timer:null,textArea:null,selected:null,selection:null,init:function($editor){var pos=$editor.position();if(dw_linkwiz.$wiz)return;dw_linkwiz.$wiz=jQuery(document.createElement('div')).dialog({autoOpen:false,draggable:true,title:LANG.linkwiz,resizable:false}).html('<div>'+LANG.linkto+' <input type="text" class="edit" id="link__wiz_entry" autocomplete="off" /></div>'+'<div id="link__wiz_result"></div>').parent().attr('id','link__wiz').css({'position':'absolute','top':(pos.top+20)+'px','left':(pos.left+80)+'px'}).hide().appendTo('.dokuwiki:first');dw_linkwiz.textArea=$editor[0];dw_linkwiz.result=jQuery('#link__wiz_result')[0];jQuery(dw_linkwiz.result).css('position','relative');dw_linkwiz.$entry=jQuery('#link__wiz_entry');if(JSINFO.namespace){dw_linkwiz.$entry.val(JSINFO.namespace+':');}jQuery('#link__wiz .ui-dialog-titlebar-close').on('click',dw_linkwiz.hide);dw_linkwiz.$entry.keyup(dw_linkwiz.onEntry);jQuery(dw_linkwiz.result).on('click','a',dw_linkwiz.onResultClick);},onEntry:function(e){if(e.keyCode==37||e.keyCode==39){return true;}if(e.keyCode==27){dw_linkwiz.hide();e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==38){dw_linkwiz.select(dw_linkwiz.selected-1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==40){dw_linkwiz.select(dw_linkwiz.selected+1);e.preventDefault();e.stopPropagation();return false;}if(e.keyCode==13){if(dw_linkwiz.selected>-1){var $obj=dw_linkwiz.$getResult(dw_linkwiz.selected);if($obj.length>0){dw_linkwiz.resultClick($obj.find('a')[0]);}}else if(dw_linkwiz.$entry.val()){dw_linkwiz.insertLink(dw_linkwiz.$entry.val());}e.preventDefault();e.stopPropagation();return false;}dw_linkwiz.autocomplete();},getResult:function(num){DEPRECATED('use dw_linkwiz.$getResult()[0] instead');return dw_linkwiz.$getResult()[0]||null;},$getResult:function(num){return jQuery(dw_linkwiz.result).find('div').eq(num);},select:function(num){if(num<0){dw_linkwiz.deselect();return;}var $obj=dw_linkwiz.$getResult(num);if($obj.length===0){return;}dw_linkwiz.deselect();$obj.addClass('selected');var childPos=$obj.position().top;var yDiff=childPos+$obj.outerHeight()-jQuery(dw_linkwiz.result).innerHeight();if(childPos<0){jQuery(dw_linkwiz.result)[0].scrollTop+=childPos;}else if(yDiff>0){jQuery(dw_linkwiz.result)[0].scrollTop+=yDiff;}dw_linkwiz.selected=num;},deselect:function(){if(dw_linkwiz.selected>-1){dw_linkwiz.$getResult(dw_linkwiz.selected).removeClass('selected');}dw_linkwiz.selected=-1;},onResultClick:function(e){if(!jQuery(this).is('a')){return;}e.stopPropagation();e.preventDefault();dw_linkwiz.resultClick(this);return false;},resultClick:function(a){dw_linkwiz.$entry.val(a.title);if(a.title==''||a.title.substr(a.title.length-1)==':'){dw_linkwiz.autocomplete_exec();}else{if(jQuery(a.nextSibling).is('span')){dw_linkwiz.insertLink(a.nextSibling.innerHTML);}else{dw_linkwiz.insertLink('');}}},insertLink:function(title){var link=dw_linkwiz.$entry.val(),sel,stxt;if(!link){return;}sel=DWgetSelection(dw_linkwiz.textArea);if(sel.start==0&&sel.end==0){sel=dw_linkwiz.selection;}stxt=sel.getText();if(stxt.charAt(stxt.length-1)==' '){sel.end--;stxt=sel.getText();}if(!stxt&&!DOKU_UHC){stxt=title;}if(dw_linkwiz.textArea.form.id.value.indexOf(':')!=-1&&link.indexOf(':')==-1){link=':'+link;}var so=link.length;var eo=0;if(dw_linkwiz.val){if(dw_linkwiz.val.open){so+=dw_linkwiz.val.open.length;link=dw_linkwiz.val.open+link;}link+='|';so+=1;if(stxt){link+=stxt;}if(dw_linkwiz.val.close){link+=dw_linkwiz.val.close;eo=dw_linkwiz.val.close.length;}}pasteText(sel,link,{startofs:so,endofs:eo});dw_linkwiz.hide();var externallinkpattern=new RegExp('^((f|ht)tps?:)?//','i'),entry_value;if(externallinkpattern.test(dw_linkwiz.$entry.val())){if(JSINFO.namespace){entry_value=JSINFO.namespace+':';}else{entry_value='';}}else{entry_value=dw_linkwiz.$entry.val().replace(/[^:]*$/,'')}dw_linkwiz.$entry.val(entry_value);},autocomplete:function(){if(dw_linkwiz.timer!==null){window.clearTimeout(dw_linkwiz.timer);dw_linkwiz.timer=null;}dw_linkwiz.timer=window.setTimeout(dw_linkwiz.autocomplete_exec,350);},autocomplete_exec:function(){var $res=jQuery(dw_linkwiz.result);dw_linkwiz.deselect();$res.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="" width="16" height="16" />').load(DOKU_BASE+'lib/exe/ajax.php',{call:'linkwiz',q:dw_linkwiz.$entry.val()});},show:function(){dw_linkwiz.selection=DWgetSelection(dw_linkwiz.textArea);dw_linkwiz.$wiz.show();dw_linkwiz.$entry.focus();dw_linkwiz.autocomplete();var temp=dw_linkwiz.$entry.val();dw_linkwiz.$entry.val('');dw_linkwiz.$entry.val(temp);},hide:function(){dw_linkwiz.$wiz.hide();dw_linkwiz.textArea.focus();},toggle:function(){if(dw_linkwiz.$wiz.css('display')=='none'){dw_linkwiz.show();}else{dw_linkwiz.hide();}}};var dw_mediamanager={keepopen:false,hide:false,popup:false,display:false,ext:false,$popup:null,align:false,link:false,size:false,forbidden_opts:{},view_opts:{list:false,sort:false},layout_width:0,minHeights:{thumbs:200,rows:100},init:function(){var $content,$tree;$content=jQuery('#media__content');$tree=jQuery('#media__tree');if(!$tree.length)return;dw_mediamanager.prepare_content($content);dw_mediamanager.attachoptions();dw_mediamanager.initpopup();$content .on('change','#upload__file',dw_mediamanager.suggest).on('click','a.select',dw_mediamanager.select).on('click','#media__content a.btn_media_delete',dw_mediamanager.confirmattach).on('submit','#mediamanager__done_form',dw_mediamanager.list);$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $link=$clicky.parent().find('div.li a.idx_dir');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$link[0].search.substr(1)+'&call=medians',show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.on('click','a',dw_mediamanager.list);dw_mediamanager.set_fileview_list();dw_mediamanager.init_options();dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();var $page=jQuery('#mediamanager__page');$page.find('div.filelist').on('click','ul.tabs a',dw_mediamanager.list).on('click','div.panelContent a',dw_mediamanager.details).on('submit','#dw__mediasearch',dw_mediamanager.list).on('change','#upload__file',dw_mediamanager.suggest).on('click','.qq-upload-file a',dw_mediamanager.details);$page.find('div.file').on('click','ul.tabs a',dw_mediamanager.details).on('submit','#mediamanager__btn_update',dw_mediamanager.list).on('submit','#page__revisions',dw_mediamanager.details).on('click','#page__revisions a',dw_mediamanager.details).on('submit','#mediamanager__save_meta',dw_mediamanager.details).on('submit','#mediamanager__btn_delete',dw_mediamanager.details).on('submit','#mediamanager__btn_restore',dw_mediamanager.details).on('submit','.btn_newer, .btn_older',dw_mediamanager.details);dw_mediamanager.update_resizable();dw_mediamanager.layout_width=$page.width();jQuery(window).on('resize',dw_mediamanager.window_resize);},init_options:function(){var $options=jQuery('div.filelist div.panelHeader form.options'),$listType,$sortBy,$both;if($options.length===0){return;}$listType=$options.find('li.listType');$sortBy=$options.find('li.sortBy');$both=$listType.add($sortBy);$options.find('button[type=submit]').parent().hide();$both.find('label').each(function(){var $this=jQuery(this);$this.children('input').appendTo($this.parent());});$both.find("input[type='radio']").checkboxradio({icon:false});$both.controlgroup();$listType.children('input').change(function(){dw_mediamanager.set_fileview_list();});$sortBy.children('input').change(function(event){dw_mediamanager.set_fileview_sort();dw_mediamanager.list.call(jQuery('#dw__mediasearch')[0]||this,event);});},initpopup:function(){var opts,$insp,$insbtn;dw_mediamanager.$popup=jQuery(document.createElement('div')).attr('id','media__popup_content').dialog({autoOpen:false,width:280,modal:true,draggable:true,title:LANG.mediatitle,resizable:false});opts=[{id:'link',label:LANG.mediatarget,btns:['lnk','direct','nolnk','displaylnk']},{id:'align',label:LANG.mediaalign,btns:['noalign','left','center','right']},{id:'size',label:LANG.mediasize,btns:['small','medium','large','original']}];jQuery.each(opts,function(_,opt){var $p,$l;$p=jQuery(document.createElement('p')).attr('id','media__'+opt.id);if(dw_mediamanager.display==="2"){$p.hide();}$l=jQuery(document.createElement('label')).text(opt.label);$p.append($l);jQuery.each(opt.btns,function(i,text){var $btn,$img;$btn=jQuery(document.createElement('button')).addClass('button').attr('id',"media__"+opt.id+"btn"+(i+1)).attr('title',LANG['media'+text]).on('click',bind(dw_mediamanager.setOpt,opt.id));$img=jQuery(document.createElement('img')).attr('src',DOKU_BASE+'lib/images/media_'+opt.id+'_'+text+'.png');$btn.append($img);$p.append($btn);});dw_mediamanager.$popup.append($p);});$insp=jQuery(document.createElement('p'));dw_mediamanager.$popup.append($insp);$insbtn=jQuery(document.createElement('input')).attr('id','media__sendbtn').attr('type','button').addClass('button').val(LANG.mediainsert);$insp.append($insbtn);},insert:function(id){var opts,cb,edid,s;dw_mediamanager.$popup.dialog('close');opts='';if({img:1,swf:1}[dw_mediamanager.ext]===1){if(dw_mediamanager.link==='4'){opts='?linkonly';}else{if(dw_mediamanager.link==="3"&&dw_mediamanager.ext==='img'){opts='?nolink';}else if(dw_mediamanager.link==="2"&&dw_mediamanager.ext==='img'){opts='?direct';}s=parseInt(dw_mediamanager.size,10);var size=s*200;if(s&&s>=1&&s<4){opts+=(opts.length)?'&':'?';opts+=size;if(dw_mediamanager.ext==='swf'){switch(s){case 1:opts+='x62';break;case 2:opts+='x123';break;case 3:opts+='x185';break;}}}}}edid=String.prototype.match.call(document.location,/&edid=([^&]+)/);edid=edid?edid[1]:'wiki__text';cb=String.prototype.match.call(document.location,/&onselect=([^&]+)/);cb=cb?cb[1].replace(/[^\w]+/,''):'dw_mediamanager_item_select';opener[cb](edid,id,opts,dw_mediamanager.align,dw_mediamanager.keepopen);if(!dw_mediamanager.keepopen){window.close();}opener.focus();return false;},suggest:function(){var $file,$name,text;$file=jQuery(this);$name=jQuery('#upload__name');if($name.val()!='')return;if(!$file.length||!$name.length){return;}text=$file.val();text=text.substr(text.lastIndexOf('/')+1);text=text.substr(text.lastIndexOf('\\')+1);$name.val(text);},list:function(event){var $link,$content,params;if(event){event.preventDefault();}jQuery('div.success, div.info, div.error, div.notify').remove();$link=jQuery(this);$content=jQuery('#media__content');if($content.length===0){$content=jQuery('div.filelist');if($link.hasClass('idx_dir')){jQuery('div.file').empty();jQuery('div.namespaces .selected').removeClass('selected');$link.addClass('selected');}}params='call=medialist&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}dw_mediamanager.update_content($content,params);},form_params:function($form){if(!$form.length)return;var action='';var i=$form[0].action.indexOf('?');if(i>=0){action=$form[0].action.substr(i+1);}return action+'&'+$form.serialize();},set_fileview_list:function(new_type){dw_mediamanager.set_fileview_opt(['list','listType',function(new_type){jQuery('div.filelist div.panelContent ul').toggleClass('rows',new_type==='rows').toggleClass('thumbs',new_type==='thumbs');}],new_type);dw_mediamanager.resize();},set_fileview_sort:function(new_sort){dw_mediamanager.set_fileview_opt(['sort','sortBy',function(new_sort){}],new_sort);},set_fileview_opt:function(opt,new_val){if(typeof new_val==='undefined'){new_val=jQuery('form.options li.'+opt[1]+' input').filter(':checked').val();if(typeof new_val==='undefined'){new_val='thumbs';}}if(new_val!==dw_mediamanager.view_opts[opt[0]]){opt[2](new_val);DokuCookie.setValue(opt[0],new_val);dw_mediamanager.view_opts[opt[0]]=new_val;}},details:function(event){var $link,$content,params,update_list;$link=jQuery(this);event.preventDefault();jQuery('div.success, div.info, div.error, div.notify').remove();if($link[0].id=='mediamanager__btn_delete'&&!confirm(LANG.del_confirm)){return false;}if($link[0].id=='mediamanager__btn_restore'&&!confirm(LANG.restore_confirm)){return false;}$content=jQuery('div.file');params='call=mediadetails&';if($link[0].search){params+=$link[0].search.substr(1);}else if($link.is('form')){params+=dw_mediamanager.form_params($link);}else if($link.closest('form').length>0){params+=dw_mediamanager.form_params($link.closest('form'));}update_list=($link[0].id=='mediamanager__btn_delete'||$link[0].id=='mediamanager__btn_restore');dw_mediamanager.update_content($content,params,update_list);},update_content:function($content,params,update_list){var $container;jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){dw_mediamanager.$resizables().resizable('destroy');if(update_list){dw_mediamanager.list.call(jQuery('#mediamanager__page').find('form.options button[type="submit"]')[0]);}$content.html(data);dw_mediamanager.prepare_content($content);dw_mediamanager.updatehide();dw_mediamanager.update_resizable();dw_behaviour.revisionBoxHandler();dw_mediamanager.set_fileview_list(dw_mediamanager.view_opts.list);dw_mediamanager.image_diff();dw_mediamanager.init_ajax_uploader();dw_mediamanager.init_options();},'html');$container=$content.find('div.panelContent');if($container.length===0){$container=$content;}$container.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." class="load" />');},window_resize:function(){dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();},$resizables:function(){return jQuery('#mediamanager__page').find('div.namespaces, div.filelist');},update_resizable:function(){var $resizables=dw_mediamanager.$resizables();$resizables.resizable({handles:(jQuery('html[dir=rtl]').length?'w':'e'),resize:function(event,ui){var $page=jQuery('#mediamanager__page');var widthFull=$page.width();var widthResizables=0;$resizables.each(function(){widthResizables+=jQuery(this).width();});var $filePanel=$page.find('div.panel.file');var widthOtherResizable=widthResizables-jQuery(this).width();var minWidthNonResizable=parseFloat($filePanel.css("min-width"));var maxWidth=widthFull-(widthOtherResizable+minWidthNonResizable)-1;$resizables.resizable("option","maxWidth",maxWidth);var relWidthNonResizable=99.9-(100*widthResizables/widthFull);$filePanel.width(relWidthNonResizable+'%');dw_mediamanager.resize();dw_mediamanager.opacity_slider();dw_mediamanager.portions_slider();}});dw_mediamanager.resize();},resize:function(){var $contents=jQuery('#mediamanager__page').find('div.panelContent'),height=jQuery(window).height()-jQuery(document.body).height()+Math.max.apply(null,jQuery.map($contents,function(v){return jQuery(v).height();}));if(height<dw_mediamanager.minHeights[dw_mediamanager.view_opts.list]){$contents.add(dw_mediamanager.$resizables()).height('auto');}else{$contents.height(height);dw_mediamanager.$resizables().each(function(){var $this=jQuery(this);$this.height(height+$this.find('div.panelContent').offset().top-$this.offset().top);});}},image_diff:function(){if(jQuery('#mediamanager__difftype').length)return;var $form=jQuery('#mediamanager__form_diffview');if(!$form.length)return;var $label=jQuery(document.createElement('label'));$label.append('<span>'+LANG.media_diff+'</span> ');var $select=jQuery(document.createElement('select')).attr('id','mediamanager__difftype').attr('name','difftype').change(dw_mediamanager.change_diff_type);$select.append(new Option(LANG.media_diff_both,"both"));$select.append(new Option(LANG.media_diff_opacity,"opacity"));$select.append(new Option(LANG.media_diff_portions,"portions"));$label.append($select);$form.append($label);var select=document.getElementById('mediamanager__difftype');select.options[0].text=LANG.media_diff_both;select.options[1].text=LANG.media_diff_opacity;select.options[2].text=LANG.media_diff_portions;},change_diff_type:function(){var $select=jQuery('#mediamanager__difftype');var $content=jQuery('#mediamanager__diff');var params=dw_mediamanager.form_params($select.closest('form'))+'&call=mediadiff';jQuery.post(DOKU_BASE+'lib/exe/ajax.php',params,function(data){$content.html(data);dw_mediamanager.portions_slider();dw_mediamanager.opacity_slider();},'html');},opacity_slider:function(){var $diff=jQuery("#mediamanager__diff");var $slider=$diff.find("div.slider");if(!$slider.length)return;var $image=$diff.find('div.imageDiff.opacity div.image1 img');if(!$image.length)return;$slider.width($image.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",0.999);$slider.slider("option","step",0.001);$slider.slider("option","value",0.5);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity:$slider.slider("option","value")});});},portions_slider:function(){var $diff=jQuery("#mediamanager__diff");if(!$diff.length)return;var $image1=$diff.find('div.imageDiff.portions div.image1 img');var $image2=$diff.find('div.imageDiff.portions div.image2 img');if(!$image1.length||!$image2.length)return;$diff.width('100%');$image2.parent().width('97%');$image1.width('100%');$image2.width('100%');if($image1.width()<$diff.width()){$diff.width($image1.width());}$image2.parent().width('50%');$image2.width($image1.width());$image1.width($image1.width());var $slider=$diff.find("div.slider");if(!$slider.length)return;$slider.width($image1.width()-20);$slider.slider();$slider.slider("option","min",0);$slider.slider("option","max",97);$slider.slider("option","step",1);$slider.slider("option","value",50);$slider.on("slide",function(event,ui){jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width:$slider.slider("option","value")+'%'});});},params_toarray:function(str){var vars=[],hash;var hashes=str.split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars[decodeURIComponent(hash[0])]=decodeURIComponent(hash[1]);}return vars;},init_ajax_uploader:function(){if(!jQuery('#mediamanager__uploader').length)return;if(jQuery('.qq-upload-list').length)return;var params=dw_mediamanager.form_params(jQuery('#dw__upload'))+'&call=mediaupload';params=dw_mediamanager.params_toarray(params);var uploader=new qq.FileUploaderExtended({element:document.getElementById('mediamanager__uploader'),action:DOKU_BASE+'lib/exe/ajax.php',params:params});},prepare_content:function($content){$content.find('div.example:visible').hide();$content.find('a.allowedmime').on('click',function(event){event.preventDefault();$toggle=jQuery(this);$list=$toggle.next('span');$list.toggle();}).next('span').hide();},select:function(event){var $link,id,dot,ext;event.preventDefault();$link=jQuery(this);id=$link.attr('id').substr(2);if(!opener){jQuery(document.getElementById('ex_'+id.replace(/:/g,'_').replace(/^_/,''))).dw_toggle();return;}dw_mediamanager.ext=false;dot=id.lastIndexOf(".");if(-1===dot){dw_mediamanager.insert(id);return;}ext=id.substr(dot);if({'.jpg':1,'.jpeg':1,'.png':1,'.gif':1,'.swf':1}[ext]!==1){dw_mediamanager.insert(id);return;}var $sendbtn=jQuery('#media__sendbtn');$sendbtn.off().on('click',bind(dw_mediamanager.insert,id));dw_mediamanager.unforbid('ext');if(ext==='.swf'){dw_mediamanager.ext='swf';dw_mediamanager.forbid('ext',{link:['1','2'],size:['4']});}else{dw_mediamanager.ext='img';}dw_mediamanager.setOpt('link');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');jQuery('#media__linkbtn1, #media__linkbtn2, #media__sizebtn4').toggle(dw_mediamanager.ext==='img');dw_mediamanager.$popup.dialog('open');$sendbtn.focus();},confirmattach:function(e){if(!confirm(LANG.del_confirm+"\n"+jQuery(this).attr('title'))){e.preventDefault();}},attachoptions:function(){var $obj,opts;$obj=jQuery('#media__opts');if($obj.length===0){return;}opts=[];if(opener){opts.push(['keepopen','keepopen']);}opts.push(['hide','hidedetails']);jQuery.each(opts,function(_,opt){var $box,$lbl;$box=jQuery(document.createElement('input')).attr('type','checkbox').attr('id','media__'+opt[0]).on('click',bind(dw_mediamanager.toggleOption,opt[0]));if(DokuCookie.getValue(opt[0])){$box.prop('checked',true);dw_mediamanager[opt[0]]=true;}$lbl=jQuery(document.createElement('label')).attr('for','media__'+opt[0]).text(LANG[opt[1]]);$obj.append($box,$lbl,document.createElement('br'));});dw_mediamanager.updatehide();},toggleOption:function(variable){if(jQuery(this).prop('checked')){DokuCookie.setValue(variable,1);dw_mediamanager[variable]=true;}else{DokuCookie.setValue(variable,'');dw_mediamanager[variable]=false;}if(variable==='hide'){dw_mediamanager.updatehide();}},updatehide:function(){jQuery('#media__content').find('div.detail').dw_toggle(!dw_mediamanager.hide);},setOpt:function(opt,e){var val,i;if(typeof e!=='undefined'){val=this.id.substring(this.id.length-1);}else{val=dw_mediamanager.getOpt(opt);}if(val===false){DokuCookie.setValue(opt,'');dw_mediamanager[opt]=false;return;}if(opt==='link'){if(val!=='4'&&dw_mediamanager.link==='4'){dw_mediamanager.unforbid('linkonly');dw_mediamanager.setOpt('align');dw_mediamanager.setOpt('size');}else if(val==='4'){dw_mediamanager.forbid('linkonly',{align:false,size:false});}jQuery("#media__size, #media__align").dw_toggle(val!=='4');}DokuCookie.setValue(opt,val);dw_mediamanager[opt]=val;for(i=1;i<=4;i++){jQuery("#media__"+opt+"btn"+i).removeClass('selected');}jQuery('#media__'+opt+'btn'+val).addClass('selected');},unforbid:function(group){delete dw_mediamanager.forbidden_opts[group];},forbid:function(group,forbids){dw_mediamanager.forbidden_opts[group]=forbids;},allowedOpt:function(opt,val){var ret=true;jQuery.each(dw_mediamanager.forbidden_opts,function(_,forbids){ret=forbids[opt]!==false&&jQuery.inArray(val,forbids[opt])===-1;return ret;});return ret;},getOpt:function(opt){var allowed=bind(dw_mediamanager.allowedOpt,opt);if(dw_mediamanager[opt]!==false&&allowed(dw_mediamanager[opt])){return dw_mediamanager[opt];}if(DokuCookie.getValue(opt)&&allowed(DokuCookie.getValue(opt))){return DokuCookie.getValue(opt);}if(opt==='size'&&allowed('2')){return'2';}return jQuery.grep(['1','2','3','4'],allowed)[0]||false;}};function dw_mediamanager_item_select(edid,mediaid,opts,align,keepopen){var alignleft='';var alignright='';var cursorInImageTag=false;var textArea=jQuery('#'+edid)[0];var selection=DWgetSelection(textArea);selection.end=selection.end+2;var charsAfterCursor=selection.getText();if(charsAfterCursor==='}}'){cursorInImageTag=true;}if(align!=='1'){alignleft=align==='2'?'':' ';alignright=align==='4'?'':' ';}if(keepopen&&cursorInImageTag){selection.start=selection.start+2;DWsetSelection(selection);}insertTags(edid,'{{'+alignleft+mediaid+opts+alignright+'|','}}','');}jQuery(dw_mediamanager.init);function DEPRECATED(msg){if(!window.console)return;if(!msg)msg='';var func;if(arguments.callee)func=arguments.callee.caller.name;if(func)func=' '+func+'()';var line='DEPRECATED function call'+func+'. '+msg;if(console.warn){console.warn(line);}else{console.log(line);}if(console.trace)console.trace();}function DEPRECATED_WRAP(func,context){return function(){DEPRECATED();return func.apply(context||this,arguments);};}jQuery.fn.dw_hide=function(fn,noaria){if(!noaria)this.attr('aria-expanded','false');return this.slideUp('fast',fn);};jQuery.fn.dw_show=function(fn,noaria){if(!noaria)this.attr('aria-expanded','true');return this.slideDown('fast',fn);};jQuery.fn.dw_toggle=function(state,fn,noaria){return this.each(function(){var $this=jQuery(this);if(typeof state==='undefined'){state=$this.is(':hidden');}$this[state?"dw_show":"dw_hide"](fn,noaria);});};var dw_behaviour={init:function(){dw_behaviour.focusMarker();dw_behaviour.scrollToMarker();dw_behaviour.removeHighlightOnClick();dw_behaviour.quickSelect();dw_behaviour.checkWindowsShares();dw_behaviour.subscription();dw_behaviour.revisionBoxHandler();jQuery(document).on('click','#page__revisions input[type=checkbox]',dw_behaviour.revisionBoxHandler);jQuery('.bounce').effect('bounce',{times:10},2000);},scrollToMarker:function(){var $obj=jQuery('#scroll__here');if($obj.length){if($obj.offset().top!=0){jQuery('html, body').animate({scrollTop:$obj.offset().top-100},500);}else{$obj[0].scrollIntoView();}}},focusMarker:function(){jQuery('#focus__this').trigger('focus');},removeHighlightOnClick:function(){jQuery('span.search_hit').on('click',function(e){jQuery(e.target).removeClass('search_hit',1000);});},quickSelect:function(){jQuery('select.quickselect').on('change',function(e){e.target.form.submit();}).closest('form').find(':button').not('.show').hide();},checkWindowsShares:function(){if(!LANG.nosmblinks||navigator.userAgent.match(/(Trident|MSIE|Edge)/)){return;}jQuery('a.windows').on('click',function(){alert(LANG.nosmblinks.replace(/\\n/,"\n"));});},subscription:function(){var $form,$list,$digest;$form=jQuery('#subscribe__form');if(0===$form.length)return;$list=$form.find("input[name='sub_style'][value='list']");$digest=$form.find("input[name='sub_style'][value='digest']");$form.find("input[name='sub_target']").on('click',function(){var $this=jQuery(this),show_list;if(!$this.prop('checked')){return;}show_list=$this.val().match(/:$/);$list.parent().dw_toggle(show_list);if(!show_list&&$list.prop('checked')){$digest.prop('checked','checked');}}).filter(':checked').trigger('click');},revisionBoxHandler:function(){var $revisions=jQuery('#page__revisions');var $all=jQuery('input[type=checkbox]',$revisions);var $checked=$all.filter(':checked');var $button=jQuery('button',$revisions);if($checked.length<2){$all.prop('disabled',false);$button.prop('disabled',true);}else{$all.prop('disabled',true);$button.prop('disabled',false);$checked.each(function(i){jQuery(this).prop('disabled',false);if(i>1){jQuery(this).prop('checked',false);}});}}};jQuery(dw_behaviour.init);dw_page={init:function(){dw_page.sectionHighlight();dw_page.currentIDHighlight();jQuery('a.fn_top').on('mouseover',dw_page.footnoteDisplay);dw_page.makeToggle('#dw__toc h3','#dw__toc > div');},sectionHighlight:function(){jQuery('form.btn_secedit').on('mouseover',function(){var $tgt=jQuery(this).parent(),nr=$tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2],$highlight=jQuery(),$highlightWrap=jQuery('<div class="section_highlight"></div>');while($tgt.length>0&&!($tgt.hasClass('sectionedit'+nr)||$tgt.find('.sectionedit'+nr).length)){$tgt=$tgt.prev();$highlight=$highlight.add($tgt);}$highlight.filter(':last').before($highlightWrap);$highlight.detach().appendTo($highlightWrap);}).on('mouseout',function(){var $highlightWrap=jQuery('.section_highlight');$highlightWrap.before($highlightWrap.children().detach());$highlightWrap.detach();});},currentIDHighlight:function(){jQuery('a.wikilink1, a.wikilink2').filter('[data-wiki-id="'+JSINFO.id+'"]').wrap('<span class="curid"></div>');},insituPopup:function(target,popup_id){var $fndiv=jQuery('#'+popup_id);if($fndiv.length===0){$fndiv=jQuery(document.createElement('div')).attr('id',popup_id).addClass('insitu-footnote JSpopup').attr('aria-hidden','true').on('mouseleave',function(){jQuery(this).hide().attr('aria-hidden','true');}).attr('role','tooltip');jQuery('.dokuwiki:first').append($fndiv);}$fndiv.show().position({my:'left top',at:'left center',of:target}).hide();return $fndiv;},footnoteDisplay:function(){var $content=jQuery(jQuery(this).attr('href')).parent().siblings('.content').clone();if(!$content.length){return;}jQuery('[id]',$content).each(function(){var id=jQuery(this).attr('id');jQuery(this).attr('id','insitu__'+id);});var content=$content.html().trim();dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('<span>+</span>');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('<span>−</span>');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').on('click',$handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);(function($){var fadeOption={duration:150};function toggleLeft(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__aside').show();}function toggleRight(){$('#sidebar_bg').show('fade',fadeOption);$('#dokuwiki__tools').show();}function preventParentWheel(e){var curScrollPos=$(this).scrollTop();var scrollableDist=$(this).prop('scrollHeight')-$(this).outerHeight();var wheelEvent=e.originalEvent;var dY=wheelEvent.deltaY;if(dY<0&&curScrollPos<=0){return false;}if(dY>0&&curScrollPos>=scrollableDist){return false;}}function showSearch(){$('div.search').toggle();$('div.search').find('input.edit').select();}function bindEvents(){$('.sidebar').on('wheel scroll',preventParentWheel);$('.btn_left').click(function(){toggleLeft();});$('.btn_right').click(function(){toggleRight();});$('#sidebar_bg').click(function(){$(this).hide('fade',fadeOption);$('#dokuwiki__aside').hide();$('#dokuwiki__tools').hide();});$('.btn_search').click(function(){showSearch();});$(document).keydown(function(e){if(e.which==70&&e.altKey){showSearch();e.preventDefault();}});}function initUI(){if($('.page h2').length>0){$('.toc_wikipedia').find('#dw__toc').insertBefore($('.page h2:first'));}else{$('.toc_wikipedia').find('#dw__toc').insertAfter($('.page h1:first').next('.level1'));}if($('.page > .level1 > blockquote').length>0){$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page > .level1 > blockquote'));}else{$('.toc_dokuwiki').find('#dw__toc').insertAfter($('.page h1:first'));}$(window).on("hashchange",function(){window.scrollTo(window.scrollX,window.scrollY-48);});}$(function(){initUI();bindEvents();});})(jQuery);var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').on('change',dw_acl.userselhandler);jQuery('#acl__user button').on('click',dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i<all.length;i++){var att=all[i].split('=');attributes[att[0]]=decodeURIComponent(att[1]);}return attributes;},treehandler:function(){var $link,$frm;$link=jQuery(this);jQuery('#acl__tree a.cur').removeClass('cur');$link.addClass('cur');$frm=jQuery('#acl__detail form');if($link.hasClass('wikilink1')){$frm.find('input[name=ns]').val('');$frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);}else if($link.hasClass('idx_dir')){$frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);$frm.find('input[name=id]').val('');}dw_acl.loadinfo();return false;}};jQuery(dw_acl.init);jQuery(function(){jQuery('form.bureaucracy__plugin').each(function(){function updateFieldset(input){jQuery.each(jQuery(input).data('dparray'),function(i,dp){var showOrHide=input.parentNode.parentNode.style.display!=='none'&&((input.checked===dp.tval)||(input.type!=='checkbox'&&(dp.tval===true&&input.value!==''))||input.value===dp.tval);dp.fset.toggle(showOrHide);dp.fset.find('input,select').each(function(){var $inputelem=jQuery(this);if($inputelem.hasClass('required')){if(showOrHide){$inputelem.attr('required','required');}else{$inputelem.removeAttr('required')}}if($inputelem.data('dparray')){$inputelem.change();}});});}jQuery('p.bureaucracy_depends',this).each(function(){var fname=jQuery(this).find('span.bureaucracy_depends_fname').html(),fvalue=jQuery(this).find('span.bureaucracy_depends_fvalue');fvalue=(fvalue.length?fvalue.html():true);var fieldsetinfo={fset:jQuery(this).parent(),tval:fvalue};jQuery("label").has(":first-child:contains('"+fname+"')").first().find("select,input:last").each(function(){if(!jQuery(this).data('dparray')){jQuery(this).data('dparray',[fieldsetinfo]);}else{jQuery(this).data('dparray').push(fieldsetinfo);}}).bind('change keyup',function(){updateFieldset(this);}).change();}).hide();});});jQuery(function(){function ajaxsource(request,response,getterm){jQuery.getJSON(DOKU_BASE+'lib/exe/ajax.php',{call:'bureaucracy_user_field',search:getterm(request)},function(data){response(jQuery.map(data,function(name,user){return{label:name+' ('+user+')',value:user}}))});}function split(val){return val.split(/,\s*/);}function extractLast(term){return split(term).pop();}jQuery(".userpicker").autocomplete({source:function(request,response){ajaxsource(request,response,function(req){return req.term})}});jQuery(".userspicker").bind("keydown",function(event){if(event.keyCode===jQuery.ui.keyCode.TAB&&jQuery(this).data("ui-autocomplete").menu.active){event.preventDefault();}}).autocomplete({minLength:0,source:function(request,response){ajaxsource(request,response,function(req){return extractLast(req.term)})},search:function(){var term=extractLast(this.value);return term.length>=2;},focus:function(){return false;},select:function(event,ui){var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");return false;}});});jQuery(function(){jQuery('.bureaucracy__plugin .datepicker').datepicker({dateFormat:"yy-mm-dd",changeMonth:true,changeYear:true});});(function(){var $,AbstractChosen,Chosen,SelectParser,_ref,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};SelectParser=(function(){function SelectParser(){this.options_index=0;this.parsed=[];}SelectParser.prototype.add_node=function(child){if(child.nodeName.toUpperCase()==="OPTGROUP"){return this.add_group(child);}else{return this.add_option(child);}};SelectParser.prototype.add_group=function(group){var group_position,option,_i,_len,_ref,_results;group_position=this.parsed.length;this.parsed.push({array_index:group_position,group:true,label:this.escapeExpression(group.label),title:group.title?group.title:void 0,children:0,disabled:group.disabled,classes:group.className});_ref=group.childNodes;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];_results.push(this.add_option(option,group_position,group.disabled));}return _results;};SelectParser.prototype.add_option=function(option,group_position,group_disabled){if(option.nodeName.toUpperCase()==="OPTION"){if(option.text!==""){if(group_position!=null){this.parsed[group_position].children+=1;}this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:option.value,text:option.text,html:option.innerHTML,title:option.title?option.title:void 0,selected:option.selected,disabled:group_disabled===true?group_disabled:option.disabled,group_array_index:group_position,group_label:group_position!=null?this.parsed[group_position].label:null,classes:option.className,style:option.style.cssText});}else{this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:true});}return this.options_index+=1;}};SelectParser.prototype.escapeExpression=function(text){var map,unsafe_chars;if((text==null)||text===false){return"";}if(!/[\&\<\>\"\'\`]/.test(text)){return text;}map={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g;return text.replace(unsafe_chars,function(chr){return map[chr]||"&amp;";});};return SelectParser;})();SelectParser.select_to_array=function(select){var child,parser,_i,_len,_ref;parser=new SelectParser();_ref=select.childNodes;for(_i=0,_len=_ref.length;_i<_len;_i++){child=_ref[_i];parser.add_node(child);}return parser.parsed;};AbstractChosen=(function(){function AbstractChosen(form_field,options){this.form_field=form_field;this.options=options!=null?options:{};if(!AbstractChosen.browser_is_supported()){return;}this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.on_ready();}AbstractChosen.prototype.set_default_values=function(){var _this=this;this.click_test_action=function(evt){return _this.test_active_click(evt);};this.activate_action=function(evt){return _this.activate_field(evt);};this.active_field=false;this.mouse_on_container=false;this.results_showing=false;this.result_highlighted=null;this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text===""?this.options.allow_single_deselect:false;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||false;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:true;this.group_search=this.options.group_search!=null?this.options.group_search:true;this.search_contains=this.options.search_contains||false;this.single_backstroke_delete=this.options.single_backstroke_delete!=null?this.options.single_backstroke_delete:true;this.max_selected_options=this.options.max_selected_options||Infinity;this.inherit_select_classes=this.options.inherit_select_classes||false;this.display_selected_options=this.options.display_selected_options!=null?this.options.display_selected_options:true;this.display_disabled_options=this.options.display_disabled_options!=null?this.options.display_disabled_options:true;return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false;};AbstractChosen.prototype.set_default_text=function(){if(this.form_field.getAttribute("data-placeholder")){this.default_text=this.form_field.getAttribute("data-placeholder");}else if(this.is_multiple){this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text;}else{this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text;}return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text;};AbstractChosen.prototype.choice_label=function(item){if(this.include_group_label_in_selected&&(item.group_label!=null)){return"<b class='group-name'>"+item.group_label+"</b>"+item.html;}else{return item.html;}};AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=true;};AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=false;};AbstractChosen.prototype.input_focus=function(evt){var _this=this;if(this.is_multiple){if(!this.active_field){return setTimeout((function(){return _this.container_mousedown();}),50);}}else{if(!this.active_field){return this.activate_field();}}};AbstractChosen.prototype.input_blur=function(evt){var _this=this;if(!this.mouse_on_container){this.active_field=false;return setTimeout((function(){return _this.blur_test();}),100);}};AbstractChosen.prototype.results_option_build=function(options){var content,data,_i,_len,_ref;content='';_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){data=_ref[_i];if(data.group){content+=this.result_add_group(data);}else{content+=this.result_add_option(data);}if(options!=null?options.first:void 0){if(data.selected&&this.is_multiple){this.choice_build(data);}else if(data.selected&&!this.is_multiple){this.single_set_selected_text(this.choice_label(data));}}}return content;};AbstractChosen.prototype.result_add_option=function(option){var classes,option_el;if(!option.search_match){return'';}if(!this.include_option_in_results(option)){return'';}classes=[];if(!option.disabled&&!(option.selected&&this.is_multiple)){classes.push("active-result");}if(option.disabled&&!(option.selected&&this.is_multiple)){classes.push("disabled-result");}if(option.selected){classes.push("result-selected");}if(option.group_array_index!=null){classes.push("group-option");}if(option.classes!==""){classes.push(option.classes);}option_el=document.createElement("li");option_el.className=classes.join(" ");option_el.style.cssText=option.style;option_el.setAttribute("data-option-array-index",option.array_index);option_el.innerHTML=option.search_text;if(option.title){option_el.title=option.title;}return this.outerHTML(option_el);};AbstractChosen.prototype.result_add_group=function(group){var classes,group_el;if(!(group.search_match||group.group_match)){return'';}if(!(group.active_options>0)){return'';}classes=[];classes.push("group-result");if(group.classes){classes.push(group.classes);}group_el=document.createElement("li");group_el.className=classes.join(" ");group_el.innerHTML=group.search_text;if(group.title){group_el.title=group.title;}return this.outerHTML(group_el);};AbstractChosen.prototype.results_update_field=function(){this.set_default_text();if(!this.is_multiple){this.results_reset_cleanup();}this.result_clear_highlight();this.results_build();if(this.results_showing){return this.winnow_results();}};AbstractChosen.prototype.reset_single_select_options=function(){var result,_i,_len,_ref,_results;_ref=this.results_data;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){result=_ref[_i];if(result.selected){_results.push(result.selected=false);}else{_results.push(void 0);}}return _results;};AbstractChosen.prototype.results_toggle=function(){if(this.results_showing){return this.results_hide();}else{return this.results_show();}};AbstractChosen.prototype.results_search=function(evt){if(this.results_showing){return this.winnow_results();}else{return this.results_show();}};AbstractChosen.prototype.winnow_results=function(){var escapedSearchText,option,regex,results,results_group,searchText,startpos,text,zregex,_i,_len,_ref;this.no_results_clear();results=0;searchText=this.get_search_text();escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");zregex=new RegExp(escapedSearchText,'i');regex=this.get_search_regex(escapedSearchText);_ref=this.results_data;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];option.search_match=false;results_group=null;if(this.include_option_in_results(option)){if(option.group){option.group_match=false;option.active_options=0;}if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){results_group=this.results_data[option.group_array_index];if(results_group.active_options===0&&results_group.search_match){results+=1;}results_group.active_options+=1;}option.search_text=option.group?option.label:option.html;if(!(option.group&&!this.group_search)){option.search_match=this.search_string_match(option.search_text,regex);if(option.search_match&&!option.group){results+=1;}if(option.search_match){if(searchText.length){startpos=option.search_text.search(zregex);text=option.search_text.substr(0,startpos+searchText.length)+'</em>'+option.search_text.substr(startpos+searchText.length);option.search_text=text.substr(0,startpos)+'<em>'+text.substr(startpos);}if(results_group!=null){results_group.group_match=true;}}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){option.search_match=true;}}}}this.result_clear_highlight();if(results<1&&searchText.length){this.update_results_content("");return this.no_results(searchText);}else{this.update_results_content(this.results_option_build());return this.winnow_results_set_highlight();}};AbstractChosen.prototype.get_search_regex=function(escaped_search_string){var regex_anchor;regex_anchor=this.search_contains?"":"^";return new RegExp(regex_anchor+escaped_search_string,'i');};AbstractChosen.prototype.search_string_match=function(search_string,regex){var part,parts,_i,_len;if(regex.test(search_string)){return true;}else if(this.enable_split_word_search&&(search_string.indexOf(" ")>=0||search_string.indexOf("[")===0)){parts=search_string.replace(/\[|\]/g,"").split(" ");if(parts.length){for(_i=0,_len=parts.length;_i<_len;_i++){part=parts[_i];if(regex.test(part)){return true;}}}}};AbstractChosen.prototype.choices_count=function(){var option,_i,_len,_ref;if(this.selected_option_count!=null){return this.selected_option_count;}this.selected_option_count=0;_ref=this.form_field.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];if(option.selected){this.selected_option_count+=1;}}return this.selected_option_count;};AbstractChosen.prototype.choices_click=function(evt){evt.preventDefault();if(!(this.results_showing||this.is_disabled)){return this.results_show();}};AbstractChosen.prototype.keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}break;case 13:evt.preventDefault();if(this.results_showing){return this.result_select(evt);}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search();}};AbstractChosen.prototype.clipboard_event_checker=function(evt){var _this=this;return setTimeout((function(){return _this.results_search();}),50);};AbstractChosen.prototype.container_width=function(){if(this.options.width!=null){return this.options.width;}else{return""+this.form_field.offsetWidth+"px";}};AbstractChosen.prototype.include_option_in_results=function(option){if(this.is_multiple&&(!this.display_selected_options&&option.selected)){return false;}if(!this.display_disabled_options&&option.disabled){return false;}if(option.empty){return false;}return true;};AbstractChosen.prototype.search_results_touchstart=function(evt){this.touch_started=true;return this.search_results_mouseover(evt);};AbstractChosen.prototype.search_results_touchmove=function(evt){this.touch_started=false;return this.search_results_mouseout(evt);};AbstractChosen.prototype.search_results_touchend=function(evt){if(this.touch_started){return this.search_results_mouseup(evt);}};AbstractChosen.prototype.outerHTML=function(element){var tmp;if(element.outerHTML){return element.outerHTML;}tmp=document.createElement("div");tmp.appendChild(element);return tmp.innerHTML;};AbstractChosen.browser_is_supported=function(){if(window.navigator.appName==="Microsoft Internet Explorer"){return document.documentMode>=8;}if(/iP(od|hone)/i.test(window.navigator.userAgent)){return false;}if(/Android/i.test(window.navigator.userAgent)){if(/Mobile/i.test(window.navigator.userAgent)){return false;}}return true;};AbstractChosen.default_multiple_text="Select Some Options";AbstractChosen.default_single_text="Select an Option";AbstractChosen.default_no_result_text="No results match";return AbstractChosen;})();$=jQuery;$.fn.extend({chosen:function(options){if(!AbstractChosen.browser_is_supported()){return this;}return this.each(function(input_field){var $this,chosen;$this=$(this);chosen=$this.data('chosen');if(options==='destroy'&&chosen instanceof Chosen){chosen.destroy();}else if(!(chosen instanceof Chosen)){$this.data('chosen',new Chosen(this,options));}});}});Chosen=(function(_super){__extends(Chosen,_super);function Chosen(){_ref=Chosen.__super__.constructor.apply(this,arguments);return _ref;}Chosen.prototype.setup=function(){this.form_field_jq=$(this.form_field);this.current_selectedIndex=this.form_field.selectedIndex;return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl");};Chosen.prototype.set_up_html=function(){var container_classes,container_props;container_classes=["chosen-container"];container_classes.push("chosen-container-"+(this.is_multiple?"multi":"single"));if(this.inherit_select_classes&&this.form_field.className){container_classes.push(this.form_field.className);}if(this.is_rtl){container_classes.push("chosen-rtl");}container_props={'class':container_classes.join(' '),'style':"width: "+(this.container_width())+";",'title':this.form_field.title};if(this.form_field.id.length){container_props.id=this.form_field.id.replace(/[^\w]/g,'_')+"_chosen";}this.container=$("<div />",container_props);if(this.is_multiple){this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');}else{this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');}this.form_field_jq.hide().after(this.container);this.dropdown=this.container.find('div.chosen-drop').first();this.search_field=this.container.find('input').first();this.search_results=this.container.find('ul.chosen-results').first();this.search_field_scale();this.search_no_results=this.container.find('li.no-results').first();if(this.is_multiple){this.search_choices=this.container.find('ul.chosen-choices').first();this.search_container=this.container.find('li.search-field').first();}else{this.search_container=this.container.find('div.chosen-search').first();this.selected_item=this.container.find('.chosen-single').first();}this.results_build();this.set_tab_index();return this.set_label_behavior();};Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this});};Chosen.prototype.register_observers=function(){var _this=this;this.container.bind('touchstart.chosen',function(evt){_this.container_mousedown(evt);return evt.preventDefault();});this.container.bind('touchend.chosen',function(evt){_this.container_mouseup(evt);return evt.preventDefault();});this.container.bind('mousedown.chosen',function(evt){_this.container_mousedown(evt);});this.container.bind('mouseup.chosen',function(evt){_this.container_mouseup(evt);});this.container.bind('mouseenter.chosen',function(evt){_this.mouse_enter(evt);});this.container.bind('mouseleave.chosen',function(evt){_this.mouse_leave(evt);});this.search_results.bind('mouseup.chosen',function(evt){_this.search_results_mouseup(evt);});this.search_results.bind('mouseover.chosen',function(evt){_this.search_results_mouseover(evt);});this.search_results.bind('mouseout.chosen',function(evt){_this.search_results_mouseout(evt);});this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen',function(evt){_this.search_results_mousewheel(evt);});this.search_results.bind('touchstart.chosen',function(evt){_this.search_results_touchstart(evt);});this.search_results.bind('touchmove.chosen',function(evt){_this.search_results_touchmove(evt);});this.search_results.bind('touchend.chosen',function(evt){_this.search_results_touchend(evt);});this.form_field_jq.bind("chosen:updated.chosen",function(evt){_this.results_update_field(evt);});this.form_field_jq.bind("chosen:activate.chosen",function(evt){_this.activate_field(evt);});this.form_field_jq.bind("chosen:open.chosen",function(evt){_this.container_mousedown(evt);});this.form_field_jq.bind("chosen:close.chosen",function(evt){_this.input_blur(evt);});this.search_field.bind('blur.chosen',function(evt){_this.input_blur(evt);});this.search_field.bind('keyup.chosen',function(evt){_this.keyup_checker(evt);});this.search_field.bind('keydown.chosen',function(evt){_this.keydown_checker(evt);});this.search_field.bind('focus.chosen',function(evt){_this.input_focus(evt);});this.search_field.bind('cut.chosen',function(evt){_this.clipboard_event_checker(evt);});this.search_field.bind('paste.chosen',function(evt){_this.clipboard_event_checker(evt);});if(this.is_multiple){return this.search_choices.bind('click.chosen',function(evt){_this.choices_click(evt);});}else{return this.container.bind('click.chosen',function(evt){evt.preventDefault();});}};Chosen.prototype.destroy=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);if(this.search_field[0].tabIndex){this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex;}this.container.remove();this.form_field_jq.removeData('chosen');return this.form_field_jq.show();};Chosen.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass('chosen-disabled');this.search_field[0].disabled=true;if(!this.is_multiple){this.selected_item.unbind("focus.chosen",this.activate_action);}return this.close_field();}else{this.container.removeClass('chosen-disabled');this.search_field[0].disabled=false;if(!this.is_multiple){return this.selected_item.bind("focus.chosen",this.activate_action);}}};Chosen.prototype.container_mousedown=function(evt){if(!this.is_disabled){if(evt&&evt.type==="mousedown"&&!this.results_showing){evt.preventDefault();}if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){if(!this.active_field){if(this.is_multiple){this.search_field.val("");}$(this.container[0].ownerDocument).bind('click.chosen',this.click_test_action);this.results_show();}else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){evt.preventDefault();this.results_toggle();}return this.activate_field();}}};Chosen.prototype.container_mouseup=function(evt){if(evt.target.nodeName==="ABBR"&&!this.is_disabled){return this.results_reset(evt);}};Chosen.prototype.search_results_mousewheel=function(evt){var delta;if(evt.originalEvent){delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail;}if(delta!=null){evt.preventDefault();if(evt.type==='DOMMouseScroll'){delta=delta*40;}return this.search_results.scrollTop(delta+this.search_results.scrollTop());}};Chosen.prototype.blur_test=function(evt){if(!this.active_field&&this.container.hasClass("chosen-container-active")){return this.close_field();}};Chosen.prototype.close_field=function(){$(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action);this.active_field=false;this.results_hide();this.container.removeClass("chosen-container-active");this.clear_backstroke();this.show_search_field_default();return this.search_field_scale();};Chosen.prototype.activate_field=function(){this.container.addClass("chosen-container-active");this.active_field=true;this.search_field.val(this.search_field.val());return this.search_field.focus();};Chosen.prototype.test_active_click=function(evt){var active_container;active_container=$(evt.target).closest('.chosen-container');if(active_container.length&&this.container[0]===active_container[0]){return this.active_field=true;}else{return this.close_field();}};Chosen.prototype.results_build=function(){this.parsing=true;this.selected_option_count=null;this.results_data=SelectParser.select_to_array(this.form_field);if(this.is_multiple){this.search_choices.find("li.search-choice").remove();}else if(!this.is_multiple){this.single_set_selected_text();if(this.disable_search||this.form_field.options.length<=this.disable_search_threshold){this.search_field[0].readOnly=true;this.container.addClass("chosen-container-single-nosearch");}else{this.search_field[0].readOnly=false;this.container.removeClass("chosen-container-single-nosearch");}}this.update_results_content(this.results_option_build({first:true}));this.search_field_disabled();this.show_search_field_default();this.search_field_scale();return this.parsing=false;};Chosen.prototype.result_do_highlight=function(el){var high_bottom,high_top,maxHeight,visible_bottom,visible_top;if(el.length){this.result_clear_highlight();this.result_highlight=el;this.result_highlight.addClass("highlighted");maxHeight=parseInt(this.search_results.css("maxHeight"),10);visible_top=this.search_results.scrollTop();visible_bottom=maxHeight+visible_top;high_top=this.result_highlight.position().top+this.search_results.scrollTop();high_bottom=high_top+this.result_highlight.outerHeight();if(high_bottom>=visible_bottom){return this.search_results.scrollTop((high_bottom-maxHeight)>0?high_bottom-maxHeight:0);}else if(high_top<visible_top){return this.search_results.scrollTop(high_top);}}};Chosen.prototype.result_clear_highlight=function(){if(this.result_highlight){this.result_highlight.removeClass("highlighted");}return this.result_highlight=null;};Chosen.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}this.container.addClass("chosen-with-drop");this.results_showing=true;this.search_field.focus();this.search_field.val(this.search_field.val());this.winnow_results();return this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this});};Chosen.prototype.update_results_content=function(content){return this.search_results.html(content);};Chosen.prototype.results_hide=function(){if(this.results_showing){this.result_clear_highlight();this.container.removeClass("chosen-with-drop");this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this});}return this.results_showing=false;};Chosen.prototype.set_tab_index=function(el){var ti;if(this.form_field.tabIndex){ti=this.form_field.tabIndex;this.form_field.tabIndex=-1;return this.search_field[0].tabIndex=ti;}};Chosen.prototype.set_label_behavior=function(){var _this=this;this.form_field_label=this.form_field_jq.parents("label");if(!this.form_field_label.length&&this.form_field.id.length){this.form_field_label=$("label[for='"+this.form_field.id+"']");}if(this.form_field_label.length>0){return this.form_field_label.bind('click.chosen',function(evt){if(_this.is_multiple){return _this.container_mousedown(evt);}else{return _this.activate_field();}});}};Chosen.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices_count()<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default");}else{this.search_field.val("");return this.search_field.removeClass("default");}};Chosen.prototype.search_results_mouseup=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target.length){this.result_highlight=target;this.result_select(evt);return this.search_field.focus();}};Chosen.prototype.search_results_mouseover=function(evt){var target;target=$(evt.target).hasClass("active-result")?$(evt.target):$(evt.target).parents(".active-result").first();if(target){return this.result_do_highlight(target);}};Chosen.prototype.search_results_mouseout=function(evt){if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){return this.result_clear_highlight();}};Chosen.prototype.choice_build=function(item){var choice,close_link,_this=this;choice=$('<li />',{"class":"search-choice"}).html("<span>"+(this.choice_label(item))+"</span>");if(item.disabled){choice.addClass('search-choice-disabled');}else{close_link=$('<a />',{"class":'search-choice-close','data-option-array-index':item.array_index});close_link.bind('click.chosen',function(evt){return _this.choice_destroy_link_click(evt);});choice.append(close_link);}return this.search_container.before(choice);};Chosen.prototype.choice_destroy_link_click=function(evt){evt.preventDefault();evt.stopPropagation();if(!this.is_disabled){return this.choice_destroy($(evt.target));}};Chosen.prototype.choice_destroy=function(link){if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){this.show_search_field_default();if(this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1){this.results_hide();}link.parents('li').first().remove();return this.search_field_scale();}};Chosen.prototype.results_reset=function(){this.reset_single_select_options();this.form_field.options[0].selected=true;this.single_set_selected_text();this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field){return this.results_hide();}};Chosen.prototype.results_reset_cleanup=function(){this.current_selectedIndex=this.form_field.selectedIndex;return this.selected_item.find("abbr").remove();};Chosen.prototype.result_select=function(evt){var high,item;if(this.result_highlight){high=this.result_highlight;this.result_clear_highlight();if(this.is_multiple&&this.max_selected_options<=this.choices_count()){this.form_field_jq.trigger("chosen:maxselected",{chosen:this});return false;}if(this.is_multiple){high.removeClass("active-result");}else{this.reset_single_select_options();}high.addClass("result-selected");item=this.results_data[high[0].getAttribute("data-option-array-index")];item.selected=true;this.form_field.options[item.options_index].selected=true;this.selected_option_count=null;if(this.is_multiple){this.choice_build(item);}else{this.single_set_selected_text(this.choice_label(item));}if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){this.results_hide();}this.search_field.val("");if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){this.form_field_jq.trigger("change",{'selected':this.form_field.options[item.options_index].value});}this.current_selectedIndex=this.form_field.selectedIndex;evt.preventDefault();return this.search_field_scale();}};Chosen.prototype.single_set_selected_text=function(text){if(text==null){text=this.default_text;}if(text===this.default_text){this.selected_item.addClass("chosen-default");}else{this.single_deselect_control_build();this.sel