Compare commits

...

509 Commits

Author SHA1 Message Date
Jacques Distler 47e76794cd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-12-03 17:34:58 -06:00
Jacques Distler 40fd643680 Update Maruku 2011-12-03 17:31:53 -06:00
Jacques Distler def8e9ae0f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-11-10 16:07:27 -06:00
Jacques Distler b52a66c207 Don't escape style_additions
Credit to Andrew Stacey
2011-11-10 16:03:54 -06:00
Jacques Distler 4a3d7e0b78 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-10-26 14:23:21 -05:00
Jacques Distler 57d52b0d15 I am a doofus
Noticed by Andrew Stacey
2011-10-26 14:21:01 -05:00
Jacques Distler 1ce128348c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-10-14 10:39:14 -05:00
Jacques Distler 987140ed83 Fix SVG-Edit bug 2011-10-14 10:35:56 -05:00
Jacques Distler 072e2e1e92 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-10-09 11:50:18 -05:00
Jacques Distler b48a56028a Avoid invalid WikiFile links
Reported by Andrew Stacey.
2011-10-09 11:47:04 -05:00
Jacques Distler 8cf98a4711 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-30 23:54:06 -05:00
Jacques Distler 66b8f3454d Update SVG-Edit (zoomed-path editing bug) 2011-09-30 23:52:09 -05:00
Jacques Distler f331becb64 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-30 00:11:42 -05:00
Jacques Distler 2d9cc8bf4d Fix tombstone bug and an SVG-Edit regression
Bug reported by Andrew Stacey
2011-09-30 00:07:53 -05:00
Jacques Distler f1e47a7ec5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-24 00:04:37 -05:00
Jacques Distler e749ee1e4b Update SVG-Edit 2011-09-24 00:01:43 -05:00
Jacques Distler c102e10315 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-23 15:21:21 -05:00
Jacques Distler 22a27c8391 Fix Theorem Environment
The fixRunIn() Javascript method
assumed that the next element after
the header was a 'p' element.

Reported by Andrew Stacey.
2011-09-23 15:18:08 -05:00
Jacques Distler 7e4c7c447e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-23 02:46:31 -05:00
Jacques Distler f6d350302c Another one... 2011-09-23 01:25:52 -05:00
Jacques Distler 88dd41e75f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-22 07:55:59 -05:00
Jacques Distler e4b00f0bff Fix bug in Maruku to_html_document_tree
Reported by Remi.
2011-09-22 07:52:40 -05:00
Jacques Distler 0f4a76d895 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-21 13:39:21 -05:00
Jacques Distler 4b09e0322f Another Cache-Sweeping efficiency 2011-09-21 13:37:33 -05:00
Jacques Distler 07aca55e6e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-21 08:07:47 -05:00
Jacques Distler b6c0ffa0d5 A slight improvement in the efficiency of the Cache Sweeper
Suggested by Andrew Stacey
2011-09-20 23:46:36 -05:00
Jacques Distler ddcf022264 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-10 23:21:54 -05:00
Jacques Distler d30bd11ff7 Also update SVG-Edit for itex2MML 1.4.7 2011-09-10 23:19:26 -05:00
Jacques Distler 1f8a4fe282 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-09 11:35:26 -05:00
Jacques Distler eff8c87d39 Better 2011-09-09 11:33:41 -05:00
Jacques Distler 60a595de17 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-09 00:11:44 -05:00
Jacques Distler c603aca852 Expire pages that want file, when file is successfully uploaded
Reported by Andrew Stacey
2011-09-09 00:05:54 -05:00
Jacques Distler 8c74de6670 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-07 15:41:53 -05:00
Jacques Distler ee05118e8f Update for itextomml 1.4.7 2011-09-07 15:39:41 -05:00
Jacques Distler c7b46cbde3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-05 02:53:39 -05:00
Jacques Distler 7bf832e8c7 Add voffset as an allowed MathML attribute 2011-09-05 02:50:15 -05:00
Jacques Distler f5c892c717 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-03 11:35:37 -05:00
Jacques Distler 364de9dbab Better
3rd time's the charm?
2011-09-03 11:33:51 -05:00
Jacques Distler 1efa08dcc7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-09-03 11:14:59 -05:00
Jacques Distler ddf1846fe1 Fix double-escaping of flash messages (for real, this time) 2011-09-03 11:12:49 -05:00
Jacques Distler 04ca7e8a38 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-31 11:59:26 -05:00
Jacques Distler f9e60828c7 Instiki 0.19.3 2011-08-31 11:57:20 -05:00
Jacques Distler 9e25ada5c8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-27 22:01:07 -05:00
Jacques Distler 66f62bac1f Source view for Revisions 2011-08-27 21:58:14 -05:00
Jacques Distler e00b2a0ac0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-27 19:33:54 -05:00
Jacques Distler 2801421969 Another Maruku bug: bold in italics 2011-08-27 19:31:02 -05:00
Jacques Distler b1d1f74b7d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-27 16:34:33 -05:00
Jacques Distler a088201062 Null search
Search without a query-param should
not result in a application error.
2011-08-27 16:30:57 -05:00
Jacques Distler c5a2e325c0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-27 09:45:27 -05:00
Jacques Distler 26ed59485a This bug is fixed. 2011-08-27 09:42:50 -05:00
Jacques Distler 2d303d54a0 Better text/html serialization
For the Andrew Staceys of this world:
deal with empty element in a more
text/html-friendly fashion.
2011-08-27 02:40:40 -05:00
Jacques Distler 453693a868 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-26 20:56:53 -05:00
Jacques Distler 27ad6ff2a8 Multiple instances of the same abbreviation
Convert all of them, not just the first, when
they occur in the same string.
2011-08-26 20:55:04 -05:00
Jacques Distler e26c12229e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-23 14:39:30 -05:00
Jacques Distler 903c4b6bdd Pre Chunk-Handler gets confused when XML parser converts empty elements to short-tag syntax.
Reported by Andrew Stacey.
2011-08-23 14:35:27 -05:00
Jacques Distler 09b2d24a18 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-22 11:02:44 -05:00
Jacques Distler e387d095ec Fix double-escaping on Search Page
Reported by Andrew Stacey
2011-08-22 11:00:03 -05:00
Jacques Distler 2d21eabee8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-22 10:26:46 -05:00
Jacques Distler 6f18c90a50 Ack! 2 more Maruku Errors
1. #to_html_code was not working
  (my own #$%* fault, for trying
  to be too fancy).
2. Empty list items. 
   Reported by Andrew Stacey
2011-08-22 10:20:17 -05:00
Jacques Distler 03fc0324db Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-22 08:21:43 -05:00
Jacques Distler 6b86177620 Whoops! Need to update those. 2011-08-22 08:19:39 -05:00
Jacques Distler 3a54d7ee72 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-21 14:00:08 -05:00
Jacques Distler 477bd91567 More Maruku #to_markdown fixes.
Is there any point to this?
What version of Markdown are
we targetting, anyway?
2011-08-21 13:41:20 -05:00
Jacques Distler 1df2483663 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-21 02:50:01 -05:00
Jacques Distler f463a3b1c8 Fix Maruku Indented Codeblocks
I'd screwed that up.
Also, fix some bugs in the #to_md
output method. Still not correct
(and I'm not sure I'm going to
bother completing the job), but
better.
2011-08-21 02:43:43 -05:00
Jacques Distler a739a52f54 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-19 19:37:14 -05:00
Jacques Distler 1e352e28a1 Make Sanitizer::safe_xhtml_sanitize use Nokogiri
Also, update Bundler to 1.0.18.
2011-08-19 19:32:53 -05:00
Jacques Distler 85cada931d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-19 01:57:27 -05:00
Jacques Distler 4b2448b09a Security: Update to Rails 2.3.14 2011-08-19 01:54:58 -05:00
Jacques Distler c1826775d2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-15 10:20:14 -05:00
Jacques Distler 3c650f2cf6 StringScanner is not multibyte-safe. Avoid like the plague. 2011-08-15 10:18:18 -05:00
Jacques Distler ecaf67dca9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-14 16:58:45 -05:00
Jacques Distler f7bce2c773 Another Maruku link bug 2011-08-14 16:54:21 -05:00
Jacques Distler 89f6b69245 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-14 02:18:43 -05:00
Jacques Distler 5c51f930b0 Fix another Maruku bbug
Image titles were not being output (a long-standing Maruku bug).
Also fix some broken specs. All the HTML specs pass. I hope they're
"correct".
2011-08-14 02:16:15 -05:00
Jacques Distler ce97abe6ac Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-13 04:01:43 -05:00
Jacques Distler 070f689f9c Fixed some Maruku bugs
Email addresses and horizontal rules now work properly.
2011-08-13 03:59:40 -05:00
Jacques Distler 5fd725e3a8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-11 20:40:12 -05:00
Jacques Distler 13a522525c REXML is dead. Long live Nokogiri.
Modify Maruku to use Nokogiri instead of REXML.
Produces a 3-fold speedup in the #to_html method.
2011-08-11 20:36:44 -05:00
Jacques Distler 6005297cfe Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-08 01:55:44 -05:00
Jacques Distler 46da1f3aaf Tweaks to lib/chunks/engines.rb 2011-08-08 01:54:06 -05:00
Jacques Distler a72d35bd4e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-08 01:46:38 -05:00
Jacques Distler 201c25ce83 Small tweaks to Maruku
A real speedup could be had by redoing output/to_html.rb
2011-08-08 01:44:01 -05:00
Jacques Distler c9312367c9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-05 09:09:12 -05:00
Jacques Distler 47996ea1d3 Fix tests for above.
Set does not have a 'last' method.
2011-08-05 09:06:44 -05:00
Jacques Distler f23e1487df Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-08-05 02:02:43 -05:00
Jacques Distler 14592f57f9 Some small efficiencies in the Chunk-handler
Also, log Maruku's processing time, out of perverse
interest.
2011-08-05 01:59:18 -05:00
Jacques Distler 7d2275d0a1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-07-28 23:18:14 -05:00
Jacques Distler 52da76ff38 These Flash messages are html_safe 2011-07-28 23:16:21 -05:00
Jacques Distler 8d7f33f99b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-07-07 10:32:49 -05:00
Jacques Distler 2967b207b2 Update for itex2MML 1.4.6 2011-07-07 10:18:55 -05:00
Jacques Distler dfad5a3a37 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-18 15:57:54 -05:00
Jacques Distler 8b008f8418 Fix Maruku Footnote Backlink
Problem reported by Shamaoke.
2011-06-18 15:54:32 -05:00
Jacques Distler fc8be60634 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-15 00:50:37 -05:00
Jacques Distler 9e909d5be3 Update Rails, rails_xss and Bundler
Update Bundler to 1.0.15.
Update Rails to 2.3.12.
Update rails_xss plugin.

The latter two were the
source of a considerable
amount of grief, as rails_xss
is now MUCH stricter about what
string methods can be used.

Also made it possible to use
rake 0.9.x with Instiki. But
you probably REALLY want to use

 ruby bundle exec rake ...

instead of just saying

 rake ....
2011-06-15 00:43:38 -05:00
Jacques Distler 088b535d52 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-12 12:59:12 -05:00
Jacques Distler ec443685a6 MathJax 1.1a final 2011-06-12 12:57:10 -05:00
Jacques Distler 97148dc205 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-11 23:42:34 -05:00
Jacques Distler cbf13ad57a Instiki 0.19.2
Bump version number.

Also update to a faster method
of loading MathJax (thanks to
Davide Cervone for assistance).
2011-06-11 23:39:42 -05:00
Jacques Distler ec31e46e92 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-09 08:36:27 -05:00
Jacques Distler 79a966f71f Fix Ordered Lists
Fix a regression in Maruku.
(Reported by Andrew Stacey.)
2011-06-09 08:30:23 -05:00
Jacques Distler 92e4aaafaf Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-04 01:16:08 -05:00
Jacques Distler 0ae83c3560 Prepare for 0.19.2 Release 2011-06-04 01:14:17 -05:00
Jacques Distler 1464e29f4f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-03 02:05:24 -05:00
Jacques Distler fcd8900cb7 Update MathJax to 1.1a-candidate 2011-06-03 02:03:06 -05:00
Jacques Distler 9090dba2b2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-01 15:29:56 -05:00
Jacques Distler ade1c1d113 Update SVG-Edit 2011-06-01 15:28:11 -05:00
Jacques Distler 1f98b7dcf9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-01 14:36:53 -05:00
Jacques Distler 0df40cb4cb Update MathJax to 1.1 final 2011-06-01 14:35:18 -05:00
Jacques Distler 95d2fe540f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-01 13:20:29 -05:00
Jacques Distler c9ad2c0c6e Non-ASCII Lists
Fix a bug in Maruku's
list-parsing.

Also fix a test broken
by latest Rack + Ruby 1.9.
2011-06-01 13:17:23 -05:00
Jacques Distler ca661ddb42 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-06-01 12:29:31 -05:00
Jacques Distler 7e5dbe5854 Unvendor Rack
You'll need to rerun

   ruby bundle

as rack is now loaded as gem.
2011-06-01 12:26:50 -05:00
Jacques Distler c2dfe7e621 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-04-25 10:58:42 -05:00
Jacques Distler 7290e90631 Efficiency
Introduce page.rev_ids, and use
that, wherever possible, instead
of page.revisions.

This avoids fetching the text of
all the revisions. D'oh!
2011-04-25 10:54:44 -05:00
Jacques Distler 823f8b79c9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-04-24 16:12:38 -05:00
Jacques Distler c010e6b7a4 Validate Web address
When changing the address of an existing Web
(or creating a new one), check that the new name is valid.
(Reported by Richard Marquez.)
2011-04-24 16:07:43 -05:00
Jacques Distler 63fd1dbbb9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-02-18 23:39:04 -06:00
Jacques Distler 844ce0ed40 Rails 2.3.11, S5 Editing bug.
Upgrade to Rails 2.3.11.
Fix a bug where the SVG-Edit button would not appear
when editing S5 slideshows.
2011-02-18 23:36:23 -06:00
Jacques Distler f9628a3f19 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-02-18 13:13:43 -06:00
Jacques Distler 3843fa608d Nasty!
How did a well-formedness bug creep into
the code? I *swear* this used to work.
2011-02-18 12:39:19 -06:00
Jacques Distler 363d72524b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-02-03 11:15:12 -06:00
Jacques Distler 1bef71bbf1 Update SVG-Edit 2011-02-03 11:13:18 -06:00
Jacques Distler 122783886f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-01-31 22:20:25 -06:00
Jacques Distler a12a778c5a Update SVG-Edit
Hyperlinking, among other new features.
2011-01-31 22:15:28 -06:00
Jacques Distler c61eb7ae1e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2011-01-27 19:13:51 -06:00
Jacques Distler 7d3f9db8f0 Update MathJax to Version 1.1-beta 2011-01-27 19:12:00 -06:00
Jacques Distler 230d2998b4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-12-06 21:17:16 -06:00
Jacques Distler 27a99e0146 Update Vendored Bundler to 1.0.7 2010-12-06 21:11:19 -06:00
Jacques Distler e98c8bda63 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-12-01 11:14:14 -06:00
Jacques Distler d8d0f2fdd6 Some Doc Updates 2010-12-01 11:12:45 -06:00
Jacques Distler 2cd2b09648 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-11-30 23:26:01 -06:00
Jacques Distler fccb1e2b01 Update SVG-Edit 2010-11-30 23:23:58 -06:00
Jacques Distler 5918d4c26e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-11-27 00:45:16 -06:00
Jacques Distler f914a40fa9 Fix Maruku Math Bug
Reported by Andrew Stacey.
2010-11-27 00:43:22 -06:00
Jacques Distler 8d7381bb54 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-11-22 19:13:15 -06:00
Jacques Distler cd674bbb36 Clean up a few before_filters 2010-11-22 19:11:21 -06:00
Jacques Distler 88291ee4a2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-11-03 23:52:06 -05:00
Jacques Distler 4be1a58a24 Update RedCloth to 4.x
Use Bundler to manage RedCloth
gem. 4.x should be much faster
and less buggy. Unfortunately,
it doesn't support mixed
Textile/Markdown syntax. So
we keep an (appropriately
renamed) copy of 3.x around,
for the users of the "Mixed"
text filter.
2010-11-03 23:32:55 -05:00
Jacques Distler 06287a4ef5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-25 09:25:46 -05:00
Jacques Distler cca857ed3a Update MathJax
On Davide Cervone's advice,
I updated MathJax from the
1.0.1 release to the (less
buggy) Revision 615 of the
MathJax svn.
2010-10-25 09:21:44 -05:00
Jacques Distler 982ab38f43 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-25 00:56:55 -05:00
Jacques Distler ad12997c1d OK ... you can have your PNGs
The iPhone, apparently, really needs
them. That sucks. The only resolution
is to not bundle MathJax in the (X)HTML
export.

Also: update SVG-Edit.
2010-10-25 00:42:36 -05:00
Jacques Distler 97434e097a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-21 23:59:35 -05:00
Jacques Distler bb17fbbe02 Included pages
Redirects and categories of included
pages should not be inherited.
(Suggestion of Andrew Stacey)
2010-10-21 23:58:04 -05:00
Jacques Distler 06f4f2cc98 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-18 08:27:06 -05:00
Jacques Distler bf69cceb25 No PNGs for you!
I removed the png versions of the MathJax
fonts. Make the config reflect that.
2010-10-18 08:25:25 -05:00
Jacques Distler 10aa983337 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-17 22:32:58 -05:00
Jacques Distler 1663d9f5c8 MathJax
For those without MathML-capable browsers,
we present MathJax. It's crappy 'n slow,
but it's better than nothing.
2010-10-17 22:30:56 -05:00
Jacques Distler d208728065 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-15 10:50:31 -05:00
Jacques Distler cebd381d0d Instiki 0.19.1
tex_list, Rails 2.3.10, etc.
2010-10-15 10:47:59 -05:00
Jacques Distler 477adeffda Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-11 11:00:00 -05:00
Jacques Distler 46da49485f More bugs in tex_list
Fix some more bugs in the new
tex_list action.
Make the drag-reorder *not*
result in a (superfluous)
AJAX request.
2010-10-11 10:57:26 -05:00
Jacques Distler a4776060a6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-10 13:29:03 -05:00
Jacques Distler 8a989b1a7b Make reordering work in Ruby 1.8.x
I was fooled: Ruby 1.9 has ordered
hashes; 1.8 doesn't. So what I did
in Revision 689 works in Ruby 1.9,
but fails in 1.8.

Now we parse the POST params ourselves.
2010-10-10 13:24:05 -05:00
Jacques Distler 57397617cd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 21:56:08 -05:00
Jacques Distler b7806c12ce Update Scriptaculous
to 1.8.3. Perhaps this will
fix Marco's bug (which I cannot
reproduce).
2010-10-09 21:54:38 -05:00
Jacques Distler 5c576f66e9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 15:42:19 -05:00
Jacques Distler 9c11c384d4 Some more tweaks to the tex_list feature 2010-10-09 15:41:25 -05:00
Jacques Distler a64194806b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 14:45:15 -05:00
Jacques Distler 7f7182afea A little CSS styling
Should make the drag target,
for re-ordering the pages,
a little more obvious.
2010-10-09 14:42:01 -05:00
Jacques Distler a0a11c0bc8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 11:22:37 -05:00
Jacques Distler b1fcc93aa5 Test for text_list
Add a functional test for
the new feature.
2010-10-09 11:21:41 -05:00
Jacques Distler 3660f13c84 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 10:34:58 -05:00
Jacques Distler fece5a3486 Drag to re-order
For the previous commit, allow the user
to change the order of the LaTeX output.
2010-10-09 10:33:11 -05:00
Jacques Distler 194f10e809 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-09 03:02:26 -05:00
Jacques Distler aee4f8b3a9 Export Multiple Pages to TeX
Per a suggestion of Marco Gualtieri.
2010-10-09 02:57:37 -05:00
Jacques Distler 7011067525 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-06 16:08:12 -05:00
Jacques Distler 1c5df9e8b5 OK. Now that's done right.
Fixed the bug in SVG-Edit that
necessitated the previous rollback.
2010-10-06 16:06:49 -05:00
Jacques Distler 1caa4822c1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-05 22:46:30 -05:00
Jacques Distler 0a95c855ba Revert changes to SVG-Edit from last commit
That was *bad* mojo ...
2010-10-05 22:45:31 -05:00
Jacques Distler b5481a1454 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-05 21:09:22 -05:00
Jacques Distler f6c818de8a LaTeX Export for \array
This will work for \array without
any options.

Also fix an SVG-Edit bug
2010-10-05 21:07:19 -05:00
Jacques Distler 5ca5bce628 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-05 10:10:13 -05:00
Jacques Distler 8aa3a9e929 SVG-Edit fixes
Some bugfixes from the latest SVG-Edit
2010-10-05 10:08:48 -05:00
Jacques Distler 1290dfc9ae Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-10-01 18:56:31 -05:00
Jacques Distler 105c1d79e7 LaTeX-style \sqrt[]{}
Fix LaTeX macros so that both (TeX-style)
\root{}{} and (LaTeX-style) \sqrt[]{} can
appear in the same file. The latter will be
supported in the next version of itex2MML.
2010-10-01 18:53:44 -05:00
Jacques Distler b6653749ac Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-29 00:19:42 -05:00
Jacques Distler 1c35c2d3fc Fat camp
Removed some extraneous (and hefty) cruft, to slim down the size of the distribution.
2010-09-28 23:57:28 -05:00
Jacques Distler 43d8c31028 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-28 14:49:07 -05:00
Jacques Distler c3979a5b56 More SVG-Edit tweaks 2010-09-28 14:48:18 -05:00
Jacques Distler 98bf5a824e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-28 11:06:43 -05:00
Jacques Distler 239a8d97e5 Instiki 0.19 2010-09-28 11:05:48 -05:00
Jacques Distler 0e4557be5c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-27 00:22:09 -05:00
Jacques Distler 54c5060533 More tweaks to the README 2010-09-27 00:21:17 -05:00
Jacques Distler 1205efacf2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-26 12:59:19 -05:00
Jacques Distler eac323a657 Sync with SVG-Edit
More improvements.
2010-09-26 12:57:59 -05:00
Jacques Distler c6edd052f5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-25 11:17:01 -05:00
Jacques Distler 08223b0f2d Update CHANGELOG and README 2010-09-25 11:16:04 -05:00
Jacques Distler 4396420cf3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-25 02:00:43 -05:00
Jacques Distler 3097b47111 Erubis and Rubyzip
Use Bundler to manage Erubis and Rubyzip.
(Remove the vendored versions.)
2010-09-25 01:59:03 -05:00
Jacques Distler fad12903f4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-25 00:43:17 -05:00
Jacques Distler 03fa32f140 Passenger Support
To get Passenger to work smoothly
with our Bundler setup, need this file.
2010-09-25 00:35:47 -05:00
Jacques Distler eee3929c4b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-24 22:40:56 -05:00
Jacques Distler 4bf2e0d944 Bundler
Remove the vendored sqlite3-ruby.
Instead, add support for Bundler
(which is vendored).

Before running the new Instiki,
do a 

   ruby bundle

which will install all of the needed gems
locally. (If you need to, tweak the contents
of Gemfile.)
2010-09-24 22:36:30 -05:00
Jacques Distler c27dc2cea3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-23 09:30:54 -05:00
Jacques Distler 399bd0d5a4 Update Fortran Syntax Highlighting
Thanks to Jason Blevins
2010-09-23 09:29:20 -05:00
Jacques Distler a099648554 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-13 17:06:53 -05:00
Jacques Distler d80003d502 SVG-Edit bugfix 2010-09-13 17:05:37 -05:00
Jacques Distler 04bb80be15 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-10 15:20:20 -05:00
Jacques Distler e5ca66ae41 Sync with SVG-Edit 2010-09-10 15:19:23 -05:00
Jacques Distler 7aa91e8b5c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-09 01:00:23 -05:00
Jacques Distler e99fcf720c Make Vendored Rack work with Ruby 1.9.2-p0
Seemed to have no troubles with 1.9.2dev. But
with the release version, Instiki would fail to
launch, with a 

  `load_missing_constant': Rack is not missing constant Handler! (ArgumentError)

error.
2010-09-09 00:57:35 -05:00
Jacques Distler a5aa1b1fa8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-09-05 15:26:17 -05:00
Jacques Distler ef30cc22df Update to Rails 2.3.9 and itextomml 1.3.27 2010-09-05 15:24:15 -05:00
Jacques Distler 86d5e23f99 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-08-13 16:15:13 -05:00
Jacques Distler 113e0af736 Update SVG-Edit
Version 2.5.1
2010-08-13 16:14:19 -05:00
Jacques Distler 7c9ab039c0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-22 17:37:19 -05:00
Jacques Distler 8e57e97869 Some Tests for Revision 666 2010-07-22 17:36:37 -05:00
Jacques Distler 1dc14ec2da Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-22 14:16:31 -05:00
Jacques Distler f6e9d17f9b Non-Latin WikiWords
Fix bug in WikiWord processing
reproted by Alexander Hambug.

Also fix Cyrillic Capital/Lowercase
regexps.
2010-07-22 14:08:21 -05:00
Jacques Distler 0a87548324 Fix breakage from Revision 664
Noted by Andrew Stacey
2010-07-22 12:44:14 -05:00
Jacques Distler 3bfc30231a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-21 09:42:26 -05:00
Jacques Distler 267f4a51fc Don't escape web.additional_style
Reported by Andrew Stacey
2010-07-21 09:39:18 -05:00
Jacques Distler 63e4c43a54 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-20 21:57:31 -05:00
Jacques Distler 4576a7f7df Remove Unneeded PHP files
We don't use these, so there's no point
in having them in our bundled SVG-Edit.
2010-07-20 21:56:10 -05:00
Jacques Distler 6602a153f7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-20 20:38:01 -05:00
Jacques Distler b3aae9b06d Sqlite3-ruby 1.3.1, itextomml 1.3.26
Update vendored sqlite3-ruby and tests
for latest itextmml.
2010-07-20 20:36:17 -05:00
Jacques Distler 8f62d3009b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-20 08:02:58 -05:00
Jacques Distler 29224d6bcc SVG-Edit update 2010-07-20 07:59:47 -05:00
Jacques Distler 0904001ef9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-07-04 08:53:10 -05:00
Jacques Distler 39c2138f88 Update Vendored Erubis to 2.6.6 2010-07-04 08:51:53 -05:00
Jacques Distler 58f44326ae Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-22 08:29:12 -05:00
Jacques Distler c18c2f988d Update SVG-Edit Sanitizer
plus some minor SVG-Edit tweaks.
2010-06-22 08:26:15 -05:00
Jacques Distler 4c4f7a7b82 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-19 03:03:36 -05:00
Jacques Distler ce8578d2d0 Some Maruku Regexp Refactoring 2010-06-19 03:02:15 -05:00
Jacques Distler 30909ec927 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-17 19:33:05 -05:00
Jacques Distler 0d8f680d4f Updates
SVG-Edit -> 2.5final
Vendored Rack -> 1.2.1
2010-06-17 19:27:39 -05:00
Jacques Distler 95854d34b5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-16 22:48:31 -05:00
Jacques Distler 6338a3bcb2 Update to latest SVG-Edit 2010-06-16 22:46:12 -05:00
Jacques Distler 65fd56888f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-13 23:21:22 -05:00
Jacques Distler 6491d70326 Update Vendored Rack to 1.2.0
Also update tests for itextomml 1.3.25.
2010-06-13 23:09:24 -05:00
Jacques Distler 9236140dde Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-10 22:44:58 -05:00
Jacques Distler 4f8759cdf3 Update vendored Sqlite3-ruby to 1.3.0
Also, some tweaks to Maruku.
2010-06-10 22:42:33 -05:00
Jacques Distler 5f6e1ce19f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-09 13:28:23 -05:00
Jacques Distler 9a80cacc34 Update Sanitizer
Support <menclose notation="...">.
2010-06-09 13:26:51 -05:00
Jacques Distler a14db81b79 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-09 12:00:55 -05:00
Jacques Distler 90ad482ed2 Rename stringsupport.rb => instiki_stringsupport.rb 2010-06-09 11:47:39 -05:00
Jacques Distler e4aa197c30 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-05 11:00:49 -05:00
Jacques Distler 3aaf3989c7 Test for divref Issue in Weizenbaum's Branch 2010-06-05 10:59:12 -05:00
Jacques Distler c4e2afa01a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-04 21:39:02 -05:00
Jacques Distler 06ae79322a Maruku Cleanup Branch
Use Nathan Weizenbaum's "cleanup" branch of
Maruku. There were a few evident problems
with his branch, so please report any
anomalies you see.
2010-06-04 21:36:31 -05:00
Jacques Distler 03c57473dc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-04 12:13:36 -05:00
Jacques Distler dead710e69 Revert #633
MathPlayer doesn't like the HTML5 DOCTYPE.
Revert to sending XHTML+MathML+SVG DOCTYPE.
2010-06-04 12:10:26 -05:00
Jacques Distler 940e9bd879 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-03 07:14:57 -05:00
Jacques Distler 05ffd215f1 SVG-Edit Markers Extension
The arrows extension on steroids.
2010-06-03 07:13:37 -05:00
Jacques Distler 3c5ad60de8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-02 00:18:05 -05:00
Jacques Distler c25b608f3d Maruku's string_utils.rb
Wow! Totally un-Ruby-like.
This is more Ruby-like and
(hopefully) faster.
2010-06-02 00:15:58 -05:00
Jacques Distler 8395508c85 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-01 10:41:31 -05:00
Jacques Distler b7a3b8aa94 Minor Update From Current Maruku 2010-06-01 10:39:55 -05:00
Jacques Distler c54a7756b5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-01 09:24:30 -05:00
Jacques Distler ad7e32c92c Tests for Revision 644 2010-06-01 09:22:37 -05:00
Jacques Distler 55337ed43c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-06-01 01:53:45 -05:00
Jacques Distler 17e9cfab87 IAL's for <li> elements
Add a Markdown syntax for attaching
attribute lists to list items (for both
ordered and unordered lists).

The syntax is trivial:

1. This is the first item
2. {: value="3"} We skip straight to #3

* This is an item
* {: style="color:red"} This is a red item
2010-06-01 01:50:19 -05:00
Jacques Distler 851b735158 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-30 13:36:04 -05:00
Jacques Distler b8647da41a Fix TeX Output
\empty was causing problems.
That was kinda stupid.
2010-05-30 13:34:30 -05:00
Jacques Distler 44e54ee4c6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-27 01:18:06 -05:00
Jacques Distler dafe67046a Better
Use :only_path => true
2010-05-27 01:17:24 -05:00
Jacques Distler 1f4f1a4ba3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-27 00:30:29 -05:00
Jacques Distler a57152d743 Fix Category Listing Bugs
The links to the category listings
were bogus, and the category listing
page needed some XSS-unprotection.
2010-05-27 00:27:49 -05:00
Jacques Distler ad3fe74cfd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-26 14:38:32 -05:00
Jacques Distler b5a4e2fd9c Sync with latest SVG-Edit 2010-05-26 14:37:55 -05:00
Jacques Distler d61ae49e66 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-26 14:17:52 -05:00
Jacques Distler 1da034e2be Fix some to-be-deprecated stuff 2010-05-26 14:16:34 -05:00
Jacques Distler 4774d7c8a1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-26 01:28:03 -05:00
Jacques Distler 4b73f1a1ae More rails_xss Plugin fun
:-(
2010-05-26 01:27:09 -05:00
Jacques Distler e3cbef7dcd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-26 00:33:21 -05:00
Jacques Distler a5e08f7bcc Rails_xss Plugin
I installed the rails_xss plugin, for
the main purpose of seeing what will
break with Rails 3.0 (where the behaviour
of the plugin is the default). I think
I've fixed everything, but let me know if you
see stuff that is HTML-escaped, which
shouldn't be.

As a side benefit, we now use Erubis,
rather than ERB, to render templates.
They tell me it's faster ...
2010-05-26 00:27:49 -05:00
Jacques Distler 5196df7575 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-25 13:01:31 -05:00
Jacques Distler d6be09e0f0 Fix some Helper Methods
It seems that (advertising to the contrary)
Rails's XSS Protection is enabled, by default
in 2.3.8. So needed to fix some helper methods.
2010-05-25 12:59:35 -05:00
Jacques Distler 52f0dbb91c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-25 12:46:37 -05:00
Jacques Distler f0635301aa Update to Rails 2.3.8 2010-05-25 12:45:45 -05:00
Jacques Distler 3745e4d669 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-23 23:23:50 -05:00
Jacques Distler 6677b46cb4 A few more additions for the Sanitizer 2010-05-23 23:22:45 -05:00
Jacques Distler f7b2a40cf6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-22 16:12:35 -05:00
Jacques Distler d2c4623bf7 HTML5 Doctype 2010-05-22 16:11:27 -05:00
Jacques Distler 3bfbb7736d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-22 15:21:52 -05:00
Jacques Distler 8149c29324 More HTML5 Attribute support in Maruku 2010-05-22 15:21:06 -05:00
Jacques Distler ecf54415eb Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-22 14:37:18 -05:00
Jacques Distler 2781890832 Updated Sanitizer for HTML5
Sanitizer should recognize HTML elements
and attributes.

New Allowed Elements:

  article aside audio canvas command details
  dialog figcaption figure footer header
  hgroup mark meter nav progress rp rt ruby
  section source summary time video war 
       
(OK, audio and video were already there)

New Allowed Attributes:

  autocomplete contenteditable contextmenu
  draggable formaction icon low max min
  open optimum pattern placeholder preload
  pubdate required reversed  spellcheck step
  wrap

Attributes removed:

  abbr charset loopcount loopend loopstart
  noshade nowrap rev rules 


Maruku supports @start and @reversed on
ordered lists. It doesn't seem to support
IALs on li elements, so you still can't
attach @value to an li.
2010-05-22 14:34:08 -05:00
Jacques Distler 5a448c3d50 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-13 00:59:14 -05:00
Jacques Distler d9d353a350 Some HTML5 audio/video attributes for the Sanitizer 2010-05-13 00:47:09 -05:00
Jacques Distler 5c7346c12e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-11 01:11:37 -05:00
Jacques Distler 80845297a3 This is even better 2010-05-11 01:10:59 -05:00
Jacques Distler 5cc477712f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-11 00:43:18 -05:00
Jacques Distler 04a1727082 Select Saved SVG
When closing SVG-Edit, make the saved
svg selected.

Also, some SVG-Edit updates.
2010-05-11 00:38:21 -05:00
Jacques Distler a2c3e2a76c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-05-08 23:46:33 -05:00
Jacques Distler fd9fc1455e Prefer Monkey-patching Rack Gem to Vendored Rack
This gets around a dreaded 

  in `load_missing_constant': Rack
  is not missing constant Handler! (ArgumentError)

error in latest Ruby 1.9.2-dev. (Ruby
1.8.x doesn't seem to care.)
2010-05-08 23:42:40 -05:00
Jacques Distler cfd972755a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-28 16:45:16 -05:00
Jacques Distler 10cf102544 More bogus namespace fixes 2010-04-28 16:44:07 -05:00
Jacques Distler ac7105591e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-28 11:57:05 -05:00
Jacques Distler 86a53d1dfa Task of Sisyphus: Filter bogus attributes generated by Gecko (again) 2010-04-28 11:54:56 -05:00
Jacques Distler bffc0a6f97 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-28 00:24:23 -05:00
Jacques Distler d1678ceb49 Sync with SVG-Edit 2.5beta 2010-04-28 00:22:49 -05:00
Jacques Distler e6854767b5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-18 12:59:25 -05:00
Jacques Distler 79a2299363 Content-Type of Cached Files with Period in Name
Monkey patch to prevent ActionCache from overriding
the correct content-type header, when serving cached
pages with a "." in the name. (Thanks to Jason Blevins)

Also sync with latest SVG-Edit.
2010-04-18 12:55:02 -05:00
Jacques Distler 226fa3033f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-12 00:37:25 -05:00
Jacques Distler 324cc12320 Gaussian Blur (and other fun stuff)
Sync with latest SVG-edit.
2010-04-12 00:33:24 -05:00
Jacques Distler 72b16ce9cc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-06 13:45:14 -05:00
Jacques Distler 6d5db0739a Buglet in latest SVG-Edit
Sync with latest SVG-Edit.
Among other things, fixes Issue 512.
2010-04-06 13:39:21 -05:00
Jacques Distler 3b87094327 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-04-02 00:02:58 -05:00
Jacques Distler da0c6a2ea1 Fix an SVG nonce bug
Dunno when this problem with randomized IDs arose.
But it's fixed now.

Also, sync with latest SVG-Edit.
2010-04-01 23:56:21 -05:00
Jacques Distler 3f87912191 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-29 09:28:51 -05:00
Jacques Distler 18b5ea9aa6 Use Instiki's escapeHTML Method in Templates
Fixes bug reported by Toby Bartels.
2010-03-29 09:27:14 -05:00
Jacques Distler e15d76d781 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-25 02:25:48 -05:00
Jacques Distler 5f66f8387e Latest SVG-Edit
Jquery-1.8, and config for extensions.
2010-03-25 02:22:55 -05:00
Jacques Distler 5f04be0eae Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-22 19:23:26 -05:00
Jacques Distler 77cfc0d2e3 Connector extension should use configured defaults 2010-03-22 19:21:00 -05:00
Jacques Distler a8428ada2f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-18 10:36:24 -05:00
Jacques Distler 3e6d7faec2 Sync with latest SVG-Edit 2010-03-18 10:32:47 -05:00
Jacques Distler d836d28593 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-15 23:51:47 -05:00
Jacques Distler 143fa30b78 Whoops!
Somehow these did not make it into the
last commit.
2010-03-15 23:42:04 -05:00
Jacques Distler 833ef96d5f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-15 16:32:56 -05:00
Jacques Distler 5167363a2d Sync with latest SVG-Edit
Loading of configuration data via URL query string.
Now no differences, from trunk, in svgcanvas.js or svg-edit.js.
2010-03-15 11:13:22 -05:00
Jacques Distler f0d9626d31 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-12 10:56:32 -06:00
Jacques Distler c946c331e1 Update extensions for new SVG-Edit API 2010-03-12 10:48:27 -06:00
Jacques Distler 9636cab11e Update to latet SVG-Edit API 2010-03-12 03:50:23 -06:00
Jacques Distler 840e218570 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-10 20:35:50 -06:00
Jacques Distler 7e7ae4c6f0 Radial Gradients
Sync with latest SVG-Edit, which 
supports radial gradients.
2010-03-10 19:02:40 -06:00
Jacques Distler a17d5127c5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-09 12:33:00 -06:00
Jacques Distler 9ed0772978 Sync with latest SVG-Edit 2010-03-09 12:20:37 -06:00
Jacques Distler ae0274783d Small Fixes
Get rid of 'markdown' attribute on SVG-Edit
whitelist (it's no longer needed).

Slightly smarter detection of existing SVGs.
2010-03-06 18:28:51 -06:00
Jacques Distler 75e4310a5b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-06 00:18:37 -06:00
Jacques Distler d33b072cba The Task of Sisyphus
Correcting, and re-correcting the bugs in SVG-Edit.
2010-03-05 22:59:45 -06:00
Jacques Distler 5a5ff87286 Fix Bug in itex Extension
Firefox was too lenient, in allowing
you to append nodes from another document to
the svg canvas. Use adoptNode(), to do things
right. (Google Chrome is more strict about this.)
2010-03-05 16:19:12 -06:00
Jacques Distler 498f043174 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-04 00:27:51 -06:00
Jacques Distler e75c0cc81c Sync with latext SVG-Edit
Subpath tool.

Also make the itex tool a little more selective
(only applies to <foreignObject>s with a <math> firstChild.
2010-03-04 00:05:36 -06:00
Jacques Distler 2df08e21d1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-03-02 16:07:08 -06:00
Jacques Distler 932c42c24a More itex Metal Refactoring 2010-03-02 13:59:50 -06:00
Jacques Distler e07960a897 Efficiency improvements to itex endpoint
Benchmarks at up to twice as fast.
2010-03-01 21:10:13 -06:00
Jacques Distler a6bceb2a8e Ensure that itex endpoint returns well-formed XML
Since itex's \begin{svg}...\end{svg} syntax allows
the client to pass arbitrary junk through the document,
we need to check that the result is well-formed.

Use a pluggable XML parser: nokogiri, if installed,
REXML otherwise.
2010-03-01 12:27:04 -06:00
Jacques Distler 7b22daa784 Fix Revision 601
With tests, this time.
2010-02-28 23:51:33 -06:00
Jacques Distler 3f8e3b43b9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-28 19:26:38 -06:00
Jacques Distler 70aa50ad4b Make dnsbl_check respond more intelligently
Thanks to Toby Bartels for pointing out
the deficiencies of the previous version.
2010-02-28 19:23:37 -06:00
Jacques Distler 88aa590ba4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-27 16:44:05 -06:00
Jacques Distler dcfe870a02 Fix foreignObject
Fix SVG-Edit Issue 503.
Selecting a foreignObject was
mistakenly setting the stroke to 'none'.
2010-02-27 16:39:57 -06:00
Jacques Distler 57fe0b9f0b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-27 09:54:13 -06:00
Jacques Distler 519f81ab20 Try to make Jeff happy
Make use of a nonce for setting SVG-Edit IDs
option. By default, SVG-Edit behaves as before.
Calling svgCanvas.randomizeIds(true) gives our
behaviour, instead.

Also, sync with latest SVG-Edit (but disable,
for now, manual editing of IDs).
2010-02-27 09:49:02 -06:00
Jacques Distler 529a91f182 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-26 14:54:22 -06:00
Jacques Distler 8a851eeab2 Sync with latest SVG-Edit
Fixes Issue 502 (Connector
lines are not re-editable).
2010-02-26 14:51:27 -06:00
Jacques Distler a30d748d82 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-25 11:12:17 -06:00
Jacques Distler f7f1668e31 Fix killer bug when attempting to edit SVGs from prior SVG-Edit versions
D'Oh!
2010-02-25 10:56:18 -06:00
Jacques Distler ce2416165b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-25 02:29:58 -06:00
Jacques Distler aa0a151ba4 Uniquify IDs in SVG-Edit
Since we can have several SVG-Edit graphics
on a page, SVG-Edit should assign unique IDs
to elements, and do so in a fashion that survives
re-editing.

To do this, we use a nonce, and record its value in
a custom se:nonce attribute on the <svg> element.
(Is there a better way?). 

Also, preserve the custom se:connector attribute for
later editing purposes.
2010-02-25 02:25:16 -06:00
Jacques Distler 966bede8dc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-23 23:10:47 -06:00
Jacques Distler c4003f79b3 Support SVG-Edit Custom Attribute(s)
Add support for se:connector attribute in
Instiki's Sanitizer.
2010-02-23 23:07:09 -06:00
Jacques Distler c26faabf2d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-23 17:31:36 -06:00
Jacques Distler 4cd626ef49 Cleanup itex extension
Most of the DOM manipulations can be done
before doing the AJAX call. This leaves
just the insertion of the MathML nodes in the
mrow for the AJAX callback function.

Also, make the stroke-width for the connector tool 
default to 2.
2010-02-23 17:24:23 -06:00
Jacques Distler 5d0eb597f1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-23 10:36:51 -06:00
Jacques Distler d201f79766 No Need to Double-Escape
Apparently, JQuery takes care of all of the
escaping we need. So ditch our own escaping
(which effectively double-escaped everything).
2010-02-23 10:16:14 -06:00
Jacques Distler 71ad1344c1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 23:25:17 -06:00
Jacques Distler 42d92a0b37 More ext-itex.js Fixes
Ajax is asynchronous. Need to 
sanitize in the callback function,
NOT when adding <math> to the DOM.

Need to unescape text for itex editor
window (since JQuery seems to take care
an 'extra' round of escaping).
2010-02-22 23:20:57 -06:00
Jacques Distler 99dd9e7276 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 21:54:46 -06:00
Jacques Distler 85e0a2cb10 More tweaks
Make the AJAX endpoint configurable (this could still be
done better).
Use POST, rather than GET for the AJAX request, so that
we don't have to worry about overly-long equations.
2010-02-22 21:50:38 -06:00
Jacques Distler 9f86780afc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 21:39:10 -06:00
Jacques Distler cb1fe51e84 Don't need an xmlns:xlink on the math element
itex2MML puts one on the mrows that are hyperlinks.
2010-02-22 21:35:29 -06:00
Jacques Distler f4f9261431 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 19:15:39 -06:00
Jacques Distler 47524a7104 Small tweak to itex metal 2010-02-22 19:13:46 -06:00
Jacques Distler c18d9f86f7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 18:55:25 -06:00
Jacques Distler a1654f1e99 Sync with latest SVG-Edit 2010-02-22 18:53:15 -06:00
Jacques Distler cf0668eb53 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 08:55:27 -06:00
Jacques Distler 3fbff19997 itex Endpoint Should Handle Blank TeX
Reported by Andrew Stacey
2010-02-22 08:52:52 -06:00
Jacques Distler 58d241c4c4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-22 00:10:28 -06:00
Jacques Distler 702b450fd9 itex Endpoint
Add a Rack Metal itex endpoint.
Add an itex tool to SVG-Edit.
Disable the foreignObject tool
(at least, for now) as it doesn't
currently play nice with the itex tool.
2010-02-22 00:05:52 -06:00
Jacques Distler 32262cb6d0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-20 23:57:04 -06:00
Jacques Distler 956d523a4a Change default line thickness
The default stroke-width on various SVG
elements is now 2 (rather than 5).

Also, sync with latest SVG-Edit.
2010-02-20 23:54:20 -06:00
Jacques Distler 33dc8486d8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-20 10:43:09 -06:00
Jacques Distler c16c67928e Another tweak to the close_path icons 2010-02-20 10:40:40 -06:00
Jacques Distler b1be043e6f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-19 17:09:40 -06:00
Jacques Distler f471ba7d59 Close_path Icons, Mark II 2010-02-19 17:06:54 -06:00
Jacques Distler 6fc05795dc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-19 16:40:41 -06:00
Jacques Distler f84b4370fa Make Closepath Icons Work 2010-02-19 16:37:20 -06:00
Jacques Distler de50902968 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-18 21:04:30 -06:00
Jacques Distler dab8e5daa1 And your little dog, too ... 2010-02-18 21:02:11 -06:00
Jacques Distler 06262ce257 Aother SVG-Edit fix that got lost in the Great Migration 2010-02-18 20:43:57 -06:00
Jacques Distler fa662e8f51 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-18 11:07:59 -06:00
Jacques Distler 9eb0573eca Fix SVG-Edit Issue #489 2010-02-18 11:04:00 -06:00
Jacques Distler 1654316557 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-18 10:16:43 -06:00
Jacques Distler 2dfb852727 Fix connectors to work with foreignObject
Alexis got this working on SVG-Edit trunk.
2010-02-18 10:12:44 -06:00
Jacques Distler d592b20032 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-17 15:48:51 -06:00
Jacques Distler 08cd194330 Restore line-height fix for foreignObjects
Line-height is inherited, and the setting in SVG-Edit
ever-so-slightly screws up foreignObject (the bounding box
is not where it should be. This can be fixed in the CSS
(and was, till the great migration to the extensions folder).
2010-02-17 15:44:53 -06:00
Jacques Distler 82e8b83ee3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-17 14:52:46 -06:00
Jacques Distler b302bf36c5 Fixes to foreignObject Extension
(From Alex)
2010-02-17 14:48:49 -06:00
Jacques Distler da25e27263 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-17 14:45:31 -06:00
Jacques Distler ea581a50ae setCustomhandlers
Further whittling away at differences between
Instiki's and the main branch of SVG-Edit.
Now, the saveHandler is set from within the calling
page.

If the editor was opened from Instiki, choosing "Save Image"
now closes the editor window. To leave it open was kinda confusing.

Also sync with latest SVG-Edit changes.
2010-02-17 14:28:00 -06:00
Jacques Distler ebf8d6df1d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-17 08:28:27 -06:00
Jacques Distler 4475f02586 Fix SVG-Edit Regression
"text" and "foreignObject" tools should not
disable "line" and "freehand" tools.
2010-02-17 08:26:05 -06:00
Jacques Distler 0f3bc348ad Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-17 07:31:32 -06:00
Jacques Distler db5b418659 Andrew Stacey says I can't count ... 2010-02-17 07:29:15 -06:00
Jacques Distler e5076085df Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-16 23:22:49 -06:00
Jacques Distler ce47d49e69 SVG-Edit foreignObject tool refactored as an extension
Thanks to Alexis Deveria. (Though I did fix one small bug.)
My patch-file is now down to a mere 178 lines (a big
chunk of which is Revision 569).
Also, the font-size for foreignObjects defaults to 16pt,
which will be more useful in Instiki.
2010-02-16 23:14:04 -06:00
Jacques Distler 021c3dfc88 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-16 13:58:48 -06:00
Jacques Distler 63f1d34d74 Fix a bug in cloning MathML nodes in Firefox
Gecko-based broswers append some weird-shit
attributes. Filter them
2010-02-16 13:55:36 -06:00
Jacques Distler ffc7a528f8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-16 11:22:58 -06:00
Jacques Distler 5094a7339b Make SVG-Edit Clone-Element Work with foreignObject
Fixes SVG-Edit Issue #485.
2010-02-16 11:17:45 -06:00
Jacques Distler e09a1e4e9a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-15 13:55:45 -06:00
Jacques Distler d6e749cf6a Make the SVG-Edit sanitizeSVG() Namespace-Aware 2010-02-15 13:53:07 -06:00
Jacques Distler 125ce68ac6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-14 22:16:58 -06:00
Jacques Distler 10c0e709f6 Fix SVG-Edit Issue #484
Incorrect namespace handling broke Text tool.
2010-02-14 22:07:45 -06:00
Jacques Distler ed5d8bb026 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-14 16:43:31 -06:00
Jacques Distler ee5d03dca6 One more attempt at namespace sanity 2010-02-14 16:36:26 -06:00
Jacques Distler c74f239248 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-14 03:19:26 -06:00
Jacques Distler 2151c8d86b More Namespace fun
I don't know why they want to mess
with this, but it's clearly way more
complicated than any benefit I can see
it yielding.
2010-02-14 03:16:54 -06:00
Jacques Distler cc91fd656f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-14 01:23:15 -06:00
Jacques Distler 2e16458c44 Namespace Handling in SVG-Edit becomes a little saner. 2010-02-14 01:20:59 -06:00
Jacques Distler 8b5973b6c6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-13 23:25:13 -06:00
Jacques Distler 612fbf2920 Fix SVG-Edit Issue 483
Fix http://code.google.com/p/svg-edit/issues/detail?id=483
2010-02-13 23:22:36 -06:00
Jacques Distler b5b7f9c146 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-13 22:25:17 -06:00
Jacques Distler afcdc932ff Two SVG-Editor buglets
Should not be able to convert a foreignObject
to a path.
#foreignObject_panel should always be initially
invisible.
2010-02-13 22:19:14 -06:00
Jacques Distler 5af4fa23d1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-13 14:47:23 -06:00
Jacques Distler c608cedab9 Make foreignObject editing work in Safari
"Apply Changes" no longer generates an error in Safari.
2010-02-13 14:44:56 -06:00
Jacques Distler 96efec37cd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-13 14:17:54 -06:00
Jacques Distler 620bb2a1f7 Fix Safari
Revision 1380 of SVG-Edit broke Safari.
Revert the problematic change.
2010-02-13 14:15:55 -06:00
Jacques Distler f7b117456d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-13 00:25:37 -06:00
Jacques Distler d503100fe9 Mostly cosmetic
Sync with latest SVG-Edit.
Tweak an icon.
2010-02-13 00:11:13 -06:00
Jacques Distler 443a2cee5f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-12 17:43:15 -06:00
Jacques Distler db7bbca920 Minor tweaks to SVG-Edit
1) Tweak the edit_foreign icon
2) Make the query parameter matching a little
less dumb (but still very dumb).
2010-02-12 17:38:17 -06:00
Jacques Distler 852848749c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-12 12:40:25 -06:00
Jacques Distler 52d85c6d01 Don't use a data-url
Pass the SVG to the editor, using
  editor.svgCanvas.setSvgString(selected);
instead. (Suggested by Jeff Schiller)
Fix a bug with line and freehand tools caused
by activating foreignObject tool. (Again, fix
due to Jeff)
Sync with SVG-Edit.
2010-02-12 12:34:56 -06:00
Jacques Distler 895d353fdf Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-12 09:16:00 -06:00
Jacques Distler e744a697c2 Update edit-foreign icon
Also, a tweak to the loading code.
(Needs to be completely rewritten.)
2010-02-12 09:12:01 -06:00
Jacques Distler f791eae642 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-12 00:18:14 -06:00
Jacques Distler 0b459d0a47 Whoops! Missed another piece of XML Namespace Bogosity
Also forgot to add the new PNGs.
2010-02-12 00:16:13 -06:00
Jacques Distler e61f1e53a1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-12 00:06:12 -06:00
Jacques Distler 502d4f20bb foreignObject Support in SVG-Edit
Added support so that you can
create new foreignObjects, manipulate
existing ones, and edit their content.

No itex support. You need to use MathML
in there. But it's a start ...
2010-02-12 00:01:27 -06:00
Jacques Distler 18f81781e9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-10 15:46:18 -06:00
Jacques Distler 9047e5d460 Fix SVG-Edit code for rotating objects
A little math goes a long way ...

Also pick up some updates from SVG-Edit trunk.
2010-02-10 15:41:47 -06:00
Jacques Distler cf9dafa5d7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-10 11:43:32 -06:00
Jacques Distler 1d8318cfd2 foreignObject are now selectable, etc
They are now selectable, draggable, resizable
and rotatable.

The MathML content behave strangely when you
resize, but snaps back to its correct size when
you let go of the mouse.

(Resizing the MathML involves changing the font-size
on the containing foreignObject. No interface for
that, yet.)
2010-02-10 11:37:26 -06:00
Jacques Distler 42005dc2c6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-10 00:24:07 -06:00
Jacques Distler d362b886c2 Make Embedded MathML Visible
Thanks to Jeff Schiller for tracking
down the problem (and committing 
preliminary MathML support to SVG-Edit).
2010-02-10 00:11:14 -06:00
Jacques Distler 3957ff89a1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-09 11:48:53 -06:00
Jacques Distler 7114e46817 Sync with SVG-Edit 2010-02-09 11:44:43 -06:00
Jacques Distler 81f77ca22b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-08 21:42:24 -06:00
Jacques Distler 65b00d8551 A fist stab at foreignObject support
Ability to resize (etc) the still-invisible
element.
Also, some improvements from SVG-Edit trunk.
2010-02-08 21:39:35 -06:00
Jacques Distler 4f2fd8d53d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-08 01:29:16 -06:00
Jacques Distler f98802336f Minor tweaks
Allow 'markdown' attribute on <svg> and
on <foreignObject> in SVG-edit whitelist.
Specify SVG-edit Window properties.
2010-02-08 01:26:41 -06:00
Jacques Distler 1d20af58c1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-06 16:58:17 -06:00
Jacques Distler c32e5b7178 Sync with SVG-Edit 2010-02-06 16:55:49 -06:00
Jacques Distler c5e5f1ef2c Yet Another "Focus" Tweak
I'm not that happy with passing
the SVG as a Base64-encoded
query-parameter.

Will have to fix that, too...
2010-02-06 01:44:41 -06:00
Jacques Distler b1e0b4830b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-06 01:17:12 -06:00
Jacques Distler b5a7f7ac05 Add MathML Support to SVG-edit
Doesn't actually render anything,
but doesn't strip out all the 
MAthML tags, either.
2010-02-06 01:14:42 -06:00
Jacques Distler 459891b6c9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-05 23:19:19 -06:00
Jacques Distler bad5beec29 Sync with SVG-edit 2010-02-05 23:17:34 -06:00
Jacques Distler de3008d3e4 Some SVG-edit tweaks
Remove the XML prolog.
Fix focus on save.
2010-02-05 22:55:54 -06:00
Jacques Distler 7249c074b0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-02-05 21:40:24 -06:00
Jacques Distler c3ed5b461b Preliminary SVG-edit Support
WYSIWYG SVG editing.

Still no support for mixed
SVG/MathML content, yet.
2010-02-05 21:36:35 -06:00
Jacques Distler 1373963fe3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-29 11:15:56 -06:00
Jacques Distler 954bcb52c2 The Rails Way
The previous implementation, in Revision
541, was ugly. This is better.
2010-01-29 11:13:16 -06:00
Jacques Distler 3af938b46e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-28 23:41:15 -06:00
Jacques Distler 5506f87f17 One-Click S5 Template
Make it yet-easier to create
S5 slideshows.
2010-01-28 23:37:10 -06:00
Jacques Distler 09c119ac42 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-26 21:55:59 -06:00
Jacques Distler 675df6b6c5 Better
This seems to work just as well, and allows for caching for
pages with "/" in the name (albeit funky).
2010-01-26 21:53:37 -06:00
Jacques Distler 716bc3d5b4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-26 13:52:51 -06:00
Jacques Distler 49e89d0f85 Fix Caching
Fix the caching of pages with "." in
their names. This was busted.
2010-01-26 13:50:43 -06:00
Jacques Distler 389c690319 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-26 00:51:47 -06:00
Jacques Distler 8f1cd5010b Fix Routes for Previous Commit
Yow! That was fuggly.
These routes work better.
There's still a problem with
cache-sweeping, though.
2010-01-26 00:48:16 -06:00
Jacques Distler 3a9d1596d2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-26 00:21:50 -06:00
Jacques Distler bafa7743f1 Allow Periods in Page Names
Thanks to Jeff Zellman.
2010-01-26 00:18:30 -06:00
Jacques Distler 711a98ccfb Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-25 22:06:13 -06:00
Jacques Distler cbb3e4b74f Less Grotty
Does what Revision 535 does, but
slightly less ugly.
2010-01-25 22:01:10 -06:00
Jacques Distler 820d2a94eb Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-25 18:46:11 -06:00
Jacques Distler 9dc59b7b7c Fix BlahTeX/PNG Path
Dunno why Ari tolerated this
up till now.
2010-01-25 17:55:31 -06:00
Jacques Distler 50d0e04624 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-24 22:57:50 -06:00
Jacques Distler d3db9d1229 Export Zipballs Include BlahTeX PNGs
It's as simple as recursing through the
files/ directory, when adding to the zipball.
2010-01-24 22:54:35 -06:00
Jacques Distler 61a52a91e1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-24 12:27:06 -06:00
Jacques Distler aea2c5099f More Ruby 1.9 Encoding Fun
Under Ruby 1.9, could not delete orphan
pages with utf-8 names. They would be
listed as orphan, but "Delete Orphan Pages"
would silently not delete them.

Fixed.
2010-01-24 12:23:47 -06:00
Jacques Distler 7a12cdb502 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-23 18:33:22 -06:00
Jacques Distler b9db67073d Ruby 1.9 fix
Make the previous fixes work under Ruby 1.9
as well.
2010-01-23 18:30:17 -06:00
Jacques Distler a8370d5f45 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-23 18:25:30 -06:00
Jacques Distler 09e885d299 Small Cleanup
Small cleanup to the zip export.
2010-01-23 18:24:14 -06:00
Jacques Distler a7d38ef6a1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-23 18:12:23 -06:00
Jacques Distler 8ed5a88db0 Fix Zip Export and Print View
Fix http://bug.to/issues/show/335
and
http://bug.to/issues/show/334

We now bundle the uploaded files directory
(and the public/ directory for the (X)HTML
export) in the Zipball when exporting a Web.

Also, correct the Print View to produce proper links
uploaded files.
2010-01-23 18:01:02 -06:00
Jacques Distler c85b50ff66 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-23 09:11:18 -06:00
Jacques Distler ad2fab42bd Whoops!
Move darken() helper method from
wiki_helper.rb to application_helper.rb.
2010-01-23 09:07:57 -06:00
Jacques Distler 512b8d60b9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-23 00:24:48 -06:00
Jacques Distler 979ea7eca0 CSS Improvements
Fixed a few aesthetic matters.
2010-01-23 00:21:14 -06:00
Jacques Distler 1bf8177e70 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-21 15:58:37 -06:00
Jacques Distler 4dae13c567 Fix Migration to work under PostgreSQL
From J. Zellman

Postgres text type does not support an upper limit.
2010-01-21 15:54:52 -06:00
Jeff Zellman 87808dd7ee Text type migration now works under postgres. Postgres text type does not support an upper limit 2010-01-20 17:39:36 -06:00
Jacques Distler 36089f1543 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-07 08:14:28 -06:00
Jacques Distler d67ce28855 Prevent Renaming to a Null Page Name
Fix http://rubyforge.org/tracker/index.php?func=detail&aid=27649&group_id=186&atid=783
2010-01-07 08:12:22 -06:00
Jacques Distler 6a5b0e108a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-07 00:10:35 -06:00
Jacques Distler c8ef0a3dd4 Release Instki 0.18.1
Seems warranted, in light of the
Ruby 1.9 encoding issues.
2010-01-07 00:07:10 -06:00
Jacques Distler 0c2bc65e7a All I want for Christmas ...
... is to settle these encoding issues 
once and for all.

Let's override the accessor methods, which 
seems to offer a simpler solution.

Now with tests (for whatever that helps)...
2010-01-06 08:15:34 -06:00
Jacques Distler 036f6335ad Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-05 09:40:23 -06:00
Jacques Distler 6e6bf1a446 Yikes! Yet more Ruby 1.9 Encoding Issues
We're getting there. Thanks to Andrew Stacey.
2010-01-05 09:35:14 -06:00
Jacques Distler 9aeeae8ddb Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-04 23:03:34 -06:00
Jacques Distler ea431ad373 Stylesheet tweak
Don't put boxes around links on the web_list page.
2010-01-04 23:00:36 -06:00
Jacques Distler 0cdbbbd9ff Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-04 18:46:00 -06:00
Jacques Distler 6cf1463525 Revert Revision 520; This is more thorough
This ensures that @page.name has the right (utf8)
encoding.
2010-01-04 18:43:27 -06:00
Jacques Distler e417054a67 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-04 06:48:20 -06:00
Jacques Distler d786e95a77 Ruby 1.9 + MySQL Hack
The default encoding in MySQL is latin1. Ruby 1.9
is a stickler about the encoding of a sequence of bytes.
In this case, a utf8 page name stored in the database comes
back as "ASCII-8BIT" (ie, binary). Coerce that back to utf8.

This doesn't affect SQLite3, and it doesn't affect Ruby 1.8.
It doesn't even affect MySQL databases with "utf8" encoding
(though that has other issues, since MySQL's utf8 support is
broken).
There are probably other, similar problems lurking.
2010-01-04 06:41:04 -06:00
Jacques Distler 0cfea84802 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-03 13:23:26 -06:00
Jacques Distler e3aa626489 Better Display of Interweb Wikilinks
Perhaps not the most creative use of CSS. But,
at least, this will read better.
2010-01-03 13:19:47 -06:00
Jacques Distler 04742e3c27 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-02 11:23:59 -06:00
Jacques Distler 7b7d2e80dc More Array -> Set
Make the syntax colouring run faster.
2010-01-02 11:22:12 -06:00
Jacques Distler 0f5ac4468a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-01 21:52:56 -06:00
Jacques Distler c212a53ad8 Updated License from Jason
Jason's fenced codeblock code is now
BSD Licensed.
2010-01-01 21:51:01 -06:00
Jacques Distler 59c0280069 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-01 20:20:17 -06:00
Jacques Distler 9fe467ee36 Tweak SQLite Syntax Colouring 2010-01-01 20:18:10 -06:00
Jacques Distler 0f4f7bc04a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-01 17:04:19 -06:00
Jacques Distler 4bb22e0fa8 Length of wiki_references referenced_name
Another minor database migration. The length of the
'referenced_name' field in the previous schema was
limited to 60 characters. Increase that to 255
characters (matching the length of then 'name' field
in 'pages', etc).

This has no effect in SQLite3 users (the default), since
SQLite3 does not enforce these length restrictions. But
MySQL users need this.

As always, run

   rake upgrade_instiki

to seamlessly upgrade your database to the latest schema.
2010-01-01 16:57:21 -06:00
Jacques Distler 958410f295 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2010-01-01 13:06:37 -06:00
Jacques Distler 753520eb70 Current Database Schema
Should have regenerated this file back at Revision 458.
2010-01-01 13:02:16 -06:00
Jacques Distler ce46bd0929 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-31 15:56:22 -06:00
Jacques Distler f66fc4de4d Fenced Code Blocks, Fortran Syntax Colouring
Support Marhdown Extra's fenced code blocks. [From Jason Blevins]
Fortran syntax colouring. [From Jason Blevins]
Turn on Syntax colouring, by default.
Point to Michel Fortin's Markdown Extra page.
2009-12-31 15:54:01 -06:00
Jacques Distler 259d70c5c6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-28 15:03:47 -06:00
Jacques Distler b72ca42199 Better handling of pathnames with spaces
This seems to be a problem, particularly on Windows.
See if we can work around it, by updating script/server
2009-12-28 15:00:38 -06:00
32122 changed files with 217530 additions and 68070 deletions

128
CHANGELOG
View File

@ -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

12
Gemfile Normal file
View File

@ -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
View File

@ -1,7 +1,7 @@
= Instiki
Instiki is a wiki clone so pretty and easy to set up, you'll wonder if its 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 its 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:

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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) }

View File

@ -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|

View File

@ -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

View File

@ -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

View File

@ -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

75
app/metal/itex.rb Normal file
View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)}")

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -1,5 +1,5 @@
<%-
@title = "Delete #{@file_name}"
@title = "Delete #{@file_name}".html_safe
@hide_navigation = true
-%>

View File

@ -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'},

View File

@ -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 -->

View File

@ -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}

View File

@ -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") -%>

View File

@ -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") -%>

View File

@ -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") -%>

View File

@ -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

View File

@ -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 -%>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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]}" )
) %>

View File

@ -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">

View File

@ -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)) %>

View File

@ -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>

View File

@ -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:

View File

@ -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) %>

View File

@ -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 -%>

View File

@ -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>

View File

@ -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
-%>

View File

@ -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>

View File

@ -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 -%>

View File

@ -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>

View File

@ -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 %>

View File

@ -0,0 +1 @@
<%= @tex_content.html_safe %>

View File

@ -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>

21
bundle Executable file
View File

@ -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)

View File

@ -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!

View File

@ -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'))

23
config/preinitializer.rb Normal file
View File

@ -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

View File

@ -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'

View File

@ -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')])

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

2372
lib/instiki_stringsupport.rb Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

1113
lib/oldredcloth.rb Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

65
lib/rack_stuff.rb Normal file
View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -31,4 +31,4 @@ class InstikiUpgrade
end
end
end
end

View File

@ -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

View File

@ -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

View File

@ -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)

202
public/MathJax/COPYING.txt vendored Normal file
View File

@ -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.

202
public/MathJax/LICENSE vendored Normal file
View File

@ -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.

30
public/MathJax/MathJax.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/MathJax/README-branch.txt vendored Normal file
View File

@ -0,0 +1 @@
This is release branch v1.1 of MathJax.

52
public/MathJax/README.md vendored Normal file
View File

@ -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.

55
public/MathJax/README.txt vendored Normal file
View File

@ -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

86
public/MathJax/config/Accessible.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

52
public/MathJax/config/MML_HTMLorMML.js vendored Normal file

File diff suppressed because one or more lines are too long

16
public/MathJax/config/MMLorHTML.js vendored Normal file
View File

@ -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

56
public/MathJax/config/TeX-AMS_HTML.js vendored Normal file

File diff suppressed because one or more lines are too long

606
public/MathJax/config/default.js vendored Normal file
View File

@ -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");

24
public/MathJax/config/instiki.js vendored Normal file
View File

@ -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");

37
public/MathJax/config/local/local.js vendored Normal file
View File

@ -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");

View File

@ -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");

16
public/MathJax/extensions/MathMenu.js vendored Normal file

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