Compare commits
509 Commits
Author | SHA1 | Date |
---|---|---|
Jacques Distler | 47e76794cd | |
Jacques Distler | 40fd643680 | |
Jacques Distler | def8e9ae0f | |
Jacques Distler | b52a66c207 | |
Jacques Distler | 4a3d7e0b78 | |
Jacques Distler | 57d52b0d15 | |
Jacques Distler | 1ce128348c | |
Jacques Distler | 987140ed83 | |
Jacques Distler | 072e2e1e92 | |
Jacques Distler | b48a56028a | |
Jacques Distler | 8cf98a4711 | |
Jacques Distler | 66b8f3454d | |
Jacques Distler | f331becb64 | |
Jacques Distler | 2d9cc8bf4d | |
Jacques Distler | f1e47a7ec5 | |
Jacques Distler | e749ee1e4b | |
Jacques Distler | c102e10315 | |
Jacques Distler | 22a27c8391 | |
Jacques Distler | 7e4c7c447e | |
Jacques Distler | f6d350302c | |
Jacques Distler | 88dd41e75f | |
Jacques Distler | e4b00f0bff | |
Jacques Distler | 0f4a76d895 | |
Jacques Distler | 4b09e0322f | |
Jacques Distler | 07aca55e6e | |
Jacques Distler | b6c0ffa0d5 | |
Jacques Distler | ddcf022264 | |
Jacques Distler | d30bd11ff7 | |
Jacques Distler | 1f8a4fe282 | |
Jacques Distler | eff8c87d39 | |
Jacques Distler | 60a595de17 | |
Jacques Distler | c603aca852 | |
Jacques Distler | 8c74de6670 | |
Jacques Distler | ee05118e8f | |
Jacques Distler | c7b46cbde3 | |
Jacques Distler | 7bf832e8c7 | |
Jacques Distler | f5c892c717 | |
Jacques Distler | 364de9dbab | |
Jacques Distler | 1efa08dcc7 | |
Jacques Distler | ddf1846fe1 | |
Jacques Distler | 04ca7e8a38 | |
Jacques Distler | f9e60828c7 | |
Jacques Distler | 9e25ada5c8 | |
Jacques Distler | 66f62bac1f | |
Jacques Distler | e00b2a0ac0 | |
Jacques Distler | 2801421969 | |
Jacques Distler | b1d1f74b7d | |
Jacques Distler | a088201062 | |
Jacques Distler | c5a2e325c0 | |
Jacques Distler | 26ed59485a | |
Jacques Distler | 2d303d54a0 | |
Jacques Distler | 453693a868 | |
Jacques Distler | 27ad6ff2a8 | |
Jacques Distler | e26c12229e | |
Jacques Distler | 903c4b6bdd | |
Jacques Distler | 09b2d24a18 | |
Jacques Distler | e387d095ec | |
Jacques Distler | 2d21eabee8 | |
Jacques Distler | 6f18c90a50 | |
Jacques Distler | 03fc0324db | |
Jacques Distler | 6b86177620 | |
Jacques Distler | 3a54d7ee72 | |
Jacques Distler | 477bd91567 | |
Jacques Distler | 1df2483663 | |
Jacques Distler | f463a3b1c8 | |
Jacques Distler | a739a52f54 | |
Jacques Distler | 1e352e28a1 | |
Jacques Distler | 85cada931d | |
Jacques Distler | 4b2448b09a | |
Jacques Distler | c1826775d2 | |
Jacques Distler | 3c650f2cf6 | |
Jacques Distler | ecaf67dca9 | |
Jacques Distler | f7bce2c773 | |
Jacques Distler | 89f6b69245 | |
Jacques Distler | 5c51f930b0 | |
Jacques Distler | ce97abe6ac | |
Jacques Distler | 070f689f9c | |
Jacques Distler | 5fd725e3a8 | |
Jacques Distler | 13a522525c | |
Jacques Distler | 6005297cfe | |
Jacques Distler | 46da1f3aaf | |
Jacques Distler | a72d35bd4e | |
Jacques Distler | 201c25ce83 | |
Jacques Distler | c9312367c9 | |
Jacques Distler | 47996ea1d3 | |
Jacques Distler | f23e1487df | |
Jacques Distler | 14592f57f9 | |
Jacques Distler | 7d2275d0a1 | |
Jacques Distler | 52da76ff38 | |
Jacques Distler | 8d7f33f99b | |
Jacques Distler | 2967b207b2 | |
Jacques Distler | dfad5a3a37 | |
Jacques Distler | 8b008f8418 | |
Jacques Distler | fc8be60634 | |
Jacques Distler | 9e909d5be3 | |
Jacques Distler | 088b535d52 | |
Jacques Distler | ec443685a6 | |
Jacques Distler | 97148dc205 | |
Jacques Distler | cbf13ad57a | |
Jacques Distler | ec31e46e92 | |
Jacques Distler | 79a966f71f | |
Jacques Distler | 92e4aaafaf | |
Jacques Distler | 0ae83c3560 | |
Jacques Distler | 1464e29f4f | |
Jacques Distler | fcd8900cb7 | |
Jacques Distler | 9090dba2b2 | |
Jacques Distler | ade1c1d113 | |
Jacques Distler | 1f98b7dcf9 | |
Jacques Distler | 0df40cb4cb | |
Jacques Distler | 95d2fe540f | |
Jacques Distler | c9ad2c0c6e | |
Jacques Distler | ca661ddb42 | |
Jacques Distler | 7e5dbe5854 | |
Jacques Distler | c2dfe7e621 | |
Jacques Distler | 7290e90631 | |
Jacques Distler | 823f8b79c9 | |
Jacques Distler | c010e6b7a4 | |
Jacques Distler | 63fd1dbbb9 | |
Jacques Distler | 844ce0ed40 | |
Jacques Distler | f9628a3f19 | |
Jacques Distler | 3843fa608d | |
Jacques Distler | 363d72524b | |
Jacques Distler | 1bef71bbf1 | |
Jacques Distler | 122783886f | |
Jacques Distler | a12a778c5a | |
Jacques Distler | c61eb7ae1e | |
Jacques Distler | 7d3f9db8f0 | |
Jacques Distler | 230d2998b4 | |
Jacques Distler | 27a99e0146 | |
Jacques Distler | e98c8bda63 | |
Jacques Distler | d8d0f2fdd6 | |
Jacques Distler | 2cd2b09648 | |
Jacques Distler | fccb1e2b01 | |
Jacques Distler | 5918d4c26e | |
Jacques Distler | f914a40fa9 | |
Jacques Distler | 8d7381bb54 | |
Jacques Distler | cd674bbb36 | |
Jacques Distler | 88291ee4a2 | |
Jacques Distler | 4be1a58a24 | |
Jacques Distler | 06287a4ef5 | |
Jacques Distler | cca857ed3a | |
Jacques Distler | 982ab38f43 | |
Jacques Distler | ad12997c1d | |
Jacques Distler | 97434e097a | |
Jacques Distler | bb17fbbe02 | |
Jacques Distler | 06f4f2cc98 | |
Jacques Distler | bf69cceb25 | |
Jacques Distler | 10aa983337 | |
Jacques Distler | 1663d9f5c8 | |
Jacques Distler | d208728065 | |
Jacques Distler | cebd381d0d | |
Jacques Distler | 477adeffda | |
Jacques Distler | 46da49485f | |
Jacques Distler | a4776060a6 | |
Jacques Distler | 8a989b1a7b | |
Jacques Distler | 57397617cd | |
Jacques Distler | b7806c12ce | |
Jacques Distler | 5c576f66e9 | |
Jacques Distler | 9c11c384d4 | |
Jacques Distler | a64194806b | |
Jacques Distler | 7f7182afea | |
Jacques Distler | a0a11c0bc8 | |
Jacques Distler | b1fcc93aa5 | |
Jacques Distler | 3660f13c84 | |
Jacques Distler | fece5a3486 | |
Jacques Distler | 194f10e809 | |
Jacques Distler | aee4f8b3a9 | |
Jacques Distler | 7011067525 | |
Jacques Distler | 1c5df9e8b5 | |
Jacques Distler | 1caa4822c1 | |
Jacques Distler | 0a95c855ba | |
Jacques Distler | b5481a1454 | |
Jacques Distler | f6c818de8a | |
Jacques Distler | 5ca5bce628 | |
Jacques Distler | 8aa3a9e929 | |
Jacques Distler | 1290dfc9ae | |
Jacques Distler | 105c1d79e7 | |
Jacques Distler | b6653749ac | |
Jacques Distler | 1c35c2d3fc | |
Jacques Distler | 43d8c31028 | |
Jacques Distler | c3979a5b56 | |
Jacques Distler | 98bf5a824e | |
Jacques Distler | 239a8d97e5 | |
Jacques Distler | 0e4557be5c | |
Jacques Distler | 54c5060533 | |
Jacques Distler | 1205efacf2 | |
Jacques Distler | eac323a657 | |
Jacques Distler | c6edd052f5 | |
Jacques Distler | 08223b0f2d | |
Jacques Distler | 4396420cf3 | |
Jacques Distler | 3097b47111 | |
Jacques Distler | fad12903f4 | |
Jacques Distler | 03fa32f140 | |
Jacques Distler | eee3929c4b | |
Jacques Distler | 4bf2e0d944 | |
Jacques Distler | c27dc2cea3 | |
Jacques Distler | 399bd0d5a4 | |
Jacques Distler | a099648554 | |
Jacques Distler | d80003d502 | |
Jacques Distler | 04bb80be15 | |
Jacques Distler | e5ca66ae41 | |
Jacques Distler | 7aa91e8b5c | |
Jacques Distler | e99fcf720c | |
Jacques Distler | a5aa1b1fa8 | |
Jacques Distler | ef30cc22df | |
Jacques Distler | 86d5e23f99 | |
Jacques Distler | 113e0af736 | |
Jacques Distler | 7c9ab039c0 | |
Jacques Distler | 8e57e97869 | |
Jacques Distler | 1dc14ec2da | |
Jacques Distler | f6e9d17f9b | |
Jacques Distler | 0a87548324 | |
Jacques Distler | 3bfc30231a | |
Jacques Distler | 267f4a51fc | |
Jacques Distler | 63e4c43a54 | |
Jacques Distler | 4576a7f7df | |
Jacques Distler | 6602a153f7 | |
Jacques Distler | b3aae9b06d | |
Jacques Distler | 8f62d3009b | |
Jacques Distler | 29224d6bcc | |
Jacques Distler | 0904001ef9 | |
Jacques Distler | 39c2138f88 | |
Jacques Distler | 58f44326ae | |
Jacques Distler | c18c2f988d | |
Jacques Distler | 4c4f7a7b82 | |
Jacques Distler | ce8578d2d0 | |
Jacques Distler | 30909ec927 | |
Jacques Distler | 0d8f680d4f | |
Jacques Distler | 95854d34b5 | |
Jacques Distler | 6338a3bcb2 | |
Jacques Distler | 65fd56888f | |
Jacques Distler | 6491d70326 | |
Jacques Distler | 9236140dde | |
Jacques Distler | 4f8759cdf3 | |
Jacques Distler | 5f6e1ce19f | |
Jacques Distler | 9a80cacc34 | |
Jacques Distler | a14db81b79 | |
Jacques Distler | 90ad482ed2 | |
Jacques Distler | e4aa197c30 | |
Jacques Distler | 3aaf3989c7 | |
Jacques Distler | c4e2afa01a | |
Jacques Distler | 06ae79322a | |
Jacques Distler | 03c57473dc | |
Jacques Distler | dead710e69 | |
Jacques Distler | 940e9bd879 | |
Jacques Distler | 05ffd215f1 | |
Jacques Distler | 3c5ad60de8 | |
Jacques Distler | c25b608f3d | |
Jacques Distler | 8395508c85 | |
Jacques Distler | b7a3b8aa94 | |
Jacques Distler | c54a7756b5 | |
Jacques Distler | ad7e32c92c | |
Jacques Distler | 55337ed43c | |
Jacques Distler | 17e9cfab87 | |
Jacques Distler | 851b735158 | |
Jacques Distler | b8647da41a | |
Jacques Distler | 44e54ee4c6 | |
Jacques Distler | dafe67046a | |
Jacques Distler | 1f4f1a4ba3 | |
Jacques Distler | a57152d743 | |
Jacques Distler | ad3fe74cfd | |
Jacques Distler | b5a4e2fd9c | |
Jacques Distler | d61ae49e66 | |
Jacques Distler | 1da034e2be | |
Jacques Distler | 4774d7c8a1 | |
Jacques Distler | 4b73f1a1ae | |
Jacques Distler | e3cbef7dcd | |
Jacques Distler | a5e08f7bcc | |
Jacques Distler | 5196df7575 | |
Jacques Distler | d6be09e0f0 | |
Jacques Distler | 52f0dbb91c | |
Jacques Distler | f0635301aa | |
Jacques Distler | 3745e4d669 | |
Jacques Distler | 6677b46cb4 | |
Jacques Distler | f7b2a40cf6 | |
Jacques Distler | d2c4623bf7 | |
Jacques Distler | 3bfbb7736d | |
Jacques Distler | 8149c29324 | |
Jacques Distler | ecf54415eb | |
Jacques Distler | 2781890832 | |
Jacques Distler | 5a448c3d50 | |
Jacques Distler | d9d353a350 | |
Jacques Distler | 5c7346c12e | |
Jacques Distler | 80845297a3 | |
Jacques Distler | 5cc477712f | |
Jacques Distler | 04a1727082 | |
Jacques Distler | a2c3e2a76c | |
Jacques Distler | fd9fc1455e | |
Jacques Distler | cfd972755a | |
Jacques Distler | 10cf102544 | |
Jacques Distler | ac7105591e | |
Jacques Distler | 86a53d1dfa | |
Jacques Distler | bffc0a6f97 | |
Jacques Distler | d1678ceb49 | |
Jacques Distler | e6854767b5 | |
Jacques Distler | 79a2299363 | |
Jacques Distler | 226fa3033f | |
Jacques Distler | 324cc12320 | |
Jacques Distler | 72b16ce9cc | |
Jacques Distler | 6d5db0739a | |
Jacques Distler | 3b87094327 | |
Jacques Distler | da0c6a2ea1 | |
Jacques Distler | 3f87912191 | |
Jacques Distler | 18b5ea9aa6 | |
Jacques Distler | e15d76d781 | |
Jacques Distler | 5f66f8387e | |
Jacques Distler | 5f04be0eae | |
Jacques Distler | 77cfc0d2e3 | |
Jacques Distler | a8428ada2f | |
Jacques Distler | 3e6d7faec2 | |
Jacques Distler | d836d28593 | |
Jacques Distler | 143fa30b78 | |
Jacques Distler | 833ef96d5f | |
Jacques Distler | 5167363a2d | |
Jacques Distler | f0d9626d31 | |
Jacques Distler | c946c331e1 | |
Jacques Distler | 9636cab11e | |
Jacques Distler | 840e218570 | |
Jacques Distler | 7e7ae4c6f0 | |
Jacques Distler | a17d5127c5 | |
Jacques Distler | 9ed0772978 | |
Jacques Distler | ae0274783d | |
Jacques Distler | 75e4310a5b | |
Jacques Distler | d33b072cba | |
Jacques Distler | 5a5ff87286 | |
Jacques Distler | 498f043174 | |
Jacques Distler | e75c0cc81c | |
Jacques Distler | 2df08e21d1 | |
Jacques Distler | 932c42c24a | |
Jacques Distler | e07960a897 | |
Jacques Distler | a6bceb2a8e | |
Jacques Distler | 7b22daa784 | |
Jacques Distler | 3f8e3b43b9 | |
Jacques Distler | 70aa50ad4b | |
Jacques Distler | 88aa590ba4 | |
Jacques Distler | dcfe870a02 | |
Jacques Distler | 57fe0b9f0b | |
Jacques Distler | 519f81ab20 | |
Jacques Distler | 529a91f182 | |
Jacques Distler | 8a851eeab2 | |
Jacques Distler | a30d748d82 | |
Jacques Distler | f7f1668e31 | |
Jacques Distler | ce2416165b | |
Jacques Distler | aa0a151ba4 | |
Jacques Distler | 966bede8dc | |
Jacques Distler | c4003f79b3 | |
Jacques Distler | c26faabf2d | |
Jacques Distler | 4cd626ef49 | |
Jacques Distler | 5d0eb597f1 | |
Jacques Distler | d201f79766 | |
Jacques Distler | 71ad1344c1 | |
Jacques Distler | 42d92a0b37 | |
Jacques Distler | 99dd9e7276 | |
Jacques Distler | 85e0a2cb10 | |
Jacques Distler | 9f86780afc | |
Jacques Distler | cb1fe51e84 | |
Jacques Distler | f4f9261431 | |
Jacques Distler | 47524a7104 | |
Jacques Distler | c18d9f86f7 | |
Jacques Distler | a1654f1e99 | |
Jacques Distler | cf0668eb53 | |
Jacques Distler | 3fbff19997 | |
Jacques Distler | 58d241c4c4 | |
Jacques Distler | 702b450fd9 | |
Jacques Distler | 32262cb6d0 | |
Jacques Distler | 956d523a4a | |
Jacques Distler | 33dc8486d8 | |
Jacques Distler | c16c67928e | |
Jacques Distler | b1be043e6f | |
Jacques Distler | f471ba7d59 | |
Jacques Distler | 6fc05795dc | |
Jacques Distler | f84b4370fa | |
Jacques Distler | de50902968 | |
Jacques Distler | dab8e5daa1 | |
Jacques Distler | 06262ce257 | |
Jacques Distler | fa662e8f51 | |
Jacques Distler | 9eb0573eca | |
Jacques Distler | 1654316557 | |
Jacques Distler | 2dfb852727 | |
Jacques Distler | d592b20032 | |
Jacques Distler | 08cd194330 | |
Jacques Distler | 82e8b83ee3 | |
Jacques Distler | b302bf36c5 | |
Jacques Distler | da25e27263 | |
Jacques Distler | ea581a50ae | |
Jacques Distler | ebf8d6df1d | |
Jacques Distler | 4475f02586 | |
Jacques Distler | 0f3bc348ad | |
Jacques Distler | db5b418659 | |
Jacques Distler | e5076085df | |
Jacques Distler | ce47d49e69 | |
Jacques Distler | 021c3dfc88 | |
Jacques Distler | 63f1d34d74 | |
Jacques Distler | ffc7a528f8 | |
Jacques Distler | 5094a7339b | |
Jacques Distler | e09a1e4e9a | |
Jacques Distler | d6e749cf6a | |
Jacques Distler | 125ce68ac6 | |
Jacques Distler | 10c0e709f6 | |
Jacques Distler | ed5d8bb026 | |
Jacques Distler | ee5d03dca6 | |
Jacques Distler | c74f239248 | |
Jacques Distler | 2151c8d86b | |
Jacques Distler | cc91fd656f | |
Jacques Distler | 2e16458c44 | |
Jacques Distler | 8b5973b6c6 | |
Jacques Distler | 612fbf2920 | |
Jacques Distler | b5b7f9c146 | |
Jacques Distler | afcdc932ff | |
Jacques Distler | 5af4fa23d1 | |
Jacques Distler | c608cedab9 | |
Jacques Distler | 96efec37cd | |
Jacques Distler | 620bb2a1f7 | |
Jacques Distler | f7b117456d | |
Jacques Distler | d503100fe9 | |
Jacques Distler | 443a2cee5f | |
Jacques Distler | db7bbca920 | |
Jacques Distler | 852848749c | |
Jacques Distler | 52d85c6d01 | |
Jacques Distler | 895d353fdf | |
Jacques Distler | e744a697c2 | |
Jacques Distler | f791eae642 | |
Jacques Distler | 0b459d0a47 | |
Jacques Distler | e61f1e53a1 | |
Jacques Distler | 502d4f20bb | |
Jacques Distler | 18f81781e9 | |
Jacques Distler | 9047e5d460 | |
Jacques Distler | cf9dafa5d7 | |
Jacques Distler | 1d8318cfd2 | |
Jacques Distler | 42005dc2c6 | |
Jacques Distler | d362b886c2 | |
Jacques Distler | 3957ff89a1 | |
Jacques Distler | 7114e46817 | |
Jacques Distler | 81f77ca22b | |
Jacques Distler | 65b00d8551 | |
Jacques Distler | 4f2fd8d53d | |
Jacques Distler | f98802336f | |
Jacques Distler | 1d20af58c1 | |
Jacques Distler | c32e5b7178 | |
Jacques Distler | c5e5f1ef2c | |
Jacques Distler | b1e0b4830b | |
Jacques Distler | b5a7f7ac05 | |
Jacques Distler | 459891b6c9 | |
Jacques Distler | bad5beec29 | |
Jacques Distler | de3008d3e4 | |
Jacques Distler | 7249c074b0 | |
Jacques Distler | c3ed5b461b | |
Jacques Distler | 1373963fe3 | |
Jacques Distler | 954bcb52c2 | |
Jacques Distler | 3af938b46e | |
Jacques Distler | 5506f87f17 | |
Jacques Distler | 09c119ac42 | |
Jacques Distler | 675df6b6c5 | |
Jacques Distler | 716bc3d5b4 | |
Jacques Distler | 49e89d0f85 | |
Jacques Distler | 389c690319 | |
Jacques Distler | 8f1cd5010b | |
Jacques Distler | 3a9d1596d2 | |
Jacques Distler | bafa7743f1 | |
Jacques Distler | 711a98ccfb | |
Jacques Distler | cbb3e4b74f | |
Jacques Distler | 820d2a94eb | |
Jacques Distler | 9dc59b7b7c | |
Jacques Distler | 50d0e04624 | |
Jacques Distler | d3db9d1229 | |
Jacques Distler | 61a52a91e1 | |
Jacques Distler | aea2c5099f | |
Jacques Distler | 7a12cdb502 | |
Jacques Distler | b9db67073d | |
Jacques Distler | a8370d5f45 | |
Jacques Distler | 09e885d299 | |
Jacques Distler | a7d38ef6a1 | |
Jacques Distler | 8ed5a88db0 | |
Jacques Distler | c85b50ff66 | |
Jacques Distler | ad2fab42bd | |
Jacques Distler | 512b8d60b9 | |
Jacques Distler | 979ea7eca0 | |
Jacques Distler | 1bf8177e70 | |
Jacques Distler | 4dae13c567 | |
Jeff Zellman | 87808dd7ee | |
Jacques Distler | 36089f1543 | |
Jacques Distler | d67ce28855 | |
Jacques Distler | 6a5b0e108a | |
Jacques Distler | c8ef0a3dd4 | |
Jacques Distler | 0c2bc65e7a | |
Jacques Distler | 036f6335ad | |
Jacques Distler | 6e6bf1a446 | |
Jacques Distler | 9aeeae8ddb | |
Jacques Distler | ea431ad373 | |
Jacques Distler | 0cdbbbd9ff | |
Jacques Distler | 6cf1463525 | |
Jacques Distler | e417054a67 | |
Jacques Distler | d786e95a77 | |
Jacques Distler | 0cfea84802 | |
Jacques Distler | e3aa626489 | |
Jacques Distler | 04742e3c27 | |
Jacques Distler | 7b7d2e80dc | |
Jacques Distler | 0f5ac4468a | |
Jacques Distler | c212a53ad8 | |
Jacques Distler | 59c0280069 | |
Jacques Distler | 9fe467ee36 | |
Jacques Distler | 0f4f7bc04a | |
Jacques Distler | 4bb22e0fa8 | |
Jacques Distler | 958410f295 | |
Jacques Distler | 753520eb70 | |
Jacques Distler | ce46bd0929 | |
Jacques Distler | f66fc4de4d | |
Jacques Distler | 259d70c5c6 | |
Jacques Distler | b72ca42199 |
128
CHANGELOG
128
CHANGELOG
|
@ -1,9 +1,135 @@
|
|||
N.B.: You *must* run
|
||||
|
||||
rake upgrade_instiki
|
||||
ruby bundle
|
||||
ruby bundle exec rake upgrade_instiki
|
||||
|
||||
after installing the new software, to enjoy the benefits of this new version.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.19.3
|
||||
|
||||
New Features:
|
||||
* Source view for Revisions
|
||||
* Rails updated to 2.3.14 (Security)
|
||||
* itextomml updated to 1.4.6
|
||||
* Replace REXML with Nokogiri in Maruku and
|
||||
in xhtml_safe_sanitize().
|
||||
(Huge speedup in rendering long pages)
|
||||
* MathJax updated to 1.1a final
|
||||
|
||||
Bugs Fixed:
|
||||
* Bundler upgraded to 1.0.18
|
||||
* Fix null search bug
|
||||
* Better text/html serialization (thank you, Nokogiri)
|
||||
* Fix Maruku footnote backlink (reported by Shamaoke)
|
||||
* Fix Maruku link bug
|
||||
* Fix Maruku image title bug
|
||||
* Fix Maruku hrule, email address and header bugs
|
||||
* Fix Maruku bold-in-italics bug
|
||||
* Fix Maruku empty list-item bug
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.19.2
|
||||
|
||||
New Features:
|
||||
* MathJax rendering for non-MathML capable browsers.
|
||||
* RedCloth (Textile) upgraded to 4.x (now handled
|
||||
by Bundler).
|
||||
* Bundler upgraded to 1.0.7
|
||||
* Rails updated to 2.3.11
|
||||
|
||||
Bugs Fixed:
|
||||
* Redirects and categories of included pages should
|
||||
not be inherited. (Suggestion of Andrew Stacey).
|
||||
* Bug in Maruku equation handling (reported by Andrew Stacey).
|
||||
* SVG-Edit updates and bug-fixes.
|
||||
* Bug in editing S5 slideshows.
|
||||
* Unvendor Rack
|
||||
* Fix Maruku list-parsing bug (reported by Shamaoke)
|
||||
* Validate Web address (Reported by Richard Marquez).
|
||||
* Fix a well-formedness bug
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.19.1
|
||||
|
||||
New Features:
|
||||
* From the "All" or Category listings, you can export selected pages (in any
|
||||
desired order) to a single LaTeX file.
|
||||
* LaTeX export supports \array{} (with no options) and a LaTeX-style optional
|
||||
argument for \sqrt[]{}. The latter requires itextomml 1.4.5 or later.
|
||||
* Updated to itextomml 1.4.5 (a bunch of new itex language features).
|
||||
* Updated to Rails 2.3.10. (There were security issues in 2.3.9 which, happily,
|
||||
did NOT affect Instiki 0.19. But 2.3.10 has other improvements, as well.)
|
||||
|
||||
Bugs Fixed:
|
||||
* Several SVG-Edit bugs fixed.
|
||||
* Removed some superfluous junk, to slim down the distribution (cuts the size of
|
||||
the compressed .tar.gz nearly in half).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.19
|
||||
|
||||
New Features:
|
||||
|
||||
* WYSIWYG SVG editing (via SVG-edit)
|
||||
* One-click S5 templates
|
||||
* Itex2MML is now a Rubygem. Latest is itextomml-1.4.2.
|
||||
* Rails Metal itex endpoint
|
||||
* HTML5 support
|
||||
* Support IALs on Markdown list items
|
||||
* Updated to Rails 2.3.9 and Erubis (now at 2.6.6)
|
||||
* Updated for Rack 1.2.1, sqlite3-ruby 1.3.1
|
||||
* Manages dependencies using Bundler. Before running Instiki for the first time
|
||||
(and whenever you update), run
|
||||
|
||||
ruby bundle
|
||||
rake upgrade_instiki
|
||||
|
||||
from the instiki directory. (You may need to run
|
||||
|
||||
ruby bundle exec rake upgrade_instiki
|
||||
|
||||
instead, if you get a complaint about your version of rake.)
|
||||
|
||||
Bugs Fixed:
|
||||
|
||||
* Works with Ruby 1.9.2
|
||||
* Fixed a bug in non-Latin WikiWord processing. (Reported by Alexander Hambug)
|
||||
* Fixed Cyrillic WikiWord support.
|
||||
* More informative dnsbl lookup responses (suggested by Toby Bartels)
|
||||
* Fixed a bug in LaTeX output
|
||||
* No longer conflicts with sqlite3-ruby 1.3.x Rubygem
|
||||
* Fixed some Category listing bugs
|
||||
* Fixed an escaping bug in 'new' and 'edit' templates. (Reported by Toby Bartels)
|
||||
* Allow special characters ('.', '/', etc) in page names.
|
||||
* Fix BlahTeX/PNG path, so equations render in diff and
|
||||
previous revision pages.
|
||||
* Fix HTML Export feature so that uploaded files are
|
||||
included, stylesheets load, etc.
|
||||
* Uploaded files inclided in Markup Export.
|
||||
* Fix Print View, so that uploaded images work.
|
||||
* Fix some more Ruby 1.9 isues.
|
||||
* Prevent page from being renamed to null.
|
||||
* Fix Migration to work under PostgreSQL (from J. Zellman).
|
||||
* Updated vendored plugins
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.18.1
|
||||
|
||||
New Features:
|
||||
|
||||
* (Markdown-Extra syle) fenced codeblocks. [From Jason Blevins]
|
||||
* Fortran syntax colouring. [From Jason Blevins]
|
||||
|
||||
Bugs Fixed:
|
||||
|
||||
* Fixed some Ruby 1.9 encoding issues, with unicode page names,
|
||||
author names and categories.
|
||||
* Better display of inter-web wikilinks
|
||||
* various syntax-colouring fixes
|
||||
* Corrected length of wiki_references referenced_name (affects
|
||||
MySQL users)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
* 0.18
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
source "http://rubygems.org"
|
||||
gem "sqlite3-ruby", :require => "sqlite3"
|
||||
gem "itextomml", ">=1.4.7"
|
||||
gem "rack", ">=1.1.0"
|
||||
gem "mongrel", ">=1.2.0.pre2"
|
||||
gem "rubyzip"
|
||||
gem "RedCloth", ">=4.0.0"
|
||||
gem "erubis"
|
||||
gem "nokogiri"
|
||||
gem "rake"
|
||||
gem "rdoc"
|
||||
gem "json"
|
79
README
79
README
|
@ -1,7 +1,7 @@
|
|||
|
||||
= Instiki
|
||||
|
||||
Instiki is a wiki clone so pretty and easy to set up, you'll wonder if it’s really a wiki. Runs on Rails and focuses on portability and stability. Supports file uploads, PDF export, RSS, multiple users and password protection. Some use Instiki as a CMS (Content Management System) because of it's ability to export static pages.
|
||||
Instiki is a wiki clone so pretty and easy to set up, you'll wonder if it’s really a wiki. Runs on Rails and focuses on portability and stability. Supports file uploads, PDF export, RSS, multiple users and password protection. Some use Instiki as a CMS (Content Management System) because of its ability to export static pages.
|
||||
|
||||
Instiki lowers the barriers of interest for when you might consider using a wiki. It's so simple to get running that you'll find yourself using it for anything -- taking notes, brainstorming, organizing a gathering.
|
||||
|
||||
|
@ -15,33 +15,32 @@ Instiki on BeOS, Amiga OS, OS2, Zeta OS and support for various exotic Platforms
|
|||
|
||||
== 3 easy Steps to get the Instiki experience
|
||||
|
||||
Step 1. Get Ruby, Download Instiki
|
||||
Step 1. Get Instiki and run "ruby bundle"
|
||||
Step 2. Run "instiki"
|
||||
Step 3. Chuckle... "There's no step three!" (TM)
|
||||
|
||||
|
||||
== Details
|
||||
|
||||
You need at least Ruby Version 1.8.4 installed on your System. The second dependency is a Database System, but don't worry, maybe you are already served.
|
||||
You need at least Ruby Version 1.8.6, and Rubygems 1.3.6, installed on your System. The second dependency is a Database System, but don't worry, the default sqlite3 will be installed for you, if it's not already installed. You can also use any other database system (MySQL, PostgreSQL, ...) supported by Rails.
|
||||
|
||||
|
||||
=== If you are on Windows
|
||||
|
||||
- Get the *Ruby One-Click Installer - Windows* http://rubyforge.org/projects/rubyinstaller
|
||||
- Get Development Kit http://github.com/oneclick/rubyinstaller/wiki/development-kit
|
||||
- In the Instiki directory, execute "ruby bundle"
|
||||
- double-click instiki.bat or instiki.cmd and there you go!
|
||||
|
||||
if you are running Windows 95, 98 or ME and cannot get instiki to run, try Version 0.11.pl1 which is the last instiki Version to support that old-style OS's. Please update to some Unix-OS or complain to the Ruby on Rails List at http://www.ruby-forum.com/forum/3 (Rails does not support your old Windows.)
|
||||
|
||||
|
||||
=== If you are on Mac OSX
|
||||
|
||||
On Leopard, you are all set.
|
||||
On Leopard and Snow Leopard, you are all set.
|
||||
- run "sudo gem update --system" via the command-line.
|
||||
- run "ruby bundle" in the instiki directory.
|
||||
- run "ruby instiki" and there you go!
|
||||
|
||||
Tiger ships with a really old Ruby Version (1.8.2) and a broken Readline Library you have to
|
||||
- use the Ruby One-Click-Installer for OSX ( http://rubyosx.com ) if you don't already have macports' Ruby
|
||||
- make sure you read http://instiki.5uper.net/instiki/show/SQLite+issues+on+OSX
|
||||
- run "ruby instiki.rb" via command-line in the directory
|
||||
|
||||
|
||||
=== If you are on Linux
|
||||
|
||||
|
@ -49,7 +48,12 @@ Tiger ships with a really old Ruby Version (1.8.2) and a broken Readline Library
|
|||
=== Any other System
|
||||
|
||||
- get Ruby for your System, compile if nessesary: http://ruby-lang.org
|
||||
- Depending on the version of Rubygems that came with your Ruby, you may need to
|
||||
|
||||
sudo gem update --system
|
||||
|
||||
- get SQLite or compile from http://sqlite.org (you can also use mysql or any other supported database system if you want)
|
||||
- run "ruby bundle"
|
||||
- run instiki
|
||||
|
||||
You're now running a perfectly suitable wiki on port 2500 that'll present you with one-step setup, followed by a textarea for the home page on http://localhost:2500
|
||||
|
@ -68,14 +72,16 @@ You're now running a perfectly suitable wiki on port 2500 that'll present you wi
|
|||
* Five markup choices:
|
||||
Markdown-based choices [http://daringfireball.net/projects/markdown/syntax]:
|
||||
Markdown+itex2MML (the default; requires itex2MML)
|
||||
Markdown+BlahTeX/PNG (requires blahtex and a working TeX installation
|
||||
Markdown+BlahTeX/PNG (requires blahtex and a working TeX installation)
|
||||
Markdown
|
||||
Textile [http://www.textism.com/tools/textile]
|
||||
RDoc [http://rdoc.sourceforge.net/doc]
|
||||
* Support for Math (using itex syntax [http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html])
|
||||
* Support for WYSIWYG SVG editing -- embed SVG graphics right in your wiki page.
|
||||
* Embedded webserver: uses Mongrel (if installed), or the bundled WEBrick webserver (if not).
|
||||
* Internationalization: Wiki words in any latin, greek, cyrillian, or armenian characters
|
||||
* Color diffs: Track changes through revisions
|
||||
* Runs on SQLite per default, can be configured to run on PostgreSQL, MySQL, DB2, Firebird, Openbase, Oracle, SQL Server or Sybase
|
||||
* Runs on SQLite3 per default, can be configured to run on PostgreSQL, MySQL, DB2, Firebird, Openbase, Oracle, SQL Server or Sybase
|
||||
|
||||
|
||||
== Command-line options:
|
||||
|
@ -87,56 +93,19 @@ You're now running a perfectly suitable wiki on port 2500 that'll present you wi
|
|||
|
||||
* See CHANGELOG
|
||||
|
||||
== Migrating from Instiki 0.11-0.12 to 0.16.3
|
||||
|
||||
rake upgrade_instiki
|
||||
|
||||
== Migrating Instiki 0.10.2 storage to Instiki 0.11.0 database
|
||||
|
||||
1. Install Instiki 0.11 and check that it works (you should be able to create a web, edit and save a HomePage)
|
||||
2. Execute
|
||||
ruby script\import_storage \
|
||||
-t /full/path/to/instiki0.10/storage \
|
||||
-i /full/path/to/instiki0.10/installation \
|
||||
-d sqlite (or mysql, or postgres, depending on what you use) \
|
||||
-o instiki_import.sql
|
||||
for example (Windows):
|
||||
ruby script\import_storage -t c:\instiki-0.10.2\storage\2500 -i c:\instiki-0.10.2 -d sqlite -o instiki_import.sql
|
||||
3. This will produce instiki_import.sql file in the current working directory.
|
||||
Open it in a text editor and inspect carefully.
|
||||
4. Connect to your production database (e.g., 'sqlite3 db\prod.db'),
|
||||
and have it execute instiki_import.sql (e.g., '.read instiki_import.sql')
|
||||
5. Execute ruby script\reset_references
|
||||
(this script parses all pages for crosslinks between them, so it may take a few minutes)
|
||||
6. Restart Instiki
|
||||
7. Go over some pages, especially those with a lot of complex markup, and see if anything is broken.
|
||||
|
||||
The most common migration problem is this: if you open All Pages and see a lot of orphaned pages,
|
||||
you forgot to run ruby script\reset_references after importing the data.
|
||||
|
||||
|
||||
===Upgrading from Instiki-AR Beta 1
|
||||
|
||||
In Beta 2, we switch to ActiveRecord:Migrations. Therefore:
|
||||
1. Back up your production database.
|
||||
2. Open command-line session to your database and execute:
|
||||
create table schema_info (version integer(11));
|
||||
insert into schema_info (version) values (1);
|
||||
3. Go back to the shell, change directory to the new Instiki and execute "rake migrate".
|
||||
|
||||
Step 2 creates a table that tells to ActiveRecord:Migrations that the current version
|
||||
of this database is 1 (corresponding to Beta 1), and step 3 makes it up-to-date with
|
||||
the current version of Instiki.
|
||||
|
||||
== Migrating from Instiki 0.11-0.18 to 0.19
|
||||
|
||||
ruby bundle
|
||||
ruby bundle exec rake upgrade_instiki
|
||||
|
||||
== Download the latest release from:
|
||||
|
||||
* http://rubyforge.org/project/showfiles.php?group_id=186
|
||||
|
||||
|
||||
== Visit the "official" Instiki wiki:
|
||||
== Visit the Instiki wiki:
|
||||
|
||||
* http://instiki.org
|
||||
* http://golem.ph.utexas.edu/wiki/instiki/
|
||||
|
||||
|
||||
== License:
|
||||
|
|
14
UPGRADING
14
UPGRADING
|
@ -5,9 +5,17 @@ See the upgrading instructions
|
|||
|
||||
http://golem.ph.utexas.edu/wiki/instiki/show/Upgrading
|
||||
|
||||
for detailed instructions. At a minimum, you need to backup your database.
|
||||
for detailed instructions.
|
||||
|
||||
At a minimum, you need to backup your database.
|
||||
After installing the new software and restoring your database, you need to run
|
||||
|
||||
rake upgrade_instiki
|
||||
ruby bundle
|
||||
ruby bundle exec rake upgrade_instiki
|
||||
|
||||
from the commandline, to complete the upgrade.
|
||||
from the commandline, to complete the upgrade. Doing a
|
||||
|
||||
|
||||
ruby bundle update
|
||||
|
||||
will update the installed gems (used by Instiki) to the latest versions.
|
|
@ -138,15 +138,4 @@ class AdminController < ApplicationController
|
|||
redirect_to :back
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def is_post
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ class ApplicationController < ActionController::Base
|
|||
Wiki.new
|
||||
end
|
||||
|
||||
helper_method :xhtml_enabled?, :html_ext
|
||||
helper_method :xhtml_enabled?, :html_ext, :darken
|
||||
|
||||
protected
|
||||
|
||||
|
@ -36,11 +36,14 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def check_authorization
|
||||
if in_a_web? and authorization_needed? and not authorized?
|
||||
redirect_to :controller => 'wiki', :action => 'login', :web => @web_name
|
||||
return false
|
||||
end
|
||||
def darken(s)
|
||||
n=s.length/3
|
||||
s.scan( %r(\w{#{n},#{n}}) ).collect {|a| (a.hex * 2/3).to_s(16).rjust(n,'0')}.join
|
||||
end
|
||||
|
||||
def check_authorization
|
||||
redirect_to(:controller => 'wiki', :action => 'login',
|
||||
:web => @web_name) if in_a_web? and authorization_needed? and not authorized?
|
||||
end
|
||||
|
||||
def connect_to_model
|
||||
|
@ -50,10 +53,8 @@ class ApplicationController < ActionController::Base
|
|||
@author = cookies['author'] || 'AnonymousCoward'
|
||||
if @web_name
|
||||
@web = @wiki.webs[@web_name]
|
||||
if @web.nil?
|
||||
render(:status => 404, :text => "Unknown web '#{@web_name}'", :layout => 'error')
|
||||
return false
|
||||
end
|
||||
render(:status => 404, :text => "Unknown web '#{@web_name}'",
|
||||
:layout => 'error') if @web.nil?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -185,7 +186,7 @@ class ApplicationController < ActionController::Base
|
|||
response.charset = 'utf-8'
|
||||
if %w(atom_with_content atom_with_headlines).include?(action_name)
|
||||
response.content_type = Mime::ATOM
|
||||
elsif %w(tex).include?(action_name)
|
||||
elsif %w(tex tex_list).include?(action_name)
|
||||
response.content_type = Mime::TEXT
|
||||
elsif xhtml_enabled?
|
||||
if request.user_agent =~ /Validator/ or request.env.include?('HTTP_ACCEPT') &&
|
||||
|
@ -241,6 +242,16 @@ class ApplicationController < ActionController::Base
|
|||
(@web.published? and action_name == 's5')
|
||||
end
|
||||
|
||||
def is_post
|
||||
unless (request.post? || Rails.env.test?)
|
||||
layout = 'error'
|
||||
layout = false if %w(tex tex_list).include?(action_name)
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => layout)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
module Mime
|
||||
|
@ -265,10 +276,10 @@ end
|
|||
module Instiki
|
||||
module VERSION #:nodoc:
|
||||
MAJOR = 0
|
||||
MINOR = 18
|
||||
TINY = 0
|
||||
MINOR = 19
|
||||
TINY = 3
|
||||
SUFFIX = '(MML+)'
|
||||
PRERELEASE = false
|
||||
PRERELEASE = false
|
||||
if PRERELEASE
|
||||
STRING = [MAJOR, MINOR].join('.') + PRERELEASE + SUFFIX
|
||||
else
|
||||
|
@ -281,3 +292,17 @@ end
|
|||
class Hash
|
||||
alias_method(:key, :index) unless method_defined?(:key)
|
||||
end
|
||||
|
||||
# Monkey patch, to ensure ActionCache doesn't muck with the content-type header.
|
||||
module ActionController #:nodoc:
|
||||
module Caching
|
||||
module Actions
|
||||
class ActionCacheFilter
|
||||
private
|
||||
def set_content_type!(controller, extension)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -8,11 +8,11 @@ module CacheSweepingHelper
|
|||
end
|
||||
|
||||
def expire_cached_summary_pages(web)
|
||||
categories = WikiReference.all(:conditions => "link_type = 'C'")
|
||||
categories = WikiReference.list_categories(web)
|
||||
%w(recently_revised list).each do |action|
|
||||
expire_action :controller => 'wiki', :web => web.address, :action => action
|
||||
categories.each do |category|
|
||||
expire_action :controller => 'wiki', :web => web.address, :action => action, :category => category.referenced_name
|
||||
expire_action :controller => 'wiki', :web => web.address, :action => action, :category => category
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -26,12 +26,14 @@ module CacheSweepingHelper
|
|||
end
|
||||
|
||||
def expire_cached_revisions(page)
|
||||
page.revisions.count.times do |i|
|
||||
page.rev_ids.count.times do |i|
|
||||
revno = i+1
|
||||
expire_action :controller => 'wiki', :web => page.web.address,
|
||||
:action => 'revision', :id => page.name, :rev => revno
|
||||
expire_action :controller => 'wiki', :web => page.web.address,
|
||||
:action => 'revision', :id => page.name, :rev => revno, :mode => 'diff'
|
||||
expire_action :controller => 'wiki', :web => page.web.address,
|
||||
:action => 'source', :id => page.name, :rev => revno
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Controller responsible for serving files and pictures.
|
||||
|
||||
require 'zip/zip'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class FileController < ApplicationController
|
||||
|
||||
|
@ -18,6 +18,9 @@ class FileController < ApplicationController
|
|||
new_file = @web.wiki_files.create(params['file'])
|
||||
if new_file.valid?
|
||||
flash[:info] = "File '#{@file_name}' successfully uploaded"
|
||||
WikiReference.pages_that_link_to_file(@web, @file_name).each do |page|
|
||||
RevisionSweeper.expire_page(@web, page)
|
||||
end
|
||||
redirect_to(params['referring_page'])
|
||||
else
|
||||
# pass the file with errors back into the form
|
||||
|
@ -88,37 +91,28 @@ class FileController < ApplicationController
|
|||
protected
|
||||
|
||||
def check_authorized
|
||||
if authorized? or @web.published?
|
||||
return true
|
||||
else
|
||||
unless authorized? or @web.published?
|
||||
@hide_navigation = true
|
||||
render(:status => 403, :text => 'This web is private', :layout => true)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def check_allow_uploads
|
||||
render(:status => 404, :text => "Web #{params['web'].inspect} not found", :layout => 'error') and return false unless @web
|
||||
if @web.allow_uploads? and authorized?
|
||||
return true
|
||||
if @web
|
||||
if @web.allow_uploads? and authorized?
|
||||
return true
|
||||
else
|
||||
@hide_navigation = true
|
||||
render(:status => 403, :text => 'File uploads are blocked by the webmaster', :layout => true)
|
||||
return false
|
||||
end
|
||||
else
|
||||
@hide_navigation = true
|
||||
render(:status => 403, :text => 'File uploads are blocked by the webmaster', :layout => true)
|
||||
return false
|
||||
render(:status => 404, :text => "Web #{params['web'].inspect} not found", :layout => 'error')
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def is_post
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
def import_from_archive(archive)
|
||||
logger.info "Importing pages from #{archive}"
|
||||
zip = Zip::ZipInputStream.open(archive)
|
||||
|
|
|
@ -18,18 +18,30 @@ class RevisionSweeper < ActionController::Caching::Sweeper
|
|||
expire_caches(record.page)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def after_create(record)
|
||||
if record.is_a?(Page)
|
||||
WikiReference.pages_that_reference(record.web, record.name).each do |page_name|
|
||||
expire_cached_page(record.web, page_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def after_delete(record)
|
||||
if record.is_a?(Page)
|
||||
expire_caches(record)
|
||||
end
|
||||
end
|
||||
|
||||
def self.expire_page(web, page_name)
|
||||
new.expire_cached_page(web, page_name)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def expire_caches(page)
|
||||
expire_cached_summary_pages(page.web)
|
||||
pages_to_expire = ([page.name] + WikiReference.pages_that_reference(page.web, page.name) +
|
||||
pages_to_expire = ([page.name] +
|
||||
WikiReference.pages_redirected_to(page.web, page.name) +
|
||||
WikiReference.pages_that_include(page.web, page.name)).uniq
|
||||
pages_to_expire.each { |page_name| expire_cached_page(page.web, page_name) }
|
||||
|
|
|
@ -9,7 +9,7 @@ class WebSweeper < ActionController::Caching::Sweeper
|
|||
def after_save(record)
|
||||
if record.is_a?(Web)
|
||||
web = record
|
||||
web.pages.each { |page| expire_cached_page(web, page.name) }
|
||||
web.pages.find_each { |page| expire_cached_page(web, page.name) }
|
||||
expire_cached_summary_pages(web)
|
||||
elsif record.is_a?(WikiFile)
|
||||
record.web.pages_that_link_to_file(record.file_name).each do |page|
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'fileutils'
|
|||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
require 'zip/zip'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'resolv'
|
||||
|
||||
class WikiController < ApplicationController
|
||||
|
@ -68,42 +68,65 @@ class WikiController < ApplicationController
|
|||
end
|
||||
|
||||
def export_html
|
||||
stylesheet = Rails.root.join('public', 'stylesheets', 'instiki.css').read
|
||||
export_pages_as_zip(html_ext) do |page|
|
||||
|
||||
renderer = PageRenderer.new(page.revisions.last)
|
||||
renderer = PageRenderer.new(page.current_revision)
|
||||
rendered_page = <<-EOL
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>#{page.plain_name} in #{@web.name}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>#{page.plain_name} in #{@web.name}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
|
||||
<style type="text/css">
|
||||
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover {
|
||||
color: ##{@web ? @web.color : "393" };
|
||||
}
|
||||
.newWikiWord { background-color: white; font-style: italic; }
|
||||
#{stylesheet}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
#{@web.additional_style}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="pageName">
|
||||
<span class="webName">#{@web.name}</span><br />
|
||||
#{page.plain_name}
|
||||
</h1>
|
||||
#{renderer.display_content_for_export}
|
||||
<div class="byline">
|
||||
#{page.revisions? ? "Revised" : "Created" } on #{ page.revised_at.strftime('%B %d, %Y %H:%M:%S') }
|
||||
by
|
||||
#{ UrlGenerator.new(self).make_link(@web, page.author.name, @web, nil, { :mode => :export }) }
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOL
|
||||
<script src="public/javascripts/page_helper.js" type="text/javascript"></script>
|
||||
<link href="public/stylesheets/instiki.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="public/stylesheets/syntax.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, [actiontype="toggle"]:hover, #TextileHelp h3 {
|
||||
color: ##{@web ? @web.color : "393"};
|
||||
}
|
||||
a:visited.existingWikiWord {
|
||||
color: ##{darken(@web ? @web.color : "393")};
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
|
||||
#{@web ? @web.additional_style : ''}
|
||||
/*]]>*/--></style>
|
||||
<script src="public/javascripts/prototype.js" type="text/javascript"></script>
|
||||
<script src="public/javascripts/effects.js" type="text/javascript"></script>
|
||||
<script src="public/javascripts/dragdrop.js" type="text/javascript"></script>
|
||||
<script src="public/javascripts/controls.js" type="text/javascript"></script>
|
||||
<script src="public/javascripts/application.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="Container">
|
||||
<div id="Content">
|
||||
<h1 id="pageName">
|
||||
#{xhtml_enabled? ? %{<span id="svg_logo"><svg version="1.1" width="100%" height="100%" viewBox='0 -1 180 198' xmlns='http://www.w3.org/2000/svg'>
|
||||
<path id="svg_logo_path" fill="##{@web ? @web.color : "393"}" stroke-width='0.5' stroke='#000' d='
|
||||
M170,60c4,11-1,20-12,25c-9,4-25,3-20,15c5,5,15,0,24,1c11,1,21,11,14,21c-10,15-35,6-48-1c-5-3-27-23-32-10c-1,13,15,10,22,16
|
||||
c11,4,24,14,34,20c12,10,7,25-9,23c-11-1-22-9-30-16c-5-5-13-18-21-9c-2,6,2,11,5,14c9,9,22,14,22,31c-2,8-12,8-18,4c-4-3-9-8-11-13
|
||||
c-3-6-5-18-12-18c-14-1-5,28-18,30c-9,2-13-9-12-16c1-14,12-24,21-31c5-4,17-13,10-20c-9-10-19,12-23,16c-7,7-17,16-31,15
|
||||
c-9-1-18-9-11-17c5-7,14-4,23-6c6-1,15-8,8-15c-5-6-57,2-42-24c7-12,51,4,61,6c6,1,17,4,18-4c2-11-12-7-21-8c-21-2-49-14-49-34
|
||||
c0-5,3-11,8-11C31,42,34,65,42,67c6,1,9-3,8-9C49,49,38,40,40,25c1-5,4-15,13-14c10,2,11,18,13,29c1,8,0,24,7,28c15,0,5-22,4-30
|
||||
C74,23,78,7,87,1c8-4,14,1,16,9c2,11-8,21-2,30c8,2,11-6,14-12c9-14,36-18,30,5c-3,9-12,19-21,24c-6,4-22,10-23,19c-2,14,15,2,18-2
|
||||
c9-9,20-18,33-22C159,52,166,54,170,60' />
|
||||
</svg></span>} : ''}
|
||||
<span class="webName">#{@web.name}</span><br />
|
||||
#{page.plain_name}
|
||||
</h1>
|
||||
#{renderer.display_content_for_export}
|
||||
<div class="byline">
|
||||
#{page.revisions? ? "Revised" : "Created" } on #{ page.revised_at.strftime('%B %d, %Y %H:%M:%S') }
|
||||
by
|
||||
#{ UrlGenerator.new(self).make_link(@web, page.author.name, @web, nil, { :mode => :export }) }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOL
|
||||
rendered_page
|
||||
end
|
||||
end
|
||||
|
@ -161,9 +184,34 @@ class WikiController < ApplicationController
|
|||
def atom_with_headlines
|
||||
render_atom(hide_description = true)
|
||||
end
|
||||
|
||||
def tex_list
|
||||
return unless is_post
|
||||
if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
|
||||
@tex_content = ''
|
||||
# Ruby 1.9.x has ordered hashes; 1.8.x doesn't. So let's just parse the query ourselves.
|
||||
ordered_params = ActiveSupport::OrderedHash[*request.raw_post.split('&').collect {|k_v| k_v.split('=').collect {|x| CGI::unescape(x)}}.flatten]
|
||||
ordered_params.each do |name, p|
|
||||
if p == 'tex' && @web.has_page?(name)
|
||||
@tex_content << "\\section*\{#{Maruku.new(name).to_latex.strip}\}\n\n"
|
||||
@tex_content << Maruku.new(@web.page(name).content).to_latex
|
||||
end
|
||||
end
|
||||
else
|
||||
@tex_content = 'TeX export only supported with the Markdown text filters.'
|
||||
end
|
||||
if @tex_content == ''
|
||||
flash[:error] = "You didn't select any pages to export."
|
||||
redirect_to :back
|
||||
return
|
||||
end
|
||||
expire_action :controller => 'wiki', :web => @web.address, :action => 'list', :category => params['category']
|
||||
render(:layout => 'tex')
|
||||
end
|
||||
|
||||
|
||||
def search
|
||||
@query = params['query'].purify
|
||||
@query = params['query'] ? params['query'].purify : ''
|
||||
@title_results = @web.select { |page| page.name =~ /#{@query}/i }.sort
|
||||
@results = @web.select { |page| page.content =~ /#{@query}/i }.sort
|
||||
all_pages_found = (@results + @title_results).uniq
|
||||
|
@ -214,7 +262,7 @@ class WikiController < ApplicationController
|
|||
redirect_home
|
||||
end
|
||||
@link_mode ||= :show
|
||||
@renderer = PageRenderer.new(@page.revisions.last)
|
||||
@renderer = PageRenderer.new(@page.current_revision)
|
||||
# to template
|
||||
end
|
||||
|
||||
|
@ -228,7 +276,7 @@ class WikiController < ApplicationController
|
|||
@page ||= wiki.read_page(@web_name, @page_name)
|
||||
@link_mode ||= :publish
|
||||
if @page
|
||||
@renderer = PageRenderer.new(@page.revisions.last)
|
||||
@renderer = PageRenderer.new(@page.current_revision)
|
||||
else
|
||||
real_page = WikiReference.page_that_redirects_for(@web, @page_name)
|
||||
if real_page
|
||||
|
@ -257,11 +305,7 @@ class WikiController < ApplicationController
|
|||
|
||||
def save
|
||||
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil?
|
||||
unless (request.post? || ENV["RAILS_ENV"] == "test")
|
||||
headers['Allow'] = 'POST'
|
||||
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
|
||||
return
|
||||
end
|
||||
return unless is_post
|
||||
author_name = params['author'].purify
|
||||
author_name = 'AnonymousCoward' if author_name =~ /^\s*$/
|
||||
|
||||
|
@ -269,12 +313,11 @@ class WikiController < ApplicationController
|
|||
the_content = params['content'].purify
|
||||
prev_content = ''
|
||||
filter_spam(the_content)
|
||||
raise Instiki::ValidationError.new('Your name cannot contain a "."') if author_name.include? '.'
|
||||
cookies['author'] = { :value => author_name.dup.as_bytes, :expires => Time.utc(2030) }
|
||||
if @page
|
||||
new_name = params['new_name'] ? params['new_name'].purify : @page_name
|
||||
new_name = @page_name if new_name.empty?
|
||||
prev_content = @page.current_revision.content
|
||||
raise Instiki::ValidationError.new('Your new title cannot contain a "."') if new_name.include? '.'
|
||||
raise Instiki::ValidationError.new('A page named "' + new_name.escapeHTML + '" already exists.') if
|
||||
@page_name != new_name && @web.has_page?(new_name)
|
||||
wiki.revise_page(@web_name, @page_name, new_name, the_content, Time.now,
|
||||
|
@ -305,7 +348,7 @@ class WikiController < ApplicationController
|
|||
def show
|
||||
if @page
|
||||
begin
|
||||
@renderer = PageRenderer.new(@page.revisions.last)
|
||||
@renderer = PageRenderer.new(@page.current_revision)
|
||||
@show_diff = (params[:mode] == 'diff')
|
||||
render :action => 'page'
|
||||
# TODO this rescue should differentiate between errors due to rendering and errors in
|
||||
|
@ -340,8 +383,8 @@ class WikiController < ApplicationController
|
|||
if @page
|
||||
@revisions_by_day = Hash.new { |h, day| h[day] = [] }
|
||||
@revision_numbers = Hash.new { |h, id| h[id] = [] }
|
||||
revision_number = @page.revisions.size
|
||||
@page.revisions.reverse.each do |rev|
|
||||
revision_number = @page.rev_ids.size
|
||||
@page.rev_ids.reverse.each do |rev|
|
||||
day = Date.new(rev.revised_at.year, rev.revised_at.month, rev.revised_at.day)
|
||||
@revisions_by_day[day] << rev
|
||||
@revision_numbers[rev.id] = revision_number
|
||||
|
@ -358,7 +401,7 @@ class WikiController < ApplicationController
|
|||
end
|
||||
|
||||
def source
|
||||
#to template
|
||||
@revision = @page.revisions[params['rev'].to_i - 1] if params['rev']
|
||||
end
|
||||
|
||||
def tex
|
||||
|
@ -367,11 +410,12 @@ class WikiController < ApplicationController
|
|||
else
|
||||
@tex_content = 'TeX export only supported with the Markdown text filters.'
|
||||
end
|
||||
render(:layout => 'tex')
|
||||
end
|
||||
|
||||
def s5
|
||||
if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
|
||||
my_rendered = PageRenderer.new(@page.revisions.last)
|
||||
my_rendered = PageRenderer.new(@page.current_revision)
|
||||
@s5_content = my_rendered.display_s5
|
||||
@s5_theme = my_rendered.s5_theme
|
||||
else
|
||||
|
@ -421,16 +465,26 @@ class WikiController < ApplicationController
|
|||
file_path = @wiki.storage_path.join(file_prefix + timestamp + '.zip')
|
||||
tmp_path = "#{file_path}.tmp"
|
||||
|
||||
Zip::ZipOutputStream.open(tmp_path) do |zip_out|
|
||||
Zip::ZipFile.open(tmp_path, Zip::ZipFile::CREATE) do |zip_out|
|
||||
@web.select.by_name.each do |page|
|
||||
zip_out.put_next_entry("#{CGI.escape(page.name)}.#{file_type}")
|
||||
zip_out.puts(block.call(page))
|
||||
zip_out.get_output_stream("#{CGI.escape(page.name)}.#{file_type}") do |f|
|
||||
f.puts(block.call(page))
|
||||
end
|
||||
end
|
||||
# add an index file, if exporting to HTML
|
||||
# add an index file, and the stylesheet and javascript directories, if exporting to HTML
|
||||
if file_type.to_s.downcase == html_ext
|
||||
zip_out.put_next_entry "index.#{html_ext}"
|
||||
zip_out.puts "<html xmlns='http://www.w3.org/1999/xhtml'><head>" +
|
||||
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=HomePage.#{file_type}\"></head></html>"
|
||||
zip_out.get_output_stream("index.#{html_ext}") do |f|
|
||||
f.puts "<html xmlns='http://www.w3.org/1999/xhtml'><head>" +
|
||||
"<meta http-equiv=\"Refresh\" content=\"0;URL=HomePage.#{html_ext}\" /></head></html>"
|
||||
end
|
||||
dir = Rails.root.join('public')
|
||||
Dir["#{dir}/{images,javascripts,s5,stylesheets}/**/*"].each do |f|
|
||||
zip_out.add "public#{f.sub(dir.to_s,'')}", f
|
||||
end
|
||||
end
|
||||
files = @web.files_path
|
||||
Dir["#{files}/**/*"].each do |f|
|
||||
zip_out.add "files#{f.sub(files.to_s,'')}", f
|
||||
end
|
||||
end
|
||||
FileUtils.rm_rf(Dir[@wiki.storage_path.join(file_prefix + '*.zip').to_s])
|
||||
|
@ -452,7 +506,7 @@ class WikiController < ApplicationController
|
|||
if params['rev']
|
||||
@revision_number = params['rev'].to_i
|
||||
else
|
||||
@revision_number = @page.revisions.size
|
||||
@revision_number = @page.rev_ids.size
|
||||
end
|
||||
@revision = @page.revisions[@revision_number - 1]
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# The methods added to this helper will be available to all templates in the application.
|
||||
module ApplicationHelper
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container
|
||||
# where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and
|
||||
|
@ -31,7 +31,7 @@ require 'stringsupport'
|
|||
end
|
||||
end
|
||||
|
||||
html_options.join("\n")
|
||||
html_options.join("\n").html_safe
|
||||
end
|
||||
|
||||
# Creates a hyperlink to a Wiki page, without checking if the page exists or not
|
||||
|
@ -39,39 +39,39 @@ require 'stringsupport'
|
|||
link_to(
|
||||
text || page.plain_name,
|
||||
{:web => @web.address, :action => 'show', :id => page.name, :only_path => true},
|
||||
html_options)
|
||||
html_options).html_safe
|
||||
end
|
||||
|
||||
# Creates a hyperlink to a Wiki page, or to a "new page" form if the page doesn't exist yet
|
||||
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||
raise 'Web not defined' if web.nil?
|
||||
UrlGenerator.new(@controller).make_link(@web, page_name, web, text,
|
||||
options.merge(:base_url => "#{base_url}/#{web.address}"))
|
||||
options.merge(:base_url => "#{base_url}/#{web.address}")).html_safe
|
||||
end
|
||||
|
||||
def author_link(page, options = {})
|
||||
UrlGenerator.new(@controller).make_link(@web, page.author.name, page.web, nil, options)
|
||||
UrlGenerator.new(@controller).make_link(@web, page.author.name, page.web, nil, options).purify.html_safe
|
||||
end
|
||||
|
||||
# Create a hyperlink to a particular revision of a Wiki page
|
||||
def link_to_revision(page, revision_number, text = nil, mode = nil, html_options = {})
|
||||
revision_number == page.revisions.size ?
|
||||
revision_number == page.rev_ids.size ?
|
||||
link_to(
|
||||
text || page.plain_name,
|
||||
{:web => @web.address, :action => 'show', :id => page.name,
|
||||
:mode => mode}, html_options) :
|
||||
:mode => mode}, html_options).html_safe :
|
||||
link_to(
|
||||
text || page.plain_name + "(rev # #{revision_number})",
|
||||
text || page.plain_name + "(rev # #{revision_number})".html_safe,
|
||||
{:web => @web.address, :action => 'revision', :id => page.name,
|
||||
:rev => revision_number, :mode => mode}, html_options)
|
||||
:rev => revision_number, :mode => mode}, html_options).html_safe
|
||||
end
|
||||
|
||||
# Create a hyperlink to the history of a particular Wiki page
|
||||
def link_to_history(page, text = nil, html_options = {})
|
||||
link_to(
|
||||
text || page.plain_name + "(history)",
|
||||
text || page.plain_name + "(history)".html_safe,
|
||||
{:web => @web.address, :action => 'history', :id => page.name},
|
||||
html_options)
|
||||
html_options).html_safe
|
||||
end
|
||||
|
||||
def base_url
|
||||
|
@ -84,19 +84,19 @@ require 'stringsupport'
|
|||
if @categories.empty?
|
||||
''
|
||||
else
|
||||
"<div id=\"categories\">\n" +
|
||||
("<div id=\"categories\">\n" +
|
||||
'<strong>Categories</strong>:' +
|
||||
'[' + link_to_unless_current('Any', :web => @web.address, :action => self.action_name, :category => nil) + "]\n" +
|
||||
@categories.map { |c|
|
||||
link_to_unless_current(c, :web => @web.address, :action => self.action_name, :category => c)
|
||||
link_to_unless_current(c.html_safe, :web => @web.address, :action => self.action_name, :category => c)
|
||||
}.join(', ') + "\n" +
|
||||
'</div>'
|
||||
'</div>').html_safe
|
||||
end
|
||||
end
|
||||
|
||||
# Performs HTML escaping on text, but keeps linefeeds intact (by replacing them with <br/>)
|
||||
def escape_preserving_linefeeds(text)
|
||||
h(text).gsub(/\n/, '<br/>')
|
||||
h(text).gsub(/\n/, '<br/>').as_utf8.html_safe
|
||||
end
|
||||
|
||||
def format_date(date, include_time = true)
|
||||
|
@ -109,20 +109,20 @@ require 'stringsupport'
|
|||
end
|
||||
|
||||
def rendered_content(page)
|
||||
PageRenderer.new(page.revisions.last).display_content
|
||||
PageRenderer.new(page.current_revision).display_content
|
||||
end
|
||||
|
||||
def truncate(text, *args)
|
||||
options = args.extract_options!
|
||||
options.reverse_merge!(:length => 30, :omission => "...")
|
||||
return text if text.num_chars <= options[:length]
|
||||
return text.html_safe if text.num_chars <= options[:length]
|
||||
len = options[:length] - options[:omission].as_utf8.num_chars
|
||||
t = ''
|
||||
text.split.collect do |word|
|
||||
if t.num_chars + word.num_chars <= len
|
||||
t << word + ' '
|
||||
else
|
||||
return t.chop + options[:omission]
|
||||
return (t.chop + options[:omission]).html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ module WikiHelper
|
|||
menu << back_for_revision if @revision_number > 1
|
||||
menu << current_revision
|
||||
menu << see_or_hide_changes_for_revision if @revision_number > 1
|
||||
menu << history if @page.revisions.size > 1
|
||||
menu << history if @page.rev_ids.size > 1
|
||||
menu << rollback
|
||||
menu
|
||||
end
|
||||
|
@ -15,11 +15,11 @@ module WikiHelper
|
|||
menu = []
|
||||
menu << edit_page
|
||||
menu << edit_web if @page.name == "HomePage"
|
||||
if @page.revisions.size > 1
|
||||
if @page.rev_ids.size > 1
|
||||
menu << back_for_page
|
||||
menu << see_or_hide_changes_for_page
|
||||
end
|
||||
menu << history if @page.revisions.size > 1
|
||||
menu << history if @page.rev_ids.size > 1
|
||||
menu
|
||||
end
|
||||
|
||||
|
@ -40,15 +40,15 @@ module WikiHelper
|
|||
end
|
||||
|
||||
def forward
|
||||
if @revision_number < @page.revisions.size - 1
|
||||
if @revision_number < @page.rev_ids.size - 1
|
||||
link_to('Forward in time',
|
||||
{:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number + 1},
|
||||
{:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) +
|
||||
" <span class='revisions'>(#{@revision.page.revisions.size - @revision_number} more)</span> "
|
||||
" <span class='revisions'>(#{@revision.page.rev_ids.size - @revision_number} more)</span> ".html_safe
|
||||
else
|
||||
link_to('Forward in time', {:web => @web.address, :action => 'show', :id => @page.name},
|
||||
{:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) +
|
||||
" <span class='revisions'>(to current)</span>"
|
||||
" <span class='revisions'>(to current)</span>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -56,15 +56,15 @@ module WikiHelper
|
|||
link_to('Back in time',
|
||||
{:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number - 1},
|
||||
{:class => 'navlink', :id => 'to_previous_revision', :rel => 'nofollow'}) +
|
||||
" <span class='revisions'>(#{@revision_number - 1} more)</span>"
|
||||
" <span class='revisions'>(#{@revision_number - 1} more)</span>".html_safe
|
||||
end
|
||||
|
||||
def back_for_page
|
||||
link_to('Back in time',
|
||||
{:web => @web.address, :action => 'revision', :id => @page.name,
|
||||
:rev => @page.revisions.size - 1},
|
||||
:rev => @page.rev_ids.size - 1},
|
||||
{:class => 'navlink', :accesskey => 'B', :id => 'to_previous_revision', :rel => 'nofollow'}) +
|
||||
" <span class='revisions'>(#{@page.revisions.size - 1} #{@page.revisions.size - 1 == 1 ? 'revision' : 'revisions'})</span>"
|
||||
" <span class='revisions'>(#{@page.rev_ids.size - 1} #{@page.rev_ids.size - 1 == 1 ? 'revision' : 'revisions'})</span>".html_safe
|
||||
end
|
||||
|
||||
def current_revision
|
||||
|
@ -91,6 +91,4 @@ module WikiHelper
|
|||
{:class => 'navlink', :id => 'rollback', :rel => 'nofollow'})
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
# Allow the metal piece to run in isolation
|
||||
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
|
||||
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class Itex
|
||||
def self.call(env)
|
||||
if env["PATH_INFO"] =~ /^\/itex/
|
||||
[200, {"Content-Type" => "application/xml"}, [response(env)]]
|
||||
else
|
||||
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# plugable XML parser; falls back to REXML
|
||||
begin
|
||||
require 'nokogiri'
|
||||
def self.xmlparse(text)
|
||||
Nokogiri::XML(text) { |config| config.strict }
|
||||
end
|
||||
rescue LoadError
|
||||
require 'rexml/document'
|
||||
def self.xmlparse(text)
|
||||
REXML::Document.new(text)
|
||||
end
|
||||
end
|
||||
|
||||
#error message to return
|
||||
def self.error(str)
|
||||
"<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><merror><mtext>" +
|
||||
str + "</mtext></merror></math>"
|
||||
end
|
||||
|
||||
# itex2MML parser
|
||||
begin
|
||||
require 'itextomml'
|
||||
def self.parse_itex(tex, filter)
|
||||
Itex2MML::Parser.new.send(filter, tex).to_utf8
|
||||
end
|
||||
rescue LoadError
|
||||
def self.parse_itex(tex, filter)
|
||||
error("Please install the itex2MML Ruby bindings.")
|
||||
end
|
||||
end
|
||||
|
||||
# the actual response
|
||||
def self.response(env)
|
||||
params = Rack::Request.new(env).params
|
||||
tex = (params['tex'] || '').purify.strip
|
||||
case params['display']
|
||||
when 'block'
|
||||
filter = :block_filter
|
||||
else
|
||||
filter = :inline_filter
|
||||
end
|
||||
return "<math xmlns='http://www.w3.org/1998/Math/MathML' display='" +
|
||||
filter.to_s[/(.*?)_filter/] + "'/>" if tex == ''
|
||||
begin
|
||||
doc = parse_itex(tex, filter)
|
||||
# make sure the result is well-formed, before sending it off
|
||||
begin
|
||||
xmlparse(doc)
|
||||
rescue
|
||||
return error("Ill-formed XML.")
|
||||
end
|
||||
return doc
|
||||
rescue Itex2MML::Error => e
|
||||
error(e.to_s)
|
||||
rescue
|
||||
error("Unknown Error")
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,7 +3,7 @@ class Author < String
|
|||
attr_reader :name
|
||||
def initialize(name, ip = nil)
|
||||
@ip = ip
|
||||
super(name)
|
||||
super(name.as_utf8)
|
||||
end
|
||||
|
||||
def name=(value)
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
class Page < ActiveRecord::Base
|
||||
belongs_to :web
|
||||
has_many :revisions, :order => 'id', :dependent => :destroy
|
||||
#In many cases, we don't need to instantiate the full revisions (with all that textual data)
|
||||
has_many :rev_ids, :order => 'id', :class_name => 'Revision', :select => 'id, revised_at, page_id, author, ip'
|
||||
has_many :wiki_references, :order => 'referenced_name'
|
||||
has_one :current_revision, :class_name => 'Revision', :order => 'id DESC'
|
||||
|
||||
def name
|
||||
read_attribute(:name).as_utf8
|
||||
end
|
||||
|
||||
def revise(content, name, time, author, renderer)
|
||||
revisions_size = new_record? ? 0 : revisions.size
|
||||
revisions_size = new_record? ? 0 : rev_ids.size
|
||||
if (revisions_size > 0) and content == current_revision.content and name == self.name
|
||||
raise Instiki::ValidationError.new(
|
||||
"You have tried to save page '#{name}' without changing its content")
|
||||
|
@ -42,11 +48,11 @@ class Page < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def revisions?
|
||||
revisions.size > 1
|
||||
rev_ids.size > 1
|
||||
end
|
||||
|
||||
def previous_revision(revision)
|
||||
revision_index = revisions.each_with_index do |rev, index|
|
||||
revision_index = rev_ids.each_with_index do |rev, index|
|
||||
if rev.id == revision.id
|
||||
break index
|
||||
else
|
||||
|
@ -68,6 +74,10 @@ class Page < ActiveRecord::Base
|
|||
wiki_references.select { |ref| ref.wiki_word? }.map { |ref| ref.referenced_name }
|
||||
end
|
||||
|
||||
def categories
|
||||
wiki_references.select { |ref| ref.category? }.map { |ref| ref.referenced_name }
|
||||
end
|
||||
|
||||
def linked_from
|
||||
web.select.pages_that_link_to(name)
|
||||
end
|
||||
|
@ -82,7 +92,7 @@ class Page < ActiveRecord::Base
|
|||
|
||||
# Returns the original wiki-word name as separate words, so "MyPage" becomes "My Page".
|
||||
def plain_name
|
||||
web.brackets_only? ? CGI.escapeHTML(name) : CGI.escapeHTML(WikiWords.separate(name))
|
||||
web.brackets_only? ? name.escapeHTML.html_safe : WikiWords.separate(name).escapeHTML.html_safe
|
||||
end
|
||||
|
||||
LOCKING_PERIOD = 30.minutes
|
||||
|
@ -104,7 +114,7 @@ class Page < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def to_param
|
||||
name
|
||||
name.as_utf8
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
class Revision < ActiveRecord::Base
|
||||
belongs_to :page
|
||||
composed_of :author, :mapping => [ %w(author name), %w(ip ip) ]
|
||||
|
||||
def content
|
||||
read_attribute(:content).as_utf8
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'instiki_stringsupport'
|
||||
|
||||
class Web < ActiveRecord::Base
|
||||
## Associations
|
||||
|
||||
|
@ -15,8 +17,7 @@ class Web < ActiveRecord::Base
|
|||
|
||||
## Validations
|
||||
|
||||
validates_uniqueness_of :address
|
||||
|
||||
validates_uniqueness_of :address, :message => 'already exists'
|
||||
validates_length_of :color, :in => 3..6
|
||||
|
||||
## Methods
|
||||
|
@ -203,6 +204,10 @@ class Web < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def validate_address
|
||||
if ['create_system', 'create_web', 'delete_web', 'delete_files', 'web_list', ''].include?(address)
|
||||
self.errors.add(:address, 'is not a valid address')
|
||||
raise Instiki::ValidationError.new("\"#{address.purify.escapeHTML}\" #{errors.on(:address)}")
|
||||
end
|
||||
unless address == CGI.escape(address)
|
||||
self.errors.add(:address, 'should contain only valid URI characters')
|
||||
raise Instiki::ValidationError.new("#{self.class.human_attribute_name('address')} #{errors.on(:address)}")
|
||||
|
|
|
@ -9,13 +9,12 @@ class WikiFile < ActiveRecord::Base
|
|||
validates_length_of :description, :maximum=>255
|
||||
|
||||
def self.find_by_file_name(file_name)
|
||||
find(:first, :conditions => ['file_name = ?', file_name])
|
||||
first(:conditions => ['file_name = ?', file_name])
|
||||
end
|
||||
|
||||
SANE_FILE_NAME = /^[a-zA-Z0-9\-_\. ]*$/
|
||||
def validate
|
||||
if file_name
|
||||
if file_name !~ SANE_FILE_NAME
|
||||
if ! WikiFile.is_valid?(file_name)
|
||||
errors.add("file_name", "is invalid. Only latin characters, digits, dots, underscores, " +
|
||||
"dashes and spaces are accepted")
|
||||
elsif file_name == '.' or file_name == '..'
|
||||
|
@ -58,7 +57,10 @@ class WikiFile < ActiveRecord::Base
|
|||
require 'fileutils'
|
||||
FileUtils.rm_f(content_path) if File.exists?(content_path)
|
||||
end
|
||||
|
||||
|
||||
|
||||
SANE_FILE_NAME = /^[a-zA-Z0-9\-_\. ]*$/
|
||||
def self.is_valid?(name)
|
||||
name =~ SANE_FILE_NAME
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -12,6 +12,10 @@ class WikiReference < ActiveRecord::Base
|
|||
belongs_to :page
|
||||
validates_inclusion_of :link_type, :in => [LINKED_PAGE, WANTED_PAGE, REDIRECTED_PAGE, INCLUDED_PAGE, CATEGORY, AUTHOR, FILE, WANTED_FILE]
|
||||
|
||||
def referenced_name
|
||||
read_attribute(:referenced_name).as_utf8
|
||||
end
|
||||
|
||||
def self.link_type(web, page_name)
|
||||
if web.has_page?(page_name) || self.page_that_redirects_for(web, page_name)
|
||||
LINKED_PAGE
|
||||
|
@ -42,7 +46,7 @@ class WikiReference < ActiveRecord::Base
|
|||
query = 'SELECT name FROM pages JOIN wiki_references ' +
|
||||
'ON pages.id = wiki_references.page_id ' +
|
||||
'WHERE wiki_references.referenced_name = ? ' +
|
||||
"AND wiki_references.link_type in ('#{FILE}') " +
|
||||
"AND wiki_references.link_type in ('#{FILE}','#{WANTED_FILE}') " +
|
||||
"AND pages.web_id = '#{web.id}'"
|
||||
names = connection.select_all(sanitize_sql([query, file_name])).map { |row| row['name'] }
|
||||
end
|
||||
|
@ -74,9 +78,9 @@ class WikiReference < ActiveRecord::Base
|
|||
"AND wiki_references.link_type = '#{REDIRECTED_PAGE}' " +
|
||||
"AND pages.web_id = '#{web.id}'"
|
||||
row = connection.select_one(sanitize_sql([query, page_name]))
|
||||
row['name'] if row
|
||||
row['name'].as_utf8 if row
|
||||
end
|
||||
|
||||
|
||||
def self.pages_in_category(web, category)
|
||||
query =
|
||||
"SELECT name FROM pages JOIN wiki_references " +
|
||||
|
@ -84,7 +88,7 @@ class WikiReference < ActiveRecord::Base
|
|||
"WHERE wiki_references.referenced_name = ? " +
|
||||
"AND wiki_references.link_type = '#{CATEGORY}' " +
|
||||
"AND pages.web_id = '#{web.id}'"
|
||||
names = connection.select_all(sanitize_sql([query, category])).map { |row| row['name'] }
|
||||
names = connection.select_all(sanitize_sql([query, category])).map { |row| row['name'].as_utf8 }
|
||||
end
|
||||
|
||||
def self.list_categories(web)
|
||||
|
@ -93,7 +97,7 @@ class WikiReference < ActiveRecord::Base
|
|||
"ON wiki_references.page_id = pages.id " +
|
||||
"WHERE wiki_references.link_type = '#{CATEGORY}' " +
|
||||
"AND pages.web_id = '#{web.id}'"
|
||||
connection.select_all(query).map { |row| row['referenced_name'] }
|
||||
connection.select_all(query).map { |row| row['referenced_name'].as_utf8 }
|
||||
end
|
||||
|
||||
def wiki_word?
|
||||
|
@ -128,4 +132,8 @@ class WikiReference < ActiveRecord::Base
|
|||
link_type == WANTED_FILE
|
||||
end
|
||||
|
||||
def category?
|
||||
link_type == CATEGORY
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -46,18 +46,18 @@
|
|||
}, @web.color) %>
|
||||
</select>
|
||||
<p>
|
||||
<input type="checkbox" class="disableAutoComplete" id="safe_mode" name="safe_mode" <%= 'checked="checked"' if @web.safe_mode? %> />
|
||||
<input type="checkbox" class="disableAutoComplete" id="safe_mode" name="safe_mode" <%= raw 'checked="checked"' if @web.safe_mode? %> />
|
||||
<label for="safe_mode">Safe mode
|
||||
<em>- strip HTML tags and stylesheet options from the content of all pages</em></label>
|
||||
<br/>
|
||||
<input type="checkbox" class="disableAutoComplete" id="brackets_only" name="brackets_only" <%= 'checked="checked"' if @web.brackets_only? %> />
|
||||
<input type="checkbox" class="disableAutoComplete" id="brackets_only" name="brackets_only" <%= raw 'checked="checked"' if @web.brackets_only? %> />
|
||||
<label for="brackets_only">Brackets only
|
||||
<em>- require all wiki words to be as [[wiki word]], WikiWord links won't be created</em></label>
|
||||
<br/>
|
||||
<input type="checkbox" class="disableAutoComplete" id="count_pages" name="count_pages" <%= 'checked="checked"' if @web.count_pages? %> />
|
||||
<input type="checkbox" class="disableAutoComplete" id="count_pages" name="count_pages" <%= raw 'checked="checked"' if @web.count_pages? %> />
|
||||
<label for="count_pages">Count pages</label>
|
||||
<br/>
|
||||
<input type="checkbox" class="disableAutoComplete" name="allow_uploads" <%= 'checked="checked"' if @web.allow_uploads? %> />
|
||||
<input type="checkbox" class="disableAutoComplete" name="allow_uploads" <%= raw 'checked="checked"' if @web.allow_uploads? %> />
|
||||
Allow uploads of no more than
|
||||
<input type="text" class="disableAutoComplete" name="max_upload_size" value="<%= @web.max_upload_size %>"
|
||||
size="20" />
|
||||
|
@ -100,7 +100,7 @@
|
|||
The published version is accessible through URLs like /<%= @web.address %>/published/HomePage.
|
||||
</div>
|
||||
<div class="inputBox">
|
||||
<input type="checkbox" id="published" name="published" class="disableAutoComplete" <%= 'checked="checked"' if @web.published? %> />
|
||||
<input type="checkbox" id="published" name="published" class="disableAutoComplete" <%= raw 'checked="checked"' if @web.published? %> />
|
||||
<label for="published">Publish this web</label>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%-
|
||||
@title = "Delete #{@file_name}"
|
||||
@title = "Delete #{@file_name}".html_safe
|
||||
@hide_navigation = true
|
||||
-%>
|
||||
|
||||
|
|
|
@ -16,21 +16,42 @@
|
|||
|
||||
<%= javascript_include_tag 'page_helper' %>
|
||||
|
||||
<%= stylesheet_link_tag 'instiki', :media => 'all' unless @inline_style %>
|
||||
<%= stylesheet_link_tag 'syntax', :media => 'all' unless @inline_style %>
|
||||
<style type="text/css">
|
||||
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, [actiontype="toggle"]:hover, #TextileHelp h3 {
|
||||
color: #<%= @web ? @web.color : "393" %>;
|
||||
}
|
||||
a:visited.existingWikiWord {
|
||||
color: #<%= darken(@web ? @web.color : "393") %>;
|
||||
}
|
||||
<%= Rails.root.join('public', 'stylesheets', 'instiki.css').read if @inline_style %>
|
||||
<%= Rails.root.join('public', 'stylesheets', 'syntax.css').read if @inline_style %>
|
||||
</style>
|
||||
<%= stylesheet_link_tag 'instiki', :media => 'all' unless @inline_style %>
|
||||
<%= stylesheet_link_tag 'syntax', :media => 'all' unless @inline_style %>
|
||||
<%= "<style type='text/css'>#{@style_additions}</style>" if @style_additions %>
|
||||
<%= "<style type='text/css'>#{@style_additions}</style>".html_safe if @style_additions %>
|
||||
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
|
||||
<%= @web ? @web.additional_style : '' %>
|
||||
<%= @web && @web.additional_style ? @web.additional_style.html_safe : '' %>
|
||||
/*]]>*/--></style>
|
||||
<%= javascript_include_tag :defaults %>
|
||||
<%= csrf_meta_tag %>
|
||||
<%- if @web -%>
|
||||
<%- if @web.markup == :markdownMML -%>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
MathML: { useMathMLspacing: true },
|
||||
"HTML-CSS": { scale: 90 }
|
||||
});
|
||||
if (window._onload_fired_) MathJax.Hub.Startup.onload();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
if (!(Prototype.Browser.Gecko || navigator.userAgent.match(/MathPlayer/))) {
|
||||
var s = document.createElement('script');
|
||||
s.src = "<%= compute_public_path('MathJax.js', 'MathJax').split('?')[0] %>?config=MML_HTMLorMML";
|
||||
document.querySelector('head').appendChild(s);
|
||||
window.addEventListener("load", function(){window._onload_fired_ = true} , false);
|
||||
};
|
||||
</script>
|
||||
<%- end -%>
|
||||
<%= auto_discovery_link_tag(:atom, {:controller => 'wiki', :web => @web.address, :action => 'atom_with_headlines'},
|
||||
:title => 'Atom with headlines') %>
|
||||
<%= auto_discovery_link_tag(:atom, {:controller => 'wiki', :web => @web.address, :action => 'atom_with_content'},
|
||||
|
|
|
@ -31,7 +31,11 @@
|
|||
</h1>
|
||||
|
||||
<div id="Error-Content">
|
||||
<%= h @content_for_layout %>
|
||||
<%= if :raw
|
||||
@content_for_layout
|
||||
else
|
||||
h @content_for_layout
|
||||
end %>
|
||||
|
||||
</div> <!-- Error-Content -->
|
||||
|
||||
|
|
|
@ -1 +1,265 @@
|
|||
\documentclass[12pt,titlepage]{article}
|
||||
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsthm}
|
||||
\usepackage{mathtools}
|
||||
<%- if @tex_content =~ /\\mathbb\{[^}]*[a-z0-9]+[^}]*\}/ -%>
|
||||
\usepackage{mathbbol}
|
||||
<% end -%>
|
||||
\usepackage{graphicx}
|
||||
\usepackage{color}
|
||||
\usepackage{ucs}
|
||||
\usepackage[utf8x]{inputenc}
|
||||
\usepackage{xparse}
|
||||
\usepackage{hyperref}
|
||||
|
||||
%----Macros----------
|
||||
%
|
||||
% Unresolved issues:
|
||||
%
|
||||
% \righttoleftarrow
|
||||
% \lefttorightarrow
|
||||
%
|
||||
% \color{} with HTML colorspec
|
||||
% \bgcolor
|
||||
% \array with options (without options, it's equivalent to the matrix environment)
|
||||
|
||||
% Of the standard HTML named colors, white, black, red, green, blue and yellow
|
||||
% are predefined in the color package. Here are the rest.
|
||||
\definecolor{aqua}{rgb}{0, 1.0, 1.0}
|
||||
\definecolor{fuschia}{rgb}{1.0, 0, 1.0}
|
||||
\definecolor{gray}{rgb}{0.502, 0.502, 0.502}
|
||||
\definecolor{lime}{rgb}{0, 1.0, 0}
|
||||
\definecolor{maroon}{rgb}{0.502, 0, 0}
|
||||
\definecolor{navy}{rgb}{0, 0, 0.502}
|
||||
\definecolor{olive}{rgb}{0.502, 0.502, 0}
|
||||
\definecolor{purple}{rgb}{0.502, 0, 0.502}
|
||||
\definecolor{silver}{rgb}{0.753, 0.753, 0.753}
|
||||
\definecolor{teal}{rgb}{0, 0.502, 0.502}
|
||||
|
||||
% Because of conflicts, \space and \mathop are converted to
|
||||
% \itexspace and \operatorname during preprocessing.
|
||||
|
||||
% itex: \space{ht}{dp}{wd}
|
||||
%
|
||||
% Height and baseline depth measurements are in units of tenths of an ex while
|
||||
% the width is measured in tenths of an em.
|
||||
\makeatletter
|
||||
\newdimen\itex@wd%
|
||||
\newdimen\itex@dp%
|
||||
\newdimen\itex@thd%
|
||||
\def\itexspace#1#2#3{\itex@wd=#3em%
|
||||
\itex@wd=0.1\itex@wd%
|
||||
\itex@dp=#2ex%
|
||||
\itex@dp=0.1\itex@dp%
|
||||
\itex@thd=#1ex%
|
||||
\itex@thd=0.1\itex@thd%
|
||||
\advance\itex@thd\the\itex@dp%
|
||||
\makebox[\the\itex@wd]{\rule[-\the\itex@dp]{0cm}{\the\itex@thd}}}
|
||||
\makeatother
|
||||
|
||||
% \tensor and \multiscript
|
||||
\makeatletter
|
||||
\newif\if@sup
|
||||
\newtoks\@sups
|
||||
\def\append@sup#1{\edef\act{\noexpand\@sups={\the\@sups #1}}\act}%
|
||||
\def\reset@sup{\@supfalse\@sups={}}%
|
||||
\def\mk@scripts#1#2{\if #2/ \if@sup ^{\the\@sups}\fi \else%
|
||||
\ifx #1_ \if@sup ^{\the\@sups}\reset@sup \fi {}_{#2}%
|
||||
\else \append@sup#2 \@suptrue \fi%
|
||||
\expandafter\mk@scripts\fi}
|
||||
\def\tensor#1#2{\reset@sup#1\mk@scripts#2_/}
|
||||
\def\multiscripts#1#2#3{\reset@sup{}\mk@scripts#1_/#2%
|
||||
\reset@sup\mk@scripts#3_/}
|
||||
\makeatother
|
||||
|
||||
% \slash
|
||||
\makeatletter
|
||||
\newbox\slashbox \setbox\slashbox=\hbox{$/$}
|
||||
\def\itex@pslash#1{\setbox\@tempboxa=\hbox{$#1$}
|
||||
\@tempdima=0.5\wd\slashbox \advance\@tempdima 0.5\wd\@tempboxa
|
||||
\copy\slashbox \kern-\@tempdima \box\@tempboxa}
|
||||
\def\slash{\protect\itex@pslash}
|
||||
\makeatother
|
||||
|
||||
% math-mode versions of \rlap, etc
|
||||
% from Alexander Perlis, "A complement to \smash, \llap, and lap"
|
||||
% http://math.arizona.edu/~aprl/publications/mathclap/
|
||||
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
|
||||
\def\mathllap{\mathpalette\mathllapinternal}
|
||||
\def\mathrlap{\mathpalette\mathrlapinternal}
|
||||
\def\mathclap{\mathpalette\mathclapinternal}
|
||||
\def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}}
|
||||
\def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}
|
||||
\def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
|
||||
|
||||
% Renames \sqrt as \oldsqrt and redefine root to result in \sqrt[#1]{#2}
|
||||
\let\oldroot\root
|
||||
\def\root#1#2{\oldroot #1 \of{#2}}
|
||||
\renewcommand{\sqrt}[2][]{\oldroot #1 \of{#2}}
|
||||
|
||||
% Manually declare the txfonts symbolsC font
|
||||
\DeclareSymbolFont{symbolsC}{U}{txsyc}{m}{n}
|
||||
\SetSymbolFont{symbolsC}{bold}{U}{txsyc}{bx}{n}
|
||||
\DeclareFontSubstitution{U}{txsyc}{m}{n}
|
||||
|
||||
% Manually declare the stmaryrd font
|
||||
\DeclareSymbolFont{stmry}{U}{stmry}{m}{n}
|
||||
\SetSymbolFont{stmry}{bold}{U}{stmry}{b}{n}
|
||||
|
||||
% Declare specific arrows from txfonts without loading the full package
|
||||
\makeatletter
|
||||
\def\re@DeclareMathSymbol#1#2#3#4{%
|
||||
\let#1=\undefined
|
||||
\DeclareMathSymbol{#1}{#2}{#3}{#4}}
|
||||
\re@DeclareMathSymbol{\neArrow}{\mathrel}{symbolsC}{116}
|
||||
\re@DeclareMathSymbol{\neArr}{\mathrel}{symbolsC}{116}
|
||||
\re@DeclareMathSymbol{\seArrow}{\mathrel}{symbolsC}{117}
|
||||
\re@DeclareMathSymbol{\seArr}{\mathrel}{symbolsC}{117}
|
||||
\re@DeclareMathSymbol{\nwArrow}{\mathrel}{symbolsC}{118}
|
||||
\re@DeclareMathSymbol{\nwArr}{\mathrel}{symbolsC}{118}
|
||||
\re@DeclareMathSymbol{\swArrow}{\mathrel}{symbolsC}{119}
|
||||
\re@DeclareMathSymbol{\swArr}{\mathrel}{symbolsC}{119}
|
||||
\re@DeclareMathSymbol{\nequiv}{\mathrel}{symbolsC}{46}
|
||||
\re@DeclareMathSymbol{\Perp}{\mathrel}{symbolsC}{121}
|
||||
\re@DeclareMathSymbol{\Vbar}{\mathrel}{symbolsC}{121}
|
||||
\re@DeclareMathSymbol{\sslash}{\mathrel}{stmry}{12}
|
||||
\re@DeclareMathSymbol{\invamp}{\mathrel}{symbolsC}{77}
|
||||
\re@DeclareMathSymbol{\parr}{\mathrel}{symbolsC}{77}
|
||||
\makeatother
|
||||
|
||||
% Widecheck
|
||||
\makeatletter
|
||||
\DeclareRobustCommand\widecheck[1]{{\mathpalette\@widecheck{#1}}}
|
||||
\def\@widecheck#1#2{%
|
||||
\setbox\z@\hbox{\m@th$#1#2$}%
|
||||
\setbox\tw@\hbox{\m@th$#1%
|
||||
\widehat{%
|
||||
\vrule\@width\z@\@height\ht\z@
|
||||
\vrule\@height\z@\@width\wd\z@}$}%
|
||||
\dp\tw@-\ht\z@
|
||||
\@tempdima\ht\z@ \advance\@tempdima2\ht\tw@ \divide\@tempdima\thr@@
|
||||
\setbox\tw@\hbox{%
|
||||
\raise\@tempdima\hbox{\scalebox{1}[-1]{\lower\@tempdima\box
|
||||
\tw@}}}%
|
||||
{\ooalign{\box\tw@ \cr \box\z@}}}
|
||||
\makeatother
|
||||
|
||||
% \mathraisebox{voffset}[height][depth]{something}
|
||||
\makeatletter
|
||||
\NewDocumentCommand\mathraisebox{moom}{%
|
||||
\IfNoValueTF{#2}{\def\@temp##1##2{\raisebox{#1}{$\m@th##1##2$}}}{%
|
||||
\IfNoValueTF{#3}{\def\@temp##1##2{\raisebox{#1}[#2]{$\m@th##1##2$}}%
|
||||
}{\def\@temp##1##2{\raisebox{#1}[#2][#3]{$\m@th##1##2$}}}}%
|
||||
\mathpalette\@temp{#4}}
|
||||
\makeatletter
|
||||
|
||||
% udots (taken from yhmath)
|
||||
\makeatletter
|
||||
\def\udots{\mathinner{\mkern2mu\raise\p@\hbox{.}
|
||||
\mkern2mu\raise4\p@\hbox{.}\mkern1mu
|
||||
\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern1mu}}
|
||||
\makeatother
|
||||
|
||||
%% Fix array
|
||||
\newcommand{\itexarray}[1]{\begin{matrix}#1\end{matrix}}
|
||||
%% \itexnum is a noop
|
||||
\newcommand{\itexnum}[1]{#1}
|
||||
|
||||
%% Renaming existing commands
|
||||
\newcommand{\underoverset}[3]{\underset{#1}{\overset{#2}{#3}}}
|
||||
\newcommand{\widevec}{\overrightarrow}
|
||||
\newcommand{\darr}{\downarrow}
|
||||
\newcommand{\nearr}{\nearrow}
|
||||
\newcommand{\nwarr}{\nwarrow}
|
||||
\newcommand{\searr}{\searrow}
|
||||
\newcommand{\swarr}{\swarrow}
|
||||
\newcommand{\curvearrowbotright}{\curvearrowright}
|
||||
\newcommand{\uparr}{\uparrow}
|
||||
\newcommand{\downuparrow}{\updownarrow}
|
||||
\newcommand{\duparr}{\updownarrow}
|
||||
\newcommand{\updarr}{\updownarrow}
|
||||
\newcommand{\gt}{>}
|
||||
\newcommand{\lt}{<}
|
||||
\newcommand{\map}{\mapsto}
|
||||
\newcommand{\embedsin}{\hookrightarrow}
|
||||
\newcommand{\Alpha}{A}
|
||||
\newcommand{\Beta}{B}
|
||||
\newcommand{\Zeta}{Z}
|
||||
\newcommand{\Eta}{H}
|
||||
\newcommand{\Iota}{I}
|
||||
\newcommand{\Kappa}{K}
|
||||
\newcommand{\Mu}{M}
|
||||
\newcommand{\Nu}{N}
|
||||
\newcommand{\Rho}{P}
|
||||
\newcommand{\Tau}{T}
|
||||
\newcommand{\Upsi}{\Upsilon}
|
||||
\newcommand{\omicron}{o}
|
||||
\newcommand{\lang}{\langle}
|
||||
\newcommand{\rang}{\rangle}
|
||||
\newcommand{\Union}{\bigcup}
|
||||
\newcommand{\Intersection}{\bigcap}
|
||||
\newcommand{\Oplus}{\bigoplus}
|
||||
\newcommand{\Otimes}{\bigotimes}
|
||||
\newcommand{\Wedge}{\bigwedge}
|
||||
\newcommand{\Vee}{\bigvee}
|
||||
\newcommand{\coproduct}{\coprod}
|
||||
\newcommand{\product}{\prod}
|
||||
\newcommand{\closure}{\overline}
|
||||
\newcommand{\integral}{\int}
|
||||
\newcommand{\doubleintegral}{\iint}
|
||||
\newcommand{\tripleintegral}{\iiint}
|
||||
\newcommand{\quadrupleintegral}{\iiiint}
|
||||
\newcommand{\conint}{\oint}
|
||||
\newcommand{\contourintegral}{\oint}
|
||||
\newcommand{\infinity}{\infty}
|
||||
\newcommand{\bottom}{\bot}
|
||||
\newcommand{\minusb}{\boxminus}
|
||||
\newcommand{\plusb}{\boxplus}
|
||||
\newcommand{\timesb}{\boxtimes}
|
||||
\newcommand{\intersection}{\cap}
|
||||
\newcommand{\union}{\cup}
|
||||
\newcommand{\Del}{\nabla}
|
||||
\newcommand{\odash}{\circleddash}
|
||||
\newcommand{\negspace}{\!}
|
||||
\newcommand{\widebar}{\overline}
|
||||
\newcommand{\textsize}{\normalsize}
|
||||
\renewcommand{\scriptsize}{\scriptstyle}
|
||||
\newcommand{\scriptscriptsize}{\scriptscriptstyle}
|
||||
\newcommand{\mathfr}{\mathfrak}
|
||||
\newcommand{\statusline}[2]{#2}
|
||||
\newcommand{\tooltip}[2]{#2}
|
||||
\newcommand{\toggle}[2]{#2}
|
||||
|
||||
% Theorem Environments
|
||||
\theoremstyle{plain}
|
||||
\newtheorem{theorem}{Theorem}
|
||||
\newtheorem{lemma}{Lemma}
|
||||
\newtheorem{prop}{Proposition}
|
||||
\newtheorem{cor}{Corollary}
|
||||
\newtheorem*{utheorem}{Theorem}
|
||||
\newtheorem*{ulemma}{Lemma}
|
||||
\newtheorem*{uprop}{Proposition}
|
||||
\newtheorem*{ucor}{Corollary}
|
||||
\theoremstyle{definition}
|
||||
\newtheorem{defn}{Definition}
|
||||
\newtheorem{example}{Example}
|
||||
\newtheorem*{udefn}{Definition}
|
||||
\newtheorem*{uexample}{Example}
|
||||
\theoremstyle{remark}
|
||||
\newtheorem{remark}{Remark}
|
||||
\newtheorem{note}{Note}
|
||||
\newtheorem*{uremark}{Remark}
|
||||
\newtheorem*{unote}{Note}
|
||||
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
\begin{document}
|
||||
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
<%= @content_for_layout %>
|
||||
|
||||
\end{document}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<h3>Markdown+itex2MML formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://maruku.rubyforge.org/maruku.html#extra">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>, <a target="_new" href="http://golem.ph.utexas.edu/instiki/show/Theorems">theorems</a>)</h3>
|
||||
<h3>Markdown+itex2MML formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://michelf.com/projects/php-markdown/extra/">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>, <a target="_new" href="http://golem.ph.utexas.edu/instiki/show/Theorems">theorems</a>)</h3>
|
||||
<p>For a complete list of LaTeX commands supported here, see the <a href="http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html">itex2MML Commands Summary</a>.</p>
|
||||
<%= render(:file => "markdown_table") -%>
|
|
@ -1,3 +1,3 @@
|
|||
<h3>Markdown+blahtex/PNG formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://maruku.rubyforge.org/#extra">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>)</h3>
|
||||
<h3>Markdown+blahtex/PNG formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://michelf.com/projects/php-markdown/extra/">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>)</h3>
|
||||
<p>For a list of the LaTeX commands supported here, see the <a href="http://www.blahtex.org/manual.html">BlahTeX manual</a>.</p>
|
||||
<%= render(:file => "markdown_table") -%>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://maruku.rubyforge.org/#extra">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>)</h3>
|
||||
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">basics</a>, <a target="_new" href="http://michelf.com/projects/php-markdown/extra/">extended syntax</a>, <a target="_new" href="http://maruku.rubyforge.org/proposal.html">metadata</a>)</h3>
|
||||
<%= render(:file => "markdown_table") -%>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<span id="svg_logo"><svg version="1.1" width="100%" height="100%" viewBox='0 0 180 197' xmlns='http://www.w3.org/2000/svg'>
|
||||
<span id="svg_logo"><svg version="1.1" width="100%" height="100%" viewBox='0 -1 180 198' xmlns='http://www.w3.org/2000/svg'>
|
||||
<path id="svg_logo_path" fill="#<%= @web ? @web.color : "393" %>" stroke-width='0.5' stroke='#000' d='
|
||||
M170,60c4,11-1,20-12,25c-9,4-25,3-20,15c5,5,15,0,24,1c11,1,21,11,14,21c-10,15-35,6-48-1c-5-3-27-23-32-10c-1,13,15,10,22,16
|
||||
c11,4,24,14,34,20c12,10,7,25-9,23c-11-1-22-9-30-16c-5-5-13-18-21-9c-2,6,2,11,5,14c9,9,22,14,22,31c-2,8-12,8-18,4c-4-3-9-8-11-13
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<%- unless @page.linked_from.empty? -%>
|
||||
<span class="linked">
|
||||
| Linked from:
|
||||
<%= @page.linked_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ") %>
|
||||
<%= @page.linked_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ").html_safe %>
|
||||
</span>
|
||||
<%- end -%>
|
||||
|
||||
<%- unless @page.included_from.empty? -%>
|
||||
<span class="linked">
|
||||
| Included from:
|
||||
<%= @page.included_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ") %>
|
||||
<%= @page.included_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ").html_safe %>
|
||||
</span>
|
||||
<%- end -%>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<li>
|
||||
<%= link_to_page author.purify %>
|
||||
co- or authored:
|
||||
<%= @page_names_by_author[author].collect { |page_name| link_to_page(page_name) }.sort.join ', ' %>
|
||||
<%= raw @page_names_by_author[author].collect { |page_name| link_to_page(page_name) }.sort.join ', ' %>
|
||||
</li>
|
||||
<%- end -%>
|
||||
</ul>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%-
|
||||
@title = "Editing #{@page.name.escapeHTML}"
|
||||
@title = "Editing #{@page.name.escapeHTML}".html_safe
|
||||
@content_width = 720
|
||||
@hide_navigation = true
|
||||
-%>
|
||||
|
@ -55,7 +55,8 @@ function toggleVisibility() {
|
|||
}
|
||||
|
||||
function addRedirect(){
|
||||
if (document.getElementById('new_name').value != "<%= escape_javascript(@page.name) %>" ) {
|
||||
var e = document.getElementById('new_name').value;
|
||||
if ( e != "<%= escape_javascript(@page.name) %>" && e != '') {
|
||||
var content = document.getElementById('content');
|
||||
content.value = '[[!redirects <%= escape_javascript(@page.name) %>]]\n' + content.value
|
||||
}
|
||||
|
@ -68,5 +69,11 @@ function cleanAuthorName() {
|
|||
}
|
||||
|
||||
document.forms["editForm"].elements["content"].focus();
|
||||
<%- if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup) -%>
|
||||
setupSVGedit('<%= compute_public_path("editor/svg-editor.html", "svg-edit").split(/\?/)[0] %>');
|
||||
<%- unless @page.categories.include?('S5-slideshow') -%>
|
||||
addS5button('<%= @page.name.escapeHTML %>');
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
//--><!]]>
|
||||
</script>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<a href="<%= url_for :web => @web.address, :action => 'files',
|
||||
:id => file.file_name %>"><%= file.file_name%></a> (<%= file.created_at.asctime %>) <span class="linked"><%= "Linked to by: " unless
|
||||
@web.pages_that_link_to_file(file.file_name).empty? -%>
|
||||
<%= @web.pages_that_link_to_file(file.file_name).collect { |referring_page| link_to_page(referring_page) }.join(", ") %></span>
|
||||
<%= @web.pages_that_link_to_file(file.file_name).collect { |referring_page| link_to_page(referring_page) }.join(", ").html_safe %></span>
|
||||
</li>
|
||||
<%- end -%>
|
||||
</ul>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%- @title = @page.plain_name + " (history)" -%>
|
||||
<%- @title = @page.plain_name + " (history)".html_safe -%>
|
||||
<%- @show_footer = true -%>
|
||||
|
||||
<%- @revisions_by_day.keys.sort.reverse.each do |day| -%>
|
||||
|
@ -7,7 +7,7 @@
|
|||
<%- for rev in @revisions_by_day[day] -%>
|
||||
<li>
|
||||
<%= link_to_revision(rev.page, @revision_numbers[rev.id],
|
||||
text= (rev.page.revisions.size == @revision_numbers[rev.id] ?
|
||||
text= (rev.page.rev_ids.size == @revision_numbers[rev.id] ?
|
||||
"Current" :
|
||||
"Revision #{@revision_numbers[rev.id]}" )
|
||||
) %>
|
||||
|
|
|
@ -6,10 +6,34 @@
|
|||
<%- unless @pages_that_are_orphaned.empty? && @page_names_that_are_wanted.empty? -%>
|
||||
<h2>
|
||||
All Pages
|
||||
<br/><span class="pageType">All pages in <%= @set_name %> listed alphabetically</span>
|
||||
<br/><span class="pageType">All pages in <%= raw @set_name %> listed alphabetically</span>
|
||||
</h2>
|
||||
<%- end -%>
|
||||
|
||||
<% if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup) -%>
|
||||
<% form_tag({ :controller => 'wiki', :action => 'tex_list', :web => @web.address },
|
||||
{'method' => 'post', 'accept-charset' => 'utf-8' }) do
|
||||
%>
|
||||
<div>
|
||||
<% if params['category'] -%>
|
||||
<input type="hidden" name="category" value="<%= params['category'] %>"/>
|
||||
<%- end -%>
|
||||
<ul id="sortable_pages">
|
||||
<% @pages_in_category.each do |page| %>
|
||||
<% content_tag_for :li, page do %>
|
||||
|
||||
<input type="checkbox" name="<%= page.name %>" value="tex"/>
|
||||
<%= link_to_existing_page page, truncate(page.plain_name, :length => 35) %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= sortable_element('sortable_pages', {:onUpdate => 'function(){}'}) %>
|
||||
<label for="commit"> Export selected pages (drag to re-order them) to a LaTeX file.</label>
|
||||
<%= submit_tag("Export") %>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<%- else -%>
|
||||
<ul>
|
||||
<%- @pages_in_category.each do |page| -%>
|
||||
<li>
|
||||
|
@ -17,6 +41,7 @@
|
|||
</li>
|
||||
<%- end -%>
|
||||
</ul>
|
||||
<%- end -%>
|
||||
|
||||
<%- if @web.count_pages? -%>
|
||||
<% total_chars = @pages_in_category.characters %>
|
||||
|
@ -30,7 +55,7 @@
|
|||
Wanted Pages
|
||||
<br/>
|
||||
<span class="pageType">
|
||||
Nonexistent pages that other pages in <%= @set_name %> reference
|
||||
Nonexistent pages that other pages in <%= raw @set_name %> reference
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
|
@ -41,7 +66,7 @@
|
|||
wanted by
|
||||
<%= @web.select.pages_that_reference(wanted_page_name).collect { |referring_page|
|
||||
link_to_existing_page referring_page
|
||||
}.join(", ")
|
||||
}.join(", ").html_safe
|
||||
%>
|
||||
</li>
|
||||
<%- end -%>
|
||||
|
@ -51,7 +76,7 @@
|
|||
<%- unless @pages_that_are_orphaned.empty? -%>
|
||||
<h2>
|
||||
Orphaned Pages
|
||||
<br/><span class="pageType">Pages in <%= @set_name %> that no other page reference</span>
|
||||
<br/><span class="pageType">Pages in <%= raw @set_name %> that no other page reference</span>
|
||||
</h2>
|
||||
|
||||
<ul style="margin-bottom: 35px">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%- @title = "#{@page.plain_name} is locked" -%>
|
||||
<%- @title = "#{@page.plain_name} is locked".html_safe -%>
|
||||
|
||||
<p>
|
||||
<%= link_to_page(h(@page.locked_by.purify)) %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%-
|
||||
@title = "Creating #{CGI.escapeHTML(WikiWords.separate(@page_name))}"
|
||||
@title = "Creating #{WikiWords.separate(@page_name).escapeHTML}".html_safe
|
||||
@content_width = 720
|
||||
@hide_navigation = true
|
||||
-%>
|
||||
|
@ -31,4 +31,8 @@ function cleanAuthorName() {
|
|||
}
|
||||
}
|
||||
document.forms["editForm"].elements["content"].focus();
|
||||
<%- if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup) -%>
|
||||
setupSVGedit('<%= compute_public_path("editor/svg-editor.html", "svg-edit").split(/\?/)[0] %>');
|
||||
addS5button('<%= @page_name.escapeHTML %>');
|
||||
<%- end -%>
|
||||
</script>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<%-
|
||||
@title = @page.plain_name
|
||||
@title += ' (changes)' if @show_diff
|
||||
@title += ' (changes)' if @show_diff
|
||||
@show_footer = true
|
||||
-%>
|
||||
|
||||
<div id="revision">
|
||||
<%- if @show_diff -%>
|
||||
<p class="show_diff">
|
||||
Showing changes from revision #<%= @page.revisions.size - 1 %> to #<%= @page.revisions.size %>:
|
||||
Showing changes from revision #<%= @page.rev_ids.size - 1 %> to #<%= @page.rev_ids.size %>:
|
||||
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del> | <del class="diffmod">Chan</del><ins class="diffmod">ged</ins>
|
||||
</p>
|
||||
<%= @renderer.display_diff %>
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
<div class="byline">
|
||||
<%= @page.revisions? ? "Revised" : "Created" %> on <%= format_date(@page.revised_at) %>
|
||||
by <%= author_link(@page).purify %>
|
||||
by <%= author_link(@page) %>
|
||||
<%= "(#{@page.author.ip})" if @page.author.respond_to?(:ip) %>
|
||||
<% if @web.count_pages? %>
|
||||
<% total_chars = @page.content.length %>
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
<div class="navigation navfoot">
|
||||
|
||||
<%= navigation_menu_for_page.join(' | ') %>
|
||||
<%= raw navigation_menu_for_page.join(' | ') %>
|
||||
|
||||
<span class="views">
|
||||
| Views:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
|
||||
-%>
|
||||
|
||||
<%= @renderer.display_content_for_export %>
|
||||
<%= @renderer.display_content %>
|
||||
|
||||
<div class="byline">
|
||||
<%= @page.revisions? ? "Revised" : "Created" %> on <%= format_date(@page.revised_at) %>
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
<%- for page in @pages_by_day[day] -%>
|
||||
<li>
|
||||
<%= link_to_existing_page page %>
|
||||
<%- if page.revisions.size > 1 %>
|
||||
<%- if page.rev_ids.size > 1 %>
|
||||
<span class="views">
|
||||
( <%= link_to_revision(page, page.revisions.size, text='diff',
|
||||
( <%= link_to_revision(page, page.rev_ids.size, text='diff',
|
||||
mode='diff') %> | <%= link_to_history(page, text='history') %> )
|
||||
</span>
|
||||
<%- end -%>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%-
|
||||
@title = "#{@page.plain_name} (Rev ##{@revision_number}#{@show_diff ? ', changes' : ''})"
|
||||
@title = "#{@page.plain_name} (Rev ##{@revision_number}#{@show_diff ? ', changes' : ''})".html_safe
|
||||
-%>
|
||||
|
||||
|
||||
|
@ -21,6 +21,11 @@
|
|||
</div>
|
||||
|
||||
<div class="navigation navfoot">
|
||||
<%= navigation_menu_for_revision.join(' | ') %>
|
||||
<%= raw navigation_menu_for_revision.join(' | ') %>
|
||||
<span class="views">
|
||||
| View:
|
||||
<%= link_to 'Source', {:web => @web.address, :action => 'source', :id => @page.name, :rev => @revision_number},
|
||||
{:id => 'view_source', :rel => 'nofollow' } %>
|
||||
</span>
|
||||
<%= render :partial => 'inbound_links' %>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%-
|
||||
@title = "Rollback to #{@page.plain_name} Rev ##{@revision_number}"
|
||||
@title = "Rollback to #{@page.plain_name} Rev ##{@revision_number}".html_safe
|
||||
@content_width = 720
|
||||
@hide_navigation = true
|
||||
-%>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
|
@ -22,6 +21,23 @@
|
|||
|
||||
<!-- S5 JS -->
|
||||
<%= javascript_include_tag 'prototype' %>
|
||||
<%- if @web.markup == :markdownMML -%>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
MathML: { useMathMLspacing: true },
|
||||
"HTML-CSS": { scale: 90 }
|
||||
});
|
||||
if (window._onload_fired_) MathJax.Hub.Startup.onload();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
if (!(Prototype.Browser.Gecko || navigator.userAgent.match(/MathPlayer/))) {
|
||||
var s = document.createElement('script');
|
||||
s.src = "<%= compute_public_path('MathJax.js', 'MathJax').split('?')[0] %>?config=MML_HTMLorMML";
|
||||
document.querySelector('head').appendChild(s);
|
||||
window.addEventListener("load", function(){window._onload_fired_ = true} , false);
|
||||
};
|
||||
</script>
|
||||
<%- end -%>
|
||||
<%= javascript_include_tag "/s5/ui/core/slides.js" %>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%- @title = "Search results for \"#{h @query}\"" -%>
|
||||
<%- @title = "Search results for \"#{h @query}\"".html_safe -%>
|
||||
|
||||
<%- unless @title_results.empty? -%>
|
||||
<h2><%= @title_results.length %> page(s) containing search string in the page name:</h2>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<%- end -%>
|
||||
|
||||
<%- if (@results + @title_results).empty? -%>
|
||||
<h2>No pages contain "<%= h @query %>" </h2>
|
||||
<h2>No pages contain "<%= h(@query).html_safe %>" </h2>
|
||||
<p>
|
||||
Perhaps you should try expanding your query. Remember that Instiki searches for entire
|
||||
phrases, so if you search for "all that jazz" it will not match pages that contain these
|
||||
|
@ -36,6 +36,6 @@
|
|||
"[a-z]*Leet?RegExpSkill(s|z)"
|
||||
</p>
|
||||
<p>
|
||||
<b>Create a new page, named:</b> "<span class='newWikiWord'><%= link_to h(@query), :web => @web.address, :action => 'new', :id => @query %></span>"
|
||||
<b>Create a new page, named:</b> "<span class='newWikiWord'><%= link_to h(@query).html_safe, :web => @web.address, :action => 'new', :id => @query %></span>"
|
||||
</p>
|
||||
<%- end -%>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<%= Rails.root.join('public', 'stylesheets', 'instiki.css').read if @inline_style %>
|
||||
</style>
|
||||
<%= stylesheet_link_tag 'instiki', :media => 'all' unless @inline_style %>
|
||||
<%= "<style type='text/css'>#{@style_additions}</style>" if @style_additions %>
|
||||
<%= "<style type='text/css'>#{@style_additions}</style>".html_safe if @style_additions %>
|
||||
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
|
||||
<%= @web ? @web.additional_style : '' %>
|
||||
/*]]>*/--></style>
|
||||
|
@ -57,7 +57,7 @@ window.onload = function (){
|
|||
<body>
|
||||
|
||||
<div id="Container">
|
||||
<textarea id='content' readonly=' readonly' rows='24' cols='60' ><%= h(@page.content.purify) %></textarea>
|
||||
<textarea id='content' readonly=' readonly' rows='24' cols='60' ><%= (@revision ? @revision.content : @page.content).purify %></textarea>
|
||||
</div> <!-- Container -->
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,252 +1,3 @@
|
|||
\documentclass[12pt,titlepage]{article}
|
||||
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsthm}
|
||||
\usepackage{mathtools}
|
||||
<%- if @tex_content =~ /\\mathbb\{[^}]*[a-z0-9]+[^}]*\}/ -%>
|
||||
\usepackage{mathbbol}
|
||||
<% end -%>
|
||||
\usepackage{graphicx}
|
||||
\usepackage{color}
|
||||
\usepackage{ucs}
|
||||
\usepackage[utf8x]{inputenc}
|
||||
\usepackage{hyperref}
|
||||
|
||||
%----Macros----------
|
||||
%
|
||||
% Unresolved issues:
|
||||
%
|
||||
% \righttoleftarrow
|
||||
% \lefttorightarrow
|
||||
%
|
||||
% \color{} with HTML colorspec
|
||||
% \bgcolor
|
||||
% \array
|
||||
|
||||
% Of the standard HTML named colors, white, black, red, green, blue and yellow
|
||||
% are predefined in the color package. Here are the rest.
|
||||
\definecolor{aqua}{rgb}{0, 1.0, 1.0}
|
||||
\definecolor{fuschia}{rgb}{1.0, 0, 1.0}
|
||||
\definecolor{gray}{rgb}{0.502, 0.502, 0.502}
|
||||
\definecolor{lime}{rgb}{0, 1.0, 0}
|
||||
\definecolor{maroon}{rgb}{0.502, 0, 0}
|
||||
\definecolor{navy}{rgb}{0, 0, 0.502}
|
||||
\definecolor{olive}{rgb}{0.502, 0.502, 0}
|
||||
\definecolor{purple}{rgb}{0.502, 0, 0.502}
|
||||
\definecolor{silver}{rgb}{0.753, 0.753, 0.753}
|
||||
\definecolor{teal}{rgb}{0, 0.502, 0.502}
|
||||
|
||||
% Because of conflicts, \space and \mathop are converted to
|
||||
% \itexspace and \operatorname during preprocessing.
|
||||
|
||||
% itex: \space{ht}{dp}{wd}
|
||||
%
|
||||
% Height and baseline depth measurements are in units of tenths of an ex while
|
||||
% the width is measured in tenths of an em.
|
||||
\makeatletter
|
||||
\newdimen\itex@wd%
|
||||
\newdimen\itex@dp%
|
||||
\newdimen\itex@thd%
|
||||
\def\itexspace#1#2#3{\itex@wd=#3em%
|
||||
\itex@wd=0.1\itex@wd%
|
||||
\itex@dp=#2ex%
|
||||
\itex@dp=0.1\itex@dp%
|
||||
\itex@thd=#1ex%
|
||||
\itex@thd=0.1\itex@thd%
|
||||
\advance\itex@thd\the\itex@dp%
|
||||
\makebox[\the\itex@wd]{\rule[-\the\itex@dp]{0cm}{\the\itex@thd}}}
|
||||
\makeatother
|
||||
|
||||
% \tensor and \multiscript
|
||||
\makeatletter
|
||||
\newif\if@sup
|
||||
\newtoks\@sups
|
||||
\def\append@sup#1{\edef\act{\noexpand\@sups={\the\@sups #1}}\act}%
|
||||
\def\reset@sup{\@supfalse\@sups={}}%
|
||||
\def\mk@scripts#1#2{\if #2/ \if@sup ^{\the\@sups}\fi \else%
|
||||
\ifx #1_ \if@sup ^{\the\@sups}\reset@sup \fi {}_{#2}%
|
||||
\else \append@sup#2 \@suptrue \fi%
|
||||
\expandafter\mk@scripts\fi}
|
||||
\def\tensor#1#2{\reset@sup#1\mk@scripts#2_/}
|
||||
\def\multiscripts#1#2#3{\reset@sup{}\mk@scripts#1_/#2%
|
||||
\reset@sup\mk@scripts#3_/}
|
||||
\makeatother
|
||||
|
||||
% \slash
|
||||
\makeatletter
|
||||
\newbox\slashbox \setbox\slashbox=\hbox{$/$}
|
||||
\def\itex@pslash#1{\setbox\@tempboxa=\hbox{$#1$}
|
||||
\@tempdima=0.5\wd\slashbox \advance\@tempdima 0.5\wd\@tempboxa
|
||||
\copy\slashbox \kern-\@tempdima \box\@tempboxa}
|
||||
\def\slash{\protect\itex@pslash}
|
||||
\makeatother
|
||||
|
||||
% math-mode versions of \rlap, etc
|
||||
% from Alexander Perlis, "A complement to \smash, \llap, and lap"
|
||||
% http://math.arizona.edu/~aprl/publications/mathclap/
|
||||
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
|
||||
\def\mathllap{\mathpalette\mathllapinternal}
|
||||
\def\mathrlap{\mathpalette\mathrlapinternal}
|
||||
\def\mathclap{\mathpalette\mathclapinternal}
|
||||
\def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}}
|
||||
\def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}}
|
||||
\def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
|
||||
|
||||
% Renames \sqrt as \oldsqrt and redefine root to result in \sqrt[#1]{#2}
|
||||
\let\oldroot\root
|
||||
\def\root#1#2{\oldroot #1 \of{#2}}
|
||||
|
||||
% Manually declare the txfonts symbolsC font
|
||||
\DeclareSymbolFont{symbolsC}{U}{txsyc}{m}{n}
|
||||
\SetSymbolFont{symbolsC}{bold}{U}{txsyc}{bx}{n}
|
||||
\DeclareFontSubstitution{U}{txsyc}{m}{n}
|
||||
|
||||
% Manually declare the stmaryrd font
|
||||
\DeclareSymbolFont{stmry}{U}{stmry}{m}{n}
|
||||
\SetSymbolFont{stmry}{bold}{U}{stmry}{b}{n}
|
||||
|
||||
% Declare specific arrows from txfonts without loading the full package
|
||||
\makeatletter
|
||||
\def\re@DeclareMathSymbol#1#2#3#4{%
|
||||
\let#1=\undefined
|
||||
\DeclareMathSymbol{#1}{#2}{#3}{#4}}
|
||||
\re@DeclareMathSymbol{\neArrow}{\mathrel}{symbolsC}{116}
|
||||
\re@DeclareMathSymbol{\neArr}{\mathrel}{symbolsC}{116}
|
||||
\re@DeclareMathSymbol{\seArrow}{\mathrel}{symbolsC}{117}
|
||||
\re@DeclareMathSymbol{\seArr}{\mathrel}{symbolsC}{117}
|
||||
\re@DeclareMathSymbol{\nwArrow}{\mathrel}{symbolsC}{118}
|
||||
\re@DeclareMathSymbol{\nwArr}{\mathrel}{symbolsC}{118}
|
||||
\re@DeclareMathSymbol{\swArrow}{\mathrel}{symbolsC}{119}
|
||||
\re@DeclareMathSymbol{\swArr}{\mathrel}{symbolsC}{119}
|
||||
\re@DeclareMathSymbol{\nequiv}{\mathrel}{symbolsC}{46}
|
||||
\re@DeclareMathSymbol{\Perp}{\mathrel}{symbolsC}{121}
|
||||
\re@DeclareMathSymbol{\Vbar}{\mathrel}{symbolsC}{121}
|
||||
\re@DeclareMathSymbol{\sslash}{\mathrel}{stmry}{12}
|
||||
\re@DeclareMathSymbol{\invamp}{\mathrel}{symbolsC}{77}
|
||||
\re@DeclareMathSymbol{\parr}{\mathrel}{symbolsC}{77}
|
||||
\makeatother
|
||||
|
||||
% Widecheck
|
||||
\makeatletter
|
||||
\DeclareRobustCommand\widecheck[1]{{\mathpalette\@widecheck{#1}}}
|
||||
\def\@widecheck#1#2{%
|
||||
\setbox\z@\hbox{\m@th$#1#2$}%
|
||||
\setbox\tw@\hbox{\m@th$#1%
|
||||
\widehat{%
|
||||
\vrule\@width\z@\@height\ht\z@
|
||||
\vrule\@height\z@\@width\wd\z@}$}%
|
||||
\dp\tw@-\ht\z@
|
||||
\@tempdima\ht\z@ \advance\@tempdima2\ht\tw@ \divide\@tempdima\thr@@
|
||||
\setbox\tw@\hbox{%
|
||||
\raise\@tempdima\hbox{\scalebox{1}[-1]{\lower\@tempdima\box
|
||||
\tw@}}}%
|
||||
{\ooalign{\box\tw@ \cr \box\z@}}}
|
||||
\makeatother
|
||||
|
||||
% udots (taken from yhmath)
|
||||
\makeatletter
|
||||
\def\udots{\mathinner{\mkern2mu\raise\p@\hbox{.}
|
||||
\mkern2mu\raise4\p@\hbox{.}\mkern1mu
|
||||
\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern1mu}}
|
||||
\makeatother
|
||||
|
||||
%% Renaming existing commands
|
||||
\newcommand{\underoverset}[3]{\underset{#1}{\overset{#2}{#3}}}
|
||||
\newcommand{\widevec}{\overrightarrow}
|
||||
\newcommand{\darr}{\downarrow}
|
||||
\newcommand{\nearr}{\nearrow}
|
||||
\newcommand{\nwarr}{\nwarrow}
|
||||
\newcommand{\searr}{\searrow}
|
||||
\newcommand{\swarr}{\swarrow}
|
||||
\newcommand{\curvearrowbotright}{\curvearrowright}
|
||||
\newcommand{\uparr}{\uparrow}
|
||||
\newcommand{\downuparrow}{\updownarrow}
|
||||
\newcommand{\duparr}{\updownarrow}
|
||||
\newcommand{\updarr}{\updownarrow}
|
||||
\newcommand{\gt}{>}
|
||||
\newcommand{\lt}{<}
|
||||
\newcommand{\map}{\mapsto}
|
||||
\newcommand{\embedsin}{\hookrightarrow}
|
||||
\newcommand{\Alpha}{A}
|
||||
\newcommand{\Beta}{B}
|
||||
\newcommand{\Zeta}{Z}
|
||||
\newcommand{\Eta}{H}
|
||||
\newcommand{\Iota}{I}
|
||||
\newcommand{\Kappa}{K}
|
||||
\newcommand{\Mu}{M}
|
||||
\newcommand{\Nu}{N}
|
||||
\newcommand{\Rho}{P}
|
||||
\newcommand{\Tau}{T}
|
||||
\newcommand{\Upsi}{\Upsilon}
|
||||
\newcommand{\omicron}{o}
|
||||
\newcommand{\lang}{\langle}
|
||||
\newcommand{\rang}{\rangle}
|
||||
\newcommand{\Union}{\bigcup}
|
||||
\newcommand{\Intersection}{\bigcap}
|
||||
\newcommand{\Oplus}{\bigoplus}
|
||||
\newcommand{\Otimes}{\bigotimes}
|
||||
\newcommand{\Wedge}{\bigwedge}
|
||||
\newcommand{\Vee}{\bigvee}
|
||||
\newcommand{\coproduct}{\coprod}
|
||||
\newcommand{\product}{\prod}
|
||||
\newcommand{\closure}{\overline}
|
||||
\newcommand{\integral}{\int}
|
||||
\newcommand{\doubleintegral}{\iint}
|
||||
\newcommand{\tripleintegral}{\iiint}
|
||||
\newcommand{\quadrupleintegral}{\iiiint}
|
||||
\newcommand{\conint}{\oint}
|
||||
\newcommand{\contourintegral}{\oint}
|
||||
\newcommand{\infinity}{\infty}
|
||||
\renewcommand{\empty}{\emptyset}
|
||||
\newcommand{\bottom}{\bot}
|
||||
\newcommand{\minusb}{\boxminus}
|
||||
\newcommand{\plusb}{\boxplus}
|
||||
\newcommand{\timesb}{\boxtimes}
|
||||
\newcommand{\intersection}{\cap}
|
||||
\newcommand{\union}{\cup}
|
||||
\newcommand{\Del}{\nabla}
|
||||
\newcommand{\odash}{\circleddash}
|
||||
\newcommand{\negspace}{\!}
|
||||
\newcommand{\widebar}{\overline}
|
||||
\newcommand{\textsize}{\normalsize}
|
||||
\renewcommand{\scriptsize}{\scriptstyle}
|
||||
\newcommand{\scriptscriptsize}{\scriptscriptstyle}
|
||||
\newcommand{\mathfr}{\mathfrak}
|
||||
\newcommand{\statusline}[2]{#2}
|
||||
\newcommand{\tooltip}[2]{#2}
|
||||
\newcommand{\toggle}[2]{#2}
|
||||
|
||||
% Theorem Environments
|
||||
\theoremstyle{plain}
|
||||
\newtheorem{theorem}{Theorem}
|
||||
\newtheorem{lemma}{Lemma}
|
||||
\newtheorem{prop}{Proposition}
|
||||
\newtheorem{cor}{Corollary}
|
||||
\newtheorem*{utheorem}{Theorem}
|
||||
\newtheorem*{ulemma}{Lemma}
|
||||
\newtheorem*{uprop}{Proposition}
|
||||
\newtheorem*{ucor}{Corollary}
|
||||
\theoremstyle{definition}
|
||||
\newtheorem{defn}{Definition}
|
||||
\newtheorem{example}{Example}
|
||||
\newtheorem*{udefn}{Definition}
|
||||
\newtheorem*{uexample}{Example}
|
||||
\theoremstyle{remark}
|
||||
\newtheorem{remark}{Remark}
|
||||
\newtheorem{note}{Note}
|
||||
\newtheorem*{uremark}{Remark}
|
||||
\newtheorem*{unote}{Note}
|
||||
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
\begin{document}
|
||||
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
\section*{<%= @page.name %>}
|
||||
|
||||
<%= @tex_content %>
|
||||
|
||||
\end{document}
|
||||
<%= @tex_content.html_safe %>
|
|
@ -0,0 +1 @@
|
|||
<%= @tex_content.html_safe %>
|
|
@ -19,7 +19,7 @@
|
|||
- Last Update: <%= web.last_page.nil? ? format_date(web.created_at) : format_date(web.last_page.revised_at) %><br/>
|
||||
<%- if ! web.last_page.nil? -%>
|
||||
Last Document: <%= link_to_page(web.last_page.name,web) %>
|
||||
<%= web.last_page.revisions? ? "Revised" : "Created" %> by <%= author_link(web.last_page).purify %> (<%= web.last_page.current_revision.ip %>)
|
||||
<%= web.last_page.revisions? ? "Revised" : "Created" %> by <%= author_link(web.last_page) %> (<%= web.last_page.current_revision.ip %>)
|
||||
<%- end -%>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# This file was generated by RubyGems.
|
||||
#
|
||||
# The application 'bundler' is installed as part of a gem, and
|
||||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require 'rubygems'
|
||||
vend = File.join(File.dirname(__FILE__), 'vendor')
|
||||
Gem.use_paths File.join(vend, 'bundle', File.basename(Gem.dir)), (Gem.path + [File.join(vend, 'plugins', 'bundler')])
|
||||
|
||||
version = ">= 0"
|
||||
|
||||
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
||||
version = $1
|
||||
ARGV.shift
|
||||
end
|
||||
|
||||
gem 'bundler', version
|
||||
load Gem.bin_path('bundler', 'bundle', version)
|
|
@ -1,7 +1,7 @@
|
|||
# Don't change this file!
|
||||
# Configure your app in config/environment.rb and config/environments/*.rb
|
||||
|
||||
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
||||
RAILS_ROOT = File.join(File.dirname(__FILE__), '..') unless defined?(RAILS_ROOT)
|
||||
|
||||
module Rails
|
||||
class << self
|
||||
|
@ -21,7 +21,7 @@ module Rails
|
|||
end
|
||||
|
||||
def vendor_rails?
|
||||
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
||||
File.exist?(File.join(RAILS_ROOT, 'vendor', 'rails'))
|
||||
end
|
||||
|
||||
def preinitialize
|
||||
|
@ -29,7 +29,7 @@ module Rails
|
|||
end
|
||||
|
||||
def preinitializer_path
|
||||
"#{RAILS_ROOT}/config/preinitializer.rb"
|
||||
File.join(RAILS_ROOT, 'config', 'preinitializer.rb')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -42,8 +42,9 @@ module Rails
|
|||
|
||||
class VendorBoot < Boot
|
||||
def load_initializer
|
||||
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
||||
require File.join(RAILS_ROOT, 'vendor', 'rails', 'railties', 'lib', 'initializer')
|
||||
Rails::Initializer.run(:install_gem_spec_stubs)
|
||||
Rails::GemDependency.add_frozen_gem_path
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -67,7 +68,7 @@ module Rails
|
|||
|
||||
class << self
|
||||
def rubygems_version
|
||||
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
||||
Gem::RubyGemsVersion rescue nil
|
||||
end
|
||||
|
||||
def gem_version
|
||||
|
@ -81,15 +82,15 @@ module Rails
|
|||
end
|
||||
|
||||
def load_rubygems
|
||||
min_version = '1.3.6'
|
||||
require 'rubygems'
|
||||
|
||||
unless rubygems_version >= '0.9.4'
|
||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
unless rubygems_version >= min_version
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
exit 1
|
||||
end
|
||||
|
||||
rescue LoadError
|
||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
@ -99,11 +100,25 @@ module Rails
|
|||
|
||||
private
|
||||
def read_environment_rb
|
||||
File.read("#{RAILS_ROOT}/config/environment.rb")
|
||||
File.read(File.join(RAILS_ROOT, 'config', 'environment.rb'))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Rails::Boot
|
||||
def run
|
||||
load_initializer
|
||||
|
||||
Rails::Initializer.class_eval do
|
||||
def load_gems
|
||||
@bundler_loaded ||= Bundler.require :default, Rails.env
|
||||
end
|
||||
end
|
||||
|
||||
Rails::Initializer.run(:set_load_path)
|
||||
end
|
||||
end
|
||||
|
||||
# All that for this:
|
||||
Rails.boot!
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
####
|
||||
|
||||
# Make sure we are using the latest rexml
|
||||
rexml_versions = ['', File.dirname(__FILE__) + '/../vendor/plugins/rexml/lib/'].collect { |v|
|
||||
`ruby -r #{v + 'rexml/rexml'} -e 'p REXML::VERSION'`.split('.').collect {|n| n.to_i} }
|
||||
$:.unshift(File.dirname(__FILE__) + '/../vendor/plugins/rexml/lib') if (rexml_versions[0] <=> rexml_versions[1]) == -1
|
||||
rexml_versions = ['', File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'rexml', 'lib', '')].collect { |v|
|
||||
`ruby -r "#{v + 'rexml/rexml'}" -e 'p REXML::VERSION'`.split('.').collect {|n| n.to_i} }
|
||||
$:.unshift(File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'rexml', 'lib')) if (rexml_versions[0] <=> rexml_versions[1]) == -1
|
||||
|
||||
require File.join(File.dirname(__FILE__), 'boot')
|
||||
|
||||
|
@ -26,7 +26,7 @@ Rails::Initializer.run do |config|
|
|||
File.open(secret_file, 'w', 0600) { |f| f.write(secret) }
|
||||
end
|
||||
config.action_controller.session = {
|
||||
:session_key => "instiki_session",
|
||||
:key => "instiki_session",
|
||||
:secret => secret
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,11 @@ end
|
|||
require_dependency 'instiki_errors'
|
||||
|
||||
#require 'jcode'
|
||||
|
||||
# Miscellaneous monkey patches (here be dragons ...)
|
||||
require 'caching_stuff'
|
||||
require 'logging_stuff'
|
||||
require 'rack_stuff'
|
||||
|
||||
#Additional Mime-types
|
||||
mime_types = YAML.load_file(File.join(File.dirname(__FILE__), 'mime_types.yml'))
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
begin
|
||||
require "rubygems"
|
||||
vend = File.join(File.dirname(__FILE__), '..', 'vendor')
|
||||
Gem.use_paths File.join(vend, 'bundle', File.basename(Gem.dir)), (Gem.path + [File.join(vend, 'plugins', 'bundler')])
|
||||
require "bundler"
|
||||
rescue LoadError
|
||||
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
||||
end
|
||||
|
||||
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
||||
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
||||
"Run `gem install bundler` to upgrade."
|
||||
end
|
||||
|
||||
begin
|
||||
# Set up load paths for all bundled gems
|
||||
ENV["BUNDLE_GEMFILE"] = File.join(File.dirname(File.dirname(__FILE__)), 'Gemfile')
|
||||
Bundler.setup
|
||||
rescue Bundler::GemNotFound
|
||||
raise RuntimeError, "Bundler couldn't find some gems." +
|
||||
"Did you run `bundle install`?"
|
||||
end
|
||||
|
|
@ -8,6 +8,9 @@ def connect_to_web(map, generic_path, generic_routing_options)
|
|||
map.connect(generic_path, generic_routing_options)
|
||||
end
|
||||
|
||||
# :id's can be arbitrary junk
|
||||
id_regexp = /.+/
|
||||
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
||||
map.connect 'create_web', :controller => 'admin', :action => 'create_web'
|
||||
|
@ -25,12 +28,14 @@ ActionController::Routing::Routes.draw do |map|
|
|||
connect_to_web map, ':web/import/:id', :controller => 'file', :action => 'import'
|
||||
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login'
|
||||
connect_to_web map, ':web/web_list', :controller => 'wiki', :action => 'web_list'
|
||||
connect_to_web map, ':web/show/diff/:id', :controller => 'wiki', :action => 'show', :mode => 'diff'
|
||||
connect_to_web map, ':web/revision/diff/:id/:rev', :controller => 'wiki', :action => 'revision', :mode => 'diff', :requirements => { :rev => /\d*/}
|
||||
connect_to_web map, ':web/revision/:id/:rev', :controller => 'wiki', :action => 'revision', :requirements => { :rev => /\d*/}
|
||||
connect_to_web map, ':web/show/diff/:id', :controller => 'wiki', :action => 'show', :mode => 'diff', :requirements => {:id => id_regexp}
|
||||
connect_to_web map, ':web/revision/diff/:id/:rev', :controller => 'wiki', :action => 'revision', :mode => 'diff',
|
||||
:requirements => { :rev => /\d+/, :id => id_regexp}
|
||||
connect_to_web map, ':web/revision/:id/:rev', :controller => 'wiki', :action => 'revision', :requirements => { :rev => /\d+/, :id => id_regexp}
|
||||
connect_to_web map, ':web/source/:id/:rev', :controller => 'wiki', :action => 'source', :requirements => { :rev => /\d+/, :id => id_regexp}
|
||||
connect_to_web map, ':web/list/:category', :controller => 'wiki', :action => 'list', :requirements => { :category => /.*/}, :category => nil
|
||||
connect_to_web map, ':web/recently_revised/:category', :controller => 'wiki', :action => 'recently_revised', :requirements => { :category => /.*/}, :category => nil
|
||||
connect_to_web map, ':web/:action/:id', :controller => 'wiki'
|
||||
connect_to_web map, ':web/:action/:id', :controller => 'wiki', :requirements => {:id => id_regexp}
|
||||
connect_to_web map, ':web/:action', :controller => 'wiki'
|
||||
connect_to_web map, ':web', :controller => 'wiki', :action => 'index'
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
require "rubygems"
|
||||
vend = File.join(File.dirname(__FILE__), '..', 'vendor')
|
||||
Gem.use_paths File.join(vend, 'bundle', File.basename(Gem.dir)), (Gem.path + [File.join(vend, 'plugins', 'bundler')])
|
|
@ -1,6 +1,8 @@
|
|||
class ModifyTextTypes < ActiveRecord::Migration
|
||||
def self.up
|
||||
change_column :revisions, :content, :text, :limit => 16777215
|
||||
unless adapter_name.eql?('PostgreSQL')
|
||||
change_column :revisions, :content, :text, :limit => 16777215
|
||||
end
|
||||
change_column :pages, :name, :string, :limit => 255
|
||||
change_column :webs, :additional_style, :text
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
class ModifyReferencedNameType < ActiveRecord::Migration
|
||||
def self.up
|
||||
change_column :wiki_references, :referenced_name, :string, :limit => 255
|
||||
end
|
||||
|
||||
def self.down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Binary file not shown.
97
db/schema.rb
97
db/schema.rb
|
@ -1,26 +1,33 @@
|
|||
# This file is autogenerated. Instead of editing this file, please use the
|
||||
# migrations feature of ActiveRecord to incrementally modify your database, and
|
||||
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
||||
# please use the migrations feature of Active Record to incrementally modify your database, and
|
||||
# then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
||||
# to create the application database on another system, you should be using db:schema:load, not running
|
||||
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 2) do
|
||||
ActiveRecord::Schema.define(:version => 20100101192755) do
|
||||
|
||||
create_table "pages", :force => true do |t|
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "updated_at", :datetime, :null => false
|
||||
t.column "web_id", :integer, :default => 0, :null => false
|
||||
t.column "locked_by", :string, :limit => 60
|
||||
t.column "name", :string, :limit => 60
|
||||
t.column "locked_at", :datetime
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "web_id", :default => 0, :null => false
|
||||
t.string "locked_by", :limit => 60
|
||||
t.string "name"
|
||||
t.datetime "locked_at"
|
||||
end
|
||||
|
||||
create_table "revisions", :force => true do |t|
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "updated_at", :datetime, :null => false
|
||||
t.column "revised_at", :datetime, :null => false
|
||||
t.column "page_id", :integer, :default => 0, :null => false
|
||||
t.column "content", :text, :default => "", :null => false
|
||||
t.column "author", :string, :limit => 60
|
||||
t.column "ip", :string, :limit => 60
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "revised_at", :null => false
|
||||
t.integer "page_id", :default => 0, :null => false
|
||||
t.text "content", :limit => 16777215, :default => "", :null => false
|
||||
t.string "author", :limit => 60
|
||||
t.string "ip", :limit => 60
|
||||
end
|
||||
|
||||
add_index "revisions", ["author"], :name => "index_revisions_on_author"
|
||||
|
@ -28,51 +35,51 @@ ActiveRecord::Schema.define(:version => 2) do
|
|||
add_index "revisions", ["page_id"], :name => "index_revisions_on_page_id"
|
||||
|
||||
create_table "sessions", :force => true do |t|
|
||||
t.column "session_id", :string
|
||||
t.column "data", :text
|
||||
t.column "updated_at", :datetime
|
||||
t.string "session_id"
|
||||
t.text "data"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
|
||||
|
||||
create_table "system", :force => true do |t|
|
||||
t.column "password", :string, :limit => 60
|
||||
t.string "password", :limit => 60
|
||||
end
|
||||
|
||||
create_table "webs", :force => true do |t|
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "updated_at", :datetime, :null => false
|
||||
t.column "name", :string, :limit => 60, :default => "", :null => false
|
||||
t.column "address", :string, :limit => 60, :default => "", :null => false
|
||||
t.column "password", :string, :limit => 60
|
||||
t.column "additional_style", :string
|
||||
t.column "allow_uploads", :integer, :default => 1
|
||||
t.column "published", :integer, :default => 0
|
||||
t.column "count_pages", :integer, :default => 0
|
||||
t.column "markup", :string, :limit => 50, :default => "markdownMML"
|
||||
t.column "color", :string, :limit => 6, :default => "008B26"
|
||||
t.column "max_upload_size", :integer, :default => 100
|
||||
t.column "safe_mode", :integer, :default => 0
|
||||
t.column "brackets_only", :integer, :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "name", :limit => 60, :default => "", :null => false
|
||||
t.string "address", :limit => 60, :default => "", :null => false
|
||||
t.string "password", :limit => 60
|
||||
t.text "additional_style", :limit => 255
|
||||
t.integer "allow_uploads", :default => 1
|
||||
t.integer "published", :default => 0
|
||||
t.integer "count_pages", :default => 0
|
||||
t.string "markup", :limit => 50, :default => "markdownMML"
|
||||
t.string "color", :limit => 6, :default => "008B26"
|
||||
t.integer "max_upload_size", :default => 100
|
||||
t.integer "safe_mode", :default => 0
|
||||
t.integer "brackets_only", :default => 0
|
||||
end
|
||||
|
||||
create_table "wiki_files", :force => true do |t|
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "updated_at", :datetime, :null => false
|
||||
t.column "web_id", :integer, :null => false
|
||||
t.column "file_name", :string, :null => false
|
||||
t.column "description", :string, :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "web_id", :null => false
|
||||
t.string "file_name", :null => false
|
||||
t.string "description", :null => false
|
||||
end
|
||||
|
||||
create_table "wiki_references", :force => true do |t|
|
||||
t.column "created_at", :datetime, :null => false
|
||||
t.column "updated_at", :datetime, :null => false
|
||||
t.column "page_id", :integer, :default => 0, :null => false
|
||||
t.column "referenced_name", :string, :limit => 60, :default => "", :null => false
|
||||
t.column "link_type", :string, :limit => 1, :default => "", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "page_id", :default => 0, :null => false
|
||||
t.string "referenced_name", :default => "", :null => false
|
||||
t.string "link_type", :limit => 1, :default => "", :null => false
|
||||
end
|
||||
|
||||
add_index "wiki_references", ["referenced_name"], :name => "index_wiki_references_on_referenced_name"
|
||||
add_index "wiki_references", ["page_id"], :name => "index_wiki_references_on_page_id"
|
||||
add_index "wiki_references", ["referenced_name"], :name => "index_wiki_references_on_referenced_name"
|
||||
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ module CachingStuff
|
|||
module Caching
|
||||
module Fragments
|
||||
def fragment_cache_key(key)
|
||||
ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key.merge(:host=>"")).split(":///").last : key.split('/')[1..-1].join('/'), :views)
|
||||
ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key.merge(:host=>"")).split(":///").last : key.split('/')[1..-1].join('/').gsub(/\?format=.*/,''), :views)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# The category chunk looks for "category: news" on a line by
|
||||
# itself and parses the terms after the ':' as categories.
|
||||
|
@ -17,8 +17,8 @@ class Category < Chunk::Abstract
|
|||
|
||||
def initialize(match_data, content)
|
||||
super(match_data, content)
|
||||
@content = content
|
||||
@hidden = match_data[1]
|
||||
# @list = match_data[2].split(',').map { |c| clean = c.purify; clean.strip.escapeHTML if clean }
|
||||
@list = match_data[2].split(',').map { |c| clean = c.purify.strip.escapeHTML; clean if clean != ''}
|
||||
@list.compact!
|
||||
@unmask_text = ''
|
||||
|
@ -32,6 +32,7 @@ def initialize(match_data, content)
|
|||
|
||||
# TODO move presentation of page metadata to controller/view
|
||||
def url(category)
|
||||
%{<a class="category_link" href="../list/#{category}">#{category}</a>}
|
||||
%{<a class="category_link" href="#{@content.url_generator.url_for :web => @content.web.address,
|
||||
:action => 'list', :only_path => true}/#{CGI.escape(category)}">#{category}</a>}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,14 +45,16 @@ module Chunk
|
|||
|
||||
# Find all the chunks of the given type in content
|
||||
# Each time the pattern is matched, create a new
|
||||
# chunk for it, and replace the occurance of the chunk
|
||||
# chunk for it, and replace the occurrence of the chunk
|
||||
# in this content with its mask.
|
||||
def self.apply_to(content)
|
||||
content.gsub!( self.pattern ) do |match|
|
||||
text = content.to_str
|
||||
text.gsub!( self.pattern ) do |match|
|
||||
new_chunk = self.new($~, content)
|
||||
content.add_chunk(new_chunk)
|
||||
new_chunk.mask
|
||||
end
|
||||
end
|
||||
content.replace text
|
||||
end
|
||||
|
||||
# should contain only [a-z0-9]
|
||||
|
@ -61,7 +63,7 @@ module Chunk
|
|||
end
|
||||
|
||||
def unmask
|
||||
@content.sub!(mask){|s| s.replace @unmask_text}
|
||||
@content.replace @content.sub(mask){|s| s.replace @unmask_text}
|
||||
end
|
||||
|
||||
def rendered?
|
||||
|
@ -73,7 +75,7 @@ module Chunk
|
|||
end
|
||||
|
||||
def revert
|
||||
@content.sub!(mask){|s| s.replace @text}
|
||||
@content.replace @content.sub(mask){|s| s.replace @text}
|
||||
# unregister
|
||||
@content.delete_chunk(self)
|
||||
end
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
$: << File.dirname(__FILE__) + "../../lib"
|
||||
|
||||
require_dependency 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
require_dependency 'rdocsupport'
|
||||
require 'redcloth'
|
||||
require 'oldredcloth'
|
||||
|
||||
# The markup engines are Chunks that call the one of RedCloth
|
||||
# or RDoc to convert text. This markup occurs when the chunk is required
|
||||
|
@ -40,16 +41,16 @@ module Engines
|
|||
|
||||
class Markdown < AbstractEngine
|
||||
def mask
|
||||
@content.as_utf8
|
||||
text = @content.as_utf8.to_str.delete("\r").to_utf8
|
||||
# If the request is for S5, call Maruku accordingly (without math)
|
||||
if @content.options[:mode] == :s5
|
||||
my_content = Maruku.new(@content.delete("\r").to_utf8,
|
||||
my_content = Maruku.new(text,
|
||||
{:math_enabled => false, :content_only => true,
|
||||
:author => @content.options[:engine_opts][:author],
|
||||
:title => @content.options[:engine_opts][:title]})
|
||||
@content.options[:renderer].s5_theme = my_content.s5_theme
|
||||
else
|
||||
html = Maruku.new(@content.delete("\r").to_utf8, {:math_enabled => false}).to_html
|
||||
html = Maruku.new(text, {:math_enabled => false}).to_html
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
end
|
||||
|
||||
|
@ -58,10 +59,10 @@ module Engines
|
|||
|
||||
class MarkdownMML < AbstractEngine
|
||||
def mask
|
||||
@content.as_utf8
|
||||
text = @content.as_utf8.to_str.delete("\r").to_utf8
|
||||
# If the request is for S5, call Maruku accordingly
|
||||
if @content.options[:mode] == :s5
|
||||
my_content = Maruku.new(@content.delete("\r").to_utf8,
|
||||
my_content = Maruku.new(text,
|
||||
{:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}'],
|
||||
:content_only => true,
|
||||
|
@ -70,9 +71,11 @@ module Engines
|
|||
@content.options[:renderer].s5_theme = my_content.s5_theme
|
||||
my_content.to_s5
|
||||
else
|
||||
html = Maruku.new(@content.delete("\r").to_utf8,
|
||||
(t = Time.now; nil)
|
||||
html = Maruku.new(text,
|
||||
{:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}']}).to_html
|
||||
(ApplicationController.logger.info("Maruku took " + (Time.now-t).to_s + " seconds."); nil)
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
end
|
||||
end
|
||||
|
@ -80,31 +83,31 @@ module Engines
|
|||
|
||||
class MarkdownPNG < AbstractEngine
|
||||
def mask
|
||||
@content.as_utf8
|
||||
text = @content.as_utf8.to_str.delete("\r").to_utf8
|
||||
# If the request is for S5, call Maruku accordingly
|
||||
if @content.options[:mode] == :s5
|
||||
my_content = Maruku.new(@content.delete("\r").to_utf8,
|
||||
my_content = Maruku.new(text,
|
||||
{:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}'],
|
||||
:html_math_output_mathml => false,
|
||||
:html_math_output_png => true,
|
||||
:html_png_engine => 'blahtex',
|
||||
:html_png_dir => @content.web.files_path.join('pngs').to_s,
|
||||
:html_png_url => '../files/pngs/',
|
||||
:html_png_url => @content.options[:png_url],
|
||||
:content_only => true,
|
||||
:author => @content.options[:engine_opts][:author],
|
||||
:title => @content.options[:engine_opts][:title]})
|
||||
@content.options[:renderer].s5_theme = my_content.s5_theme
|
||||
my_content.to_s5
|
||||
else
|
||||
html = Maruku.new(@content.delete("\r").to_utf8,
|
||||
html = Maruku.new(text,
|
||||
{:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}'],
|
||||
:html_math_output_mathml => false,
|
||||
:html_math_output_png => true,
|
||||
:html_png_engine => 'blahtex',
|
||||
:html_png_dir => @content.web.files_path.join('pngs').to_s,
|
||||
:html_png_url => '../files/pngs/'}).to_html
|
||||
:html_png_url => @content.options[:png_url]}).to_html
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
end
|
||||
end
|
||||
|
@ -113,7 +116,7 @@ module Engines
|
|||
class Mixed < AbstractEngine
|
||||
def mask
|
||||
@content.as_utf8
|
||||
redcloth = RedCloth.new(@content, @content.options[:engine_opts])
|
||||
redcloth = OldRedCloth.new(@content.to_str, @content.options[:engine_opts])
|
||||
redcloth.filter_html = false
|
||||
redcloth.no_span_caps = false
|
||||
html = redcloth.to_html
|
||||
|
@ -122,8 +125,7 @@ module Engines
|
|||
|
||||
class RDoc < AbstractEngine
|
||||
def mask
|
||||
@content.as_utf8
|
||||
html = RDocSupport::RDocFormatter.new(@content).to_html
|
||||
html = RDocSupport::RDocFormatter.new(@content.as_utf8.to_str).to_html
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ class Include < WikiChunk::WikiReference
|
|||
else
|
||||
raise "Unsupported rendering mode #{@mode.inspect}"
|
||||
end
|
||||
@content.merge_chunks(included_content)
|
||||
# redirects and categories of included pages should not be inherited
|
||||
@content.merge_chunks(included_content.delete_chunks!([Redirect, Category]))
|
||||
clear_include_list
|
||||
return included_content.pre_rendered
|
||||
else
|
||||
|
|
|
@ -18,7 +18,7 @@ module Literal
|
|||
# A literal chunk that protects 'code' and 'pre' tags from wiki rendering.
|
||||
class Pre < AbstractLiteral
|
||||
PRE_BLOCKS = "a|pre|code|math"
|
||||
PRE_PATTERN = Regexp.new('<('+PRE_BLOCKS+')\b[^>]*?>.*?</\1>', Regexp::MULTILINE)
|
||||
PRE_PATTERN = Regexp.new('<('+PRE_BLOCKS+')\b[^>]*?(>.*?</\1>|/>)', Regexp::MULTILINE)
|
||||
def self.pattern() PRE_PATTERN end
|
||||
end
|
||||
|
||||
|
@ -30,9 +30,9 @@ module Literal
|
|||
|
||||
# A literal chunk that protects equations from wiki rendering.
|
||||
class Math < AbstractLiteral
|
||||
MATH_START = '(\${1,2}|' + Regexp.escape('\[') + '|\\begin\{equation\})'
|
||||
MATH_END = '(\${1,2}|' + Regexp.escape('\]') + '|\\end\{equation\})'
|
||||
MATH_PATTERN = Regexp.new(MATH_START + '([^$]|\\\$)+?' + MATH_END, Regexp::MULTILINE)
|
||||
MATH_START = "(?:\\\\\\[|\\${1,2}|\\\\begin\\{equation\\})"
|
||||
MATH_END = "(?:\\\\\\]|\\${1,2}|\\\\end\\{equation\\})"
|
||||
MATH_PATTERN = Regexp.new( '(' + MATH_START + "(?:\\\\\\$|(?!\\$|\\\\\\]|\\\\end\\{equation\\}).)+?" + MATH_END + ')', Regexp::MULTILINE)
|
||||
def self.pattern() MATH_PATTERN end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# Contains all the methods for finding and replacing wiki related links.
|
||||
module WikiChunk
|
||||
|
@ -34,7 +34,8 @@ module WikiChunk
|
|||
end
|
||||
|
||||
def self.apply_to(content)
|
||||
content.as_utf8.gsub!( self.pattern ) do |matched_text|
|
||||
text = content.as_utf8.to_str
|
||||
text.gsub!( self.pattern ) do |matched_text|
|
||||
chunk = self.new($~, content)
|
||||
if chunk.textile_url?
|
||||
# do not substitute
|
||||
|
@ -44,6 +45,7 @@ module WikiChunk
|
|||
chunk.mask
|
||||
end
|
||||
end
|
||||
content.replace text
|
||||
end
|
||||
|
||||
def textile_url?
|
||||
|
@ -155,6 +157,7 @@ module WikiChunk
|
|||
if web_match
|
||||
@web_name = normalize_whitespace(web_match[1])
|
||||
@page_name = web_match[2]
|
||||
@link_text = @page_name if @link_text == web_match[0]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,7 @@ class PageRenderer
|
|||
|
||||
diffs = ''
|
||||
diff_doc.write(diffs, -1, true, true)
|
||||
diffs.gsub(/\A<div class='xhtmldiff_wrapper'>(.*)<\/div>\Z/m, '\1')
|
||||
diffs.gsub(/\A<div class='xhtmldiff_wrapper'>(.*)<\/div>\Z/m, '\1').html_safe
|
||||
else
|
||||
display_content
|
||||
end
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
require 'webrick'
|
||||
require 'stringio'
|
||||
require 'rack/content_length'
|
||||
require 'tempfile'
|
||||
|
||||
module Rack
|
||||
module Handler
|
||||
class WEBrick < ::WEBrick::HTTPServlet::AbstractServlet
|
||||
def self.run(app, options={})
|
||||
options[:BindAddress] = options.delete(:Host) if options[:Host]
|
||||
@server = ::WEBrick::HTTPServer.new(options)
|
||||
@server.mount "/", Rack::Handler::WEBrick, app
|
||||
trap(:INT) { @server.shutdown }
|
||||
trap(:TERM) { @server.shutdown }
|
||||
yield @server if block_given?
|
||||
@server.start
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Rack.release <= "1.2"
|
||||
# The Tempfile bug is fixed in the bundled version of Rack
|
||||
class RewindableInput
|
||||
def make_rewindable
|
||||
# Buffer all data into a tempfile. Since this tempfile is private to this
|
||||
# RewindableInput object, we chmod it so that nobody else can read or write
|
||||
# it. On POSIX filesystems we also unlink the file so that it doesn't
|
||||
# even have a file entry on the filesystem anymore, though we can still
|
||||
# access it because we have the file handle open.
|
||||
@rewindable_io = Tempfile.new('RackRewindableInput')
|
||||
@rewindable_io.chmod(0000)
|
||||
@rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
|
||||
@rewindable_io.binmode
|
||||
if filesystem_has_posix_semantics? && !tempfile_unlink_contains_bug?
|
||||
@rewindable_io.unlink
|
||||
@unlinked = true
|
||||
end
|
||||
|
||||
buffer = ""
|
||||
while @io.read(1024 * 4, buffer)
|
||||
entire_buffer_written_out = false
|
||||
while !entire_buffer_written_out
|
||||
written = @rewindable_io.write(buffer)
|
||||
entire_buffer_written_out = written == Rack::Utils.bytesize(buffer)
|
||||
if !entire_buffer_written_out
|
||||
buffer.slice!(0 .. written - 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
@rewindable_io.rewind
|
||||
end
|
||||
|
||||
def tempfile_unlink_contains_bug?
|
||||
# The tempfile library as included in Ruby 1.9.1-p152 and later
|
||||
# contains a bug: unlinking an open Tempfile object also closes
|
||||
# it, which breaks our expected POSIX semantics. This problem
|
||||
# has been fixed in Ruby 1.9.2, but the Ruby team chose not to
|
||||
# include the bug fix in later versions of the 1.9.1 series.
|
||||
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
|
||||
ruby_engine == "ruby" && RUBY_VERSION == "1.9.1" && RUBY_PATCHLEVEL >= 152
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -39,7 +39,7 @@ class RDocMarkup < SM::SimpleMarkup
|
|||
end
|
||||
|
||||
def convert(text, handler)
|
||||
super.sub(/^<p>\n/, '').sub(/<\/p>$/, '')
|
||||
super.sub(/^\n{0,1}<p>\n{0,1}/, '').sub(/\n{0,1}<\/p>\n{0,1}$/, '')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
1113
lib/redcloth.rb
1113
lib/redcloth.rb
File diff suppressed because it is too large
Load Diff
|
@ -7,68 +7,77 @@ module Sanitizer
|
|||
|
||||
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
||||
require 'node'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'set'
|
||||
require 'nokogiri'
|
||||
|
||||
acceptable_elements = Set.new %w[a abbr acronym address area audio b big blockquote br
|
||||
button caption center cite code col colgroup dd del dfn dir div dl dt
|
||||
em fieldset font form h1 h2 h3 h4 h5 h6 hr i img input ins kbd label
|
||||
legend li map menu ol optgroup option p pre q s samp select small span
|
||||
strike strong sub sup table tbody td textarea tfoot th thead tr tt u
|
||||
ul var video]
|
||||
acceptable_elements = Set.new %w[a abbr acronym address area article aside
|
||||
audio b big blockquote br button canvas caption center cite code
|
||||
col colgroup command datalist dd del details dfn dialog dir div dl dt
|
||||
em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 header
|
||||
hgroup hr i img input ins kbd label legend li map mark menu meter nav
|
||||
ol optgroup option p pre progress q rp rt ruby s samp section select small
|
||||
source span strike strong sub summary sup table tbody td textarea tfoot
|
||||
th thead time tr tt u ul var video wbr]
|
||||
|
||||
mathml_elements = Set.new %w[annotation annotation-xml maction math merror mfrac
|
||||
mfenced mi mmultiscripts mn mo mover mpadded mphantom mprescripts mroot
|
||||
mathml_elements = Set.new %w[annotation annotation-xml maction math menclose merror
|
||||
mfrac mfenced mi mmultiscripts mn mo mover mpadded mphantom mprescripts mroot
|
||||
mrow mspace msqrt mstyle msub msubsup msup mtable mtd mtext mtr munder
|
||||
munderover none semantics]
|
||||
|
||||
svg_elements = Set.new %w[a animate animateColor animateMotion animateTransform
|
||||
circle clipPath defs desc ellipse font-face font-face-name font-face-src
|
||||
foreignObject g glyph hkern linearGradient line marker metadata
|
||||
missing-glyph mpath path polygon polyline radialGradient rect set
|
||||
stop svg switch text title tspan use]
|
||||
circle clipPath defs desc ellipse feGaussianBlur filter font-face
|
||||
font-face-name font-face-src foreignObject g glyph hkern linearGradient
|
||||
line marker mask metadata missing-glyph mpath path pattern polygon
|
||||
polyline radialGradient rect set stop svg switch text textPath title tspan use]
|
||||
|
||||
acceptable_attributes = Set.new %w[abbr accept accept-charset accesskey action
|
||||
align alt axis border cellpadding cellspacing char charoff charset
|
||||
checked cite class clear cols colspan color compact controls coords datetime
|
||||
dir disabled enctype for frame headers height href hreflang hspace id
|
||||
ismap label lang longdesc loop maxlength media method multiple name nohref
|
||||
noshade nowrap poster prompt readonly rel rev rows rowspan rules scope
|
||||
selected shape size span src start style summary tabindex target title
|
||||
type usemap valign value vspace width xml:lang]
|
||||
align alt autocomplete axis bgcolor border cellpadding cellspacing char charoff
|
||||
checked cite class clear cols colspan color compact contenteditable contextmenu
|
||||
controls coords datetime dir disabled draggable enctype face for formaction frame
|
||||
headers height high href hreflang hspace icon id ismap label list lang longdesc
|
||||
loop low max maxlength media method min multiple name nohref noshade nowrap open
|
||||
optimumpattern placeholder poster preload pubdate radiogroup readonly rel
|
||||
required rev reversed rows rowspan rules spellcheck scope
|
||||
selected shape size span src start step style summary tabindex target title
|
||||
type usemap valign value vspace width wrap xml:lang]
|
||||
|
||||
mathml_attributes = Set.new %w[actiontype align close columnalign columnalign
|
||||
mathml_attributes = Set.new %w[actiontype align close
|
||||
columnalign columnlines columnspacing columnspan depth display
|
||||
displaystyle encoding equalcolumns equalrows fence fontstyle fontweight
|
||||
frame height linethickness lspace mathbackground mathcolor mathvariant
|
||||
mathvariant maxsize minsize open other rowalign rowalign rowalign
|
||||
maxsize minsize notation open other rowalign
|
||||
rowlines rowspacing rowspan rspace scriptlevel selection separator
|
||||
separators stretchy width width xlink:href xlink:show xlink:type xmlns
|
||||
separators stretchy width voffset xlink:href xlink:show xlink:type xmlns
|
||||
xmlns:xlink]
|
||||
|
||||
svg_attributes = Set.new %w[accent-height accumulate additive alphabetic
|
||||
arabic-form ascent attributeName attributeType baseProfile bbox begin
|
||||
by calcMode cap-height class clip-path clip-rule color color-rendering
|
||||
by calcMode cap-height class clip-path clip-rule color
|
||||
color-interpolation-filters color-rendering
|
||||
content cx cy d dx dy descent display dur end fill fill-opacity fill-rule
|
||||
font-family font-size font-stretch font-style font-variant font-weight from
|
||||
fx fy g1 g2 glyph-name gradientUnits hanging height horiz-adv-x horiz-origin-x
|
||||
id ideographic k keyPoints keySplines keyTimes lang marker-end
|
||||
marker-mid marker-start markerHeight markerUnits markerWidth
|
||||
mathematical max min name offset opacity orient origin
|
||||
overline-position overline-thickness panose-1 path pathLength points
|
||||
preserveAspectRatio r refX refY repeatCount repeatDur
|
||||
requiredExtensions requiredFeatures restart rotate rx ry slope stemh
|
||||
stemv stop-color stop-opacity strikethrough-position
|
||||
strikethrough-thickness stroke stroke-dasharray stroke-dashoffset
|
||||
stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity
|
||||
stroke-width systemLanguage target text-anchor to transform type u1
|
||||
u2 underline-position underline-thickness unicode unicode-range
|
||||
units-per-em values version viewBox visibility width widths x
|
||||
x-height x1 x2 xlink:actuate xlink:arcrole xlink:href xlink:role
|
||||
xlink:show xlink:title xlink:type xml:base xml:lang xml:space xmlns
|
||||
xmlns:xlink y y1 y2 zoomAndPan]
|
||||
filterRes filterUnits font-family font-size font-stretch font-style
|
||||
font-variant font-weight from fx fy g1 g2 glyph-name gradientUnits
|
||||
hanging height horiz-adv-x horiz-origin-x id ideographic k keyPoints
|
||||
keySplines keyTimes lang marker-end marker-mid marker-start
|
||||
markerHeight markerUnits markerWidth maskContentUnits maskUnits
|
||||
mathematical max method min name offset opacity orient origin
|
||||
overline-position overline-thickness panose-1 path pathLength
|
||||
patternContentUnits patternTransform patternUnits points
|
||||
preserveAspectRatio primitiveUnits r refX refY repeatCount repeatDur
|
||||
requiredExtensions requiredFeatures restart rotate rx ry se:connector
|
||||
se:nonce slope spacing
|
||||
startOffset stdDeviation stemh stemv stop-color stop-opacity
|
||||
strikethrough-position strikethrough-thickness stroke stroke-dasharray
|
||||
stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit
|
||||
stroke-opacity stroke-width systemLanguage target text-anchor
|
||||
to transform type u1 u2 underline-position underline-thickness
|
||||
unicode unicode-range units-per-em values version viewBox
|
||||
visibility width widths x x-height x1 x2 xlink:actuate
|
||||
xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type
|
||||
xml:base xml:lang xml:space xmlns xmlns:xlink xmlns:se y y1 y2 zoomAndPan]
|
||||
|
||||
attr_val_is_uri = Set.new %w[href src cite action longdesc xlink:href xml:base]
|
||||
attr_val_is_uri = Set.new %w[href src cite action formaction longdesc xlink:href xml:base]
|
||||
|
||||
svg_attr_val_allows_ref = Set.new %w[clip-path color-profile cursor fill
|
||||
filter marker marker-start marker-mid marker-end mask stroke]
|
||||
|
@ -219,9 +228,9 @@ module Sanitizer
|
|||
# (REXML trees are always utf-8 encoded.)
|
||||
def safe_xhtml_sanitize(html, options = {})
|
||||
sanitized = xhtml_sanitize(html.purify)
|
||||
doc = REXML::Document.new("<div xmlns='http://www.w3.org/1999/xhtml'>#{sanitized}</div>")
|
||||
sanitized = doc.to_s.gsub(/\A<div xmlns='http:\/\/www.w3.org\/1999\/xhtml'>(.*)<\/div>\Z/m, '\1')
|
||||
rescue REXML::ParseException
|
||||
doc = Nokogiri::XML::Document.parse("<div xmlns='http://www.w3.org/1999/xhtml'>#{sanitized}</div>", nil, (options[:encoding] || 'UTF-8'), 0)
|
||||
sanitized = doc.root.children.to_xml(:indent => (options[:indent] || 2), :save_with => 2 )
|
||||
rescue Nokogiri::XML::SyntaxError
|
||||
sanitized = sanitized.escapeHTML
|
||||
end
|
||||
|
||||
|
|
2370
lib/stringsupport.rb
2370
lib/stringsupport.rb
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
require File.join(File.dirname(__FILE__), '..', 'lib', 'manage_fixtures.rb')
|
||||
require Rails.root.join('vendor', 'plugins', 'manage_fixtures', 'lib', 'manage_fixtures.rb')
|
||||
|
||||
desc "use rake db:fixtures:export_using_query SQL=\"select * from foo where id='bar'\" FIXTURE_NAME=foo"
|
||||
namespace :db do
|
||||
|
@ -33,7 +33,7 @@ namespace :db do
|
|||
ActiveRecord::Base.establish_connection
|
||||
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
|
||||
i = "000"
|
||||
File.open("#{RAILS_ROOT}/dump/fixtures/#{table_name}.yml", 'w' ) do |file|
|
||||
File.open(Rails.root.join('dump', 'fixtures', table_name + '.yml'), 'w' ) do |file|
|
||||
write_yaml_fixtures_to_file(sql % table_name, table_name)
|
||||
end
|
||||
end
|
||||
|
@ -73,8 +73,9 @@ namespace :db do
|
|||
namespace :fixtures do
|
||||
task :import_all => :environment do
|
||||
ActiveRecord::Base.establish_connection
|
||||
Dir.glob(File.join(RAILS_ROOT,'dump','fixtures',"*.yml")).each do |f|
|
||||
table_name = f.gsub(File.join(RAILS_ROOT,'dump','fixtures', ''), '').gsub('.yml', '')
|
||||
Dir.glob(Rails.root.join('dump','fixtures',"*.yml")).each do |f|
|
||||
table_name = f.gsub( Regexp.escape(Rails.root.join('dump','fixtures').to_s + File::SEPARATOR), '').gsub('.yml', '')
|
||||
puts "Importing #{table_name}"
|
||||
import_table_fixture(table_name)
|
||||
end
|
||||
end
|
|
@ -31,4 +31,4 @@ class InstikiUpgrade
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class AbstractUrlGenerator
|
||||
|
||||
|
@ -53,7 +53,10 @@ class AbstractUrlGenerator
|
|||
raise "Unknown link type: #{link_type}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def url_for(hash = {})
|
||||
@controller.url_for hash
|
||||
end
|
||||
end
|
||||
|
||||
class UrlGenerator < AbstractUrlGenerator
|
||||
|
@ -61,10 +64,11 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
private
|
||||
|
||||
def file_link(mode, name, text, web_address, known_file, description)
|
||||
return bad_filename(name) unless WikiFile.is_valid?(name)
|
||||
case mode
|
||||
when :export
|
||||
if known_file
|
||||
%{<a class="existingWikiWord" title="#{description}" href="#{CGI.escape(name)}.#{html_ext}">#{text}</a>}
|
||||
%{<a class="existingWikiWord" title="#{description}" href="files/#{CGI.escape(name)}">#{text}</a>}
|
||||
else
|
||||
%{<span class="newWikiWord">#{text}</span>}
|
||||
end
|
||||
|
@ -88,7 +92,6 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
end
|
||||
|
||||
def page_link(mode, name, text, web_address, known_page)
|
||||
return %{<span class='wikilink-error'><b>Illegal link (target contains a '.'):</b> #{name}</span>} if name.include?('.')
|
||||
case mode
|
||||
when :export
|
||||
if known_page
|
||||
|
@ -114,12 +117,13 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
end
|
||||
|
||||
def pic_link(mode, name, text, web_address, known_pic)
|
||||
return bad_filename(name) unless WikiFile.is_valid?(name)
|
||||
href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file',
|
||||
:id => name, :only_path => true
|
||||
case mode
|
||||
when :export
|
||||
if known_pic
|
||||
%{<img alt="#{text}" src="#{CGI.escape(name)}" />}
|
||||
%{<img alt="#{text}" src="files/#{CGI.escape(name)}" />}
|
||||
else
|
||||
%{<img alt="#{text}" src="no image" />}
|
||||
end
|
||||
|
@ -139,12 +143,13 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
end
|
||||
|
||||
def media_link(mode, name, text, web_address, known_media, media_type)
|
||||
return bad_filename(name) unless WikiFile.is_valid?(name)
|
||||
href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file',
|
||||
:id => name, :only_path => true
|
||||
case mode
|
||||
when :export
|
||||
if known_media
|
||||
%{<#{media_type} src="#{CGI.escape(name)}" controls="controls">#{text}</#{media_type}>}
|
||||
%{<#{media_type} src="files/#{CGI.escape(name)}" controls="controls">#{text}</#{media_type}>}
|
||||
else
|
||||
text
|
||||
end
|
||||
|
@ -175,12 +180,17 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
|
||||
private
|
||||
|
||||
def bad_filename(name)
|
||||
"<span class='badWikiWord'>[[invalid filename: #{name}]]</span>"
|
||||
end
|
||||
|
||||
def wikilink_for(mode, name, text, web_address)
|
||||
web = Web.find_by_address(web_address)
|
||||
action = web.published? && (web != @web || [:publish, :s5].include?(mode) ) ? 'published' : 'show'
|
||||
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => action,
|
||||
:id => name, :only_path => true
|
||||
%{<a class="existingWikiWord" href="#{href}">#{text}</a>}
|
||||
title = web == @web ? '' : %{ title="#{web_address}"}
|
||||
%{<a class="existingWikiWord" href="#{href}"#{title}>#{text}</a>}
|
||||
end
|
||||
|
||||
def html_ext
|
||||
|
|
|
@ -7,7 +7,8 @@ require_dependency 'chunks/wiki'
|
|||
require_dependency 'chunks/literal'
|
||||
require 'chunks/nowiki'
|
||||
require 'sanitizer'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'set'
|
||||
|
||||
|
||||
# Wiki content is just a string that can process itself with a chain of
|
||||
|
@ -53,10 +54,10 @@ module ChunkManager
|
|||
def init_chunk_manager
|
||||
@chunks_by_type = Hash.new
|
||||
Chunk::Abstract::derivatives.each{|chunk_type|
|
||||
@chunks_by_type[chunk_type] = Array.new
|
||||
@chunks_by_type[chunk_type] = Set.new
|
||||
}
|
||||
@chunks_by_id = Hash.new
|
||||
@chunks = []
|
||||
@chunks = Set.new
|
||||
@chunk_id = 0
|
||||
end
|
||||
|
||||
|
@ -115,7 +116,7 @@ class WikiContentStub < String
|
|||
end
|
||||
end
|
||||
|
||||
class WikiContent < String
|
||||
class WikiContent < ActiveSupport::SafeBuffer
|
||||
|
||||
include ChunkManager
|
||||
include Sanitizer
|
||||
|
@ -128,7 +129,7 @@ class WikiContent < String
|
|||
:mode => :show
|
||||
}.freeze
|
||||
|
||||
attr_reader :web, :options, :revision, :not_rendered, :pre_rendered
|
||||
attr_reader :web, :options, :revision, :not_rendered, :pre_rendered, :url_generator
|
||||
|
||||
# Create a new wiki content string from the given one.
|
||||
# The options are explained at the top of this file.
|
||||
|
@ -143,6 +144,12 @@ class WikiContent < String
|
|||
@options[:active_chunks] = (ACTIVE_CHUNKS - [WikiChunk::Word] ) if @web.brackets_only?
|
||||
@options[:hide_chunks] = (HIDE_CHUNKS - [Literal::Math] ) unless
|
||||
[Engines::MarkdownMML, Engines::MarkdownPNG].include?(@options[:engine])
|
||||
if @options[:engine] == Engines::MarkdownPNG
|
||||
@options[:png_url] =
|
||||
@options[:mode] == :export ? 'files/pngs/' :
|
||||
(@url_generator.url_for :controller => 'file', :web => @web.address,
|
||||
:action => 'file', :id => 'pngs', :only_path => true) + '/'
|
||||
end
|
||||
|
||||
@not_rendered = @pre_rendered = nil
|
||||
|
||||
|
@ -175,10 +182,20 @@ class WikiContent < String
|
|||
@options[:engine].apply_to(copy)
|
||||
|
||||
copy.inside_chunks(@options[:hide_chunks]) do |id|
|
||||
@chunks_by_id[id.to_i].revert
|
||||
@chunks_by_id[id.to_i].revert if @chunks_by_id[id.to_i]
|
||||
end
|
||||
end
|
||||
|
||||
def delete_chunks!(types)
|
||||
types.each do |t|
|
||||
@chunks_by_type[t].each do |c|
|
||||
@pre_rendered.sub!(c.mask, '') if @pre_rendered
|
||||
@chunks.delete(c)
|
||||
end
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
def pre_render!
|
||||
unless @pre_rendered
|
||||
@chunks_by_type[Include].each{|chunk| chunk.unmask }
|
||||
|
@ -192,7 +209,8 @@ class WikiContent < String
|
|||
@options[:engine].apply_to(self)
|
||||
as_utf8
|
||||
# unmask in one go. $~[1] is the chunk id
|
||||
gsub!(MASK_RE[ACTIVE_CHUNKS]) do
|
||||
text = self.to_str
|
||||
text.gsub!(MASK_RE[ACTIVE_CHUNKS]) do
|
||||
chunk = @chunks_by_id[$~[1].to_i]
|
||||
if chunk.nil?
|
||||
# if we match a chunkmask that existed in the original content string
|
||||
|
@ -202,7 +220,8 @@ class WikiContent < String
|
|||
chunk.unmask_text
|
||||
end
|
||||
end
|
||||
self.replace xhtml_sanitize(self)
|
||||
self.replace xhtml_sanitize(text)
|
||||
self.html_safe
|
||||
end
|
||||
|
||||
def page_name
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
#coding: utf-8
|
||||
# Contains all the methods for finding and replacing wiki words
|
||||
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
module WikiWords
|
||||
# In order of appearance: Latin, greek, cyrillic, armenian
|
||||
I18N_HIGHER_CASE_LETTERS =
|
||||
"ÀÁÂÃÄÅĀĄĂÆÇĆČĈĊĎĐÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌÍÎÏĪĨĬĮİIJĴĶŁĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌŐŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴŶŸȲÝŹŽŻ" +
|
||||
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" +
|
||||
"ΆΈΉΊΌΎΏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӁӃӅӇӉӋӍӏӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
|
||||
"ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢ" +
|
||||
"ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖ"
|
||||
|
||||
I18N_LOWER_CASE_LETTERS =
|
||||
"àáâãäåāąăæçćĉċčďđèéêëēęěĕėƒĝğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöøōŏőœŕřŗśŝšşșťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſð" +
|
||||
"άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώΐ" +
|
||||
"абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҌҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ" +
|
||||
"աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև"
|
||||
"абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣ" +
|
||||
"աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև"
|
||||
|
||||
WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS + ']\w+'
|
||||
WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS +
|
||||
'][A-Za-z0-9_' + I18N_HIGHER_CASE_LETTERS + I18N_LOWER_CASE_LETTERS + ']+'
|
||||
CAMEL_CASED_WORD_BORDER = /([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u
|
||||
|
||||
def self.separate(wiki_word)
|
||||
|
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
This is release branch v1.1 of MathJax.
|
|
@ -0,0 +1,52 @@
|
|||
# MathJax
|
||||
|
||||
## Beautiful math in all browsers
|
||||
|
||||
MathJax is an open-source JavaScript display engine for LaTeX and MathML
|
||||
that works in all modern browsers. It was designed with the goal of
|
||||
consolidating the recent advances in web technologies into a single,
|
||||
definitive, math-on-the-web platform supporting the major browsers and
|
||||
operating systems. It requires no setup on the part of the user (no
|
||||
plugins to download or software to install), so the page author can write
|
||||
web documents that include mathematics and be confident that users will be
|
||||
able to view it naturally and easily. Simply include MathJax and some
|
||||
mathematics in a web page, and MathJax does the rest.
|
||||
|
||||
Some of the main features of MathJax include:
|
||||
|
||||
- High-quality display of LaTeX and MathML math notation in HTML pages
|
||||
|
||||
- Supported in most browsers with no plug-ins, extra fonts, or special
|
||||
setup for the reader
|
||||
|
||||
- Easy for authors, flexible for publishers, extensible for developers
|
||||
|
||||
- Supports math accessibility, cut-and-paste interoperability and other
|
||||
advanced functionality
|
||||
|
||||
- Powerful API for integration with other web applications
|
||||
|
||||
See <http://www.mathjax.org/> for additional details.
|
||||
|
||||
|
||||
## Installation and Usage
|
||||
|
||||
The MathJax installation and usage documentation is available in the
|
||||
`docs/html` directory of the MathJax distribution (see
|
||||
`docs/html/index.html` for the starting point). The documents are also
|
||||
available on the MathJax web site on line at <http://www.mathjax.org/resources/docs/>.
|
||||
|
||||
|
||||
## Community
|
||||
|
||||
The main MathJax website is <http://www.mathjax.org>, and it includes
|
||||
announcements and other important information. MathJax is maintained and
|
||||
distributed on GitHub at <http://github.com/mathjax/MathJax>. A user forum
|
||||
for asking questions and getting assistance is hosted at Google, and the
|
||||
bug tracker is hosted at GitHub:
|
||||
|
||||
Bug tracker: <https://github.com/mathjax/MathJax/issues>
|
||||
MathJax-Users Group: <http://groups.google.com/group/mathjax-users>
|
||||
|
||||
Before reporting a bug, please check that it has not already been reported.
|
||||
Also, please use the bug tracker for reporting bugs rather than the help forum.
|
|
@ -0,0 +1,55 @@
|
|||
OVERVIEW:
|
||||
|
||||
MathJax is an open-source JavaScript display engine for LaTeX and
|
||||
MathML that works in all modern browsers. It was designed with the
|
||||
goal of consolidating the recent advances in web technologies into a
|
||||
single, definitive, math-on-the-web platform supporting the major
|
||||
browsers and operating systems. It requires no setup on the part of
|
||||
the user (no plugins to downlaod or software to install), so the page
|
||||
author can write web documents that include mathematics and be
|
||||
confident that users will be able to view it naturally and easily.
|
||||
One simply includes MathJax and some mathematics in a web page, and
|
||||
MathJax does the rest.
|
||||
|
||||
Some of the main features of MathJax include:
|
||||
|
||||
o High-quality display of LaTeX and MathML math notation in HTML pages
|
||||
|
||||
o Supported in most browsers with no plug-ins, extra fonts, or special
|
||||
setup for the reader
|
||||
|
||||
o Easy for authors, flexible for publishers, extensible for developers
|
||||
|
||||
o Supports math accessibility, cut and paste interoperability and other
|
||||
advanced functionality
|
||||
|
||||
o Powerful API for integration with other web applications
|
||||
|
||||
See http://www.mathjax.org/ for additional details.
|
||||
|
||||
|
||||
INSTALLATION AND USAGE:
|
||||
|
||||
The MathJax installation and usage documentation is available on the
|
||||
docs/html directory of the MathJax distribution (see
|
||||
docs/html/index.html for the starting point). The documents are also
|
||||
available on the MathJax web site on line at
|
||||
|
||||
http://www.mathjax.org/docs/
|
||||
|
||||
|
||||
COMMUNITY:
|
||||
|
||||
The main MathJax website is www.mathjax.org, and it includes announcements
|
||||
and other important information. MathJax also has a SourceForge site at
|
||||
http://sourceforge.net/projects/mathjax/ that includes the download site
|
||||
for the MathJax distribution, the bug-tracker for reporting bugs, and
|
||||
several user forums for asking questions and getting assistance:
|
||||
|
||||
Bug tracker: http://sourceforge.net/tracker/?group_id=261188&atid=1240827
|
||||
MathJax Help: http://sourceforge.net/projects/mathjax/forums/forum/948701
|
||||
Open Discussion: http://sourceforge.net/projects/mathjax/forums/forum/948700
|
||||
|
||||
Before reporting a bug, please check that it has not already been reported.
|
||||
Also, please use the bug tracker for reporting bugs rather than the help
|
||||
forum.
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* /MathJax/config/MMLorHTML.js
|
||||
*
|
||||
* Copyright (c) 2010 Design Science, Inc.
|
||||
*
|
||||
* Part of the MathJax library.
|
||||
* See http://www.mathjax.org for details.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
(function(c){var h="1.1.1";var a=MathJax.Hub.CombineConfig("MMLorHTML",{prefer:{MSIE:"MML",Firefox:"MML",Opera:"HTML",other:"HTML"}});var e={Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4};var b=(c.Browser.version==="0.0"||c.Browser.versionAtLeast(e[c.Browser]||0));var g=false;if(!c.Browser.isIE9){try{new ActiveXObject("MathPlayer.Factory.1");g=true}catch(f){}}var d=(c.Browser.isFirefox&&c.Browser.versionAtLeast("1.5"))||(c.Browser.isMSIE&&g)||(c.Browser.isOpera&&c.Browser.versionAtLeast("9.52"));c.Register.StartupHook("End Config",function(){var i=(a.prefer&&typeof(a.prefer)==="object"?a.prefer[MathJax.Hub.Browser]||a.prefer.other||"HTML":a.prefer);if(b||d){if(d&&(i==="MML"||!b)){if(MathJax.OutputJax.NativeMML){MathJax.OutputJax.NativeMML.Register("jax/mml")}else{c.config.jax.unshift("output/NativeMML")}c.Startup.signal.Post("NativeMML output selected")}else{if(MathJax.OutputJax["HTML-CSS"]){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}else{c.config.jax.unshift("output/HTML-CSS")}c.Startup.signal.Post("HTML-CSS output selected")}}else{c.PreProcess.disabled=true;c.prepareScripts.disabled=true;MathJax.Message.Set("Your browser does not support MathJax",null,4000);c.Startup.signal.Post("MathJax not supported")}})})(MathJax.Hub);MathJax.Ajax.loadComplete("[MathJax]/config/MMLorHTML.js");
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,606 @@
|
|||
/*************************************************************
|
||||
*
|
||||
* MathJax/config/default.js
|
||||
*
|
||||
* This configuration file is loaded when you load MathJax
|
||||
* via <script src="MathJax.js?config=default"></script>
|
||||
*
|
||||
* Use it to customize the MathJax settings. See comments below.
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2009-2011 Design Science, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This file lists most, but not all, of the options that can be set for
|
||||
* MathJax and its various components. Some additional options are
|
||||
* available, however, and are listed in the various links at:
|
||||
*
|
||||
* http://www.mathjax.org/resources/docs/?configuration.html#configuration-options-by-component
|
||||
*
|
||||
* You can add these to the configuration object below if you
|
||||
* want to change them from their default values.
|
||||
*/
|
||||
|
||||
MathJax.Hub.Config({
|
||||
|
||||
//
|
||||
// A comma-separated list of configuration files to load
|
||||
// when MathJax starts up. E.g., to define local macros, etc.
|
||||
// The default directory is the MathJax/config directory.
|
||||
//
|
||||
// Example: config: ["local/local.js"],
|
||||
// Example: config: ["local/local.js","MMLtoHTML.js"],
|
||||
//
|
||||
config: [],
|
||||
|
||||
//
|
||||
// A comma-separated list of CSS stylesheet files to be loaded
|
||||
// when MathJax starts up. The default directory is the
|
||||
// MathJax/config directory.
|
||||
//
|
||||
// Example: styleSheets: ["MathJax.css"],
|
||||
//
|
||||
styleSheets: [],
|
||||
|
||||
//
|
||||
// Styles to be defined dynamically at startup time.
|
||||
//
|
||||
// Example:
|
||||
// styles: {
|
||||
// ".MathJax .merror": {
|
||||
// color: "blue",
|
||||
// "background-color": "green"
|
||||
// }
|
||||
// },
|
||||
//
|
||||
styles: {},
|
||||
|
||||
//
|
||||
// A comma-separated list of input and output jax to initialize at startup.
|
||||
// Their main code is loaded only when they are actually used, so it is not
|
||||
// inefficient to include jax that may not actually be used on the page. These
|
||||
// are found in the MathJax/jax directory.
|
||||
//
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
|
||||
//
|
||||
// A comma-separated list of extensions to load at startup. The default
|
||||
// directory is MathJax/extensions.
|
||||
//
|
||||
// Example: extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"],
|
||||
//
|
||||
extensions: ["tex2jax.js"],
|
||||
|
||||
//
|
||||
// Patterns to remove from before and after math script tags. If you are not
|
||||
// using one of the preprocessors (e.g., tex2jax), you need to insert something
|
||||
// extra into your HTML file in order to avoid a bug in Internet Explorer. IE
|
||||
// removes spaces from the DOM that it thinks are redundent, and since a SCRIPT
|
||||
// tag usually doesn't add content to the page, if there is a space before and after
|
||||
// a MathJax SCRIPT tag, IE will remove the first space. When MathJax inserts
|
||||
// the typeset mathematics, this means there will be no space before it and the
|
||||
// preceeding text. In order to avoid this, you should include some "guard characters"
|
||||
// before or after the math SCRIPT tag; define the patterns you want to use below.
|
||||
// Note that these are used as regular expressions, so you will need to quote
|
||||
// special characters. Furthermore, since they are javascript strings, you must
|
||||
// quote javascript special characters as well. So to obtain a backslash, you must
|
||||
// use \\ (doubled for javascript). For example, "\\[" is the pattern \[ in the
|
||||
// regular expression. That means that if you want an actual backslash in your
|
||||
// guard characters, you need to use "\\\\" in order to get \\ in the regular
|
||||
// expression, and \ in the actual text. If both preJax and postJax are defined,
|
||||
// both must be present in order to be removed.
|
||||
//
|
||||
// See also the preRemoveClass comments below.
|
||||
//
|
||||
// Example:
|
||||
// preJax: "\\\\\\\\", // makes a double backslash the preJax text
|
||||
// or
|
||||
// preJax: "\\[\\[", // jax scripts must be enclosed in double brackets
|
||||
// postJax: "\\]\\]",
|
||||
//
|
||||
preJax: null,
|
||||
postJax: null,
|
||||
|
||||
//
|
||||
// The CSS class for a math preview to be removed preceeding a MathJax
|
||||
// SCRIPT tag. If the tag just before the MathJax SCRIPT tag is of this
|
||||
// class, its contents are removed when MathJax processes the SCRIPT
|
||||
// tag. This allows you to include a math preview in a form that will
|
||||
// be displayed prior to MathJax performing its typesetting. It also
|
||||
// avoids the Internet Explorer space-removal bug, and can be used in
|
||||
// place of preJax and postJax if that is more convenient.
|
||||
//
|
||||
// For example
|
||||
//
|
||||
// <span class="MathJax_Preview">[math]</span><script type="math/tex">...</script>
|
||||
//
|
||||
// would display "[math]" in place of the math until MathJax is able to typeset it.
|
||||
//
|
||||
preRemoveClass: "MathJax_Preview",
|
||||
|
||||
//
|
||||
// This value controls whether the "Processing Math: nn%" message are displayed
|
||||
// in the lower left-hand corner. Set to "false" to prevent those messages (though
|
||||
// file loading and other messages will still be shown).
|
||||
//
|
||||
showProcessingMessages: true,
|
||||
|
||||
//
|
||||
// This value controls the verbosity of the messages in the lower left-hand corner.
|
||||
// Set it to "none" to eliminate all messages, or set it to "simple" to show
|
||||
// "Loading..." and "Processing..." rather than showing the full file name and the
|
||||
// percentage of the mathematics processed.
|
||||
//
|
||||
messageStyle: "normal",
|
||||
|
||||
//
|
||||
// These two parameters control the alignment and shifting of displayed equations.
|
||||
// The first can be "left", "center", or "right", and determines the alignment of
|
||||
// displayed equations. When the alignment is not "center", the second determines
|
||||
// an indentation from the left or right side for the displayed equations.
|
||||
//
|
||||
displayAlign: "center",
|
||||
displayIndent: "0em",
|
||||
|
||||
//
|
||||
// Normally MathJax will perform its starup commands (loading of
|
||||
// configuration, styles, jax, and so on) as soon as it can. If you
|
||||
// expect to be doing additional configuration on the page, however, you
|
||||
// may want to have it wait until the page's onload hander is called. If so,
|
||||
// set this to "onload".
|
||||
//
|
||||
delayStartupUntil: "none",
|
||||
|
||||
//
|
||||
// Normally MathJax will typeset the mathematics on the page as soon as
|
||||
// the page is loaded. If you want to delay that process, in which case
|
||||
// you will need to call MathJax.Hub.Typeset() yourself by hand, set
|
||||
// this value to true.
|
||||
//
|
||||
skipStartupTypeset: false,
|
||||
|
||||
//
|
||||
// A list of element ID's that are the ones to process for mathematics
|
||||
// when any of the Hub typesetting calls (Typeset, Process, Update, etc)
|
||||
// are called with no element specified. This lets you restrict the
|
||||
// processing to particular containers rather than scanning the entire
|
||||
// document for mathematics. If none are supplied, the entire document
|
||||
// is processed.
|
||||
//
|
||||
elements: [],
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the tex2jax preprocessor (when you have included
|
||||
// "tex2jax.js" in the extensions list above).
|
||||
//
|
||||
tex2jax: {
|
||||
|
||||
//
|
||||
// The delimiters that surround in-line math expressions. The first in each
|
||||
// pair is the initial delimiter and the second is the terminal delimiter.
|
||||
// Comment out any that you don't want, but be sure there is no extra
|
||||
// comma at the end of the last item in the list -- some browsers won't
|
||||
// be able to handle that.
|
||||
//
|
||||
inlineMath: [
|
||||
// ['$','$'], // uncomment this for standard TeX math delimiters
|
||||
['\\(','\\)']
|
||||
],
|
||||
|
||||
//
|
||||
// The delimiters that surround displayed math expressions. The first in each
|
||||
// pair is the initial delimiter and the second is the terminal delimiter.
|
||||
// Comment out any that you don't want, but be sure there is no extra
|
||||
// comma at the end of the last item in the list -- some browsers won't
|
||||
// be able to handle that.
|
||||
//
|
||||
displayMath: [
|
||||
['$$','$$'],
|
||||
['\\[','\\]']
|
||||
],
|
||||
|
||||
//
|
||||
// This array lists the names of the tags whose contents should not be
|
||||
// processed by tex2jax (other than to look for ignore/process classes
|
||||
// as listed below). You can add to (or remove from) this list to prevent
|
||||
// MathJax from processing mathematics in specific contexts.
|
||||
//
|
||||
skipTags: ["script","noscript","style","textarea","pre","code"],
|
||||
|
||||
//
|
||||
// This is the class name used to mark elements whose contents should
|
||||
// not be processed by tex2jax (other than to look for the
|
||||
// processClass pattern below). Note that this is a regular
|
||||
// expression, and so you need to be sure to quote any regexp special
|
||||
// characters. The pattern is automatically preceeded by '(^| )(' and
|
||||
// followed by ')( |$)', so your pattern will have to match full words
|
||||
// in the class name. Assigning an element this class name will
|
||||
// prevent `tex2jax` from processing its contents.
|
||||
//
|
||||
ignoreClass: "tex2jax_ignore",
|
||||
|
||||
//
|
||||
// This is the class name used to mark elements whose contents SHOULD
|
||||
// be processed by tex2jax. This is used to turn on processing within
|
||||
// tags that have been marked as ignored or skipped above. Note that
|
||||
// this is a regular expression, and so you need to be sure to quote
|
||||
// any regexp special characters. The pattern is automatically
|
||||
// preceeded by '(^| )(' and followed by ')( |$)', so your pattern
|
||||
// will have to match full words in the class name. Use this to
|
||||
// restart processing within an element that has been marked as
|
||||
// ignored above.
|
||||
//
|
||||
processClass: "tex2jax_process",
|
||||
|
||||
//
|
||||
// Set to "true" to allow \$ to produce a dollar without starting in-line
|
||||
// math mode. If you uncomment the ['$','$'] line above, you should change
|
||||
// this to true so that you can insert plain dollar signs into your documents
|
||||
//
|
||||
processEscapes: false,
|
||||
|
||||
//
|
||||
// Controls whether tex2jax processes LaTeX environments outside of math
|
||||
// mode. Set to "false" to prevent processing of environments except within
|
||||
// math mode.
|
||||
//
|
||||
processEnvironments: true,
|
||||
|
||||
//
|
||||
// Controls whether tex2jax inserts MathJax_Preview spans to make a
|
||||
// preview available, and what preview to use, when it locates in-line
|
||||
// and display mathetics on the page. The default is "TeX", which
|
||||
// means use the TeX code as the preview (until it is processed by
|
||||
// MathJax). Set to "none" to prevent the previews from being
|
||||
// inserted (the math will simply disappear until it is typeset). Set
|
||||
// to an array containing the description of an HTML snippet in order
|
||||
// to use the same preview for all equations on the page (e.g., you
|
||||
// could have it say "[math]" or load an image).
|
||||
//
|
||||
// E.g., preview: ["[math]"],
|
||||
// or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]]
|
||||
//
|
||||
preview: "TeX"
|
||||
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the mml2jax preprocessor (when you have included
|
||||
// "mml2jax.js" in the extensions list above).
|
||||
//
|
||||
mml2jax: {
|
||||
|
||||
//
|
||||
// Controls whether mml2jax inserts MathJax_Preview spans to make a
|
||||
// preview available, and what preview to use, whrn it locates
|
||||
// mathematics on the page. The default is "alttext", which means use
|
||||
// the <math> tag's alttext attribute as the preview (until it is
|
||||
// processed by MathJax), if the tag has one. Set to "none" to
|
||||
// prevent the previews from being inserted (the math will simply
|
||||
// disappear until it is typeset). Set to an array containing the
|
||||
// description of an HTML snippet in order to use the same preview for
|
||||
// all equations on the page (e.g., you could have it say "[math]" or
|
||||
// load an image).
|
||||
//
|
||||
// E.g., preview: ["[math]"],
|
||||
// or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]]
|
||||
//
|
||||
preview: "alttext"
|
||||
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the jsMath2jax preprocessor (when you have included
|
||||
// "jsMath2jax.js" in the extensions list above).
|
||||
//
|
||||
jsMath2jax: {
|
||||
|
||||
//
|
||||
// Controls whether jsMath2jax inserts MathJax_Preview spans to make a
|
||||
// preview available, and what preview to use, when it locates
|
||||
// mathematics on the page. The default is "TeX", which means use the
|
||||
// TeX code as the preview (until it is processed by MathJax). Set to
|
||||
// "none" to prevent the previews from being inserted (the math will
|
||||
// simply disappear until it is typeset). Set to an array containing
|
||||
// the description of an HTML snippet in order to use the same preview
|
||||
// for all equations on the page (e.g., you could have it say "[math]"
|
||||
// or load an image).
|
||||
//
|
||||
// E.g., preview: ["[math]"],
|
||||
// or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]]
|
||||
//
|
||||
preview: "TeX"
|
||||
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the TeX input jax.
|
||||
//
|
||||
TeX: {
|
||||
|
||||
//
|
||||
// This specifies the side on which \tag{} macros will place the tags.
|
||||
// Set to "left" to place on the left-hand side.
|
||||
//
|
||||
TagSide: "right",
|
||||
|
||||
//
|
||||
// This is the amound of indentation (from right or left) for the tags.
|
||||
//
|
||||
TagIndent: ".8em",
|
||||
|
||||
//
|
||||
// This is the width to use for the multline environment
|
||||
//
|
||||
MultLineWidth: "85%",
|
||||
|
||||
//
|
||||
// List of macros to define. These are of the form
|
||||
// name: value
|
||||
// where 'value' is the replacement text for the macro \name.
|
||||
// The 'value' can also be [value,n] where 'value' is the replacement
|
||||
// text and 'n' is the number of parameters for the macro.
|
||||
// Note that backslashes must be doubled in the replacement string.
|
||||
//
|
||||
// E.g.,
|
||||
//
|
||||
// Macros: {
|
||||
// RR: '{\\bf R}',
|
||||
// bold: ['{\\bf #1}', 1]
|
||||
// }
|
||||
//
|
||||
Macros: {}
|
||||
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the MathML inupt jax.
|
||||
//
|
||||
MathML: {
|
||||
//
|
||||
// This specifies whether to use TeX spacing or MathML spacing when the
|
||||
// HTML-CSS output jax is used.
|
||||
//
|
||||
useMathMLspacing: false
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the HTML-CSS output jax.
|
||||
//
|
||||
"HTML-CSS": {
|
||||
|
||||
//
|
||||
// This controls the global scaling of mathematics as compared to the
|
||||
// surrounding text. Values between 100 and 133 are usually good choices.
|
||||
//
|
||||
scale: 100,
|
||||
|
||||
//
|
||||
// This is a list of the fonts to look for on a user's computer in
|
||||
// preference to using MathJax's web-based fonts. These must
|
||||
// correspond to directories available in the jax/output/HTML-CSS/fonts
|
||||
// directory, where MathJax stores data about the characters available
|
||||
// in the fonts. Set this to ["TeX"], for example, to prevent the
|
||||
// use of the STIX fonts, or set it to an empty list, [], if
|
||||
// you want to force MathJax to use web-based or image fonts.
|
||||
//
|
||||
availableFonts: ["STIX","TeX"],
|
||||
|
||||
//
|
||||
// This is the preferred font to use when more than one of those
|
||||
// listed above is available.
|
||||
//
|
||||
preferredFont: "TeX",
|
||||
|
||||
//
|
||||
// This is the web-based font to use when none of the fonts listed
|
||||
// above are available on the user's computer. Note that currently
|
||||
// only the TeX font is available in a web-based form. Set this to
|
||||
//
|
||||
// webFont: null,
|
||||
//
|
||||
// if you want to prevent the use of web-based fonts.
|
||||
//
|
||||
webFont: "TeX",
|
||||
|
||||
//
|
||||
// This is the font to use for image fallback mode (when none of the
|
||||
// fonts listed above are available and the browser doesn't support
|
||||
// web-fonts via the @font-face CSS directive). Note that currently
|
||||
// only the TeX font is available as an image font. Set this to
|
||||
//
|
||||
// imageFont: null,
|
||||
//
|
||||
// if you want to prevent the use of image fonts (e.g., you have not
|
||||
// installed the image fonts on your server). In this case, only
|
||||
// browsers that support web-based fonts will be able to view your pages
|
||||
// without having the fonts installed on the client computer. The browsers
|
||||
// that support web-based fonts include: IE6 and later, Chrome, Safari3.1
|
||||
// and above, Firefox3.5 and later, and Opera10 and later. Note that
|
||||
// Firefox3.0 is NOT on this list, so without image fonts, FF3.0 users
|
||||
// will be required to to download and install either the STIX fonts or the
|
||||
// MathJax TeX fonts.
|
||||
//
|
||||
imageFont: "TeX",
|
||||
|
||||
//
|
||||
// This is the font-family CSS value used for characters that are not
|
||||
// in the selected font (e.g., for web-based fonts, this is where to
|
||||
// look for characters not included in the MathJax_* fonts). IE will
|
||||
// stop looking after the first font that exists on the system (even
|
||||
// if it doesn't contain the needed character), so order these carefully.
|
||||
//
|
||||
undefinedFamily: "STIXGeneral,'Arial Unicode MS',serif",
|
||||
|
||||
//
|
||||
// This controls whether the MathJax contextual menu will be available
|
||||
// on the mathematics in the page. If true, then right-clicking (on
|
||||
// the PC) or control-clicking (on the Mac) will produce a MathJax
|
||||
// menu that allows you to get the source of the mathematics in
|
||||
// various formats, change the size of the mathematics relative to the
|
||||
// surrounding text, and get information about MathJax.
|
||||
//
|
||||
// Set this to false to disable the menu. When true, the MathMenu
|
||||
// items below configure the actions of the menu.
|
||||
//
|
||||
showMathMenu: true,
|
||||
|
||||
//
|
||||
// This allows you to define or modify the styles used to display
|
||||
// various math elements created by MathJax.
|
||||
//
|
||||
// Example:
|
||||
// styles: {
|
||||
// ".MathJax_Preview": {
|
||||
// "font-size": "80%", // preview uses a smaller font
|
||||
// color: "red" // and is in red
|
||||
// }
|
||||
// }
|
||||
//
|
||||
styles: {},
|
||||
|
||||
//
|
||||
// Configuration for <maction> tooltips
|
||||
// (see also the #MathJax_Tooltip CSS in MathJax/jax/output/HTML-CSS/config.js,
|
||||
// which can be overriden using the styles values above).
|
||||
//
|
||||
tooltip: {
|
||||
delayPost: 600, // milliseconds delay before tooltip is posted after mouseover
|
||||
delayClear: 600, // milliseconds delay before tooltip is cleared after mouseout
|
||||
offsetX: 10, offsetY: 5 // pixels to offset tooltip from mouse position
|
||||
}
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the NativeMML output jax.
|
||||
//
|
||||
NativeMML: {
|
||||
|
||||
//
|
||||
// This controls the global scaling of mathematics as compared to the
|
||||
// surrounding text. Values between 100 and 133 are usually good choices.
|
||||
//
|
||||
scale: 100,
|
||||
|
||||
//
|
||||
// This controls whether the MathJax contextual menu will be available
|
||||
// on the mathematics in the page. If true, then right-clicking (on
|
||||
// the PC) or control-clicking (on the Mac) will produce a MathJax
|
||||
// menu that allows you to get the source of the mathematics in
|
||||
// various formats, change the size of the mathematics relative to the
|
||||
// surrounding text, and get information about MathJax.
|
||||
//
|
||||
// Set this to false to disable the menu. When true, the MathMenu
|
||||
// items below configure the actions of the menu.
|
||||
//
|
||||
// There is a separate setting for MSIE, since the code to handle that
|
||||
// is a bit delicate; if it turns out to have unexpected consequences,
|
||||
// you can turn it off without turing off other browser support.
|
||||
//
|
||||
showMathMenu: true,
|
||||
showMathMenuMSIE: true,
|
||||
|
||||
//
|
||||
// This allows you to define or modify the styles used to display
|
||||
// various math elements created by MathJax.
|
||||
//
|
||||
// Example:
|
||||
// styles: {
|
||||
// ".MathJax_MathML": {
|
||||
// color: "red" // MathML is in red
|
||||
// }
|
||||
// }
|
||||
//
|
||||
styles: {}
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the contextual menus that are available on the
|
||||
// mathematics within the page (provided the showMathMenu value is true above).
|
||||
//
|
||||
MathMenu: {
|
||||
//
|
||||
// This is the hover delay for the display of submenus in the
|
||||
// contextual menu. When the mouse is still over a submenu label for
|
||||
// this long, the menu will appear. (The menu also will appear if you
|
||||
// click on the label.) It is in milliseconds.
|
||||
//
|
||||
delay: 400,
|
||||
|
||||
//
|
||||
// This is the URL for the MathJax Help menu item.
|
||||
//
|
||||
helpURL: "http://www.mathjax.org/help/user/",
|
||||
|
||||
//
|
||||
// These control whether the "Math Renderer", "Font Preferences",
|
||||
// and "Contextual Menu" submenus will be displayed or not.
|
||||
//
|
||||
showRenderer: true,
|
||||
showFontMenu: false,
|
||||
showContext: false,
|
||||
|
||||
//
|
||||
// These are the settings for the Show Source window. The initial
|
||||
// width and height will be reset after the source is shown in an
|
||||
// attempt to make the window fit the output better.
|
||||
//
|
||||
windowSettings: {
|
||||
status: "no", toolbar: "no", locationbar: "no", menubar: "no",
|
||||
directories: "no", personalbar: "no", resizable: "yes", scrollbars: "yes",
|
||||
width: 100, height: 50
|
||||
},
|
||||
|
||||
//
|
||||
// This allows you to change the CSS that controls the menu
|
||||
// appearance. See the extensions/MathMenu.js file for details
|
||||
// of the default settings.
|
||||
//
|
||||
styles: {}
|
||||
|
||||
},
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// These parameters control the MMLorHTML configuration file.
|
||||
// NOTE: if you add MMLorHTML.js to the config array above,
|
||||
// you must REMOVE the output jax from the jax array.
|
||||
//
|
||||
MMLorHTML: {
|
||||
//
|
||||
// The output jax that is to be preferred when both are possible
|
||||
// (set to "MML" for native MathML, "HTML" for MathJax's HTML-CSS output jax).
|
||||
//
|
||||
prefer: {
|
||||
MSIE: "MML",
|
||||
Firefox: "MML",
|
||||
Opera: "HTML",
|
||||
other: "HTML"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/config/default.js");
|
|
@ -0,0 +1,24 @@
|
|||
MathJax.Hub.Config({
|
||||
config: ["MMLorHTML.js"],
|
||||
jax: ["input/MathML"],
|
||||
extensions: ["mml2jax.js","MathMenu.js","MathZoom.js"],
|
||||
MathML: {
|
||||
useMathMLspacing: true
|
||||
},
|
||||
"HTML-CSS": {
|
||||
preferredFont: "STIX",
|
||||
scale: 90
|
||||
},
|
||||
MMLorHTML: {
|
||||
prefer:
|
||||
{
|
||||
MSIE: "MML",
|
||||
Firefox: "MML",
|
||||
Opera: "HTML",
|
||||
other: "HTML"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Hub.Startup.onload();
|
||||
MathJax.Ajax.loadComplete("[MathJax]/config/local/local.js");
|
|
@ -0,0 +1,37 @@
|
|||
/*************************************************************
|
||||
*
|
||||
* MathJax/config/local/local.js
|
||||
*
|
||||
* Include changes and configuration local to your installation
|
||||
* in this file. For example, common macros can be defined here
|
||||
* (see below). To use this file, add "local/local.js" to the
|
||||
* config array in MathJax.js or your MathJax.Hub.Config() call.
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2009 Design Science, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
var TEX = MathJax.InputJax.TeX;
|
||||
|
||||
// place macros here. E.g.:
|
||||
// TEX.Macro("R","{\\bf R}");
|
||||
// TEX.Macro("op","\\mathop{\\rm #1}",1); // a macro with 1 parameter
|
||||
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[MathJax]/config/local/local.js");
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* /MathJax/extensions/FontWarnings.js
|
||||
*
|
||||
* Copyright (c) 2010 Design Science, Inc.
|
||||
*
|
||||
* Part of the MathJax library.
|
||||
* See http://www.mathjax.org for details.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0;
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
(function(d,g){var f="1.1";var b=d.CombineConfig("FontWarnings",{messageStyle:{position:"fixed",bottom:"4em",left:"3em",width:"40em",border:"3px solid #880000","background-color":"#E0E0E0",padding:"1em","font-size":"small","white-space":"normal","border-radius":".75em","-webkit-border-radius":".75em","-moz-border-radius":".75em","-khtml-border-radius":".75em","box-shadow":"4px 4px 10px #AAAAAA","-webkit-box-shadow":"4px 4px 10px #AAAAAA","-moz-box-shadow":"4px 4px 10px #AAAAAA","-khtml-box-shadow":"4px 4px 10px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=3, OffY=3, Color='gray', Positive='true')"},Message:{webFont:[["closeBox"],"MathJax is using web-based fonts to display the mathematics ","on this page. These take time to download, so the page would","render faster if you installed math fonts directly in your ","system's font folder.",["fonts"]],imageFonts:[["closeBox"],"MathJax is using its image fonts rather than local or web-based fonts. ","This will render slower than usual, and the mathematics may not print ","at the full resolution of your printer.",["fonts"],["webfonts"]],noFonts:[["closeBox"],"MathJax is unable to locate a font to use to display ","its mathematics, and image fonts are not available, so it ","is falling back on generic unicode characters in hopes that ","your browser will be able to display them. Some characters ","may not show up properly, or possibly not at all.",["fonts"],["webfonts"]]},HTML:{closeBox:[["div",{style:{position:"absolute",overflow:"hidden",top:".1em",right:".1em",border:"1px outset",width:"1em",height:"1em","text-align":"center",cursor:"pointer","background-color":"#EEEEEE",color:"#606060","border-radius":".5em","-webkit-border-radius":".5em","-moz-border-radius":".5em","-khtml-border-radius":".5em"},onclick:function(){if(c.div&&c.fade===0){if(c.timer){clearTimeout(c.timer)}c.div.style.display="none"}}},[["span",{style:{position:"relative",bottom:".2em"}},["x"]]]]],webfonts:[["p"],"Most modern browsers allow for fonts to be downloaded over the web. ","Updating to a more recent version of your browser (or changing browsers) ","could improve the quality of the mathematics on this page."],fonts:[["p"],"MathJax can use either the ",["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"]," or the ",["a",{href:"http://www.mathjax.org/help/fonts/",target:"_blank"},["MathJax TeX fonts"]],". Download and install either one to improve your MathJax experience."],STIXfonts:[["p"],"This page is designed to use the ",["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"],". Download and install those fonts to improve your MathJax experience."],TeXfonts:[["p"],"This page is designed to use the ",["a",{href:"http://www.mathjax.org/help/fonts/",target:"_blank"},["MathJax TeX fonts"]],". Download and install those fonts to improve your MathJax experience."]},removeAfter:12*1000,fadeoutSteps:10,fadeoutTime:1.5*1000});if(MathJax.Hub.Browser.isIE9&&document.documentMode>=9){delete b.messageStyle.filter}var c={div:null,fade:0};var a=function(k){if(c.div){return}var h=MathJax.OutputJax["HTML-CSS"],l=document.body;if(d.Browser.isMSIE){if(b.messageStyle.position==="fixed"){MathJax.Message.Init();l=document.getElementById("MathJax_MSIE_Frame");b.messageStyle.position="absolute"}}else{delete b.messageStyle.filter}b.messageStyle.maxWidth=(document.body.clientWidth-75)+"px";var j=0;while(j<k.length){if(k[j] instanceof Array&&b.HTML[k[j][0]]){k.splice.apply(k,[j,1].concat(b.HTML[k[j][0]]))}else{j++}}c.div=h.addElement(l,"div",{id:"MathJax_FontWarning",style:b.messageStyle},k);if(b.removeAfter){d.Register.StartupHook("End",function(){c.timer=setTimeout(e,b.removeAfter)})}g.Cookie.Set("fontWarn",{warned:true})};var e=function(){c.fade++;if(c.timer){delete c.timer}if(c.fade<b.fadeoutSteps){var h=1-c.fade/b.fadeoutSteps;c.div.style.opacity=h;c.div.style.filter="alpha(opacity="+Math.floor(100*h)+")";setTimeout(e,b.fadeoutTime/b.fadeoutSteps)}else{c.div.style.display="none"}};if(!g.Cookie.Get("fontWarn").warned){d.Startup.signal.Interest(function(k){if(k.match(/HTML-CSS Jax - /)&&!c.div){var h=MathJax.OutputJax["HTML-CSS"],l=h.config.availableFonts,j;var i=(l&&l.length);if(!i){b.HTML.fonts=[""]}else{if(l.length===1){b.HTML.fonts=b.HTML[l[0]+"fonts"]}}if(h.allowWebFonts){b.HTML.webfonts=[""]}if(k.match(/- Web-Font/)){if(i){j="webFont"}}else{if(k.match(/- using image fonts/)){j="imageFonts"}else{if(k.match(/- no valid font/)){j="noFonts"}}}if(j&&b.Message[j]){a(b.Message[j])}}})}})(MathJax.Hub,MathJax.HTML);MathJax.Ajax.loadComplete("[MathJax]/extensions/FontWarnings.js");
|
||||
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue