Compare commits

...

1337 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
Jacques Distler 7e61bc10d7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-27 00:57:51 -06:00
Jacques Distler 2780344a1b Version 0.18 2009-12-27 00:55:48 -06:00
Jacques Distler 27eab3ee41 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-27 00:43:28 -06:00
Jacques Distler b75aa4b8d6 Fix a broken test 2009-12-27 00:41:04 -06:00
Jacques Distler dce19f6eda Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-26 23:47:38 -06:00
Jacques Distler 601331b508 Move Files When Renaming Web
Renaming a web should move the
corresponding subdirectory of webs/ .
Otherwise, links to uploaded files break.
2009-12-26 23:43:18 -06:00
Jacques Distler 47439e97c5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-26 14:03:26 -06:00
Jacques Distler a705709f9a Vendor Rack 1.1
Also clean up some View stuff.
2009-12-26 14:00:18 -06:00
Jacques Distler d9467ba836 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-25 12:04:10 -06:00
Jacques Distler 77014652a3 Add Some Obsolete HTML Elements
Recognize some obsolete, but commonly-used,
HTML elements in the CSS syntax colourer.
2009-12-25 12:00:48 -06:00
Jacques Distler 5fd08cdcab Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-25 04:28:16 -06:00
Jacques Distler fcef0fd031 Stylesheet tweak 2009-12-25 04:26:07 -06:00
Jacques Distler 77ae91124c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-25 04:19:21 -06:00
Jacques Distler c1420153d8 Update CSS Syntax Colouring for HTML5
Update the list of elements to what you
would encounter in an HTML5 document.
2009-12-25 04:16:03 -06:00
Jacques Distler b4589e197d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-25 03:21:49 -06:00
Jacques Distler f06e6c004b Ruby 1.9 Compatibility of Vendored Syntax Library
The CSS language support of the syntax
colourer was broken under Ruby 1.9
2009-12-25 03:17:06 -06:00
Jacques Distler 2ab51ba512 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-24 12:28:23 -06:00
Jacques Distler 3ab7327cea Whoops! Also Update Maruku
Support syntax-colouring for
lang=css
2009-12-24 12:25:44 -06:00
Jacques Distler e6673c4cee Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-24 00:52:39 -06:00
Jacques Distler af0f607e75 Syntax Colouring
New syntax colouring modes.
In addition to the existing
  html, xml, ruby
we now support
  yaml, ansic, javascript, sqlite, css
2009-12-24 00:45:45 -06:00
Jacques Distler 22b00d76f1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-23 02:21:24 -06:00
Jacques Distler 1d32d45944 Upgrade Vendored rubyzip to Version 0.9.3 2009-12-23 02:19:16 -06:00
Jacques Distler d6b729b5b3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-22 21:02:34 -06:00
Jacques Distler 7c51accaab Update Windows sqlite3.dll
For whatever the heck it's worth...
2009-12-22 21:00:23 -06:00
Jacques Distler b4758d9bfa Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-22 20:50:39 -06:00
Jacques Distler a71e64a172 Update Vendored sqlite3-ruby 2009-12-22 20:48:32 -06:00
Jacques Distler 67b27da5c9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-18 23:57:05 -06:00
Jacques Distler 9874650e4b Silence Some Stupid Warnings in Ruby 1.9 2009-12-18 23:53:43 -06:00
Jacques Distler f50d7189f7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-18 20:20:17 -06:00
Jacques Distler 76f388f3e2 Vendor Rack 1.0.1
Incorporate patch from Revision 496.
2009-12-18 20:16:58 -06:00
Jacques Distler f8c6c4410e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-18 11:50:56 -06:00
Jacques Distler a7202d54cd Workaround Ruby 1.9.1 tempfile Bug
Add a patch (from Passenger 2.2.8) to
vendored Rack, which works around a bug
in Ruby 1.9.1. This patch to Rack has been
floating around the intertubes for a while.
2009-12-18 11:45:26 -06:00
Jacques Distler 8017ce5279 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-17 22:51:59 -06:00
Jacques Distler a166fb9608 Add Link to BlahTeX Manual 2009-12-17 22:50:10 -06:00
Jacques Distler cc8aa4b3e0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-17 10:37:34 -06:00
Jacques Distler a1420aa5c7 Revamp Markup Cheat Sheets
They still suck, but less-so.
2009-12-17 10:29:51 -06:00
Jacques Distler c391c0eeee Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-16 01:04:56 -06:00
Jacques Distler fe877a10b4 Make html_ext Available as a Helper
... and protected.
2009-12-16 00:59:33 -06:00
Jacques Distler cf37421f4b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-14 22:37:37 -06:00
Jacques Distler f3b69bc57b Make xhtml_enabled? a Protected Method
... as it should be. Remarkably, it's
still possible to use it in views, if
you declare it a helper method.
2009-12-14 22:34:31 -06:00
Jacques Distler 47941683ab Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-14 17:43:53 -06:00
Jacques Distler d3e79ea84a Make truncate() Unicode-aware 2009-12-14 17:41:28 -06:00
Jacques Distler 085783d308 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-14 02:07:56 -06:00
Jacques Distler 2c5e5a0015 Refactoring
Move the truncate() method into ApplicationHelper.
Move another method around, for no particularly
good reason. Controllers really shouldn't have
public methods that don't correspond to actions.
2009-12-14 02:01:50 -06:00
Jacques Distler 5899e19611 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-13 21:16:26 -06:00
Jacques Distler dc3d202665 Cache Source View
Also, fix a cache-sweeping bug reported,
long ago, by Toby Bartels.
2009-12-13 21:09:12 -06:00
Jacques Distler a02ada047a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-13 20:02:24 -06:00
Jacques Distler 1613973929 Array#collect is faster than Array#inject
Also add some more tests.
2009-12-13 20:00:18 -06:00
Jacques Distler 0b1fccc178 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-13 19:29:02 -06:00
Jacques Distler 282515d907 Source View
Add a Source view. [Based on a suggestion by Andrew Stacey]
Fix a well-formedness bug in the list action, due to
boneheaded truncation algorithm. [Reported by Roby Bartels]
2009-12-13 19:25:14 -06:00
Jacques Distler 9d859343f3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-12 23:10:05 -06:00
Jacques Distler c88a1d43dc Another Textarea Resizing Tweak
Handle the 'Change page name'
part of the form more intelligently.
2009-12-12 22:37:38 -06:00
Jacques Distler 9ef71a7bce Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-12 15:30:47 -06:00
Jacques Distler a58bee7437 Another Textarea Tweak and a Ruby 1.9 Fix 2009-12-12 15:28:05 -06:00
Jacques Distler 3890461b16 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-12 01:16:10 -06:00
Jacques Distler 60a233a917 More Robust
Browsers have a bewildering array of
default behaviours for <textarea>s.

This will work a little more uniformly
across brosswers.
2009-12-12 01:12:52 -06:00
Jacques Distler 619f2f1793 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-10 16:59:23 -06:00
Jacques Distler 561a007682 Auto-resizing Textarea
Resize textarea to fit viewing area.
Also update Prototype to 1.6.1.
2009-12-10 16:57:05 -06:00
Jacques Distler ffe50318e3 Add a log/ directory to the GIT repository
Dunno why the #$%* GIT repository doesn't have one
(the BZR repository does). For good measure, add a
stub log/production.log file, since the absence of
one, apparently causes troubles for some users.
(And anyway, we all know how much GIT *loves* empty
directories.)
2009-12-09 21:35:50 -06:00
Jacques Distler efd3def461 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-08 11:49:17 -06:00
Jacques Distler 023d84c4a4 Ack! This is better 2009-12-08 09:08:25 -06:00
Jacques Distler a06d5443e1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-08 08:52:09 -06:00
Jacques Distler faac8951a3 More Ruby 1.9 String Encoding Fun 2009-12-08 08:50:01 -06:00
Jacques Distler 5090d1f167 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-07 15:31:28 -06:00
Jacques Distler 2c5c6dc78a S5 Fix
Omit a (seemingly superfluous)
javascript hack which causes
Gecko-based browsers to request
   /my_wiki/s5/null
when they load an s5 slideshow.

Also a stylistic cleanup in
the wiki_controller.
2009-12-07 15:27:40 -06:00
Jacques Distler 36bf257d72 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-05 10:53:19 -06:00
Jacques Distler 171c12d2c1 Efficiency
This version of String#purify
is 12% faster, under Ruby 1.9,
than before.
2009-12-05 10:50:58 -06:00
Jacques Distler 0bc05f11fd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-02 12:47:53 -06:00
Jacques Distler f7044ecbb4 Ruby 1.9.1 Fixes
Some more fixes to deal with Ruby 1.9.1.
2009-12-02 12:46:15 -06:00
Jacques Distler 8d67865ba5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-01 21:34:29 -06:00
Jacques Distler 063a8ca5a7 Fix Maruku Ruby 1.9 Bug
In Rbuy 1.8, ?c returns an integer.
In Ruby 1.9, it returns a 1-character
string. This was causing one of our
LaTeX conversion functional tests to
fail.
Fixed.
2009-12-01 21:29:07 -06:00
Jacques Distler 1376a01574 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-12-01 12:07:16 -06:00
Jacques Distler 34b63a8375 Fix a Ruby 1.9 Character Encoding Bug
Wow, this stuff is complicated!
Some things really want to be UTF-8;
others really want to be byte strings.
2009-12-01 12:03:15 -06:00
Jacques Distler 17b1e6e96e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-30 19:40:48 -06:00
Jacques Distler e3832c6f79 Rails 2.3.5
Upgrade to Rails 2.3.5.
Also work around this bug:
 https://rails.lighthouseapp.com/projects/8994/tickets/3524
created by the aforementioned
Rails release.
2009-11-30 19:38:34 -06:00
Jacques Distler f23d892bf9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-30 16:35:46 -06:00
Jacques Distler a6429f8c22 Ruby 1.9 Compatibility
Completely removed the html5lib sanitizer.
Fixed the string-handling to work in both
Ruby 1.8.x and 1.9.2. There are still,
inexplicably, two functional tests that
fail. But the rest seems to work quite well.
2009-11-30 16:28:18 -06:00
Jacques Distler 1cf29f444f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-22 01:34:50 -06:00
Jacques Distler 79c8572053 Use Rails.root
A little cleanup.
2009-11-22 01:32:58 -06:00
Jacques Distler 13c8990c80 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-22 00:33:18 -06:00
Jacques Distler 045dcbf1f5 Media Type
The default stylesheet should be media='all',
rather than media='screen'.
Damned Rails defaults!
2009-11-22 00:27:42 -06:00
Jacques Distler 7a8aef6020 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-18 12:45:58 -06:00
Jacques Distler b1b988c672 Update Test for itex2MML 1.3.18
More entity fun.
2009-11-18 12:44:25 -06:00
Jacques Distler 5fb5744245 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-18 12:07:12 -06:00
Jacques Distler 371aab6f96 Sync with Latest itex2MML and MathML::Entities
Support the latest changes in
http://www.w3.org/TR/2009/WD-xml-entity-names-20091117/
2009-11-18 12:04:07 -06:00
Jacques Distler 77dcb015f3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-09 18:19:12 -06:00
Jacques Distler e678b7e3a2 Spacing Tweak 2009-11-09 18:17:57 -06:00
Jacques Distler 7189863225 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-09 12:01:20 -06:00
Jacques Distler 2b213d95de Accessiblity: Skip Navigation Link
Thanks to John Gardner for the suggestion.
2009-11-09 11:58:57 -06:00
Jacques Distler 6d560848aa Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-08 02:30:22 -06:00
Jacques Distler 6be9c5ca6a More Robust mactionWorkarounds
The previous version was OK with itex2MML
output. But this one will not get tripped up
by extraneous text nodes.
2009-11-08 02:27:38 -06:00
Jacques Distler 301dc6f7b0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-07 21:13:47 -06:00
Jacques Distler f9bd8f081f Change body Font Back to Verdana
Some CSS experiments crept into Revision 464.
Revert them.
2009-11-07 21:11:32 -06:00
Jacques Distler 9015cfcfc0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-06 21:26:01 -06:00
Jacques Distler 2e52ce48df Update LaTeX Output for Revision 464 2009-11-06 21:23:18 -06:00
Jacques Distler 88cb82769a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-11-06 14:37:40 -06:00
Jacques Distler 977da29f68 Support for \tooltip{}{} and \statusline{}{}
itex2MML 1.3.16 add a \tooltip{}{} command which,
like \statusline{}{}, produces an <maction> element.

Neither of these is natively supported by Mozilla/Firefox.
Add some Javascript to work around that weakness.
2009-11-06 14:32:45 -06:00
Jacques Distler df509623ed Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-28 00:25:15 -05:00
Jacques Distler c99ca26a8d Better log rotation for Passenger
Touch the tmp/restart.txt file, when
rotatingthe log files. Otherwise, multiple
workers may try to rotate the log files
at the same time, with sub-optimal results.

Also, an aesthetic tweak to the url_generator.
2009-10-28 00:03:25 -05:00
Jacques Distler 4176ef2bcf Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-23 11:14:41 -05:00
Jacques Distler 883d82992c Version 0.17.3 2009-10-23 11:13:26 -05:00
Jacques Distler 698c194b63 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-23 10:08:21 -05:00
Jacques Distler f559d8a06d Intra-Web Links in S5 Slideshows on Published Webs
Never really thought through where those should go.
They now point to the published version.
2009-10-23 10:05:02 -05:00
Jacques Distler 4764364480 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-23 00:25:32 -05:00
Jacques Distler d880d81b0a Simplification
The last commit means we can
simplify the url_generator.rb a bit more.
It's still an ugly beast.
2009-10-23 00:18:23 -05:00
Jacques Distler 3a4f66d484 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-22 17:59:25 -05:00
Jacques Distler 761f8bbb51 Links From Published Webs
Damn, but it's hard to get this right.
I think I've finally done it, though.
We'll see ...
2009-10-22 17:57:13 -05:00
Jacques Distler dc26bbdd36 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-21 00:53:26 -05:00
Jacques Distler 97a35e280b DB Migration
% rake upgrade_instiki

fixes some potential problems in the database column types.

Revision content can now be up to 16MB.
Under MySQL, the previous limit was 64KB.

Page names can now be up to 255 bytes.
Under MySQL, the previous limit was 60 bytes.

Additional CSS styles can now be up to 64KB.
Under MySQL, the previous limit was 255 bytes.

Thanks to Andrew Stacey for reporting these.
2009-10-21 00:42:48 -05:00
Jacques Distler 097ce16e8b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-19 22:59:29 -05:00
Jacques Distler 5df1504255 Tests for Revision 456
Functional tests for Revision 456.
Also, fix a buglet in handling rescues
for new pages.
2009-10-19 22:57:11 -05:00
Jacques Distler 6e8c25d96a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-19 18:26:34 -05:00
Jacques Distler 20c99df440 Work around Rails flash bug
When redirected to another page, flash 
messages will not display if the query
string is longer than 10192 bytes. In
Instiki, certain rescue operations 
involve redirection, with the updated
content of the page passed as a query
parameter. Fall back to using the stored
content (ie, don't pass a query parameter)
if the content is too long.
2009-10-19 18:19:31 -05:00
Jacques Distler 0cbeda005d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-11 14:49:48 -05:00
Jacques Distler 3372d78df3 Auto-Restarting for Passenger
Added a tmp/restart.txt file.
Touching this file will cause 
Passenger to restart the application.
2009-10-11 14:41:32 -05:00
Jacques Distler 4de9fb9283 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-11 14:02:44 -05:00
Jacques Distler cae4b5c539 Enable X-Sendfile support under Passenger
Passenger doesn't behave like a proxy server.
But it does support X-Sendfile. So let's make
use of that.
2009-10-11 14:00:16 -05:00
Jacques Distler 5e3e4b1cb7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-11 10:31:02 -05:00
Jacques Distler 2240206554 Ack!
Do that right.
2009-10-11 10:29:15 -05:00
Jacques Distler 008824c1ad Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-11 10:22:15 -05:00
Jacques Distler a483b4e71e Also fix S5 slides.js
It needs to use relative URLs, too.
2009-10-11 10:20:43 -05:00
Jacques Distler de44b81020 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-11 09:56:55 -05:00
Jacques Distler 23e9c6beb2 Use AssetTagHelpers in S5 Template
Otherwise S5  breaks when Instiki is
deployed to a non-root URL (e.g., by
setting RailsBaseURI in Passenger).

Also a stylistic tweak in lib/node.rb
2009-10-11 09:49:01 -05:00
Jacques Distler fe9e834983 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-10 03:54:33 -05:00
Jacques Distler dd8c912c6c Update lib/node.rb
Grab some fixes from html_scanner, and add few of our own.
2009-10-10 03:52:33 -05:00
Jacques Distler ffa6ee23cd Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-10 02:46:59 -05:00
Jacques Distler d5e35d2861 Some more Sanitizer tweaks
Mostly stylistic things, but allow some constants to be defined by the calling program.
2009-10-10 02:44:44 -05:00
Jacques Distler 7995143c09 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-09 23:20:38 -05:00
Jacques Distler d14db51d9e More Sanitizer Refactoring
Make the Sanitizer more efficient.
Also, update some unit tests.
2009-10-09 23:18:17 -05:00
Jacques Distler 0f1b6bc695 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-09 14:03:57 -05:00
Jacques Distler 9b7071d190 Update Sanitizer Docs
They were a bit out-of-sync with what the sanitizer
actually does.
2009-10-09 14:02:07 -05:00
Jacques Distler 043db32754 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-09 13:04:00 -05:00
Jacques Distler e7b77dd3d3 Sanitizer Refactoring
A bit of cleanup for the Sanitizer.
2009-10-09 13:02:02 -05:00
Jacques Distler 5c2e4437b5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-08 16:24:59 -05:00
Jacques Distler 2f3ff9f651 Efficiency
There's a moderate efficiency gain to be had by
using Set#include?, rather than Array#include?
in the sanitizer.
2009-10-08 16:22:50 -05:00
Jacques Distler 59dba2105c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-06 11:32:27 -05:00
Jacques Distler aef669a923 Change some CRs to LFs 2009-10-06 11:31:15 -05:00
Jacques Distler 0d210fe10f Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-05 02:40:11 -05:00
Jacques Distler d89769fe81 Update for itex2MML 1.3.13
Implements \mathrlap{}, \mathllap{}, and \mathclap{}.
Deprecates the use of \rlap{} (use \mathrlap{}, instead:
the latter works in math-mode in the LaTeX export, whereas
TeX's \rlap{} did not).
2009-10-05 02:36:00 -05:00
Jacques Distler 5634f93afc Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-10-04 03:47:21 -05:00
Jacques Distler 41274d64d0 Support itex2MML 1.3.12 2009-10-04 03:46:06 -05:00
Jacques Distler 48e6bd5f74 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-26 00:38:29 -05:00
Jacques Distler 510e44a61a More tests 2009-09-26 00:36:28 -05:00
Jacques Distler a35921a90d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-25 16:02:23 -05:00
Jacques Distler e0df6c8a6a Updated Tests and Sanitizer Fixes for Revision 439 2009-09-25 15:59:43 -05:00
Jacques Distler b438bc64f6 Update More MathML Entity Mappings
Bring up-to-date with Editor's copy of
XML Entity definitions for Characters
(W3C Working Draft 13 September 2009)
http://www.w3.org/2003/entities/2007doc/overview.html
2009-09-25 14:34:22 -05:00
Jacques Distler 22b119c056 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-24 16:24:04 -05:00
Jacques Distler 31ed55f055 Update MathML Entity Mappings
Update list of XHTML+MathML named entities
to match
http://www.w3.org/TR/2008/WD-xml-entity-names-20080721/
2009-09-24 16:21:22 -05:00
Jacques Distler e489d77579 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-13 11:27:01 -05:00
Jacques Distler affc47fc22 Fix TeX Rendering Bug
Make sure we

  require 'maruku/ext/math'

before calling the Maruku#to_latex method.

Also, update test for itex2MML 1.3.11 .
2009-09-13 11:23:57 -05:00
Jacques Distler e652af4e73 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-09 15:03:49 -05:00
Jacques Distler 7185af32fc Fix an Eyesore
That just looked sloppy. I blame copy/paste.
2009-09-09 15:01:25 -05:00
Jacques Distler f5f3d76c99 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-09 09:18:39 -05:00
Jacques Distler 3ff68ef42f Don't Expand NCRs
That operation is not idempotent (among other defects).
Instead, just check that the NCRs corespond to valid utf-8.
(Reported by Andrew Stacey)
2009-09-09 09:16:00 -05:00
Jacques Distler 03abccc45a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-08 22:24:12 -05:00
Jacques Distler d51b04d3db Update Location of Textile Help
_why_the_lucky_stiff disappeared . Use a
mirror site instead. (Reported by villem)
2009-09-08 22:20:18 -05:00
Jacques Distler 2068683ee8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-07 20:44:57 -05:00
Jacques Distler 116255dc0d Purify Categories
Apply the same methodology, as in Revision 432,
to the category chunk-handler. This completes
the replacement of all the code that looks like

  if string.is_utf8?
    do something
  else
    complain
  end

with code that looks like

  string.purify
  do something
2009-09-07 20:38:09 -05:00
Jacques Distler 52a0b565a5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-07 16:08:33 -05:00
Jacques Distler c79fef9c01 Clean, rather than Complain
Previously, if the user tried to submit content which was
malformed utf-8, Instiki would complain loudly to him.

A slightly more user-friendly approach was suggested by
the latest Rails 2.3.4, and a conversation with Sam Ruby
(who suggested some improvements).

Now, instead of complaining, we remove the offending bytes,
leaving a well-formed utf-8 string, which we pretend is what
the user meant to submit.
2009-09-07 16:02:36 -05:00
Jacques Distler 8957927c7a That'll Teach Me to Merge Indiscriminately!
Rollback rake upgrade task
2009-09-05 23:21:44 -05:00
Jacques Distler 7f3d0f529b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-05 23:09:06 -05:00
Jacques Distler f029aae60e Refactoring the Web Model (From James Herdman)
A bit of refactoring, via 

  http://github.com/jherdman/instiki/tree/master
2009-09-05 23:02:52 -05:00
Jacques Distler e5848d53c3 Ignore this 2009-09-05 22:52:12 -05:00
James Herdman 2c10cff214 Remove superfluous comment 2009-09-05 20:51:31 -04:00
James Herdman 5a29810abc Document many obvious methods on Web 2009-09-05 20:47:48 -04:00
James Herdman 33bbf31333 Use the 'pages' association in Web#add_page 2009-09-05 20:43:14 -04:00
James Herdman c5beb7d9a1 Make sure we ignore any generated file in webs 2009-09-05 20:43:13 -04:00
James Herdman 3f265a520b Document Web#default_web? 2009-09-05 20:43:13 -04:00
James Herdman 7a7d187c7f Refactor methods that touch the 'wiki_files' association on Web 2009-09-05 20:43:13 -04:00
James Herdman 9e988401c5 There's a weird sqlite file generated that is now covered by this test 2009-09-05 20:43:13 -04:00
James Herdman bea8525130 Fully leverage the #wiki_files association on Web 2009-09-05 20:43:13 -04:00
James Herdman 8c1ded2303 More succinct Web#has_page? method 2009-09-05 20:43:13 -04:00
James Herdman af61e78b96 More succinct Web#last_page method, and documentation 2009-09-05 20:43:13 -04:00
James Herdman b52dee63c3 More succinct Web#page method and documentation 2009-09-05 20:43:13 -04:00
James Herdman 09531ce777 Moved validators and hooks to the top of Web to promote their visibility
visibility
2009-09-05 20:43:12 -04:00
James Herdman 23dae8b155 Clean up Web#page_names_by_author implemention 2009-09-05 20:43:12 -04:00
James Herdman 6a4af8a59a More succinct Web#markup method, now with documentation 2009-09-05 20:43:12 -04:00
James Herdman b96810fd2e Refactor Web#authors and document it using Yard-style markup 2009-09-05 20:43:12 -04:00
James Herdman c0cab0d0b7 Introduce 'revisions' association on Web 2009-09-05 20:43:12 -04:00
James Herdman ed8e9cfbd8 White space police 2009-09-05 20:43:12 -04:00
James Herdman e3752a04dc Ignore everything in webs 2009-09-05 15:26:54 -04:00
James Herdman 4d9789644d Merge from parasew/master 2009-09-05 15:26:29 -04:00
Jacques Distler 63deb51ec1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-05 02:45:51 -05:00
Jacques Distler 37a8f30ded Whoops! Make Sure Instiki Works with Vendored Rack 2009-09-05 02:44:19 -05:00
Jacques Distler 9be02c92e5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-05 02:07:44 -05:00
Jacques Distler 4bdf703ab2 Instiki 0.17.2: Security Release
This release upgrades Instiki to Rails 2.3.4, which
patches two security holes in Rails. See

  http://weblog.rubyonrails.org/2009/9/4/ruby-on-rails-2-3-4

There are also some new features, and the usual boatload
of bugfixes. See the CHANGELOG for details.
2009-09-05 02:01:46 -05:00
Jacques Distler de97daa048 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-04 00:11:48 -05:00
Jacques Distler 34c4306867 More ActiveRecord Association .length -> .size Optimizations 2009-09-04 00:09:39 -05:00
Jacques Distler f9a0c824ca Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-09-03 23:12:27 -05:00
Jacques Distler 342298ed0e Wikilinks to Published Webs
Should be to the published action. This
didn't work right for inter-web links.
(Reported by Mike Shulman)

Also, change some .length's to .size's
(for Andrew Stacey)
2009-09-03 23:09:10 -05:00
Jacques Distler e75a0f9881 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-29 23:38:08 -05:00
Jacques Distler 888e93a7fd Streamline Rake Task
Refactor the upgrade_instiki rake task.
Based on the (very nice) JHerdman's
  64d305f2a8
but defaults to 'production' environment, instead.
Instiki users don't know about production/development/test.
Instiki defaults to 'production'. So should its associated rake tasks.
2009-08-29 23:31:39 -05:00
James Herdman ac07bab815 Clean up file permissions 2009-08-29 14:28:13 -04:00
James Herdman 6db6f37439 This shouldn't be under revision control 2009-08-29 14:26:44 -04:00
James Herdman 13fd273f6f Merge branch 'fix_upgrade_rake_task' 2009-08-29 14:25:34 -04:00
James Herdman bdc8abd11c Introduce rules for Git to ignore certain generated files 2009-08-29 14:25:20 -04:00
James Herdman 64d305f2a8 Don't make ANY assumptions about the environment. Use the model and
Rails to do as much work as possible.
2009-08-29 14:20:08 -04:00
Jacques Distler 23890d6ec0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-28 11:15:37 -05:00
Jacques Distler 336e57d6b4 Pathname Objects
Web#files_path and Web#blatex_pngs_path now return Pathname objects.
Based on JHerdman's
5d1e8f420b
but requires several other changes to the code (which assumed a string).

Also, test for itex2MML 1.3.10 (you should update that too).
2009-08-28 11:10:34 -05:00
Jacques Distler 205fbcb898 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-27 17:01:44 -05:00
Jacques Distler c05d69bcff Make upgrade_instiki Rake Task Database-Agnostic
Reported by James Herdman.
2009-08-27 16:57:37 -05:00
Jacques Distler 7f8b696dec Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-27 15:31:05 -05:00
Jacques Distler 93ea19f567 Workaround for Mozilla Bug 449396
Andrew Stacey reminded me that this bug
   https://bugzilla.mozilla.org/show_bug.cgi?id=449396
is still unfixed.
But it's easy to work around...
2009-08-27 15:28:16 -05:00
Jacques Distler 4ce68073c5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-24 17:45:37 -05:00
Jacques Distler 28cf501166 Correctly Set noindex,nofollow On /diff Pages
None of them should be indexed.
Make sure that happens.
2009-08-24 17:42:34 -05:00
Jacques Distler b1117a19c6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-12 12:22:46 -05:00
Jacques Distler 8cf26c9249 Add a "Create New Page" Link to the Search Page
Based on an idea by nowa:

   bcac6c9f94
2009-08-12 12:19:23 -05:00
Jacques Distler c14c1f3c5a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-04 15:45:56 -05:00
Jacques Distler 664552ac02 Rails 2.3.3.1
Update to latest Rails.
A little bit of jiggery-pokery is involved, since they
neglected to re-include vendored Rack in this release.
2009-08-04 10:16:03 -05:00
Jacques Distler 96defb0945 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-08-04 00:08:01 -05:00
Jacques Distler 329fafafce Fix Two bugs from Toby Bartels
1. Ensure that "rollback" respects locked pages.
2. Expire revisions of an edited page. Use a before_save
   hook to deal with the situation where a page's name
   has been changed.
2009-08-04 00:02:04 -05:00
Jacques Distler 9edb8f6045 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-27 22:53:11 -05:00
Jacques Distler 0e0f666fb4 Rollbacks and Relative URLs
Ensure "rollback" locks page for editing. (reported by Toby Bartels)
Generate relative URLs, when possible. (Patch by Dennis Knauf)
2009-07-27 22:49:12 -05:00
Jacques Distler d474cb83ad Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-14 00:02:07 -05:00
Jacques Distler 698daecf0e Maruku "Email" Header Detection
The Regexp, used in Maruku to detect "email"
headers (used, e.g., for S5 slideshow metadata)
could, for some inputs, interact badly with
Instiki's Chunk Handler.
Fixed.
2009-07-13 23:59:09 -05:00
Jacques Distler 9b074a93c7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-13 13:01:53 -05:00
Jacques Distler 51280b758d Redirected Pages are not Wanted Pages
Correct list of Wanted Pages. Should not
include redirected pages.
(Reported by Toby Bartels)
2009-07-13 12:59:42 -05:00
Jacques Distler 6079fedc16 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-09 15:42:14 -05:00
Jacques Distler 77e00f1a76 Test for itex2MML 1.3.9
Make sure we have the latest itex2MML.
2009-07-09 15:40:45 -05:00
Jacques Distler ad087b270a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-07 00:15:33 -05:00
Jacques Distler a0b965c9f5 Tweak CSS for S5 Themes
So that syntax-colouring will be passably OK there.
2009-07-07 00:13:48 -05:00
Jacques Distler 4bbc157b2b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-06 15:34:16 -05:00
Jacques Distler ef5878cf11 Put class name on <pre>, rather than <code>
Better CSS styling options ensue, if we put
the class='lang' on the <pre> element.

(Suggested by Casper Gripenberg)
2009-07-06 15:30:35 -05:00
Jacques Distler e2aca9346b Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-06 11:12:09 -05:00
Jacques Distler 573af987bc Syntax Colouring
Add some default CSS support for syntax colouring of code blocks.

Try:

	require 'chunks/chunk'
{:lang=ruby html_use_syntax=true}

or

        <div xhtml:class='foo' width='4'>bar<!-- fubar --></div>
{:lang=html html_use_syntax=true}

(Suggested by Casper Gripenberg)
2009-07-06 11:07:57 -05:00
Jacques Distler 717a89d8b4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-07-02 11:05:10 -05:00
Jacques Distler 7f2e883e12 Slashes in Page Names
Make it possible to change the name of a page, whose currrent name
contains a forward slash.
(Reported boy Toby Bartels)
2009-07-02 11:02:05 -05:00
Jacques Distler 73f15777a0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-21 00:41:35 -05:00
Jacques Distler a049d27222 Escape Page name
Use escape_javascript() in page name-changing javascript.
2009-06-21 00:39:24 -05:00
Jacques Distler a016729d89 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-17 21:17:34 -05:00
Jacques Distler 07fbf17af1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-17 13:03:16 -05:00
Jacques Distler 32c8c4028c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-17 11:31:09 -05:00
Jacques Distler 17d8bbe5e1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-15 08:39:14 -05:00
Jacques Distler 335f4669f6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-14 23:18:44 -05:00
Jacques Distler b77c1d8db5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-14 23:00:34 -05:00
Jacques Distler 193d932904 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-14 16:54:42 -05:00
Jacques Distler 191f7b3b2c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-12 19:49:34 -05:00
Jacques Distler 89757dccd4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-11 13:18:37 -05:00
Jacques Distler cea00549f7 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-11 01:56:48 -05:00
Jacques Distler 9f3d3c8607 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-10 21:11:56 -05:00
Jacques Distler 22ab39dfb5 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-06 23:37:59 -05:00
Jacques Distler 2995354b3a Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-06 21:09:30 -05:00
Jacques Distler 42a84d8b32 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-06 12:39:44 -05:00
Jacques Distler d99503df52 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-05 22:50:23 -05:00
Jacques Distler 2fe01ab0d8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-05 22:27:45 -05:00
Jacques Distler 09a62be647 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-05 17:48:04 -05:00
Jacques Distler 27c878a537 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-05 09:04:38 -05:00
Jacques Distler 8624a40bf8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-05 00:41:33 -05:00
Jacques Distler e52ca89aab Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-02 23:37:54 -05:00
Jacques Distler 3d626dae30 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-06-02 22:24:50 -05:00
Jacques Distler 8b36dad71c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-05-13 01:47:12 -05:00
Jacques Distler 9e4e565221 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-05-13 01:31:28 -05:00
Jacques Distler 8cde9dff82 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-05-08 16:16:45 -05:00
Jacques Distler 4d34abc8fa Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-05-07 17:03:03 -05:00
Jacques Distler 80c3c15143 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-05-03 01:00:24 -05:00
Jacques Distler 8222c14396 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-04-13 19:09:30 -05:00
Jacques Distler 83e9415c67 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-04-05 11:06:23 -05:00
Jacques Distler 60f2864b9e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-04-01 09:22:19 -05:00
Jacques Distler eebf7ecc6e Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-31 23:39:16 -05:00
Jacques Distler 62fd333e71 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-31 16:23:11 -05:00
Jacques Distler db534ec840 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-31 08:54:52 -05:00
Jacques Distler 6b09f76864 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-30 23:55:20 -05:00
Jacques Distler c351689469 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-29 21:25:56 -05:00
Jacques Distler 72c4fb71df Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-27 09:27:00 -05:00
Jacques Distler d3d57c1157 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-27 02:53:51 -05:00
Jacques Distler 771ef0eefe Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-24 22:43:36 -05:00
Jacques Distler af22bc67e6 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-16 09:57:44 -05:00
Jacques Distler 0b29f5bb94 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-10 00:17:35 -05:00
Jacques Distler d4b0831fa1 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-08 23:31:35 -05:00
Jacques Distler 58073d8302 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-07 20:50:41 -06:00
Jacques Distler 448e843192 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-05 21:44:55 -06:00
Jacques Distler 50f58779a8 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-05 12:18:40 -06:00
Jacques Distler 8239c392da Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-05 08:01:39 -06:00
Jacques Distler 3dfe994bd2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-05 07:55:36 -06:00
Jacques Distler cdc7b8debf Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-04 15:56:36 -06:00
Jacques Distler a404834b75 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-03 22:29:03 -06:00
Jacques Distler 3fdfad29a3 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-03 12:19:13 -06:00
Jacques Distler 52f57f151c Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-03-02 02:39:23 -06:00
Jacques Distler d039840bb4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-27 19:24:43 -06:00
parasew 3f012531b9 added revised documents from jacques 2009-02-20 20:02:25 +01:00
parasew d44184800f added jacques to maintainer list. TODO: bring the README more up-to date 2009-02-19 22:50:47 +01:00
parasew 3d1b978dd8 added changelog for the upcoming version 2009-02-19 22:40:10 +01:00
parasew 2e8624be24 Merge branch 'master' of git@github.com:parasew/instiki 2009-02-19 22:24:04 +01:00
parasew bddecddc59 added the changelog information for version 0.13 to the main CHANGELOG 2009-02-19 22:22:36 +01:00
Jacques Distler 16f320c2b0 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-18 22:25:44 -06:00
Jacques Distler 186079a0e9 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-18 01:43:49 -06:00
Jacques Distler 3f239a564d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-13 17:24:49 -06:00
Jacques Distler 8c1cf4bfa4 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-11 01:42:08 -06:00
Jacques Distler 123fd29d16 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-09 22:25:53 -06:00
Jacques Distler 84d831f7c2 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-08 19:38:42 -06:00
Jacques Distler 2878049b2d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-08 10:29:25 -06:00
Jacques Distler 7e7442a085 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-08 03:47:48 -06:00
Jacques Distler 39341cea0d Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-08 03:18:40 -06:00
Jacques Distler 5b258daef9 Added empty directories because Git is stupid. 2009-02-05 03:02:31 -06:00
Jacques Distler 98ba84ba66 Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki 2009-02-05 01:57:52 -06:00
parasew f6f9ef6969 added /tmp direcotry which got lost in the svn->git conversion. TODO: check for other possible missing dirs. 2009-02-05 01:37:48 +01:00
Matthias Tarasiewicz b804a0a504 Merge git@github.com:parasew/instiki 2009-02-04 23:33:34 +01:00
Jacques Distler 96fea14d60 Recursive Includes 2008-12-24 20:43:47 +00:00
Jacques Distler 84756f889a Fix bug #17978. 2008-12-20 20:39:38 +00:00
Jacques Distler 2a967aebb0 Fix "can't modify frozen string" bug with some versions of Rails. 2008-10-27 13:40:50 +00:00
Matthias Tarasiewicz 8685a29a40 updated the changelog for the upcoming 0.13 release 2008-03-17 15:03:42 +00:00
Jacques Distler 503f956084 Fix Two XSS Vulnerabilities
Unescaped  page names (in 'edit' an 'new' views).
Unsanitized HTTP_CLIENT_IP header.
2008-03-14 23:22:46 +00:00
Jacques Distler ab63a21ccd Fix Rails 1.2.5 deprecation warnings. 2007-10-15 19:12:36 +00:00
Matthias Tarasiewicz 2c8a3ec4d7 added instiki.bat for older windows versions 2007-10-15 07:08:45 +00:00
Matthias Tarasiewicz 7298fe97d2 updated trunk to rails 1.2.5 2007-10-15 07:05:58 +00:00
Matthias Tarasiewicz 69b9c77482 documentation updates 2007-10-15 06:45:51 +00:00
Matthias Tarasiewicz 5e095d59cb finally removed pdf and latex export which caused the export button to fail with mongrel. PDF export will be added later on without pdflatex. 2007-10-14 14:11:37 +00:00
Matthias Tarasiewicz 806a1fc682 added /tmp folder plus structure to make instiki work with mongrel_cluster 2007-10-09 15:13:22 +00:00
Jacques Distler 5cbdccec2a MIME-Types for WEBrick 2007-10-08 04:16:31 +00:00
Jacques Distler ab7f429a10 Security: Enforce POSTs
Spammers can bypass form_spam_protect plugin by using GET instead of POST.

Fix this, by ensuring that unsafe operations are POSTs, rather than GETs.
2007-10-07 17:59:20 +00:00
Matthias Tarasiewicz 4199843e08 changing back some 'require_dependency' to 'require' since it is not needed for all (info from jacques distler) 2007-09-28 08:40:24 +00:00
Jacques Distler 10b0561aca Category lists and WikiReferences restrict to current Web.
Fix one sanitization test.
2007-09-28 03:57:52 +00:00
Matthias Tarasiewicz 2cd2b2746e change of 'require_dependencies' to 'require' which should fix the 'superclass mismatch error' that occurred. 2007-09-27 06:09:58 +00:00
Jacques Distler a3d3f1c536 Fix XSS vulnerabilities in chunk-handling 2007-09-23 19:30:39 +00:00
Matt MacGillivray 36b86a9d41 Removed deprecation errors for rails 1.2.3. Corrected test case failures as a result of updated features and functionality 2007-05-07 22:46:00 +00:00
Matthias Tarasiewicz 322a09274f in response to #406 - commented out parts in the css that would render the admin part ununsable. still needs research. 2007-04-08 20:12:23 +00:00
Matthias Tarasiewicz 40a71e80d9 fixes #439 by patch from alex eagle 2007-04-08 19:37:47 +00:00
Matthias Tarasiewicz ca9e155c17 reverted redcloth to 3.0.3 (fixes formatting bugs)
upgraded integrated rails to 1.2.3
2007-03-18 10:20:35 +00:00
Michal Wlodkowski 8fb8517156 css updates 2007-02-27 21:56:13 +00:00
Jacques Distler 552cf4cff0 XSS Security fixes 2007-02-25 15:13:50 +00:00
Matthias Tarasiewicz c9a9b7d315 adding the form_spam_protection plugin that was missing from the last commit 2007-02-13 13:27:54 +00:00
Matthias Tarasiewicz 113223f364 - AntiSPAM: included form-spam-protection rails plugin (Hivelogic Enkoder)
- update: updated scripts and javascripts to rails 1.2.1
2007-02-13 13:24:03 +00:00
Matthias Tarasiewicz ad22579668 cookie fix: being logged in on more Webs at once works now [Jaques Distler] 2007-02-10 09:47:36 +00:00
Matthias Tarasiewicz 49032a99c6 svn:external rails updated to 1.2.2
fixed ticket #372 typo in db-query
sqlite3-ruby updated to 1.2.1
2007-02-08 22:01:36 +00:00
Matthias Tarasiewicz 7378ce9610 reverted to rails 1.1.6 since there were problems reported 2007-01-18 19:31:07 +00:00
Matthias Tarasiewicz 1877f66f17 big update to the web_list - statistics: last update, last document, created or revised; plus css updates to make small fonts look better in firefox 2007-01-18 17:57:16 +00:00
Matthias Tarasiewicz 2e558d5222 fixed the correct display of authors per web. added singular/plural for authors and pages. css optimizations 2007-01-18 13:33:52 +00:00
Matthias Tarasiewicz 4eefc3c979 updated to rails 1.2 stable 2007-01-18 08:42:39 +00:00
Matthias Tarasiewicz 95d794cfcb fixes Ticket #259 html_options minor fix 2007-01-17 21:28:20 +00:00
Matthias Tarasiewicz 85a568fe79 added back jcode 2007-01-17 21:00:17 +00:00
Matthias Tarasiewicz 4f312bc336 removed jcode unicode reference, since this is included in rails 1.2 2007-01-17 20:53:46 +00:00
Matthias Tarasiewicz 692a1beffe updated rubyzip from 0.5.8 to 0.9.1 and moved plugin into the right folder 2007-01-17 12:47:46 +00:00
Matthias Tarasiewicz 78ebbed446 updating environment.rb to reflect sqlite3-ruby move 2007-01-17 12:26:46 +00:00
Matthias Tarasiewicz 80028814a6 moved sqlite3-ruby in the right directory (preparing for proper rails 1.2 directory structure) 2007-01-17 12:25:48 +00:00
Matthias Tarasiewicz 1596d84333 updated recloth to 3.0.4 2007-01-17 12:08:16 +00:00
Matthias Tarasiewicz 69945c9d9d updated svn:external rails to 1.2rc1 to implement changes like unicode and other rails 1.2 features 2007-01-17 11:37:02 +00:00
Matthias Tarasiewicz c39ca54b8c config_load path for dnsbl_check 2007-01-16 07:28:48 +00:00
Matthias Tarasiewicz 1005d92bd1 web list does not show a link to a published version if it has none [Jesse Newland]
visual display if webs are pass-protected (div background)
2007-01-16 07:23:53 +00:00
Matthias Tarasiewicz 8bfe83fa20 fix PDF output not to contain garbage chars [Jesse Newland] 2007-01-16 07:21:16 +00:00
Matthias Tarasiewicz bdf5ab51ef ANTISPAM: included dnsbl_check - DNS Blackhole Lists check [thanks to joost from http://www.spacebabies.nl ] 2007-01-16 07:16:56 +00:00
Matthias Tarasiewicz d7508a34ab updated packaged sqlite3-ruby to 1.2.0 2007-01-16 07:13:14 +00:00
Matthias Tarasiewicz 4481c8bdf6 ANTISPAM: added spam_patterns from the main instiki site wikispam 2007-01-16 07:07:31 +00:00
Matthias Tarasiewicz 9aaf45a810 added support for delete_web 2007-01-16 07:05:04 +00:00
Matthias Tarasiewicz 26024acddc added Rails 1.2 compatibility information, after checking 2007-01-14 06:11:14 +00:00
Alexey Verkhovsky 8323b12795 get_page_and_revision handles the case of no rev parameter explicitly, rather than by chance 2006-09-19 19:13:02 +00:00
Alexey Verkhovsky 453968a08b made gray a lighter shade 2006-09-14 16:49:15 +00:00
Alexey Verkhovsky 84a8f66505 documented the last change 2006-09-07 04:10:01 +00:00
Alexey Verkhovsky 4b29a843e5 Fixes #248 2006-09-07 04:07:51 +00:00
Alexey Verkhovsky 839dc364dd fixes #280 2006-09-07 03:11:53 +00:00
Alexey Verkhovsky 8f48a19827 documented the last change 2006-09-07 03:04:34 +00:00
Alexey Verkhovsky 1454fbf14a expire page cache for diff 2006-09-07 02:56:55 +00:00
Alexey Verkhovsky 5f7e569737 Replaced auto-generated shebangs in public/dispatch.* with something more meaningful 2006-05-04 06:19:15 +00:00
Alexey Verkhovsky 02658b6d51 Fixed migration for compatibility with Postgres 2006-05-04 06:18:33 +00:00
Alexey Verkhovsky 9c52933cbe Reverting a strange change to favicon.ico, step 2 2006-05-04 05:55:20 +00:00
Alexey Verkhovsky 7ebd2d5437 Reverting a strange change to favicon.ico 2006-05-04 05:53:57 +00:00
Alexey Verkhovsky dfdc718425 Enable fragment caching in ./cache 2006-05-04 05:38:18 +00:00
Alexey Verkhovsky 709d28dc4b /wiki/published renders a home page 2006-05-04 04:45:05 +00:00
Alexey Verkhovsky cbca2ba318 Fixed a silly bug 2006-05-04 04:31:55 +00:00
Alexey Verkhovsky 98b2efdb5b Blow away page caches when web settings are changed 2006-04-02 06:17:05 +00:00
Alexey Verkhovsky 56dc390ddb Improved cache sweeping for All Pages and Recently Revised (categories stuff again) 2006-04-02 05:47:41 +00:00
Alexey Verkhovsky 2a91464aa8 Tweaked routes.rb for categories; this may _really_ fix them :) 2006-04-02 05:11:17 +00:00
Alexey Verkhovsky ecb0d32140 Upgrade to Rails 1.1 (fixes categories in All Pages and Recently Revised) 2006-04-02 05:03:11 +00:00
Alexey Verkhovsky 22d257a8b2 Specified SVN properties for script/reset_references 2006-04-02 05:01:45 +00:00
Alexey Verkhovsky 4902986b2c reset_references is an executable 2006-04-02 04:55:58 +00:00
Alexey Verkhovsky d3971a5951 Linux packaging 2006-04-02 04:38:31 +00:00
Alexey Verkhovsky f5d9dee00d anothr CSS tweak (size of the currently selected item in the navigation menu) 2006-04-02 03:40:31 +00:00
Alexey Verkhovsky dd6572ac85 CSS tweaks around page editing 2006-04-02 03:32:39 +00:00
Alexey Verkhovsky db20c05283 insignificant CSS validity fixes 2006-04-02 02:38:25 +00:00
Alexey Verkhovsky bde924f597 Ignore stuff created in ./public directory by tests etc 2006-04-02 01:49:03 +00:00
Alexey Verkhovsky 5f3cf38851 Fixed connect_to_model filter extension in wiki_controller (using inheritance here was daft); accelerated tests somewhat 2006-03-24 07:53:20 +00:00
Alexey Verkhovsky 64313ca208 Fixing FileController#import; sort of works, but fails on some interesting tests 2006-03-23 07:14:51 +00:00
Alexey Verkhovsky cb869abf0d accept--charset attribute added to all forms 2006-03-23 04:51:13 +00:00
Alexey Verkhovsky 73dfa6b813 Corrected installation instruction 2006-03-23 04:25:56 +00:00
Alexey Verkhovsky d051b174f8 Quick amd dirty spam filtering. We'll build something better in due time. 2006-03-20 01:36:45 +00:00
Alexey Verkhovsky faf0c51218 Wrong defition of a default font size 2006-03-20 01:09:05 +00:00
Alexey Verkhovsky d6fedc7f84 Converting linefeeds to Unix-style 2006-03-19 21:49:53 +00:00
Alexey Verkhovsky da24698a4c Deleting create_db script, as it is obsolete 2006-03-19 20:08:50 +00:00
Alexey Verkhovsky 6f0434bf83 All tests pass, including Watir suite 2006-03-19 07:54:54 +00:00
Alexey Verkhovsky b49bc6a31d Replacing some require statements with require_dependency 2006-03-12 04:57:24 +00:00
Alexey Verkhovsky ad4c289ec5 Added disposition to HTTP headers for sending files 2006-03-12 04:53:39 +00:00
Alexey Verkhovsky 13cb4a1356 Ignoring some files 2006-03-11 23:55:10 +00:00
Alexey Verkhovsky b1d01b274e Boolean values are imported as 0/1 to MySQL 2006-03-11 23:52:31 +00:00
Alexey Verkhovsky 04b75e1684 2006-03-11 23:25:04 +00:00
Alexey Verkhovsky cd5aec2aab Added some database.yml to Subversion trunk 2006-03-11 23:10:47 +00:00
Alexey Verkhovsky e44d16aef9 Fixed rendering of Recently Revised 2006-03-11 22:59:55 +00:00
Alexey Verkhovsky f8b3e2b11d See Changes as a separate page (still implemented within show and revision actions) 2006-03-11 22:10:32 +00:00
Alexey Verkhovsky c435bf2f2b [FIXES BVILD] Further improvement to diff.rb (I hope not to touch this beast again any time soon); See Changes ripped out from WikiController#show, will become a separate action 2006-03-11 21:27:49 +00:00
Alexey Verkhovsky 0aa87bf348 Smaller relative size of the default font 2006-01-23 07:02:03 +00:00
Alexey Verkhovsky 6c55533500 Handle migrations from Instiki installs with RedCloth version 3.0.3 2006-01-23 07:01:04 +00:00
Alexey Verkhovsky 01c9636ffd More goodness to lib/diff.rb! 2006-01-23 06:57:19 +00:00
Alexey Verkhovsky 3285737917 Fixed an NPE in ApplicationController#authorized? 2006-01-23 06:56:30 +00:00
Alexey Verkhovsky ba9232bbde Admin settings are correctly displayed on edit_web form (closes #256) 2006-01-22 23:27:57 +00:00
Alexey Verkhovsky 3ea1ef881f Refactoring and deleting unused code from lib/diffr.rb until I can understand what it says. Also fixes #256. The build is still broken. 2006-01-22 21:40:20 +00:00
Alexey Verkhovsky 60c07ca1a2 wiki_references fixture (fixed #275) 2005-12-30 08:49:15 +00:00
Alexey Verkhovsky 9b87b1f85f Fixed a broken func. test for FileController 2005-12-30 08:42:06 +00:00
Alexey Verkhovsky df8cc90658 Documented the installation and upgrade from beta1 using migrations 2005-12-30 08:14:44 +00:00
Alexey Verkhovsky b78b693299 Upgrade to Rails 1.0 (doesnt work yet) 2005-12-30 07:25:49 +00:00
Alexey Verkhovsky 9cf5315d8b Switch from schema.rb to migrations 2005-12-30 07:24:51 +00:00
Alexey Verkhovsky 7de64bdecf diff.rb ignores insides of <pre> and <code> blocks - this is better than mangling them 2005-11-19 14:46:27 +00:00
Alexey Verkhovsky 90fc099a78 Changes in RHTML templates to go wioth the earlier commit 2005-11-14 14:02:36 +00:00
Alexey Verkhovsky 434371dd2a Reworked stylesheet to use relative sizes wherever possible 2005-11-14 13:57:17 +00:00
Alexey Verkhovsky a2cb920489 Fixed All Pages with a category 2005-11-14 11:07:14 +00:00
Alexey Verkhovsky 614a48c6ff Exclude links to files and pages from All Pages (so that they don't show up in Wanted Pages etc). 2005-11-14 11:00:46 +00:00
Alexey Verkhovsky 42098e0a9f Documented the last commit 2005-11-14 10:17:27 +00:00
Alexey Verkhovsky 8f33b8e549 HTML diff from I2 - works better than the original 2005-11-14 10:13:18 +00:00
Alexey Verkhovsky 0b1a80a852 [BUILD STILL BROKEN] File uploads roughly speaking work (to about same extent as in 0.10) 2005-11-14 08:38:37 +00:00
Alexey Verkhovsky ac72f9b807 Small correction to the last commit 2005-11-13 17:48:54 +00:00
Alexey Verkhovsky 1f07ec78de Put cursor in the text area when opening wiki/edit 2005-11-13 17:48:21 +00:00
Alexey Verkhovsky 07b7d9210a Added a button to the login view (apparently needed by people on obscure PDA browsers) 2005-11-13 17:38:43 +00:00
Alexey Verkhovsky 3f46b5f008 Documented DB schema changes in README 2005-11-13 13:39:28 +00:00
Alexey Verkhovsky 8bdee631f6 [BREAKS BUILD] Some work on File uploads, half-done, committing as a backup 2005-11-13 13:37:47 +00:00
Alexey Verkhovsky a61c11854d Always check that the rendering output is well-formed 2005-11-13 09:27:55 +00:00
Alexey Verkhovsky 2f43e4a603 Added indexes; documented migration from Beta 1 2005-11-13 06:47:43 +00:00
Alexey Verkhovsky 78ddfc0642 Upgrading to Rails 0.14.3 2005-11-13 06:05:54 +00:00
Alexey Verkhovsky 7fc212c9a6 Included sqlite3 DB and driver; No Step 3 installation for Win32 2005-11-13 05:24:17 +00:00
Alexey Verkhovsky c192481732 Deleting the gemspec 2005-11-13 04:26:58 +00:00
Alexey Verkhovsky b876bcc299 [ANOTHER DRASTIC!] Moving branches/instiki-ar to trunk 2005-11-06 08:28:02 +00:00
Alexey Verkhovsky c7295287a4 Extract the inbound links list from page.rhtml and revision.rhtml into a partial 2005-11-04 06:19:10 +00:00
Alexey Verkhovsky 4779a4fa4e Diocumented installation and data migration in README 2005-11-04 05:57:31 +00:00
Alexey Verkhovsky 0c412e4a26 CHANGELOG update. Previous commit also included: reenabled FileController, refactoring of authorization code and some other tweaks 2005-11-04 05:26:32 +00:00
Alexey Verkhovsky dea8d70c48 Improved behavior of JavaScript in the author field [from I2 patch by court3nay] 2005-11-04 05:23:34 +00:00
Alexey Verkhovsky 35b77f6440 A bit of spit and polish 2005-11-02 09:04:53 +00:00
Alexey Verkhovsky 7f8d3adfb5 Copied over 0.14.2 ./public contents 2005-11-02 07:34:11 +00:00
Alexey Verkhovsky 26a5338764 FIX BUILD 2005-11-02 05:59:49 +00:00
Alexey Verkhovsky c6ea47d6de Dropping .erbsql files (we now have schema.rb instead) 2005-11-02 05:36:11 +00:00
Alexey Verkhovsky 0b05368359 [BREAKS BUILD] Database schema, Rakefile and contents of config directory are brought inline with 0.14.2 defaults 2005-11-02 05:34:07 +00:00
Alexey Verkhovsky 3703c1e1b3 Upgrade to Rails 0.14.2; fixed a failing functional test 2005-11-02 04:55:06 +00:00
Alexey Verkhovsky e1d7b26be2 Clarified documentation in import_storage script 2005-11-01 14:44:06 +00:00
Alexey Verkhovsky d3b25c8a19 Added meta robots tag to the default layout; added error handling to published pages 2005-11-01 07:31:44 +00:00
Alexey Verkhovsky 9e7306fb0a Outdated TODO deleted 2005-10-28 14:14:31 +00:00
Alexey Verkhovsky af25237a90 Render HTML pages for ExportHTML 'manually' 2005-10-27 05:29:24 +00:00
Alexey Verkhovsky d28be2b0ef [Breaks build] Upgraded Rails to 0.14.1 2005-10-26 01:06:41 +00:00
Alexey Verkhovsky 44d09c45f8 Fixed file permissions mask in file_yard 2005-10-20 01:23:31 +00:00
Alexey Verkhovsky 50b2cbd693 Fix to #255 - Author cookie expiry 2005-10-20 01:18:15 +00:00
Alexey Verkhovsky 9ea6e6ae65 Downgrading RedCloth back to 3.0.3 (3.0.4 is said to be buggy) 2005-09-28 04:12:11 +00:00
Alexey Verkhovsky 61776995b6 Fixes for MySQL compatibility 2005-09-28 02:03:28 +00:00
Alexey Verkhovsky 223a1f9de3 Speeding up some stuff 2005-09-27 13:46:02 +00:00
Alexey Verkhovsky 5447b82ed9 A bit of caching in the page_renderer 2005-09-27 05:26:19 +00:00
Alexey Verkhovsky 9816c395c5 Expire caches for referencing pages on saves and deletes; fixed date formatting in recently_revised 2005-09-27 03:53:29 +00:00
Alexey Verkhovsky 5b1778a7f1 Fixed handling of Windows EOLs in the import_storage 2005-09-27 03:30:42 +00:00
Alexey Verkhovsky 16454549fe Fixed a nasty bug that caused Instiki to go into an endless loop on call to /wiki/print/ 2005-09-27 03:30:01 +00:00
Alexey Verkhovsky 1d44ce1c18 Upgraded RedCloth to 3.0.4 2005-09-16 04:27:07 +00:00
Alexey Verkhovsky 79cf8a0ea1 Removing breakpoint from include.rb 2005-09-14 02:02:00 +00:00
Alexey Verkhovsky 4a8d6eefe0 Fixed chunk mask to handle negative object_id values [Venkat] 2005-09-14 02:01:20 +00:00
Alexey Verkhovsky 4c14f07100 Fixed caching of RSS feeds; changed from caches_page to caches_action to make authentication and other filters work 2005-09-12 01:12:00 +00:00
Alexey Verkhovsky cc99790a4a Caching and sweeping pages. RSS feeds behave funny 2005-09-11 18:02:56 +00:00
Alexey Verkhovsky c4f593151e [FIXES BUILD] Fixed categories behavior and added id generation in import_storage. Something is still wrong with orphaned pages though 2005-09-11 16:49:08 +00:00
Alexey Verkhovsky 303622341b Ignoring the cached stuff in public 2005-09-11 14:04:52 +00:00
Alexey Verkhovsky 32d238098e Taking care of svn adds and svn deletes for the last 24 hours or so. Boo on me! 2005-09-11 14:03:08 +00:00
Alexey Verkhovsky ac819d4d68 BREAKS BUILD: all pages etc are much faster, but categories functionality is broken (it was responsible for calling the renderer once per every page on All Pages) 2005-09-11 09:34:41 +00:00
Alexey Verkhovsky 541a5d3994 Deleted all references to PageRenderer from PageSet selectors; using wiki_references instead 2005-09-11 08:05:19 +00:00
Alexey Verkhovsky bec3c98227 Moved the last unit test where it belongs 2005-09-11 06:28:59 +00:00
Alexey Verkhovsky 6ff74f6b5a Update wiki_references to a newly created page from 'W' to 'L' 2005-09-11 06:15:59 +00:00
Alexey Verkhovsky 0c6626c375 Corrected WikiReference::link_type when a newly created page refers to itself (should be 'L', not 'W') 2005-09-11 05:59:21 +00:00
Alexey Verkhovsky cd68db01d2 Store wiki references found during rendering 2005-09-11 05:44:34 +00:00
Alexey Verkhovsky bfecd09b56 Fixed includes; started wrking onn caching strategy 2005-09-11 04:23:50 +00:00
Alexey Verkhovsky 70fa15e3f3 Continue extracting URL generation logic from model classes 2005-09-10 11:07:40 +00:00
Alexey Verkhovsky 7e500dfe57 Controllers create renderer objects and pass them on to page.revise and page.rollback methods 2005-09-10 06:12:57 +00:00
Alexey Verkhovsky 4838f6e684 Deleted the last of the rendering logic from Revision (making it a totally anemic entity, by the way) 2005-09-09 20:40:35 +00:00
Alexey Verkhovsky 427f989d69 Extacted rendering logic from the model 2005-09-09 05:31:27 +00:00
Alexey Verkhovsky acfae2818c Rmoved a redundant require 2005-09-09 03:32:54 +00:00
Alexey Verkhovsky fa0cf9032f Extracted link generation from Web into a separate class 2005-09-09 03:31:49 +00:00
Alexey Verkhovsky 829d54a368 Fixed functional tests 2005-09-09 03:23:33 +00:00
Alexey Verkhovsky 49fccc41c1 Cleaned up unit tests and began refactoring link generation 2005-08-25 07:41:25 +00:00
Ben Bleything 7aaa35ae4a Ye olde converter script.
* Script now parses the madeleine storage into SQL
  * Added a new option, -o/--outfile to specify where the output from
    the script should go
  * ./import_storage -t /home/joe/instiki/storage/2500 \
      -i /home/joe/instiki -o /home/joe/export.sql

Exporting the instiki.org snapshot I have takes about 40 seconds (with
output to screen) and generates an approximately 17 meg SQL script from
the ~900k Madeleine snapshot.  Oh well.

Tested with MySQL.
2005-08-22 16:57:01 +00:00
Ben Bleything 0238780355 Set a couple of props on script/import_storage to prepare for the next
checkin...
2005-08-22 16:50:38 +00:00
Alexey Verkhovsky e5b7037259 Small correction to the last commit 2005-08-18 03:35:25 +00:00
Alexey Verkhovsky 84d4e71d3e Patch for Watir test from Bret Pettichord 2005-08-18 03:34:13 +00:00
Alexey Verkhovsky 64dae975ae Patch for Watir test from Bret Pettichord 2005-08-18 03:22:18 +00:00
Alexey Verkhovsky cd1d5135a0 script/import_storage, half-way done. The idea is to have it output a series of INSERT statements that the user can review and execute in a database of user's choice. The part that I have done loads the Madeleine storage and iterates through webs/pages/revisions there 2005-08-16 06:47:52 +00:00
Ben Bleything b29c59e470 Line ending cleanup. Most of these are svn propsets which should make
the files check out appropriately in the future.  The three files in
app/models had inconsitent line endings, so they had to be fixed by
hand.
2005-08-15 19:17:32 +00:00
Alexey Verkhovsky 47946e1c57 Committing OS X build files from Oleg 2005-08-15 00:40:34 +00:00
Alexey Verkhovsky 4849ca62fb Fix for ticket:189 2005-08-15 00:37:16 +00:00
Alexey Verkhovsky 32bd6e47b7 Fix for ticket:189 2005-08-15 00:35:14 +00:00
Alexey Verkhovsky 7493bc8af9 Fixed exports and other file downloads 2005-08-15 00:24:15 +00:00
Alexey Verkhovsky 61eacae836 Fix for exports and other file downloads 2005-08-15 00:07:43 +00:00
Alexey Verkhovsky 06959ab278 Moved pretty date formatting from revision to the main view helper, where this presentation logic obviously belongs 2005-08-14 23:35:10 +00:00
Alexey Verkhovsky 5b075ca338 Renamed revised_on to revised_at everywhere (for consistency) 2005-08-14 23:27:55 +00:00
Alexey Verkhovsky c381287714 Fixed revision numbers in page.rhtml. All Watir tests now pass. 2005-08-14 23:22:31 +00:00
Alexey Verkhovsky d24cf7c8e1 Fixed continuous revision check 2005-08-14 23:09:10 +00:00
Alexey Verkhovsky 052754b068 Dropped number from revision table. Also dropped timestamp. We will rely on autoincremented ID for sorting, and will for now store the time of last edit of the revision in revised_at. Later we will refactor content into a separate table (so as not to load the whole 300 kb of text and cached HTML every time we need page.revisions in code). Rake tests all pass, but watir tests indicate that some revision traversing links are still broken 2005-08-14 22:26:54 +00:00
Alexey Verkhovsky 476d7810f6 Added Revision.timestamp attribute, which is a timestamp to the precision of msec. Intention is to get rid of the revision.number and use this one for sotrting etc. The problem with created_at / updated_at in this role is that trhey have precision of seconds, which is not good enough for some of the purposes. 2005-08-14 18:58:36 +00:00
Alexey Verkhovsky b4ae0b3065 Moving back some model classes to where they belong. Model classes need not map to database entities to be model classes 2005-08-14 04:42:19 +00:00
Alexey Verkhovsky 4f7e5bca30 Changes in Watir test to accomodate the AR backend 2005-08-14 04:06:31 +00:00
Ben Bleything f07d0e32c6 Fix shebangs. Consistentlicious! 2005-08-11 05:46:38 +00:00
Ben Bleything 50343b79e8 Finish Rails-ifying the tree. Adds missing files and directories and
brings a few miscellaneous files up to date.
2005-08-11 05:36:35 +00:00
Alexey Verkhovsky 0f35016069 Also check if the specified page is there, and return 404 if not 2005-08-11 05:36:11 +00:00
Alexey Verkhovsky fe868135c4 Check existance of a revision and respond with 404 if it doesn't exist. 2005-08-11 05:30:20 +00:00
Alexey Verkhovsky 503aa99c63 Set default port to 2500 2005-08-10 06:16:15 +00:00
Rick Okin a91bd946b3 Added db/*.db to svn:ignore 2005-08-10 05:59:42 +00:00
Rick Okin fa82bfdb9c Without Madeleine, chunks can again use their object_id as a unique identifier, instead of an artificial one. This speeds up rendering somewhat, and eliminates the last mention of Madeleine from the codebase :) 2005-08-10 05:58:18 +00:00
Rick Okin 2c7a2779c7 Deleting Madeleine... with pleasure (it is cool, but not for wiki data) 2005-08-10 05:28:05 +00:00
Ben Bleything b94559bc4c remove development_structure.sql and ignore it in the future. We're
going to be hurting if we're developing on multiple db engines and keep
this file around.
2005-08-09 04:40:55 +00:00
Rick Okin fffe1b897e added log directory, set default database.yml 2005-08-09 03:52:54 +00:00
Ben Bleything 17833e23a5 Add executable bit to script/console and script/create_db 2005-08-09 03:45:09 +00:00
Rick Okin 08a66badb9 Removed debugging code from the last commit 2005-08-09 02:29:51 +00:00
Rick Okin 634bc67342 More lenient parsing of blocked_ips.txt and spam_patterns.txt 2005-08-09 02:28:37 +00:00
Rick Okin 6832b2edf9 removed old models' 2005-08-09 02:20:50 +00:00
Rick Okin 26c046cdfa move to AR 2005-08-09 02:20:28 +00:00
Rick Okin c4b7b2d9f2 added chunks 2005-08-09 02:07:39 +00:00
Rick Okin 7ab0f052f3 Primitive spam filter 2005-08-09 01:58:16 +00:00
Rick Okin 8c331d1019 moved old test stuff 2005-08-09 01:28:19 +00:00
Rick Okin 64b9a5c747 fixing bad filename 2005-08-09 01:24:44 +00:00
Rick Okin 2eb01cd575 moved some tests over 2005-08-09 01:23:11 +00:00
Rick Okin e4ecb406bf renamed model directory 2005-08-09 01:18:00 +00:00
Rick Okin 6fb0102a5a Just checking authentication 2005-08-08 04:32:03 +00:00
Alexey Verkhovsky 125cc37135 Added non-nullable fields to fixtures 2005-08-02 08:59:57 +00:00
Alexey Verkhovsky 1b8baa3d03 Some infrastructure for AR and accompanying unit tests 2005-08-02 08:56:09 +00:00
Alexey Verkhovsky 6d8190c096 Moved old tests and app/model out of the way 2005-08-02 07:59:22 +00:00
Alexey Verkhovsky 21adee88d4 Initial database definitions 2005-08-02 07:58:22 +00:00
Alexey Verkhovsky 9f36bd59a9 Fxed handling of a page that tries to include itself 2005-08-02 03:23:05 +00:00
Alexey Verkhovsky 66ab8df6f4 Yet another extremely convoluted story about markup parsing... markup engines can replicate content within <pre> tags, and it was failing in an interesting way then 2005-08-02 01:03:43 +00:00
Alexey Verkhovsky b6cede774d Clearing all caches retrieved from storage on startup 2005-08-02 01:00:07 +00:00
Alexey Verkhovsky 6a9cc87536 Markup engines are not a kind of chunk 2005-08-02 00:59:12 +00:00
Alexey Verkhovsky 0d1c92a988 Documented the previous change 2005-08-01 05:08:29 +00:00
Alexey Verkhovsky 6578bed720 Starting snapshot thread on first HTTP request (otherwise, --daemon option fails); ticket:48, ticket:198 2005-08-01 05:02:52 +00:00
Alexey Verkhovsky fdba99cb93 Branching out instiki-ar (for building an ActiveRecord backend) 2005-08-01 03:20:36 +00:00
Alexey Verkhovsky adc6b005d5 Just checking my SVN access 2005-07-31 00:27:31 +00:00
Alexey Verkhovsky 64b1283bdd The right Rails version in gemspec 2005-07-30 07:05:49 +00:00
Alexey Verkhovsky 021f37f16c Typo correction 2005-07-30 06:51:03 +00:00
Alexey Verkhovsky b89b0fbd36 Preparing a 0.10.2 release 2005-07-30 06:49:21 +00:00
Alexey Verkhovsky 207737aa22 Fixed a subtle incompatibility with older storages. Madeleine must die 2005-07-30 06:39:34 +00:00
Alexey Verkhovsky 659f4a4cc5 Correction of an earlier commit 2005-07-21 01:16:06 +00:00
Alexey Verkhovsky 55c1254627 Added routes such that URLs as /show/HomePage are directed to DEFAULT_WEB/show/HomePage, if DEFAULT_WEB is defined. This would greatly simplify Proxy configuration for sites like instiki.org 2005-07-20 03:21:20 +00:00
Alexey Verkhovsky 9d667c8ba5 Corrected a few failing functional tests (side effect of the prrevious commit) 2005-07-20 01:50:49 +00:00
Alexey Verkhovsky b22d4fb530 Upgraded Rails to version 0.13.1 2005-07-20 01:36:58 +00:00
Alexey Verkhovsky cf3cebb589 Replaced links to static resources with appropriate Rails helpers 2005-07-19 22:27:45 +00:00
Alexey Verkhovsky e5f34fd1db Adde a real href to Textile syntax hyperlink 2005-06-09 20:27:59 +00:00
Alexey Verkhovsky 1ac54a0685 Documented the last change 2005-06-09 20:25:35 +00:00
Alexey Verkhovsky 79eb882a31 Avoid autolinking Markdown URIs (ticket:177) 2005-06-09 20:24:14 +00:00
Alexey Verkhovsky ebe0af1dfc Better handling of permissions for re-uploading a file that already exists (ticket:163) 2005-06-09 20:05:16 +00:00
Alexey Verkhovsky 04a8f80273 Further tweaking of markup error handling code 2005-05-29 18:40:25 +00:00
Alexey Verkhovsky 2786446dbb Fixed a bad require in Watir test 2005-05-29 18:39:56 +00:00
Alexey Verkhovsky dfbb5ff1e9 Added usage documentation to script/debug_storage 2005-05-29 17:08:15 +00:00
Alexey Verkhovsky 9f5ee2bc61 Script that helps to poke around in the Instiki storage 2005-05-29 16:47:08 +00:00
Alexey Verkhovsky d275777d23 Watir tests for RSS feeds 2005-05-29 16:46:37 +00:00
Alexey Verkhovsky a1527f60b0 Added explicit sorting of authors and pages in Authors page 2005-05-29 14:18:05 +00:00
Alexey Verkhovsky c00d1ca0f1 Watir test for Authors 2005-05-29 14:12:46 +00:00
Alexey Verkhovsky a01f1aa008 Test for Recently Revised 2005-05-29 00:13:09 +00:00
Alexey Verkhovsky 62f5be7b35 Added assertion about wanted pages to All pages test, im proved handling of page names that need escaping by Watir test 2005-05-29 00:02:54 +00:00
Alexey Verkhovsky 5ef861f779 Removed a duplicate definition of the same test case; added an assertion to All Pages test 2005-05-28 23:43:28 +00:00
Alexey Verkhovsky 895dd41263 Watir tests for Hide Changes and for All Pages 2005-05-28 23:37:51 +00:00
Alexey Verkhovsky af50549e3e Don't include changes div, if there is only one revision 2005-05-28 23:37:23 +00:00
Alexey Verkhovsky 3107341af5 Corrected how orphan page names are rendered in All Pages list 2005-05-28 23:13:01 +00:00
Alexey Verkhovsky bc6f2c9bbc Watir test for View Changes 2005-05-28 22:54:09 +00:00
Alexey Verkhovsky a9bf736cbd Watir test for the rollback 2005-05-18 03:11:33 +00:00
Alexey Verkhovsky 7247e5ac99 Gave names to bottom menu hyperlinks (testability) 2005-05-18 02:07:48 +00:00
Alexey Verkhovsky 95097ace5c Watir test for page editing and revisions behavior 2005-05-18 01:53:59 +00:00
Alexey Verkhovsky 79cea66e36 Consistency tweak of the bottom menu in revision.rhtml 2005-05-18 01:47:07 +00:00
Alexey Verkhovsky 4c181089bb Gave names to bottom menu hyperlinks (testability) 2005-05-18 01:10:49 +00:00
Alexey Verkhovsky f92c000b1c Some more assertions in the Watir test 2005-05-18 00:39:26 +00:00
Alexey Verkhovsky acda6f3ed1 Watir test for adding a new page 2005-05-17 22:27:26 +00:00
Alexey Verkhovsky 9abb4f575a Refactoring page creation code [dm1] 2005-05-12 01:07:24 +00:00
Alexey Verkhovsky f6a3b88693 Fix for multiple includes on the same page; ignoring leading/trailing whitespace in WikiLinks [both by dm1] 2005-05-12 00:56:57 +00:00
Alexey Verkhovsky 7c5958ae7b Corrected shorthand Rake tasks for unit testing 2005-05-12 00:34:37 +00:00
Alexey Verkhovsky 33ae92a332 Extracted Instiki start/stop code in the Watir test suite (hairy Win32 incantations) into a class of its own. 2005-05-10 13:22:29 +00:00
Alexey Verkhovsky 57e4c725e9 Some CSS tweaks from http://instiki.org/show/StylesheetTweaks 2005-05-10 03:02:46 +00:00
Alexey Verkhovsky 19368f24c1 Add a horizontal scrollbar to <pre> blocks that are too long to fit in the viewable window 2005-05-10 02:41:48 +00:00
Alexey Verkhovsky 0a47c34181 Removed an out of sync comment 2005-05-09 06:12:12 +00:00
Alexey Verkhovsky 705c35d078 Removed unneeded :recent task from rakefile.rb. Instiki unit tests are fast. 2005-05-09 06:09:21 +00:00
Alexey Verkhovsky c2b9b48536 redirect_to_last_remembered raises an error when it fails to redirect to home - instead of trying retrying endlessly 2005-05-09 05:53:47 +00:00
Alexey Verkhovsky 4053380fd4 Improved error handling in wiki/save (ticket:153) 2005-05-09 05:16:20 +00:00
Alexey Verkhovsky 7aac9e3690 Removing debug code accidentally committed in the last commit 2005-05-09 04:39:38 +00:00
Alexey Verkhovsky 7be6cbecba HTML-escaping of error and info messages 2005-05-09 04:31:02 +00:00
Alexey Verkhovsky 757e58b94f Corrected error handling by admin/remove_orphaned_pages 2005-05-09 03:52:43 +00:00
Alexey Verkhovsky b3e355f4bc Fixed error message display in admin/edit_web - Rails flash handling apparently has changed 2005-05-09 03:41:00 +00:00
Alexey Verkhovsky f1c5004543 Corrected switching on of the debug logging in test and dev environments 2005-05-09 02:53:50 +00:00
Alexey Verkhovsky b432bbd3ae Slightly improved start/stop code in Watir test 2005-05-06 03:18:14 +00:00
Alexey Verkhovsky 7f9211d36b Beginings of a Watir test suite 2005-05-06 02:40:52 +00:00
Alexey Verkhovsky a14430a285 Multiline <nowiki> tag 2005-05-06 01:02:30 +00:00
Alexey Verkhovsky f77cf37f8e Assertion against nil arguments in Page constructor - one guy sent me a storage, containing a page with nil name 2005-05-05 12:24:02 +00:00
Alexey Verkhovsky e48c348e7f Documented last changes 2005-05-05 12:23:06 +00:00
Alexey Verkhovsky 8755935bf6 Fixed wiki/export_html, ticket:147 2005-05-05 09:42:25 +00:00
Alexey Verkhovsky dd10e838c5 More hard-coded URI paths in form.action attributes 2005-05-05 06:26:47 +00:00
Alexey Verkhovsky 9b6c391062 Fixed a hard-coded link to :web/search, ticket:149 2005-05-05 06:13:33 +00:00
Alexey Verkhovsky 389242747e Small rearrangement in instiki.css 2005-05-05 06:12:29 +00:00
Alexey Verkhovsky 8827f61b70 Export with no layout option in the export_html 2005-05-03 02:13:42 +00:00
Alexey Verkhovsky d3fc0c40a2 Preparing to release 0.10.1 2005-05-02 02:25:16 +00:00
Alexey Verkhovsky c0e5673cc5 Fixed an incompatibility with old storages; ticket:133 2005-05-02 01:43:44 +00:00
Alexey Verkhovsky ee396a3237 Fixed HTML export to work with current Rails (the implementation uses some non-public Rails methods, and since some point Rails 'forgot' to use layout in there) 2005-05-02 00:51:37 +00:00
Alexey Verkhovsky e20e529960 Corrected a typo in a comment 2005-05-01 03:24:06 +00:00
Alexey Verkhovsky bd224623e8 Upgraded Rails version to 0.12.0 2005-05-01 03:16:31 +00:00
Alexey Verkhovsky 598e4f272d Mixed mode that doesn't break on images 2005-05-01 02:47:57 +00:00
Alexey Verkhovsky bb1425c6f7 Fixed a silly error in pubDate generation (RSS feed) 2005-04-28 23:52:44 +00:00
Alexey Verkhovsky e6624b92d3 Removed a duplicate test 2005-04-28 23:43:52 +00:00
Alexey Verkhovsky 24f418e5b5 Renamed redirect_show to redirect_to_page and redirect_home 2005-04-28 23:07:42 +00:00
Alexey Verkhovsky 396c651487 XHTML validity fixes from ticket:138 [JosephSHuang] 2005-04-28 05:35:58 +00:00
Alexey Verkhovsky eae0312932 Escaping page title in RSS feeds (ticket:143) 2005-04-28 05:10:58 +00:00
Alexey Verkhovsky 69c839e70a Correct DOCTYPE tag for transitional XHTML (ticket:129) 2005-04-19 04:17:17 +00:00
Alexey Verkhovsky 25a9cdea18 pubDate in RSS feeds is displayed in GT timezone (to work around a problem with showing a timezone in non-English OSes, ticket:92 2005-04-14 00:14:16 +00:00
Alexey Verkhovsky 5c97cc593e [RESTORES BUILD] RedCloth does not support hard breaks in mixed mode 2005-04-10 17:57:24 +00:00
Alexey Verkhovsky a251b658f1 [BUILD BROKEN] BlueCloth the original distribution has some bugs. Digged out a patched-up version from Instiki 0.9 2005-04-10 17:48:50 +00:00
Alexey Verkhovsky 6f36e53290 BlueCloth is back with vengeance 2005-04-10 17:10:11 +00:00
Alexey Verkhovsky f776807dff Upgraded rubyzip to 0.5.8 2005-04-10 16:55:44 +00:00
Alexey Verkhovsky ee876a2907 Added some Textile rules to markdown option, in an attempt to force RedCloth to _really_ render Markdown 2005-04-10 03:18:10 +00:00
Alexey Verkhovsky 363276e436 Uncommented one test, and updated the other (after the hard breaks requirement) 2005-04-10 03:11:37 +00:00
Alexey Verkhovsky 9d3a3b2b8c textarea in wiki/edit.rhtml is HTML-escaped 2005-04-09 03:49:55 +00:00
Alexey Verkhovsky afb14c1011 Some JavaScript was showing on edit_web (ticket:117) 2005-04-09 03:05:37 +00:00
Alexey Verkhovsky b9ec3ee4b2 Line breaks cause <br/> in Textile again 2005-04-09 02:49:55 +00:00
Alexey Verkhovsky ab60287bad Working stats task in Rakefile 2005-04-09 02:49:29 +00:00
Alexey Verkhovsky 7b47716106 Corrected a typo in CHANGELOG 2005-04-08 06:25:56 +00:00
Alexey Verkhovsky 37e1e6be0e Corrected position of markup help in new.rhtml (it really should be the same template as edit.rhtml) 2005-04-08 06:16:22 +00:00
Alexey Verkhovsky 7152a78476 Synchronized file names with their hyperlink paths in export files 2005-04-08 05:40:11 +00:00
Alexey Verkhovsky e3a48c2732 Corrected some export file names (to have a slash between directory and file name) 2005-04-08 05:29:20 +00:00
Alexey Verkhovsky 6213e851e0 Fixed link to remove_orphaned_pages 2005-04-08 05:21:08 +00:00
Alexey Verkhovsky 76d6ea57a8 Help template for mixed markup 2005-04-08 05:20:40 +00:00
Alexey Verkhovsky b3aefba07a Fixed rendering, added a Mixed option (Textile + Markdown), default is Textile-only 2005-04-08 05:02:48 +00:00
Alexey Verkhovsky 1c40b5e570 Fixed an incompatibility with 0.9 storages that showed up only when you would try to edit a web 2005-04-08 04:31:48 +00:00
Alexey Verkhovsky 029189d8e9 Updated packaging automation to 0.10 2005-04-07 06:11:22 +00:00
Alexey Verkhovsky 4f04ff39e9 Fixed a subtle bug in RedclothForTex 2005-04-07 05:15:46 +00:00
Alexey Verkhovsky 41b3468a57 Cleared another reload warning 2005-04-07 05:14:02 +00:00
Alexey Verkhovsky 64061a95f9 More pesky hrefs deleted 2005-04-07 03:36:12 +00:00
Alexey Verkhovsky a74b3f8934 Extracted categories menu to a helper, and got rid of hrefs 2005-04-07 03:24:02 +00:00
Alexey Verkhovsky 1df5f3f764 Autofocus in login form 2005-04-05 12:47:59 +00:00
Alexey Verkhovsky bac34a53a9 More accurate stubbing out of ActiveRecord 2005-04-05 01:08:31 +00:00
Alexey Verkhovsky 0ad1b746f0 Stubbed out another new ActiveRecord dependency 2005-04-04 06:48:42 +00:00
Alexey Verkhovsky e9c4948d0a Fixed links on wiki/export page 2005-04-03 07:52:01 +00:00
Alexey Verkhovsky 6f8b5b44d3 RSS feeds are now smart about password-protected webs 2005-04-03 07:31:11 +00:00
Alexey Verkhovsky bdb77c7108 Fixed the links on wiki/feeds page 2005-04-03 06:46:45 +00:00
Alexey Verkhovsky 449a7fb8f3 Fixed links to author pages on wiki/revised_pages 2005-04-03 06:34:15 +00:00
Alexey Verkhovsky 1038c2b373 ... and on wiki/published, too 2005-04-03 06:19:33 +00:00
Alexey Verkhovsky cad124dbb5 Running on Rails footer shows only on the wiki/page view 2005-04-03 06:15:53 +00:00
Alexey Verkhovsky 8aac533614 orphaned_pages considers self-linking pages as orphans 2005-04-03 06:11:37 +00:00
Alexey Verkhovsky b1e92e3719 Cache clearing in Revision did not include wiki_reference_cache, which caused new pages to be created as orphans 2005-04-03 05:15:56 +00:00
Alexey Verkhovsky c0605f0b78 Disabled file uploads in preparation to release 0.10 2005-04-03 04:22:46 +00:00
Alexey Verkhovsky c646121b32 Fixed some unit tests 2005-03-31 04:44:10 +00:00
Alexey Verkhovsky 0dabfca465 Use an internal sequence instead of object_id for an ID of a chunk [Denis Mertz] 2005-03-31 02:06:46 +00:00
Alexey Verkhovsky 4850e59d18 Fixed a really stupid bug in list.rhtml [Denis Mertz] 2005-03-29 06:25:42 +00:00
Alexey Verkhovsky 8b14617aea Removed explicit conversions of URL elements - routing does that, and it was therefore done twice - wrong 2005-03-29 06:10:01 +00:00
Alexey Verkhovsky 5e971e00b7 Reverting the last change 2005-03-29 06:08:18 +00:00
Alexey Verkhovsky 6367ef38c4 Small refactoring in web.rb (replaced three lines with one) 2005-03-29 06:00:07 +00:00
Alexey Verkhovsky dcfc6a48c4 Added a unit test for parsing of [[With:Colon]] 2005-03-29 05:19:32 +00:00
Alexey Verkhovsky c6ab8edd44 Corrected the default IP binding (0.0.0.0 instead of 127.0.0.1) 2005-03-29 03:51:52 +00:00
Alexey Verkhovsky 68683890e1 Improved rendering of hyperlinks in TeX and PDF [sfoy] 2005-03-27 18:32:26 +00:00
Alexey Verkhovsky 78bad46419 Refactoring of chunks and rendering [Denis Mertz] 2005-03-27 18:13:43 +00:00
Alexey Verkhovsky a87ef98aef Replaced web.name with web.address in navigation.rhtml links 2005-03-27 14:23:09 +00:00
Alexey Verkhovsky 096fc1c8af Fixed navigation.rhtml links [dm1] 2005-03-26 18:56:37 +00:00
Alexey Verkhovsky ae7ac63a9d Fixed web password protection (was broken by earlier refactoring), also adcded some user-friendlines to it 2005-03-26 15:43:59 +00:00
Alexey Verkhovsky c73db9ff5d Calls to show with unspecified page name cause HTTP 404, not HTTP 500 2005-03-26 05:37:04 +00:00
Alexey Verkhovsky 6cceead11c Added a code that is supposed to advertise RSS feeds for auto-discovery 2005-03-26 05:26:12 +00:00
Alexey Verkhovsky dfcc891795 Removed some code from admin/create_web, the purpose of which was incomprehensible 2005-03-26 00:19:31 +00:00
Alexey Verkhovsky 2969b38bd0 Fixed expected redirection path in a couple of tests 2005-03-26 00:15:04 +00:00
Alexey Verkhovsky b333e0797c More user-friendly error handling in admin/create_web 2005-03-26 00:09:41 +00:00
Alexey Verkhovsky d330c02186 Prohibit invalid URI characters in web names (JavaScript normally prevents from it, but it may be disabled) 2005-03-26 00:00:49 +00:00
Alexey Verkhovsky 759fbda8a0 Return HTTP404 to requests pointing to a non-existant web name 2005-03-25 23:40:03 +00:00
Alexey Verkhovsky 1bb4747a0f Fixed development environment 2005-03-25 22:55:59 +00:00
Alexey Verkhovsky f58d9a80d5 Updated GEM packaging about renaming libraries to lib 2005-03-25 19:32:28 +00:00
Alexey Verkhovsky dda7c8eec0 Requiring ApplicationController from server script 2005-03-25 19:23:26 +00:00
Alexey Verkhovsky 7c2ca61569 Some rewording in CHANGELOG 2005-03-25 19:22:38 +00:00
Alexey Verkhovsky 946080ddf9 Added prototype.js library (standardRails thing), though it's not used now 2005-03-25 19:22:10 +00:00
Alexey Verkhovsky f9b213cb82 Fixed Markdown tests to match RedCloth 3 rendering (which is slightly different from BlueCloth) 2005-03-25 19:20:43 +00:00
Alexey Verkhovsky 8de7ca3cee Bringing various things inline with the current state of Rails develolpment 2005-03-25 19:11:41 +00:00
Alexey Verkhovsky 0a63789e61 Removed a route for login witrhout a web name (login needs a web name to work) 2005-03-25 17:53:40 +00:00
Alexey Verkhovsky aab6c4e32a Corrected some bad inglish [Gavin Sinclair] 2005-03-24 01:18:41 +00:00
Alexey Verkhovsky 0a3dccbaab Removed some debugging code that accidentally made it to the SVN (ouch) 2005-03-24 00:31:41 +00:00
Alexey Verkhovsky 6ee7514fb3 FileYard checks the file size against max_upload_size attribute 2005-02-21 14:00:00 +00:00
Alexey Verkhovsky 217dbdafdc Added max_upload_size to the FileYard constructor 2005-02-21 13:36:53 +00:00
Alexey Verkhovsky 06e806fe30 Added some code to config/environment.rb to accomodate recent Rails changes 2005-02-21 13:34:27 +00:00
Alexey Verkhovsky b1b04e1af4 URL autolinking bypasses inlined HTML (or any other URL preceded by double or single quote) 2005-02-20 09:28:41 +00:00
Alexey Verkhovsky 3e7610c0cd Fixed URL definition for edit_web action 2005-02-20 07:49:10 +00:00
Alexey Verkhovsky d7198af00a HTMLDiff does not drop endlines anymore 2005-02-20 07:46:48 +00:00
Alexey Verkhovsky beeed3eee6 Corrected a copy/paste bug in tests, and corresponding problems in rollback.rhtml 2005-02-19 14:38:10 +00:00
Alexey Verkhovsky 1fa143f5d4 [RESTORES BUILD] Added assert_recognizes to test_helper.rb, pending commit of Rails patch 638 2005-02-19 13:58:27 +00:00
Alexey Verkhovsky f389d84453 Fixed a bug: URLs should contain web address, not name 2005-02-19 02:45:28 +00:00
Alexey Verkhovsky 414ed31a58 Converting hyperlinks to link_to calls (now that we have Routes, they work) 2005-02-18 23:19:42 +00:00
Alexey Verkhovsky a9304d35fb Simplified some code in wiki_content.rb 2005-02-18 14:21:17 +00:00
Alexey Verkhovsky aa95acb4f7 RSS feeds accept query parameter start, end and limit 2005-02-18 02:24:16 +00:00
Alexey Verkhovsky 5e25a94e51 [BREAK BUILD] Upgrade URL rewriting to Routes (there is one test case in routes_test.rb that fails, and it depends on some refactoring that I agreed upon with Ulysses) 2005-02-15 22:41:58 +00:00
Alexey Verkhovsky 9c04ed3461 Rehashed URL generation once again - templates should not use web.make_link anymore, there is link_for_page helper instead 2005-02-13 18:53:49 +00:00
Alexey Verkhovsky fd1d0ccc1e Better readability for URL generation methods in web.rb 2005-02-13 15:57:58 +00:00
Alexey Verkhovsky 112a21da5c Moved remove_orphaned_pages action to admin controller 2005-02-13 14:58:03 +00:00
Alexey Verkhovsky bb2d16c8a1 Upgraded RedCloth to 3.0.3 2005-02-10 23:11:47 +00:00
Alexey Verkhovsky 2aa1aa8fad Graceful handling of validation errors in edit_web, and a friendly confirmation in case of success 2005-02-10 22:05:30 +00:00
Alexey Verkhovsky 533ef6a1cd Fixed the JavaScript in edit_web.js 2005-02-10 21:55:13 +00:00
Alexey Verkhovsky 8ab380d6dd Deconflicting a name of an input for two forms on the same page 2005-02-10 21:41:31 +00:00
Alexey Verkhovsky 4e6d2cbdf6 Added validations to edit_web (it could overwrite parameters of an existing Wiki before) 2005-02-10 21:03:50 +00:00
Alexey Verkhovsky b888799798 Better URL parsing (URIChunk knows more country codes, and is smarter about avoiding messing with Textile markup) 2005-02-05 16:46:26 +00:00
Alexey Verkhovsky 21f7693c06 Fixed links to Wiki pages with slashes and other interesting characters in the name 2005-02-05 16:36:27 +00:00
Alexey Verkhovsky 5cb21ff619 Friendly confirmation message in remove_orphaned_pages 2005-02-05 14:06:50 +00:00
Alexey Verkhovsky 5334fe626a compulsive quote editing 2005-02-05 13:59:43 +00:00
Alexey Verkhovsky 7c28e46688 added JavaScript check for empty password to remove_orphaned_pages action 2005-02-05 13:53:29 +00:00
Alexey Verkhovsky bc97b8d4f7 enhanced password checking behavior in remove_orphaned_pages;
extracted password error to application
2005-02-05 13:34:12 +00:00
Alexey Verkhovsky 8b21b8286f extra tests for edit_web 2005-02-05 13:19:20 +00:00
Alexey Verkhovsky 09cfb5635c merged edit_web and update_web into one action 2005-02-05 13:04:55 +00:00
Alexey Verkhovsky 9cfa77dca2 same as before 2005-02-05 12:25:01 +00:00
Alexey Verkhovsky 20173b6457 compulsive quote editing 2005-02-05 12:15:50 +00:00
Alexey Verkhovsky ace569ae05 more regexp caching 2005-02-04 19:00:28 +00:00
Alexey Verkhovsky 9ea307b9d2 cleanup of chunks/engines [Denis] 2005-02-04 18:57:42 +00:00
Alexey Verkhovsky 2ca286971c Web remembers max_upload_size submitted to update_web action (still is not used though) 2005-01-30 06:18:57 +00:00
Alexey Verkhovsky 9a5a195c47 Added max_ulpoad_sze property to web (not used yet), and redesigned edit_web page a little. 2005-01-30 06:11:00 +00:00
Alexey Verkhovsky 5ea3f93bf9 author links on print page are smart about whether they are being exported or just displayed in the browser 2005-01-30 05:33:05 +00:00
Alexey Verkhovsky c99d675780 web attribute accessed directly, not through accessor. Reason: not to scratch head about "who is web?" 2005-01-30 05:22:19 +00:00
Alexey Verkhovsky d80d60243b Some more accesskeys [kjell] 2005-01-30 05:12:01 +00:00
Alexey Verkhovsky 85bc93984d Page will try to render itself in revise method, and behave appropriately if markup engine fails [inspired by Denis] 2005-01-30 04:50:41 +00:00
Alexey Verkhovsky 2e9e82bd0a Documented last change in CHANGELOG; it was: search looks at page titles, as well as contents [edk] 2005-01-30 03:32:56 +00:00
Alexey Verkhovsky a0303d1eea Search 2005-01-30 03:17:02 +00:00
Alexey Verkhovsky 22a8ebb86d Droppped obsolewte require 'chunks/match' [Denis] 2005-01-30 02:57:53 +00:00
Alexey Verkhovsky 3c1990a42a Not all incarnations of pdflatex know the --output-directory option [Denis] 2005-01-30 02:56:03 +00:00
Alexey Verkhovsky 63cf09059b Merged new_web action into create_web 2005-01-28 03:44:36 +00:00
Alexey Verkhovsky 16dcdb6e0e A friendly confirmation when a new wiki is set up 2005-01-28 02:57:25 +00:00
Alexey Verkhovsky 22e7104ea1 Error message look slightly better. 2005-01-28 02:44:22 +00:00
Alexey Verkhovsky 83c6eadc0c Merged new_system action into create_system 2005-01-28 02:35:59 +00:00
Alexey Verkhovsky 88e52ab5a9 Extracted AdminController from WikiController 2005-01-28 01:24:31 +00:00
Alexey Verkhovsky 9bc9a29789 corrected a warning prevention condition 2005-01-28 01:00:10 +00:00
Alexey Verkhovsky 60dfbd72b7 renamde a test for authenticate with wrong password so that it does not duplicate the name of another test. 2005-01-28 00:52:37 +00:00
Alexey Verkhovsky 785276efc1 bit better error handling in file/import 2005-01-27 04:14:41 +00:00
Alexey Verkhovsky 06daadc7df Reshaped "import wiki" feature from command-line to web interface 2005-01-27 03:55:19 +00:00
Alexey Verkhovsky 3e4154de82 fixed a problem where Instiki wouldn't start because
require 'application' was before require 'webrick_server' (?)
2005-01-26 01:02:39 +00:00
Alexey Verkhovsky c1b04185a6 First attempt at an "import wiki" script (causes regexp stack overflows in RedCloth 2 on Win32; reason unknown) 2005-01-25 22:13:14 +00:00
Alexey Verkhovsky 9f90f083d7 Moved some things from scripts/server to config/environment.rb 2005-01-25 22:06:34 +00:00
Alexey Verkhovsky 9e84693cb2 dropped -w flag from shebangs of ./instiki and ./instiki.rb.
There are many warnings coming from Rails, and spoiling the end-user experience.
2005-01-25 21:25:22 +00:00
Alexey Verkhovsky 3b6566577c Massive change of SVN properties to deal with EOL style problem 2005-01-24 18:52:04 +00:00
Alexey Verkhovsky b747b611b3 Blocking of file uploads by admin 2005-01-24 01:04:00 +00:00
Alexey Verkhovsky 6c020342a3 explicitly assign all defaults in Web constructor 2005-01-24 00:57:47 +00:00
Alexey Verkhovsky 75a8a3f560 "View changes" colours replaced text as well [Denis Mertz] 2005-01-24 00:55:18 +00:00
Alexey Verkhovsky 8d576bbbf7 test for Web constructor (lots of default values) 2005-01-24 00:50:46 +00:00
Alexey Verkhovsky 40ed02c771 anoter well-formedness tweak in edit_web.rhtml 2005-01-24 00:49:31 +00:00
Alexey Verkhovsky 8d8deb8e76 "user interface" to allow or prohibit file uploads (not working, just the UI element) 2005-01-24 00:20:31 +00:00
Alexey Verkhovsky a99e492f05 corrected a typo 2005-01-23 20:27:24 +00:00
Alexey Verkhovsky 405e81d29d set uploaded files to read-only access mode 2005-01-23 20:26:39 +00:00
Alexey Verkhovsky 12722d1df3 Cleaning up edit_web.rhtml; extracted all the JavaScript to a static file 2005-01-23 19:14:45 +00:00
Alexey Verkhovsky 584c4b39ef Preventing an endless loop in case test_helper is loaded twice
(note to self: _always_ enclose alias within unless method_defined?)
2005-01-23 19:12:57 +00:00
Alexey Verkhovsky 780891349a explicit action and test for edit_web 2005-01-23 18:30:33 +00:00
Alexey Verkhovsky a3142c377a prevent password managers from messing up edit_web form 2005-01-23 18:23:27 +00:00
Alexey Verkhovsky 805d4a829e further XML well-formedness fixes 2005-01-23 17:05:28 +00:00
Alexey Verkhovsky 685874da83 when response is a file download, there is no need to check that it is well formed HTML (it's not, anyway) 2005-01-23 16:37:58 +00:00
Alexey Verkhovsky c8e459cbb0 Added a check for XML well-formedness to assert_success
(optional, enabled by uncommenting a variable at the top of test_helper.rb);
corrected some malformed templates (not all yet)
2005-01-23 16:34:27 +00:00
Alexey Verkhovsky 203405c4dc File upload implemented (mentioning it in CHANGELOG).
Things to do: 
* testing, 
* security tightening, 
* admin controls (upload size cap, a way to disable the feature)
* handling of files/pictures in exported and published wikis
2005-01-23 14:58:32 +00:00
Alexey Verkhovsky a7bb047424 FileController refreshes references to files/pictures after an upload 2005-01-23 14:54:41 +00:00
Alexey Verkhovsky 14c114529a added test for upload 2005-01-23 14:32:10 +00:00
Alexey Verkhovsky 44eea43940 uploading pics when not found in the file yard (same as for files) 2005-01-23 13:42:56 +00:00
Alexey Verkhovsky 8263e4bfcd [RESTORES BUILD] Wiki link (in double square brackets) has precedence over autolinking URLs;
contents of wiki links are not passed to markup engines; got rid of bracketing mask method in the 
chunks parser (it was a feature that caused a lot of parsing grief for no good reason)
2005-01-23 05:19:39 +00:00
Alexey Verkhovsky 301464c4e4 new file (should have been included in the last commit) 2005-01-23 04:06:17 +00:00
Alexey Verkhovsky 39f854a11e display images from the file yard 2005-01-23 03:52:07 +00:00
Alexey Verkhovsky d6fe54f4ad [BREAKS BUILD] Links to pictures. Problem is, URIChunk thinks that index.jpg is a hyperlink to http://index.jp.
Also, commented out the code that was hiding rendering errors. This should be done at a different level.
2005-01-23 03:27:45 +00:00
Alexey Verkhovsky 1d82582c3b Extracted storage of files functionality from controller to an object called FileYard.
There is one file yard per web.
2005-01-23 01:36:51 +00:00
Alexey Verkhovsky 0d81292168 Rake's Test/Unit runner be damned 2005-01-23 00:48:00 +00:00
Alexey Verkhovsky 295e41c245 another go at file upload: slightly less naive and _working_ 2005-01-22 19:30:49 +00:00
Alexey Verkhovsky 7dc399650f Added an informational notice (implemented as a flash) to the default layout 2005-01-22 19:24:27 +00:00
Alexey Verkhovsky aec9449771 Naive implementation of a file upload 2005-01-22 18:38:16 +00:00
Alexey Verkhovsky e6c32bafc6 Wiki links to files point to the appropriate actions (file, pic) 2005-01-22 16:38:33 +00:00
Alexey Verkhovsky c30989c7eb Actions that send files to browser smartly determine content-type HTTP header by the file name extnsion 2005-01-22 14:58:43 +00:00
Alexey Verkhovsky e9a419c40f File download (primitive implementation) 2005-01-22 02:49:52 +00:00
Alexey Verkhovsky 9d90901cd0 URI rewriting to determine a controller based on an action name 2005-01-22 01:57:05 +00:00
Alexey Verkhovsky 12a34823a8 Beginnings of a FileController (serving the file upload feature) 2005-01-22 01:35:00 +00:00
Alexey Verkhovsky 71407f9b9f removed a redundant method from WikiController 2005-01-22 01:15:09 +00:00
Alexey Verkhovsky 26878462f3 Extracted two methods from WikiChunk::Link constructor (it was too long) 2005-01-22 00:54:44 +00:00
Alexey Verkhovsky dcd63ff408 Dcumented the last change in the CHANGELOG 2005-01-22 00:42:43 +00:00
Alexey Verkhovsky 92404470e8 Wiki link (square brackets) now knows its type (show, file or pic),
and does not mess up with Textile link hyperlink syntax
2005-01-22 00:39:03 +00:00
Alexey Verkhovsky 87ab5d00ae A bit of golf 2005-01-21 23:00:29 +00:00
Alexey Verkhovsky 578becb609 uncommented a test that actually passes (WikiWord within Textile URL) 2005-01-21 22:43:13 +00:00
Alexey Verkhovsky 661fb64561 more regexp caching 2005-01-21 22:40:16 +00:00
Alexey Verkhovsky 780bf4fe91 a little golf 2005-01-21 22:28:37 +00:00
Alexey Verkhovsky 75b6d30d80 simplified WikiWords.separate 2005-01-21 22:15:29 +00:00
Alexey Verkhovsky befa8c91b2 reduced the number of warnings in unit tests (still very high though) 2005-01-21 22:08:47 +00:00
Alexey Verkhovsky 259a7028e3 cache compiled regexps in constants 2005-01-21 21:58:48 +00:00
Alexey Verkhovsky 9242ad045d fixed the render_to_string hack to live peasefully with the new ActionPack rule that "the first render wins" 2005-01-21 21:06:46 +00:00
Alexey Verkhovsky 26974db864 Documented ability to server static content in the CHANGELOG (it's a side-effect of porting to Rails) 2005-01-21 19:51:46 +00:00
Alexey Verkhovsky f84727c03e explicitly tell to Rails not to render a layout for file download actions (it shouldn't matter, but...) 2005-01-21 19:44:34 +00:00
Alexey Verkhovsky 88d7dc832d Setting Content-Type to UTF-8, to be consistent with meta-data in the HTML itself 2005-01-21 19:41:46 +00:00
Alexey Verkhovsky e619e575ce extracted wiki fixture to test_helper (it still doesn't deserge a class of its own, but one day it might) 2005-01-21 19:40:04 +00:00
Alexey Verkhovsky a9cf729f25 Enable UTF-8 support in certain methods of String class 2005-01-21 19:17:25 +00:00
Alexey Verkhovsky f75f5223c3 Enabled UTF-8 support in string functions 2005-01-21 19:00:45 +00:00
Alexey Verkhovsky dce2af06aa Autolink URLs like http://localhost:8000 (anything that has a schema like http:// and looks like a URL), in addition to internet URLs. 2005-01-20 21:34:27 +00:00
Alexey Verkhovsky b74244ee3f documented the change in categories behavior in CHANGELOG 2005-01-20 13:39:12 +00:00
Alexey Verkhovsky 7a5aa277bb Corrected a reference to non-existent web method in list.rhtml 2005-01-20 13:35:46 +00:00
Alexey Verkhovsky dc6c455426 instead of parsing category line by markup engine etc, convert it to /list/?category=XYZ hyperlinks 2005-01-20 13:34:15 +00:00
Alexey Verkhovsky dfde41e63e tweaked unmasking (no need to create and compile regexps all the time when sub(string, string) is enough 2005-01-20 13:32:37 +00:00
Alexey Verkhovsky 0d9d89ad3c URI rewriting should be very liberal towards page names 2005-01-20 01:00:47 +00:00
Alexey Verkhovsky 12aa4365ad Disabled a test that fails on RedCloth 2 2005-01-20 00:21:29 +00:00
Alexey Verkhovsky 97857409a9 Added -w to all shebangs [Florian Gross] 2005-01-20 00:05:23 +00:00
Alexey Verkhovsky 8eb35d4021 [RESTORES BUILD] URI parsing is smart about Instiki images again 2005-01-19 21:09:08 +00:00
Alexey Verkhovsky e8b2a3c30a moved apply_to from WikiContent to Chunk, so tha UriChunk can override it and decide when it
wants to match a URL and when it doesn't want to the in the way of Textile syntax
2005-01-19 20:29:43 +00:00
Alexey Verkhovsky 02930e20fe preparing UriChunk to a refactoring that will let chunks decide whether they want to match or not
(not merely by specifying a regexp pattern)
2005-01-19 20:17:26 +00:00
Alexey Verkhovsky dbfe531abb Extracted various computations in the constructor of UriChunk to local methods. 2005-01-19 10:59:52 +00:00
Alexey Verkhovsky d3b12631dd pre-compile and cache URI regexp 2005-01-19 10:56:46 +00:00
Alexey Verkhovsky 11794e6f4f Fixed a test broken by lasy commit 2005-01-19 00:54:18 +00:00
Alexey Verkhovsky 2c637539be paths in Instiki errors will look a bit less funny 2005-01-18 23:38:36 +00:00
Alexey Verkhovsky ca22e59c38 [BREAKS BUILD] Corrected and refactored revision_test.rb
Same story as with uri_test.rb; this test was skipped by Rake, because there was a syntax error in it.
Now there is no syntax error, but there is a failing test instead (introduced by changeset:48)
2005-01-18 22:32:50 +00:00
Alexey Verkhovsky 07e43d2dae Streamlined URI parsing [dm1] 2005-01-18 20:31:42 +00:00
Alexey Verkhovsky 60c16e0be7 Corrected failing test 2005-01-18 20:29:10 +00:00
Alexey Verkhovsky fb2e77a2ce More tests in uri_test.rb 2005-01-18 19:15:48 +00:00
Alexey Verkhovsky 8bf050292a [BREAKS BUILD] Deleted a wrong require that was causing Rake to skip uri_test.rb (bug in Rake?). There was, as it turned out, a failing test there. 2005-01-18 18:55:40 +00:00
Alexey Verkhovsky 7748ea4ecd End-of-line style for "executables" is LF (Unix) so that shebangs always work. 2005-01-18 17:50:16 +00:00
Alexey Verkhovsky b195cd8b74 Footer with links to instiki.org and rubyonrails.org 2005-01-18 01:19:58 +00:00
Alexey Verkhovsky 5db16d8850 Documented the last changes 2005-01-18 00:44:39 +00:00
Alexey Verkhovsky 7c02805102 Unsuccessful save unlocks the page; some tweaks and debug-level logging in in return_to_last_remembered 2005-01-18 00:36:43 +00:00
Alexey Verkhovsky 94292199b2 Corrected a link, and changed it to a link_to method 2005-01-18 00:33:10 +00:00
Alexey Verkhovsky b9737747f2 Display error message from a flash at the top of the page 2005-01-18 00:27:28 +00:00
Alexey Verkhovsky 73552b36a0 If there is a validation error, save action will redirect to the last known good location and set error message in a flash 2005-01-17 23:17:28 +00:00
Alexey Verkhovsky 5c8b738238 Added test at the service level, to see how well madeleine copes with errors. Looks like it does cope with them. 2005-01-17 22:42:45 +00:00
Alexey Verkhovsky cb1d8ed54f Controller-level test for the last revision (submit of an identical revision) 2005-01-17 21:31:26 +00:00
Alexey Verkhovsky 878a6336fb Page#revise raises ValidationError if a revision is exactly same as the page before 2005-01-17 21:27:38 +00:00
Alexey Verkhovsky 7780a13fe8 Created a special error class for handling graecful rollbacks (not sure if Madeleine can take it yet) 2005-01-17 21:22:41 +00:00
Alexey Verkhovsky 8f5ac3440a All controller actions are covered by tests [main success scenarios only - not really trying to break it yet] 2005-01-17 20:37:06 +00:00
Alexey Verkhovsky c50dd048e3 Corrected the binary_content method 2005-01-17 20:11:49 +00:00
Alexey Verkhovsky f28e572c65 Added a test for tex action 2005-01-17 20:03:49 +00:00
Alexey Verkhovsky 58f92caa19 Removed code that made it into Rails SVN 2005-01-17 18:28:01 +00:00
Alexey Verkhovsky 57df455d1d Removed accidentally duplicated code 2005-01-17 18:25:13 +00:00
Alexey Verkhovsky bd8e725578 Added assertions for the response content in pdf action; changed all output file names to include seconds 2005-01-17 18:09:13 +00:00
Alexey Verkhovsky 01c5a65405 Sorted out pdf action 2005-01-17 15:47:43 +00:00
Alexey Verkhovsky 0367f67fba changed tex.rhtml in response to a warning from pdflatex
version: MiKTeX-pdfetex 2.4.1700 (1.20a-rc7.2) (MiKTeX 2.4)
2005-01-17 15:39:06 +00:00
Alexey Verkhovsky 8a1ca5fe14 Placeholder in public/stylesheets is no longer needed 2005-01-17 14:12:37 +00:00
Alexey Verkhovsky bba4810789 Documented a new command-line option 2005-01-17 14:10:00 +00:00
Alexey Verkhovsky 151cd65194 Documented last changes 2005-01-16 23:59:20 +00:00
Alexey Verkhovsky da3c060c89 Non-mutating operations should not be logged. 2005-01-16 23:51:59 +00:00
Alexey Verkhovsky 621b79db55 Tests for WikiService use default WikiService (with Madeleine persistence), not a WikiServiceWithNoPersistence. 2005-01-16 23:17:30 +00:00
Alexey Verkhovsky ab63f1449d Added shebangs and require 'test_helper' to all tests, so that they can be run standalone 2005-01-16 22:40:44 +00:00
Alexey Verkhovsky ef65e5e78a Fix to ticket 2.
When updating the last page revision in the "continuous revision" case, created_at should be used
instead of Time.now.
2005-01-16 22:27:09 +00:00
Alexey Verkhovsky da3674770e Moved Page#pretty_revised_on to the view (it is not a model method) 2005-01-16 22:19:28 +00:00
Alexey Verkhovsky 042391bfff Reformatted all the very long strings to fit 100 columns 2005-01-16 22:16:24 +00:00
Alexey Verkhovsky f559a17ba4 Renamed "mocks" to "stubs", cause these things are stubs, not mocks. 2005-01-16 21:49:27 +00:00
Alexey Verkhovsky 9b30ec0811 Rails icon as Instiki favicon (pending nextangle's confirmation on this one) 2005-01-16 20:02:35 +00:00
Alexey Verkhovsky dcf1030aaa Removed an obsoleted method and changed some comments 2005-01-16 19:37:34 +00:00
Alexey Verkhovsky 6f943a01d4 Changed a file comment and reformatted redcloth_for_tex.rb 2005-01-16 19:18:34 +00:00
Alexey Verkhovsky 590af3ae4f compulsive tweaking of quotes 2005-01-16 19:12:22 +00:00
Alexey Verkhovsky 0fca1f5d1a Documented the last change in CHANGELOG 2005-01-16 16:42:14 +00:00
Alexey Verkhovsky 178f3f53ee Fixed rendering of URIs with port number; moved match.rb to test_helper (where it belongs) 2005-01-16 16:04:45 +00:00
Alexey Verkhovsky 832cfdf605 Extracted default layout 2005-01-16 15:00:11 +00:00
Alexey Verkhovsky 041c250837 Documented the last change in CHANGELOG 2005-01-16 03:12:22 +00:00
Alexey Verkhovsky bf309d3fbd Madeleine will check every hour if there are new commands in the log or 24 hours have passed since last snapshot, and take snapshot if either of these conditions is true 2005-01-16 03:05:45 +00:00
Alexey Verkhovsky 5daf352e68 Providing start files both with .rb extension (for existing /init.d scripts and Win32 double-clicks).
and without (for gem distribution)
2005-01-16 02:08:36 +00:00
Alexey Verkhovsky 88b3a1ba08 Fixed a bug with system creation; also fixed a semi-hardcoded EXPORT_DIRECTORY path in controller 2005-01-16 01:11:08 +00:00
Alexey Verkhovsky 778e9420b5 Made pdf action callable, and wrote a naive test for it 2005-01-16 00:21:08 +00:00
Alexey Verkhovsky 10214ebb26 Defined externals (for Rails modules), replaced .cvsignore files with svn:ignore properties 2005-01-15 21:10:38 +00:00
Alexey Verkhovsky 223b2bec6c Initial import of the sources from SVN 2005-01-15 20:26:54 +00:00
Alexey Verkhovsky e1a14bc27b top-level directories structure 2005-01-15 20:06:21 +00:00
32382 changed files with 231499 additions and 65456 deletions

223
CHANGELOG Executable file → Normal file
View file

@ -1,3 +1,226 @@
N.B.: You *must* run
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
New Features:
* Syntax colouring: 'ansic', 'javascript', 'sqlite', 'yaml' and 'css' modes,
in addition to the existing 'html', 'xml', and 'ruby' modes,
* Source view [suggested by Andrew Stacey]
* Auto-resizing Textareas scale to fit viewing area.
* Instiki upgraded to Rails 2.3.5 and Rack 1.1.
* Now runs on Ruby 1.9. (If you're a Passenger user, you may need to upgrade to Passenger
2.2.8, which works around some bugs in Ruby 1.9.1.)
* Upgraded for itex2MML 1.3.19 (which works under Ruby 1.9, and has several new feautures,
relative to 1.3.15).
Bugs Fixed:
* Fixed a CSS bug, which screwed up printing (unless you used the "Print" view).
* Fixed a well-formedness bug in the page-name truncation algorithm [reported by Toby Bartels]
* Fixed a cache-sweeping bug [reported by Toby Bartels]
* Better accessibility.
* Improved log rotation under Passenger.
* Omit a (seemingly superfluous) javascript hack which causes Gecko-based browsers to request
/my_wiki/s5/null
when they load an s5 slideshow.
* Upgraded vendored sqlite3-ruby and rubyzip
* Move files when renaming a web (so that links to uploaded files don't break).
* Many Ruby 1.9 fixes, including removing the html5lib Sanitizer.
------------------------------------------------------------------------------
* 0.17.3
The most important facet of this release is a small change in the database
schema. Previously, people migrating from the default SQLite3 database to MySQL
ran the risk of silent data loss, because MySQL had a more strict interpretation
of the column types in the database. The new schema will prevent such problems.
rake upgrade_instiki
will seamlessly upgrade your existing database to the new schema.
New Features:
* Passenger support (including X-Sendfile support, if the Apache mod_xsendfile
module is installed).
* Update for itex2MML 1.3.13. (You should upgrade your itex2MML to the latest
version, too.)
Bugs Fixed:
* Refactored the Web model (from James Herdman).
* Clean malformed utf-8 strings, rather than complaining about them.
* Updated location of Textile help, since _why_the_lucky_stiff left the 'net.
* Fixed a TeX rendering bug.
* Updated list of XHTML+MathML named entities to match W3C Working Draft.
* Refactored the Sanitizer (speedup).
* Fix S5 Slideshows for non-root Instiki URLs.
* Work around a Rails flash bug.
* Links from published webs should work right (finally?).
* An important database migration for MySQL users.
------------------------------------------------------------------------------
* 0.17.2
Security: Updated to Rails 2.3.4
* Fixes Timing Weakness in Rails MessageVerifier and the Cookie Store
http://weblog.rubyonrails.org/2009/9/4/timing-weakness-in-ruby-on-rails
* Fixes XSS Vulnerability in Rails
http://weblog.rubyonrails.org/2009/9/4/xss-vulnerability-in-ruby-on-rails
New Features:
* Syntax colouring (`ruby` and `html`) for code blocks.
* Updated for itex2MML 1.3.10 (supports \rlap{} and \underline{}). You should upgrade that, too.
* Add a "Create New Page" Link to the Search Page. (Based on an idea by nowa)
* Updated to Rails 2.3.4
Bugs Fixed:
* Wikilinks to published webs should be to the published action. This didn't work
right for inter-web links. (Reported by Mike Shulman)
* Use .size, rather than .length for ActiveRecord associations. A huge memory saving
in building the recently_revised page.
* Refactor the upgrade_instiki rake task, to make it database-agnostic. (Many thanks to James Herdman)
* Web#files_path and Web#blatex_pngs_path now return Pathname objects. (Thanks, again, to James Herdman)
* Workaround for Mozilla Bug 449396. (Reported by Andrew Stacey)
* Correctly Set noindex,nofollow On /diff Pages.
* Page-renaming javascript deals correctly with page names containing ampersands, slashes, and other garbage.
* List of Wanted Pages should not include redirected pages.
* The Regexp, used in Maruku to detect "email" headers (used, e.g., for S5 slideshow metadata) could, for some inputs, interact badly with Instiki's Chunk Handler. Fixed.
* Ensure "rollback" locks page for editing.
* Generate relative URLs, when possible. (Patch by Dennis Knauf)
* Expire revisions of an edited page. Use a `before_save` hook to deal with the situation where a page's name has been changed.
------------------------------------------------------------------------------
* 0.17
New features:

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"

77
README Executable file → Normal file
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:

21
UPGRADING Normal file
View file

@ -0,0 +1,21 @@
UPGRADING
=========
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.
After installing the new software and restoring your database, you need to run
ruby bundle
ruby bundle exec rake upgrade_instiki
from the commandline, to complete the upgrade. Doing a
ruby bundle update
will update the installed gems (used by Instiki) to the latest versions.

0
app/apis/.gitignore vendored Normal file
View file

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

@ -1,7 +1,7 @@
# The filters added to this controller will be run for all controllers in the application.
# Likewise will all the methods added be available for all controllers.
class ApplicationController < ActionController::Base
# require 'dnsbl_check'
protect_forms_from_spam
before_filter :connect_to_model, :check_authorization, :setup_url_generator, :set_content_type_header, :set_robots_metatag
after_filter :remember_location, :teardown_url_generator
@ -19,13 +19,31 @@ class ApplicationController < ActionController::Base
Wiki.new
end
helper_method :xhtml_enabled?, :html_ext, :darken
protected
def check_authorization
if in_a_web? and authorization_needed? and not authorized?
redirect_to :controller => 'wiki', :action => 'login', :web => @web_name
return false
def xhtml_enabled?
in_a_web? and [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
end
def html_ext
if xhtml_enabled? && request.env.include?('HTTP_ACCEPT') &&
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
'xhtml'
else
'html'
end
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
@ -35,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
@ -87,7 +103,8 @@ class ApplicationController < ActionController::Base
original_options[:type] ||= (FILE_TYPES[File.extname(file_name)] or 'application/octet-stream')
original_options[:disposition] ||= (DISPOSITION[original_options[:type]] or 'attachment')
original_options[:stream] ||= false
original_options[:x_sendfile] = true if request.env.include?('HTTP_X_SENDFILE_TYPE') && request.remote_addr == LOCALHOST
original_options[:x_sendfile] = true if request.env.include?('HTTP_X_SENDFILE_TYPE') &&
( request.remote_addr == LOCALHOST || defined?(PhusionPassenger) )
original_options
end
@ -140,7 +157,7 @@ class ApplicationController < ActionController::Base
<html xmlns="http://www.w3.org/1999/xhtml"><body>
<h2>Internal Error</h2>
<p>An application error occurred while processing your request.</p>
<!-- \n#{exception.to_s.is_utf8? ? exception.to_s.gsub!(/-{2,}/, '- -') : ''}\n#{exception.backtrace.join("\n")}\n -->
<!-- \n#{exception.to_s.purify.gsub!(/-{2,}/, '- -') }\n#{exception.backtrace.join("\n")}\n -->
</body></html>
EOL
end
@ -165,13 +182,11 @@ class ApplicationController < ActionController::Base
end
end
public
def set_content_type_header
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') &&
@ -189,14 +204,8 @@ class ApplicationController < ActionController::Base
end
end
def xhtml_enabled?
in_a_web? and (@web.markup == :markdownMML or @web.markup == :markdownPNG or @web.markup == :markdown)
end
protected
def set_robots_metatag
if controller_name == 'wiki' and %w(show published).include? action_name
if controller_name == 'wiki' and %w(show published s5).include? action_name and !(params[:mode] == 'diff')
@robots_metatag_value = 'index,follow'
else
@robots_metatag_value = 'noindex,nofollow'
@ -233,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
@ -257,8 +276,8 @@ end
module Instiki
module VERSION #:nodoc:
MAJOR = 0
MINOR = 17
TINY = 0
MINOR = 19
TINY = 3
SUFFIX = '(MML+)'
PRERELEASE = false
if PRERELEASE
@ -268,3 +287,22 @@ module Instiki
end
end
end
# Monkey patch, to make Hash#key work in Ruby 1.8
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

@ -2,17 +2,17 @@ module CacheSweepingHelper
def expire_cached_page(web, page_name)
expire_action :controller => 'wiki', :web => web.address,
:action => %w(show published s5 tex print history), :id => page_name
:action => %w(show published s5 tex print history source), :id => page_name
expire_action :controller => 'wiki', :web => web.address,
:action => 'show', :id => page_name, :mode => 'diff'
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.length.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,14 +1,14 @@
# Controller responsible for serving files and pictures.
require 'zip/zip'
require 'stringsupport'
require 'instiki_stringsupport'
class FileController < ApplicationController
layout 'default'
before_filter :dnsbl_check, :check_authorized
before_filter :check_allow_uploads, :except => [:file, :blahtex_png]
before_filter :check_authorized
before_filter :check_allow_uploads, :dnsbl_check, :except => [:file, :blahtex_png]
def file
@file_name = params['id']
@ -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
@ -26,7 +29,7 @@ class FileController < ApplicationController
end
else
# no form supplied, this is a request to download the file
file = @web.files_path + '/' + @file_name
file = @web.files_path.join(@file_name)
if File.exists?(file)
send_file(file)
else
@ -38,7 +41,7 @@ class FileController < ApplicationController
end
def blahtex_png
send_file(@web.blahtex_pngs_path + '/' + params['id'])
send_file(@web.blahtex_pngs_path.join(params['id']))
end
def delete
@ -88,17 +91,14 @@ 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
if @web.allow_uploads? and authorized?
return true
else
@ -106,32 +106,22 @@ class FileController < ApplicationController
render(:status => 403, :text => 'File uploads are blocked by the webmaster', :layout => true)
return false
end
else
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)
while (entry = zip.get_next_entry) do
ext_length = File.extname(entry.name).length
page_name = entry.name[0..-(ext_length + 1)]
page_content = entry.get_input_stream.read
page_name = entry.name[0..-(ext_length + 1)].purify
page_content = entry.get_input_stream.read.purify
logger.info "Processing page '#{page_name}'"
begin
if !page_content.is_utf8?
logger.info "Page '#{page_name}' contains non-utf8 character data. Skipping."
next
end
existing_page = @wiki.read_page(@web.address, page_name)
if existing_page
if existing_page.content == page_content

View file

@ -6,23 +6,42 @@ class RevisionSweeper < ActionController::Caching::Sweeper
observe Revision, Page
def before_save(record)
if record.is_a?(Revision)
expire_cached_page(record.page.web, record.page.name)
expire_cached_revisions(record.page)
end
end
def after_save(record)
if record.is_a?(Revision)
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

@ -1,25 +1,26 @@
require 'fileutils'
require 'maruku'
require 'maruku/ext/math'
require 'zip/zip'
require 'stringsupport'
require 'instiki_stringsupport'
require 'resolv'
class WikiController < ApplicationController
before_filter :load_page
before_filter :dnsbl_check, :only => [:edit, :new, :save, :export_html, :export_markup]
caches_action :show, :published, :authors, :tex, :s5, :print, :recently_revised, :list, :file_list,
caches_action :show, :published, :authors, :tex, :s5, :print, :recently_revised, :list, :file_list, :source,
:history, :revision, :atom_with_content, :atom_with_headlines, :if => Proc.new { |c| c.send(:do_caching?) }
cache_sweeper :revision_sweeper
layout 'default', :except => [:atom_with_content, :atom_with_headlines, :atom, :tex, :s5, :export_html]
layout 'default', :except => [:atom_with_content, :atom_with_headlines, :atom, :source, :tex, :s5, :export_html]
def index
if @web_name
redirect_home
elsif not @wiki.setup?
redirect_to :controller => 'admin', :action => 'create_system'
elsif @wiki.webs.length == 1
elsif @wiki.webs.size == 1
redirect_home @wiki.webs.values.first.address
else
redirect_to :action => 'web_list'
@ -67,10 +68,8 @@ class WikiController < ApplicationController
end
def export_html
stylesheet = File.read(File.join(RAILS_ROOT, 'public', 'stylesheets', 'instiki.css'))
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">
@ -78,19 +77,42 @@ class WikiController < ApplicationController
<title>#{page.plain_name} in #{@web.name}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<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, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover {
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, [actiontype="toggle"]:hover, #TextileHelp h3 {
color: ##{@web ? @web.color : "393"};
}
.newWikiWord { background-color: white; font-style: italic; }
#{stylesheet}
</style>
<style type="text/css">
#{@web.additional_style}
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>
@ -98,7 +120,9 @@ class WikiController < ApplicationController
<div class="byline">
#{page.revisions? ? "Revised" : "Created" } on #{ page.revised_at.strftime('%B %d, %Y %H:%M:%S') }
by
#{ UrlGenerator.new(self).make_link(page.author.name, @web, nil, { :mode => :export }) }
#{ UrlGenerator.new(self).make_link(@web, page.author.name, @web, nil, { :mode => :export }) }
</div>
</div>
</div>
</body>
</html>
@ -161,9 +185,33 @@ class WikiController < ApplicationController
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']
render(:text => "Your query string was not valid utf-8", :layout => 'error', :status => 400) and return unless @query.is_utf8?
@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
@ -180,7 +228,7 @@ class WikiController < ApplicationController
end
def edit
if @page.nil? or not @page_name.is_utf8?
if @page.nil?
redirect_home
elsif @page.locked?(Time.now) and not params['break_lock']
redirect_to :web => @web_name, :action => 'locked', :id => @page_name
@ -190,12 +238,10 @@ class WikiController < ApplicationController
end
def locked
render(:text => 'Page name is not valid utf-8.', :status => 400, :layout => 'error') unless @page_name.is_utf8?
# to template
end
def new
render(:text => 'Page name is not valid utf-8.', :status => 400, :layout => 'error') unless @page_name.is_utf8?
# to template
end
@ -216,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
@ -230,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
@ -250,37 +296,30 @@ class WikiController < ApplicationController
def rollback
get_page_and_revision
if @page.locked?(Time.now) and not params['break_lock']
redirect_to :web => @web_name, :action => 'locked', :id => @page_name
else
@page.lock(Time.now, @author)
end
end
def save
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil? or not @page_name.is_utf8?
unless (request.post? || ENV["RAILS_ENV"] == "test")
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return
end
author_name = params['author']
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil?
return unless is_post
author_name = params['author'].purify
author_name = 'AnonymousCoward' if author_name =~ /^\s*$/
begin
raise Instiki::ValidationError.new('Your name was not valid utf-8') unless author_name.is_utf8?
raise Instiki::ValidationError.new('Your name cannot contain a "."') if author_name.include? '.'
cookies['author'] = { :value => author_name, :expires => Time.utc(2030) }
the_content = params['content']
the_content = params['content'].purify
prev_content = ''
filter_spam(the_content)
unless the_content.is_utf8?
cookies['author'] = { :value => author_name.dup.as_bytes, :expires => Time.utc(2030) }
if @page
the_content = @page.content
else
the_content = ''
end
raise Instiki::ValidationError.new('Your content was not valid utf-8.')
end
if @page
new_name = params['new_name'] || @page_name
raise Instiki::ValidationError.new('Your new title was not valid utf-8.') unless new_name.is_utf8?
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)
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('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,
Author.new(author_name, remote_ip), PageRenderer.new)
@page.unlock
@ -293,11 +332,15 @@ class WikiController < ApplicationController
rescue Instiki::ValidationError => e
flash[:error] = e.to_s
logger.error e
param_hash = {:web => @web_name, :id => @page_name}
# Work around Rails bug: flash will not display if query string is longer than 10192 bytes
param_hash.update( :content => the_content ) if the_content &&
CGI::escape(the_content).length < 10183 && the_content != prev_content
if @page
@page.unlock
redirect_to :action => 'edit', :web => @web_name, :id => @page_name, :content => the_content
redirect_to param_hash.update( :action => 'edit' )
else
redirect_to :action => 'new', :web => @web_name, :id => @page_name, :content => the_content
redirect_to param_hash.update( :action => 'new' )
end
end
end
@ -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
@ -320,7 +363,7 @@ class WikiController < ApplicationController
end
end
else
if not @page_name.nil? and @page_name.is_utf8? and not @page_name.empty?
if not @page_name.nil? and not @page_name.empty?
real_page = WikiReference.page_that_redirects_for(@web, @page_name)
if real_page
flash[:info] = "Redirected from \"#{@page_name}\"."
@ -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.length
@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
@ -349,7 +392,7 @@ class WikiController < ApplicationController
end
render :action => 'history'
else
if not @page_name.nil? and @page_name.is_utf8? and not @page_name.empty?
if not @page_name.nil? and not @page_name.empty?
redirect_to :web => @web_name, :action => 'new', :id => @page_name
else
render :text => 'Page name is not specified', :status => 404, :layout => 'error'
@ -357,17 +400,22 @@ class WikiController < ApplicationController
end
end
def source
@revision = @page.revisions[params['rev'].to_i - 1] if params['rev']
end
def tex
if @web.markup == :markdownMML or @web.markup == :markdownPNG or @web.markup == :markdown
if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
@tex_content = Maruku.new(@page.content).to_latex
else
@tex_content = 'TeX export only supported with the Markdown text filters.'
end
render(:layout => 'tex')
end
def s5
if @web.markup == :markdownMML || @web.markup == :markdownPNG || @web.markup == :markdown
my_rendered = PageRenderer.new(@page.revisions.last)
if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup)
my_rendered = PageRenderer.new(@page.current_revision)
@s5_content = my_rendered.display_s5
@s5_theme = my_rendered.s5_theme
else
@ -376,15 +424,6 @@ class WikiController < ApplicationController
end
end
def html_ext
if xhtml_enabled? && request.env.include?('HTTP_ACCEPT') &&
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
'xhtml'
else
'html'
end
end
protected
def do_caching?
@ -392,7 +431,7 @@ class WikiController < ApplicationController
end
def load_page
@page_name = params['id']
@page_name = params['id'] ? params['id'].purify : nil
@page = @wiki.read_page(@web_name, @page_name) if @page_name
end
@ -423,22 +462,32 @@ class WikiController < ApplicationController
file_prefix = "#{@web.address}-#{file_type}-"
timestamp = @web.revised_at.strftime('%Y-%m-%d-%H-%M-%S')
file_path = File.join(@wiki.storage_path, file_prefix + timestamp + '.zip')
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
# add an index file, if exporting to HTML
end
# 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
FileUtils.rm_rf(Dir[File.join(@wiki.storage_path, file_prefix + '*.zip')])
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])
FileUtils.mv(tmp_path, file_path)
send_file file_path
end
@ -457,7 +506,7 @@ class WikiController < ApplicationController
if params['rev']
@revision_number = params['rev'].to_i
else
@revision_number = @page.revisions.length
@revision_number = @page.rev_ids.size
end
@revision = @page.revisions[@revision_number - 1]
end
@ -504,10 +553,6 @@ class WikiController < ApplicationController
@web.password.nil? or @web.published?
end
def truncate(text, length = 30, truncate_string = '...')
if text.length > length then text[0..(length - 3)] + truncate_string else text end
end
def filter_spam(content)
@@spam_patterns ||= load_spam_patterns
@@spam_patterns.each do |pattern|
@ -516,9 +561,9 @@ class WikiController < ApplicationController
end
def load_spam_patterns
spam_patterns_file = "#{RAILS_ROOT}/config/spam_patterns.txt"
spam_patterns_file = Rails.root.join('config', 'spam_patterns.txt')
if File.exists?(spam_patterns_file)
File.readlines(spam_patterns_file).inject([]) { |patterns, line| patterns << Regexp.new(line.chomp, Regexp::IGNORECASE) }
spam_patterns_file.readlines.inject([]) { |patterns, line| patterns << Regexp.new(line.chomp, Regexp::IGNORECASE) }
else
[]
end

View file

@ -1,5 +1,6 @@
# The methods added to this helper will be available to all templates in the application.
module ApplicationHelper
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
@ -30,7 +31,7 @@ module ApplicationHelper
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
@ -38,39 +39,39 @@ module ApplicationHelper
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(page_name, web, text,
options.merge(:base_url => "#{base_url}/#{web.address}"))
UrlGenerator.new(@controller).make_link(@web, page_name, web, text,
options.merge(:base_url => "#{base_url}/#{web.address}")).html_safe
end
def author_link(page, options = {})
UrlGenerator.new(@controller).make_link(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.length ?
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
@ -83,19 +84,19 @@ module ApplicationHelper
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)
@ -108,7 +109,22 @@ module ApplicationHelper
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.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]).html_safe
end
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.length > 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.length > 1
if @page.rev_ids.size > 1
menu << back_for_page
menu << see_or_hide_changes_for_page
end
menu << history if @page.revisions.length > 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.length - 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.length - @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.length - 1},
:rev => @page.rev_ids.size - 1},
{:class => 'navlink', :accesskey => 'B', :id => 'to_previous_revision', :rel => 'nofollow'}) +
" <span class='revisions'>(#{@page.revisions.length - 1} #{@page.revisions.length - 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

@ -83,13 +83,18 @@ class PageSet < Array
# Returns all the wiki words in this page set for which
# there are no pages in this page set's web
def wanted_pages
wiki_words - web.select.names
known_pages = (web.select.names + redirected_names).uniq
wiki_words - known_pages
end
def names
self.map { |page| page.name }
end
def redirected_names
self.wiki_words.select {|name| web.has_redirect_for?(name) }.uniq.sort
end
def wiki_words
self.inject([]) { |wiki_words, page|
wiki_words + page.wiki_words

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,7 +1,28 @@
require 'instiki_stringsupport'
class Web < ActiveRecord::Base
## Associations
has_many :pages, :dependent => :destroy
has_many :wiki_files, :dependent => :destroy
has_many :revisions, :through => :pages
## Hooks
before_save :sanitize_markup
after_save :create_files_directory
before_validation :validate_address
## Validations
validates_uniqueness_of :address, :message => 'already exists'
validates_length_of :color, :in => 3..6
## Methods
# @return [Wiki] a new Wiki instance
def wiki
Wiki.new
end
@ -13,34 +34,40 @@ class Web < ActiveRecord::Base
end
def add_page(name, content, time, author, renderer)
page = page(name) || Page.new(:web => self, :name => name)
page = page(name) || pages.build(:name => name)
page.revise(content, name, time, author, renderer)
end
# @return [Array<String>] a collection of all the names of the authors that
# have ever contributed to the pages for this Web
def authors
connection.select_all(
'SELECT DISTINCT r.author AS author ' +
'FROM revisions r ' +
'JOIN pages p ON p.id = r.page_id ' +
'WHERE p.web_id = ' + self.id.to_s +
' ORDER by 1 '
).collect { |row| row['author'] }
revisions.all(
:select => "DISTINCT revisions.author",
:order => "1"
).collect(&:author)
end
def categories
select.map { |page| page.categories }.flatten.uniq.sort
end
# @param [String] name the name of some associated Page record to find
# @return [Page, nil] the associated Page record, or +nil+ if no record is
# found with the provided name
def page(name)
pages.first(:conditions => ['name = ?', name])
pages.find_by_name(name)
end
# @return [Page] the last associated Page record
def last_page
return Page.first(:order => 'id desc', :conditions => ['web_id = ?', self.id])
pages.last
end
# @param [String] name the name of some potential Page record
# @return [Boolean] whether or not a given Page record exists with a given
# name
def has_page?(name)
Page.count(:conditions => ['web_id = ? AND name = ?', id, name]) > 0
pages.exists?(:name => name)
end
def has_redirect_for?(name)
@ -52,11 +79,11 @@ class Web < ActiveRecord::Base
end
def has_file?(file_name)
WikiFile.find_by_file_name(file_name) != nil
wiki_files.exists?(:file_name => file_name)
end
def file_list(sort_order = 'file_name')
WikiFile.all(:order => sort_order, :conditions => ['web_id = ?', id])
def file_list(sort_order="file_name")
wiki_files.all(:order => sort_order)
end
def pages_that_link_to(page_name)
@ -67,30 +94,34 @@ class Web < ActiveRecord::Base
WikiReference.pages_that_link_to_file(self, file_name)
end
# @param [String] file_name the name of some WikiFile of interest
# @return [String, nil] the description of some WikiFile of interest, nil if
# the WikiFile could not be found
def description(file_name)
file = WikiFile.find_by_file_name(file_name)
file.description if file
wiki_files.find_by_file_name(file_name).try(:description)
end
# @return [Symbol] the type of markup used by this Web
def markup
read_attribute('markup').to_sym
self[:markup].to_sym
end
# @return [Hash] a Hash wherein the key is some author's name, and the
# values are an array of page names for that author.
def page_names_by_author
connection.select_all(
'SELECT DISTINCT r.author AS author, p.name AS page_name ' +
'FROM revisions r ' +
'JOIN pages p ON r.page_id = p.id ' +
"WHERE p.web_id = #{self.id} " +
'ORDER by p.name'
).inject({}) { |result, row|
author, page_name = row['author'], row['page_name']
result[author] = [] unless result.has_key?(author)
result[author] << page_name
data = revisions.all(
:select => "DISTINCT revisions.author AS author, pages.name AS page_name",
:order => "pages.name"
)
data.inject({}) do |result, revision|
result[revision.author] ||= []
result[revision.author] << revision.page_name
result
}
end
end
# OPTIMIZE Use the +delete_all+ with conditions for extra efficiency
def remove_pages(pages_to_be_removed)
pages_to_be_removed.each { |p| p.destroy }
end
@ -107,42 +138,51 @@ class Web < ActiveRecord::Base
PageSet.new(self, pages, nil)
end
# @return [String] uses the +address+ attribute for this record's parameter name
def to_param
address
end
# Called by an +after_save+ hook. Creates the directory that houses this
# Web's associated files.
#
# TODO Move this into the WikiFile model
def create_files_directory
return unless allow_uploads == 1
dummy_file = self.wiki_files.build(:file_name => '0', :description => '0', :content => '0')
dummy_file = wiki_files.build(
:file_name => "0",
:description => "0",
:content => "0"
)
File.umask(0002)
dir = File.dirname(dummy_file.content_path)
begin
require 'fileutils'
FileUtils.mkdir_p dir
dummy_file.content_path.parent.mkpath
dummy_file.save
dummy_file.destroy
rescue => e
logger.error("Failed create files directory for #{self.address}: #{e}")
logger.error "Failed create files directory for #{address}: #{e}"
raise "Instiki could not create directory to store uploaded files. " +
"Please make sure that Instiki is allowed to create directory " +
"#{File.expand_path(dir)} and add files to it."
"#{dummy_file.content_path.expand_path} and add files to it."
end
end
# @return [Pathname] the path to the files for this record
def files_path
path = Rails.root.join("webs")
if default_web?
"#{RAILS_ROOT}/webs/files"
path.join("files")
else
"#{RAILS_ROOT}/webs/#{self.address}/files"
path.join(address, "files")
end
end
# @return [Pathname] the path to PNGs for this record
def blahtex_pngs_path
if default_web?
"#{RAILS_ROOT}/webs/files/pngs"
else
"#{RAILS_ROOT}/webs/#{self.address}/files/pngs"
end
files_path.join("pngs")
end
private
@ -158,24 +198,24 @@ class Web < ActiveRecord::Base
end
protected
before_save :sanitize_markup
after_save :create_files_directory
before_validation :validate_address
validates_uniqueness_of :address
validates_length_of :color, :in => 3..6
def sanitize_markup
self.markup = markup.to_s
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)}")
end
end
# @return [Boolean] whether or not this record is considered the default Web
def default_web?
defined? DEFAULT_WEB and self.address == DEFAULT_WEB
defined?(DEFAULT_WEB) && address == DEFAULT_WEB
end
end

View file

@ -1,7 +1,7 @@
class Wiki
cattr_accessor :storage_path, :logger
self.storage_path = "#{RAILS_ROOT}/storage/"
self.storage_path = Rails.root.join('storage')
def authenticate(password)
password == (system.password || 'instiki')
@ -27,6 +27,7 @@ class Wiki
if not (web = Web.find_by_address(old_address))
raise Instiki::ValidationError.new("Web with address '#{old_address}' does not exist")
end
old_files_path = web.files_path
web.update_attributes(:address => new_address, :name => name, :markup => markup, :color => color,
:additional_style => additional_style, :safe_mode => safe_mode, :password => password, :published => published,
@ -34,6 +35,19 @@ class Wiki
@webs = nil
raise Instiki::ValidationError.new("There is already a web with address '#{new_address}'") unless web.errors.on(:address).nil?
web
move_files(old_files_path, web.files_path)
end
def move_files(old_path, new_path)
return if new_path == old_path
default_path = Rails.root.join("webs", "files")
FileUtils.rmdir(new_path) if File.exist?(new_path)
if [old_path, new_path].include? default_path
File.rename(old_path, new_path)
FileUtils.rmdir(old_path.parent) unless old_path == default_path
else
File.rename(old_path.parent, new_path.parent)
end
end
def read_page(web_address, page_name)

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 == '..'
@ -46,7 +45,7 @@ class WikiFile < ActiveRecord::Base
end
def content_path
web.files_path + '/' + file_name
web.files_path.join(file_name)
end
def write_content_to_file
@ -59,6 +58,9 @@ class WikiFile < ActiveRecord::Base
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,7 +78,7 @@ 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)
@ -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

@ -18,7 +18,7 @@
onchange="proposeAddress();" /> &#xa0;&#xa0;
<label for="address">Address:</label> <input type="text" class="disableAutoComplete" id="address" name="address" value="<%= @web.address %>"
onchange="cleanAddress();" />
<small><em>(Letters and digits only)</em></small>
<em>(Letters and digits only)</em>
</div>
<h2 style="margin-bottom: 3px">Specialize</h2>
@ -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" />
@ -71,7 +71,8 @@
Stylesheet tweaks &gt;&gt;</a>
<em>
- add or change styles used by this web; styles defined here take precedence over
instiki.css. Hint: View HTML source of a page you want to style to find ID names on individual
instiki.css.<br/>
Hint: View HTML source of a page you want to style to find ID names on individual
tags.</em>
<br/>
<textarea id="additionalStyle" class="disableAutoComplete" cols="50" rows="20"
@ -96,10 +97,10 @@
<div class="help">
You can turn on a read-only version of this web that's accessible even when the regular web
is password protected.
The published version is accessible through URLs like /wiki/published/HomePage.
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

@ -15,7 +15,7 @@
<input type="text" name="author" id="authorName" value="<%= @author %>"
onclick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
<%- if @page -%>
| <%= link_to 'Cancel', :web => @web.address, :action => 'file'%> <small>(unlocks page)</small>
| <%= link_to 'Cancel', :web => @web.address, :action => 'file'%> <em>(unlocks page)</em>
<%- end -%>
</p>

View file

@ -16,19 +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, #TextileHelp h3 {
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, [actiontype="toggle"]:hover, #TextileHelp h3 {
color: #<%= @web ? @web.color : "393" %>;
}
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
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' 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'},
@ -41,7 +64,7 @@
<div id="Container">
<div id="Content">
<h1 id="pageName">
<%= render(:file => 'svg_logo') if @controller.xhtml_enabled? %>
<%= render(:file => 'svg_logo') if xhtml_enabled? %>
<%- if @page and (@page.name == 'HomePage') and %w( show published print ).include?(@action_name) -%>
<%= h(@web.name) + (@show_diff ? ' (changes)' : '') %>
<%- elsif @web -%>

View file

@ -12,10 +12,10 @@
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
color: #<%= @web ? @web.color : "393" %>;
}
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
<%= Rails.root.join('public', 'stylesheets', 'instiki.css').read if @inline_style %>
</style>
<%= stylesheet_link_tag 'instiki' unless @inline_style %>
<%= stylesheet_link_tag 'instiki', :media => 'all' unless @inline_style %>
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
<%= @style_additions %>
@ -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,15 +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>
<table cellspacing="0" cellpadding="0">
<tr><td>_your text_</td><td class="arrow">&#x2192;</td><td><em>your text</em></td></tr>
<tr><td>**your text**</td><td class="arrow">&#x2192;</td><td><strong>your text</strong></td></tr>
<tr><td>`my code`</td><td class="arrow">&#x2192;</td><td><code>my code</code></td></tr>
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">&#x2192;</td><td>&#8226; Bulleted list<br />&#8226; Second item</td></tr>
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">&#x2192;</td><td>1. Numbered list<br />2. Second item</td></tr>
<tr><td>Definition list<br />: is useful</td><td class="arrow">&#x2192;</td><td><dl style="display:inline"><dt>Definition list</dt><dd>is useful</dd></dl></td></tr>
<tr><td>[link name](URL)</td><td class="arrow">&#x2192;</td><td><a href="URL">link name</a></td></tr>
<tr><td>![Alt text](URL)</td><td class="arrow">&#x2192;</td><td>Image</td></tr>
<tr><td>## Header ##<br />### Subheader ###<br />#### Etc. ####</td><td class="arrow">&#x2192;</td><td><b><span style="font-size:1.2em">Header</span><br /><span style="font-size:1.1em">Subheader</span><br /><span style="font-size:1em">Etc.</span></b></td></tr>
<tr><td>***</td><td class="arrow">&#x2192;</td><td>Horizontal ruler</td></tr>
<tr><td>&lt;http://url><br />&lt;email@add.com></td><td class="arrow">&#x2192;</td><td>Auto-linked</td></tr>
</table>
<%= render(:file => "markdown_table") -%>

View file

@ -1,16 +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>
<table cellspacing="0" cellpadding="0">
<tr><td>_your text_</td><td class="arrow">&#x2192;</td><td><em>your text</em></td></tr>
<tr><td>**your text**</td><td class="arrow">&#x2192;</td><td><strong>your text</strong></td></tr>
<tr><td>`my code`</td><td class="arrow">&#x2192;</td><td><code>my code</code></td></tr>
<tr><td>$LaTeX code$</td><td class="arrow">&#x2192;</td><td>Insert an inline <br /> math expression</td></tr>
<tr><td>\[LaTeX code\]</td><td class="arrow">&#x2192;</td><td>Insert a math <br /> expression on <br /> its own line</td></tr>
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">&#x2192;</td><td>&#8226; Bulleted list<br />&#8226; Second item</td></tr>
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">&#x2192;</td><td>1. Numbered list<br />2. Second item</td></tr>
<tr><td>Definition list<br />: is useful</td><td class="arrow">&#x2192;</td><td><dl style="display:inline"><dt>Definition list</dt><dd>is useful</dd></dl></td></tr>
<tr><td>[link name](URL)</td><td class="arrow">&#x2192;</td><td><a href="URL">link name</a></td></tr>
<tr><td>![Alt text](URL)</td><td class="arrow">&#x2192;</td><td>Image</td></tr>
<tr><td>## Header ##<br />### Subheader ###<br />#### Etc. ####</td><td class="arrow">&#x2192;</td><td><b><span style="font-size:1.2em">Header</span><br /><span style="font-size:1.1em">Subheader</span><br /><span style="font-size:1em">Etc.</span></b></td></tr>
<tr><td>***</td><td class="arrow">&#x2192;</td><td>Horizontal ruler</td></tr>
<tr><td>&lt;http://url><br />&lt;email@add.com></td><td class="arrow">&#x2192;</td><td>Auto-linked</td></tr>
</table>
<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,14 +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>
<table cellspacing="0" cellpadding="0">
<tr><td>_your text_</td><td class="arrow">&#x2192;</td><td><em>your text</em></td></tr>
<tr><td>**your text**</td><td class="arrow">&#x2192;</td><td><strong>your text</strong></td></tr>
<tr><td>`my code`</td><td class="arrow">&#x2192;</td><td><code>my code</code></td></tr>
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">&#x2192;</td><td>&#8226; Bulleted list<br />&#8226; Second item</td></tr>
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">&#x2192;</td><td>1. Numbered list<br />2. Second item</td></tr>
<tr><td>Definition list<br />: is useful</td><td class="arrow">&#x2192;</td><td><dl style="display:inline"><dt>Definition list</dt><dd>is useful</dd></dl></td></tr>
<tr><td>[link name](URL)</td><td class="arrow">&#x2192;</td><td><a href="URL">link name</a></td></tr>
<tr><td>![Alt text](URL)</td><td class="arrow">&#x2192;</td><td>Image</td></tr>
<tr><td>## Header ##<br />### Subheader ###<br />#### Etc. ####</td><td class="arrow">&#x2192;</td><td><b><span style="font-size:1.2em">Header</span><br /><span style="font-size:1.1em">Subheader</span><br /><span style="font-size:1em">Etc.</span></b></td></tr>
<tr><td>***</td><td class="arrow">&#x2192;</td><td>Horizontal ruler</td></tr>
<tr><td>&lt;http://url><br />&lt;email@add.com></td><td class="arrow">&#x2192;</td><td>Auto-linked</td></tr>
</table>
<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

@ -0,0 +1,17 @@
<table cellspacing="0" cellpadding="0">
<tr><td>_your text_</td><td class="arrow">&#x2192;</td><td><em>your text</em></td></tr>
<tr><td>**your text**</td><td class="arrow">&#x2192;</td><td><strong>your text</strong></td></tr>
<tr><td>`my code`</td><td class="arrow">&#x2192;</td><td><code>my code</code></td></tr>
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">&#x2192;</td><td>&#8226; Bulleted list<br />&#8226; Second item</td></tr>
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">&#x2192;</td><td>1. Numbered list<br />2. Second item</td></tr>
<tr><td>Definition list<br />: is useful</td><td class="arrow">&#x2192;</td><td><dl style="display:inline"><dt>Definition list</dt><dd>is useful</dd></dl></td></tr>
<tr><td>[link name](URL)</td><td class="arrow">&#x2192;</td><td><a href="URL">link name</a></td></tr>
<tr><td>![Alt text](URL)</td><td class="arrow">&#x2192;</td><td>Image</td></tr>
<tr><td>## Header ##<br />### Subheader ###<br />#### Subsubhead####<br/>##### Etc. #####</td><td class="arrow">&#x2192;</td>
<td><b><span style="font-size:1.73em">Header</span>
<br/><span style="font-size:1.44em">Subheader</span><br/><span style="font-size:1.2em">Subsubhead</span>
<br/><span style="font-size:1em">Etc.</span></b></td></tr>
<tr><td>***</td><td class="arrow">&#x2192;</td><td>Horizontal rule</td></tr>
<tr><td>Some text[^fine] here.<br/>[^fine]: The fine print.</td><td class="arrow">&#x2192;</td><td>A footnote</td></tr>
<tr><td>*[LA]: Los Angeles<br/>*[ppm]: parts per million</td><td class="arrow">&#x2192;</td><td>Abbreviations</td></tr>
</table>

View file

@ -9,7 +9,8 @@ end
%>
<div class="navigation">
<% if params['action'] != 'published' then %>
<span class="skipNav"><a href='#navEnd'>Skip the Navigation Links</a> | </span>
<%- if params['action'] != 'published' then -%>
<%= list_item 'Home Page', {:action => 'show', :id => 'HomePage'}, 'Home, Sweet Home', 'H' %> |
<%= list_item 'All Pages', {:action => 'list'}, 'Alphabetically sorted list of pages', 'A' %> |
<%= list_item 'Recently Revised', {:action =>'recently_revised'}, 'Pages sorted by when they were last changed', 'U' %> |
@ -22,8 +23,9 @@ end
onfocus="this.value == 'Search' ? this.value = '' : true"
onblur="this.value == '' ? this.value = 'Search' : true" /></fieldset>
<% end %>
<% else %>
<%- else -%>
<%= list_item 'Home Page', {:action => 'published', :id => 'HomePage'}, 'Home, Sweet Home', 'H' %> |
<%= list_item 'Feeds', {:action => 'feeds'}, 'Subscribe to changes by Atom' %>
<% end%>
<% end-%>
<span id='navEnd'></span>
</div>

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,20 +1,19 @@
<h3>Textile formatting tips (<a href="http://hobix.com/textile/quick.html" onclick="quickRedReference(); return false;">advanced</a>)</h3>
<h3>Textile formatting tips (<a href="http://redcloth.org/hobix.com/textile/quick.html" onclick="quickRedReference(); return false;">advanced</a>)</h3>
<table cellspacing="0" cellpadding="0">
<tr><td>_your text_</td><td class="arrow">&rarr;</td><td><em>your text</em></td></tr>
<tr><td>*your text*</td><td class="arrow">&rarr;</td><td><strong>your text</strong></td></tr>
<tr><td>%{color:red}hello%</td><td class="arrow">&rarr;</td><td><span style="color: red;">hello</span></td></tr>
<tr><td style="padding-right:0.75em">%{color:red}hello%</td><td class="arrow">&rarr;</td><td><span style="color: red;">hello</span></td></tr>
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">&rarr;</td><td>&#8226; Bulleted list<br />&#8226; Second item</td></tr>
<tr><td># Numbered list<br /># Second item</td><td class="arrow">&rarr;</td><td>1. Numbered list<br />2. Second item</td></tr>
<tr><td>"linkname":URL</td><td class="arrow">&rarr;</td><td><a href="URL">linkname</a></td></tr>
<tr><td>|a|table|row|<br />|b|table|row|</td><td class="arrow">&rarr;</td><td>Table</td></tr>
<tr><td>http://url<br />email@address.com</td><td class="arrow">&rarr;</td><td>Auto-linked</td></tr>
<tr><td>!imageURL!</td><td class="arrow">&rarr;</td><td>Image</td></tr>
</table>
<script language="JavaScript">
function quickRedReference() {
window.open(
"http://hobix.com/textile/quick.html",
"http://redcloth.org/hobix.com/textile/quick.html",
"redRef",
"height=600,width=550,channelmode=0,dependent=0," +
"directories=0,fullscreen=0,location=0,menubar=0," +

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,12 +1,12 @@
<%-
@title = "Editing #{@page.name.escapeHTML}"
@title = "Editing #{@page.name.escapeHTML}".html_safe
@content_width = 720
@hide_navigation = true
-%>
<div id="MarkupHelp">
<%= render(:file => "#{@web.markup}_help") %>
<%= render(:file => 'wiki_words_help') %>
<%= render(:file => "#{@web.markup}_help") -%>
<%= render(:file => 'wiki_words_help') unless @web.brackets_only? -%>
</div>
<% form_tag({ :action => 'save', :web => @web.address, :id => @page.name },
@ -14,7 +14,7 @@
'accept-charset' => 'utf-8' }) do %>
<div>
<textarea name="content" id="content" rows="24" cols="60"><%= h(flash[:content] ||
((params['content'] && params['content'].is_utf8?) ? params['content'] : @page.content).purify) %></textarea>
(params['content'] ? params['content'] : @page.content).purify) %></textarea>
<% if @page_name != 'HomePage' -%>
<p>
<%= check_box_tag :alter_title, value = "1", checked=false,
@ -46,18 +46,19 @@ function toggleVisibility() {
var span = document.getElementById('title_change');
if (span.style.display =='inline') {
span.style.display ='none';
document.getElementById('new_name').value = "<%= @page.name %>";
document.getElementById('new_name').value = "<%= escape_javascript(@page.name) %>";
var content = document.getElementById('content').value
document.getElementById('content').value = content.replace(/\[\[!redirects <%= Regexp.escape(@page.name) %>\]\]\n/, '')
document.getElementById('content').value = content.replace(/\[\[!redirects <%= Regexp.escape(@page.name).gsub('/', '\\/') %>\]\]\n/, '')
}
else
span.style.display ='inline'
}
function addRedirect(){
if (document.getElementById('new_name').value != "<%= @page.name %>" ) {
var e = document.getElementById('new_name').value;
if ( e != "<%= escape_javascript(@page.name) %>" && e != '') {
var content = document.getElementById('content');
content.value = '[[!redirects <%= @page.name %>]]\n' + content.value
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.length == @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,12 +1,12 @@
<%-
@title = "Creating #{CGI.escapeHTML(WikiWords.separate(@page_name))}"
@title = "Creating #{WikiWords.separate(@page_name).escapeHTML}".html_safe
@content_width = 720
@hide_navigation = true
-%>
<div id="MarkupHelp">
<%= render(:file => "#{@web.markup}_help") %>
<%= render(:file => 'wiki_words_help') %>
<%= render(:file => "#{@web.markup}_help") -%>
<%= render(:file => 'wiki_words_help') unless @web.brackets_only? -%>
</div>
<div id="editForm">
@ -14,7 +14,7 @@
{ 'id' => 'editForm', 'method' => 'post', 'onsubmit' => 'cleanAuthorName();', 'accept-charset' => 'utf-8' }) do %>
<textarea name="content" id="content" rows="24" cols="60"><%= h(flash[:content] ||
( (params['content'] && params['content'].is_utf8?) ? params['content'] : '').purify ) %></textarea>
params['content'] ? params['content'].purify : '' ) %></textarea>
<div id="editFormButtons">
<input type="submit" value="Submit" accesskey="s"/> as
<%= text_field_tag :author, @author,
@ -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

@ -7,7 +7,7 @@
<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:
@ -45,6 +45,9 @@
{:id => 'view_S5'} %>
<%- end -%>
<%- end -%>
|
<%= link_to 'Source', {:web => @web.address, :action => 'source', :id => @page.name},
{:id => 'view_source', :rel => 'nofollow' } %>
</span>
<%= render :partial => 'inbound_links' %>

View file

@ -2,10 +2,9 @@
@title = @page.plain_name
@hide_navigation = true
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
@inline_style = true
-%>
<%= @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.length > 1 %>
<%- if page.rev_ids.size > 1 %>
<span class="views">
( <%= link_to_revision(page, page.revisions.length, 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,14 +1,12 @@
<%-
@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
-%>
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{params["msg"]}</small></p>" if params["msg"] %>
<div id="MarkupHelp">
<%= render(:file => "#{@web.markup}_help") %>
<%= render(:file => 'wiki_words_help') %>
<%= render(:file => "#{@web.markup}_help") -%>
<%= render(:file => 'wiki_words_help') unless @web.brackets_only? -%>
</div>
<% form_tag({:web => @web.address, :action => 'save', :id => @page.name},

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>
@ -13,15 +12,33 @@
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<link rel="stylesheet" href="/s5/themes/<%=@s5_theme%>/slides.css" type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="/s5/ui/core/outline.css" type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="/s5/ui/core/print.css" type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="/s5/ui/core/opera.css" type="text/css" media="projection" id="operaFix" />
<link rel="stylesheet" href="/s5/ui/core/math.css" type="text/css" media="all" id="mathStyle" />
<%= stylesheet_link_tag "/stylesheets/syntax.css", :media => 'all', :id => 'syntaxStyle' %>
<%= stylesheet_link_tag "/s5/ui/core/outline.css", :media => 'screen', :id => 'outlineStyle' %>
<%= stylesheet_link_tag "/s5/ui/core/print.css", :media => 'print', :id => 'slidePrint' %>
<%= stylesheet_link_tag "/s5/ui/core/opera.css", :media => 'projection', :id => 'operaFix' %>
<%= stylesheet_link_tag "/s5/ui/core/math.css", :media => 'all', :id => 'mathStyle' %>
<%= stylesheet_link_tag "/s5/themes/#{@s5_theme}/slides.css", :media => 'projection', :id => 'slideProj' %>
<!-- S5 JS -->
<script src="/s5/ui/core/slides.js" type="text/javascript"></script>
<script src="/javascripts/prototype.js" type="text/javascript"></script>
<%= 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 params["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 params["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
@ -35,4 +35,7 @@
expression. That's actually what Instiki uses, so go right ahead and flex your
"[a-z]*Leet?RegExpSkill(s|z)"
</p>
<p>
<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

@ -0,0 +1,64 @@
<!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>
<%- if @page and (@page.name == 'HomePage') -%>
<%= h(@web.name) %>
<%- else @web -%>
<%= @page.plain_name %> in <%= h @web.name %>
<%- end -%>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="<%= @robots_metatag_value %>" />
<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" %>;
}
<%= 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>".html_safe if @style_additions %>
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
<%= @web ? @web.additional_style : '' %>
/*]]>*/--></style>
<%= javascript_include_tag :defaults %>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
function updateSize(elt, w, h) {
// adjust to the size of the user's browser area.
// w and h are the original, unadjusted, width and height per row/column
var parentheight = document.viewport.getHeight();
var parentwidth = $('Container').getWidth();
elt.writeAttribute({'cols': Math.floor(parentwidth/w) - 1,
'rows': Math.floor(parentheight/h) - 2 });
elt.setStyle({Width: parentwidth, Height: parentheight});
}
function resizeableTextarea() {
//make the textarea resize to fit available space
$$('textarea#content').each( function(textarea) {
var w = textarea.getWidth()/textarea.getAttribute('cols');
var h = textarea.getStyle('lineHeight').replace(/(\d*)px/, "$1");
Event.observe(window, 'resize', function(){ updateSize(textarea, w, h) });
updateSize(textarea, w, h);
Form.Element.focus(textarea);
});
}
window.onload = function (){
resizeableTextarea();
}
//--><!]]>
</script>
</head>
<body>
<div id="Container">
<textarea id='content' readonly=' readonly' rows='24' cols='60' ><%= (@revision ? @revision.content : @page.content).purify %></textarea>
</div> <!-- Container -->
</body>
</html>

View file

@ -1,239 +1,3 @@
\documentclass[12pt,titlepage]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
<%- 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
% 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{\toggle}[2]{#1}
% 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

@ -15,11 +15,11 @@
<%- end -%>
<div class="byline" style="margin-bottom: 0px">
<%= web.pages.length %> page<% if web.pages.length != 1 %>s<% end %> by <%= web.authors.length %> author<% if web.authors.length != 1 %>s<% end %>
<%= web.pages.size %> page<% if web.pages.size != 1 %>s<% end %> by <%= web.authors.size %> author<% if web.authors.size != 1 %>s<% end %>
- 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>

View file

@ -1,207 +1,262 @@
# == Introduction
#
# This module provides sanitization of XHTML+MathML+SVG
# and of inline style attributes. Its genesis is {described here}[http://golem.ph.utexas.edu/~distler/blog/archives/001181.html].
#
# Uses the {HTML5lib parser}[http://code.google.com/p/html5lib/], so that the parsing behaviour should
# resemble that of browsers.
#
# sanitize_xhtml() is a case-sensitive sanitizer, suitable for XHTML
# sanitize_html() is a case-insensitive sanitizer suitable for HTML
# sanitize_rexml() sanitizes a REXML tree, returning a string
# safe_sanitize_xhtml() makes extra-sure that the result is well-formed XHTML
# by running the output of sanitize_xhtml() through REXML
#
# == Files
#
# {sanitize.rb}[http://golem.ph.utexas.edu/~distler/code/instiki/svn/lib/sanitize.rb],
# {HTML5lib}[http://golem.ph.utexas.edu/~distler/code/instiki/svn/vendor/plugins/HTML5lib/]
#
# == Author
#
# {Jacques Distler}[http://golem.ph.utexas.edu/~distler/]
#
# == License
#
# Ruby License
module Sanitize
# This module provides sanitization of XHTML+MathML+SVG
# and of inline style attributes.
require 'html5/html5parser'
require 'html5/liberalxmlparser'
require 'html5/treewalkers'
require 'html5/treebuilders'
require 'html5/serializer'
require 'html5/sanitizer'
require 'stringsupport.rb'
include HTML5
# Sanitize a string, parsed using XHTML parsing rules.
#
# Based heavily on Sam Ruby's code in the Universal FeedParser.
require 'html/tokenizer'
require 'node'
acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', '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']
mathml_elements = ['maction', 'math', 'merror', 'mfrac', 'mi',
'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom',
'mprescripts', 'mroot', 'mrow', 'mspace', 'msqrt', 'mstyle', 'msub',
'msubsup', 'msup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder',
'munderover', 'none']
svg_elements = ['a', 'animate', 'animateColor', 'animateMotion',
'animateTransform', 'circle', 'defs', 'desc', 'ellipse', 'font-face',
'font-face-name', 'font-face-src', 'g', 'glyph', 'hkern', 'image',
'linearGradient', 'line', 'marker', 'metadata', 'missing-glyph',
'mpath', 'path', 'polygon', 'polyline', 'radialGradient', 'rect',
'set', 'stop', 'svg', 'switch', 'text', 'title', 'tspan', 'use']
acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey',
'action', 'align', 'alt', 'axis', 'border', 'cellpadding',
'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class',
'clear', 'cols', 'colspan', 'color', 'compact', 'coords', 'datetime',
'dir', 'disabled', 'enctype', 'for', 'frame', 'headers', 'height',
'href', 'hreflang', 'hspace', 'id', 'ismap', 'label', 'lang',
'longdesc', 'maxlength', 'media', 'method', 'multiple', 'name',
'nohref', 'noshade', 'nowrap', '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']
mathml_attributes = ['actiontype', 'align', 'columnalign', 'columnalign',
'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'depth',
'display', 'displaystyle', 'equalcolumns', 'equalrows', 'fence',
'fontstyle', 'fontweight', 'frame', 'height', 'linethickness', 'lspace',
'mathbackground', 'mathcolor', 'mathvariant', 'mathvariant', 'maxsize',
'minsize', 'other', 'rowalign', 'rowalign', 'rowalign', 'rowlines',
'rowspacing', 'rowspan', 'rspace', 'scriptlevel', 'selection',
'separator', 'stretchy', 'width', 'width', 'xlink:href', 'xlink:show',
'xlink:type', 'xmlns', 'xmlns:xlink']
svg_attributes = ['accent-height', 'accumulate', 'additive', 'alphabetic',
'arabic-form', 'ascent', 'attributeName', 'attributeType',
'baseProfile', 'bbox', 'begin', 'by', 'calcMode', 'cap-height',
'class', 'color', 'color-rendering', 'content', 'cx', 'cy', 'd', 'dx',
'dy', 'descent', 'display', 'dur', 'end', 'fill', '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']
attr_val_is_uri = ['href', 'src', 'cite', 'action', 'longdesc', 'xlink:href']
acceptable_css_properties = ['azimuth', 'background-color',
'border-bottom-color', 'border-collapse', 'border-color',
'border-left-color', 'border-right-color', 'border-top-color', 'clear',
'color', 'cursor', 'direction', 'display', 'elevation', 'float', 'font',
'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight',
'height', 'letter-spacing', 'line-height', 'overflow', 'pause',
'pause-after', 'pause-before', 'pitch', 'pitch-range', 'richness',
'speak', 'speak-header', 'speak-numeral', 'speak-punctuation',
'speech-rate', 'stress', 'text-align', 'text-decoration', 'text-indent',
'unicode-bidi', 'vertical-align', 'voice-family', 'volume',
'white-space', 'width']
acceptable_css_keywords = ['auto', 'aqua', 'black', 'block', 'blue',
'bold', 'both', 'bottom', 'brown', 'center', 'collapse', 'dashed',
'dotted', 'fuchsia', 'gray', 'green', '!important', 'italic', 'left',
'lime', 'maroon', 'medium', 'none', 'navy', 'normal', 'nowrap', 'olive',
'pointer', 'purple', 'red', 'right', 'solid', 'silver', 'teal', 'top',
'transparent', 'underline', 'white', 'yellow']
acceptable_svg_properties = [ 'fill', 'fill-opacity', 'fill-rule',
'stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin',
'stroke-opacity']
acceptable_protocols = [ 'ed2k', 'ftp', 'http', 'https', 'irc',
'mailto', 'news', 'gopher', 'nntp', 'telnet', 'webcal',
'xmpp', 'callto', 'feed', 'urn', 'aim', 'rsync', 'tag',
'ssh', 'sftp', 'rtsp', 'afs' ]
ALLOWED_ELEMENTS = acceptable_elements + mathml_elements + svg_elements unless defined?(ALLOWED_ELEMENTS)
ALLOWED_ATTRIBUTES = acceptable_attributes + mathml_attributes + svg_attributes unless defined?(ALLOWED_ATTRIBUTES)
ALLOWED_CSS_PROPERTIES = acceptable_css_properties unless defined?(ALLOWED_CSS_PROPERTIES)
ALLOWED_CSS_KEYWORDS = acceptable_css_keywords unless defined?(ALLOWED_CSS_KEYWORDS)
ALLOWED_SVG_PROPERTIES = acceptable_svg_properties unless defined?(ALLOWED_SVG_PROPERTIES)
ALLOWED_PROTOCOLS = acceptable_protocols unless defined?(ALLOWED_PROTOCOLS)
ATTR_VAL_IS_URI = attr_val_is_uri unless defined?(ATTR_VAL_IS_URI)
# Sanitize the +html+, escaping all elements not in ALLOWED_ELEMENTS, and stripping out all
# attributes not in ALLOWED_ATTRIBUTES. Style attributes are parsed, and a restricted set,
# specified by ALLOWED_CSS_PROPERTIES and ALLOWED_CSS_KEYWORDS, are allowed through.
# attributes in ATTR_VAL_IS_URI are scanned, and only URI schemes specified in
# ALLOWED_PROTOCOLS are allowed.
# You can adjust what gets sanitized, by defining these constant arrays before this Module is loaded.
# :call-seq:
# sanitize_xhtml(string) -> string
# sanitize_xhtml(string, {:encoding => 'iso-8859-1', :to_tree => true}) -> REXML::Document
#
# sanitize_html('<script> do_nasty_stuff() </script>')
# => &lt;script> do_nasty_stuff() &lt;/script>
# sanitize_html('<a href="javascript: sucker();">Click here for $100</a>')
# => <a>Click here for $100</a>
def sanitize_html(html)
if html.index("<")
tokenizer = HTML::Tokenizer.new(html)
new_text = ""
while token = tokenizer.next
node = XHTML::Node.parse(nil, 0, 0, token, false)
new_text << case node.tag?
when true
if ALLOWED_ELEMENTS.include?(node.name)
if node.closing != :close
node.attributes.delete_if { |attr,v| !ALLOWED_ATTRIBUTES.include?(attr) }
ATTR_VAL_IS_URI.each do |attr|
val_unescaped = CGI.unescapeHTML(node.attributes[attr].to_s).gsub(/[\000-\040\177\s]+|\302*[\200-\240]/,'').downcase
if val_unescaped =~ /^[a-z0-9][-+.a-z0-9]*:/ and !ALLOWED_PROTOCOLS.include?(val_unescaped.split(':')[0])
node.attributes.delete attr
end
end
if node.attributes['style']
node.attributes['style'] = sanitize_css(node.attributes['style'])
end
end
node.to_s
# Unless otherwise specified, the string is assumed to be utf-8 encoded.
# By default, the output is a string. But, optionally, you can return a REXML tree.
#
# The string returned is utf-8 encoded. If you want, you can use iconv to convert it to some other encoding.
# (REXML trees are always utf-8 encoded.)
def sanitize_xhtml(html, options = {})
@encoding = 'utf-8'
@treebuilder = TreeBuilders::REXML::TreeBuilder
@to_tree = false
options.each do |name, value|
next unless %w(encoding treebuilder to_tree).include? name.to_s
if name.to_s == 'treebuilder'
@treebuilder = HTML5lib::TreeBuilders.get_tree_builder(value)
else
node.to_s.gsub(/</, "&lt;")
instance_variable_set("@#{name}", value)
end
end
if @encoding == 'utf-8'
parsed = XHTMLParser.parse_fragment(html.to_utf8, {:tokenizer => HTMLSanitizer,
:lowercase_element_name => false, :lowercase_attr_name => false,
:encoding => @encoding, :tree => @treebuilder })
else
node.to_s.gsub(/</, "&lt;")
parsed = XHTMLParser.parse_fragment(html.to_ncr, {:tokenizer => HTMLSanitizer,
:lowercase_element_name => false, :lowercase_attr_name => false,
:encoding => @encoding, :tree => @treebuilder })
end
return parsed if @to_tree
return parsed.to_s
end
# Sanitize a string, parsed using XHTML parsing rules. Reparse the result to
# ensure well-formedness.
#
# :call-seq:
# safe_sanitize_xhtml(string) -> string
#
# Unless otherwise specified, the string is assumed to be utf-8 encoded.
#
# The string returned is utf-8 encoded. If you want, you can use iconv to convert it to some other encoding.
# (REXML trees are always utf-8 encoded.)
def safe_sanitize_xhtml(html, options = {})
options[:to_tree] = false
sanitized = sanitize_xhtml(html, options)
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
sanitized = sanitized.escapeHTML
end
# Sanitize a string, parsed using HTML parsing rules.
#
# :call-seq:
# sanitize_html( string ) -> string
# sanitize_html( string, {:encoding => 'iso-8859-1', :to_tree => true} ) -> REXML::Document
#
# Unless otherwise specified, the string is assumed to be utf-8 encoded.
# By default, the output is a string. But, optionally, you can return a REXML tree.
#
# The string returned is utf-8 encoded. If you want, you can use iconv to convert it to some other encoding.
# (REXML trees are always utf-8 encoded.)
def sanitize_html(html, options = {})
@encoding = 'utf-8'
@treebuilder = TreeBuilders::REXML::TreeBuilder
@to_tree = false
options.each do |name, value|
next unless %w(encoding treebuilder to_tree).include? name.to_s
if name.to_s == 'treebuilder'
@treebuilder = HTML5lib::TreeBuilders.get_tree_builder(value)
else
instance_variable_set("@#{name}", value)
end
end
if @encoding == 'utf-8'
parsed = HTMLParser.parse_fragment(html.to_utf8, {:tokenizer => HTMLSanitizer,
:encoding => @encoding, :tree => @treebuilder })
else
parsed = HTMLParser.parse_fragment(html.to_ncr, {:tokenizer => HTMLSanitizer,
:encoding => @encoding, :tree => @treebuilder })
end
return parsed if @to_tree
return parsed.to_s
end
# Sanitize a REXML tree. The output is a string.
#
# :call-seq:
# sanitize_rexml(tree) -> string
#
def sanitize_rexml(tree)
tokens = TreeWalkers.get_tree_walker('rexml2').new(tree)
XHTMLSerializer.serialize(tokens, {:encoding=>'utf-8',
:space_before_trailing_solidus => true,
:inject_meta_charset => false,
:sanitize => true})
end
end
html = new_text
end
html
require 'rexml/element'
module REXML #:nodoc:
class Element
# Convert XHTML+MathML Named Entities in a REXML::Element to Numeric Character References
#
# :call-seq:
# tree.to_ncr -> REXML::Element
#
# REXML, typically, converts NCRs to utf-8 characters, which is what you'll see when you
# access the resulting REXML document.
#
# Note that this method needs to traverse the entire tree, converting text nodes and attributes
# for each element. This can be SLOW. It will often be faster to serialize to a string and then
# use String.to_ncr instead.
#
def to_ncr
self.each_element { |el|
el.texts.each_index {|i|
el.texts[i].value = el.texts[i].to_s.to_ncr
}
el.attributes.each { |name,val|
el.attributes[name] = val.to_ncr
}
el.to_ncr if el.has_elements?
}
return self
end
def sanitize_css(style)
# disallow urls
style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
# gauntlet
if style !~ /^([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/
style = ''
return style
end
if style !~ /^(\s*[-\w]+\s*:\s*[^:;]*(;|$))*$/
style = ''
return style
# Convert XHTML+MathML Named Entities in a REXML::Element to UTF-8
#
# :call-seq:
# tree.to_utf8 -> REXML::Element
#
# Note that this method needs to traverse the entire tree, converting text nodes and attributes
# for each element. This can be SLOW. It will often be faster to serialize to a string and then
# use String.to_utf8 instead.
#
def to_utf8
self.each_element { |el|
el.texts.each_index {|i|
el.texts[i].value = el.texts[i].to_s.to_utf8
}
el.attributes.each { |name,val|
el.attributes[name] = val.to_utf8
}
el.to_utf8 if el.has_elements?
}
return self
end
clean = []
style.scan(/([-\w]+)\s*:\s*([^:;]*)/) do |prop,val|
if ALLOWED_CSS_PROPERTIES.include?(prop.downcase)
clean << prop + ': ' + val + ';'
elsif ['background','border','margin','padding'].include?(prop.split('-')[0].downcase)
goodval = true
val.split().each do |keyword|
if !ALLOWED_CSS_KEYWORDS.include?(keyword) and
keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/
goodval = false
end
end
if goodval
clean << prop + ': ' + val + ';'
end
elsif ALLOWED_SVG_PROPERTIES.include?(prop.downcase)
clean << prop + ': ' + val + ';'
end
end
style = clean.join(' ')
module HTML5 #:nodoc: all
module TreeWalkers
private
class << self
def [](name)
case name.to_s.downcase
when 'rexml'
require 'html5/treewalkers/rexml'
REXML::TreeWalker
when 'rexml2'
REXML2::TreeWalker
else
raise "Unknown TreeWalker #{name}"
end
end
alias :get_tree_walker :[]
end
module REXML2
class TreeWalker < HTML5::TreeWalkers::NonRecursiveTreeWalker
private
def node_details(node)
case node
when ::REXML::Document
[:DOCUMENT]
when ::REXML::Element
if !node.name
[:DOCUMENT_FRAGMENT]
else
[:ELEMENT, node.name,
node.attributes.map {|name,value| [name,value.to_utf8]},
node.has_elements? || node.has_text?]
end
when ::REXML::Text
[:TEXT, node.value.to_utf8]
when ::REXML::Comment
[:COMMENT, node.string]
when ::REXML::DocType
[:DOCTYPE, node.name, node.public, node.system]
when ::REXML::XMLDecl
[nil]
else
[:UNKNOWN, node.class.inspect]
end
end
def first_child(node)
node.children.first
end
def next_sibling(node)
node.next_sibling
end
def parent(node)
node.parent
end
end
end
end
end

View file

@ -1,187 +1,189 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '/../test_helper'))
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
require 'sanitize'
require 'json'
class SanitizeTest < Test::Unit::TestCase
include Sanitize
def setup
end
Sanitize::ALLOWED_ELEMENTS.each do |tag_name|
def do_sanitize_xhtml stream
safe_sanitize_xhtml(stream)
end
def check_sanitization(input, htmloutput, xhtmloutput, rexmloutput)
assert_equal htmloutput, do_sanitize_xhtml(input)
end
def rexml_doc(string)
REXML::Document.new(
"<div xmlns='http://www.w3.org/1999/xhtml'>#{string}</div>")
end
def my_rex(string)
sanitize_rexml(rexml_doc(string.to_utf8)).gsub(/\A<div xmlns="http:\/\/www.w3.org\/1999\/xhtml">(.*)<\/div>\Z/m, '\1')
end
def test_sanitize_named_entities
input = '<p>Greek &phis; &phi;, double-struck &Aopf;, numeric &#x1D538; &#8279;, uppercase &TRADE; &LT;</p>'
output = "<p>Greek \317\225 \317\206, double-struck \360\235\224\270, numeric \360\235\224\270 \342\201\227, uppercase \342\204\242 &lt;</p>"
output2 = "<p>Greek \317\225 \317\206, double-struck \360\235\224\270, numeric &#x1D538; &#8279;, uppercase \342\204\242 &lt;</p>"
assert_equal(output, sanitize_xhtml(input))
assert_equal(output, sanitize_html(input))
assert_equal(output, my_rex(input))
assert_equal(output2, input.to_utf8)
end
def test_sanitize_malformed_utf8
input = "<p>\357elephant &AMP; \302ivory</p>"
output = "<p>\357\277\275elephant &amp; \357\277\275ivory</p>"
check_sanitization(input, output, output, output)
end
Sanitizer::ALLOWED_ELEMENTS.each do |tag_name|
define_method "test_should_allow_#{tag_name}_tag" do
assert_equal "<#{tag_name} title=\"1\">foo &lt;bad>bar&lt;/bad> baz</#{tag_name}>",
sanitize_html("<#{tag_name} title='1'>foo <bad>bar</bad> baz</#{tag_name}>")
input = "<#{tag_name} title='1'>foo <bad>bar</bad> baz</#{tag_name}>"
htmloutput = "<#{tag_name.downcase} title='1'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</#{tag_name.downcase}>"
xhtmloutput = "<#{tag_name} title='1'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</#{tag_name}>"
rexmloutput = xhtmloutput
if %w[caption colgroup optgroup option tbody td tfoot th thead tr].include?(tag_name)
htmloutput = "foo &lt;bad&gt;bar&lt;/bad&gt; baz"
xhtmloutput = htmloutput
elsif tag_name == 'col'
htmloutput = "foo &lt;bad&gt;bar&lt;/bad&gt; baz"
xhtmloutput = htmloutput
rexmloutput = "<col title='1' />"
elsif tag_name == 'table'
htmloutput = "foo &lt;bad&gt;bar&lt;/bad&gt;baz<table title='1'> </table>"
xhtmloutput = htmloutput
elsif tag_name == 'image'
htmloutput = "<img title='1'/>foo &lt;bad&gt;bar&lt;/bad&gt; baz"
xhtmloutput = htmloutput
rexmloutput = "<image title='1'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</image>"
elsif VOID_ELEMENTS.include?(tag_name)
htmloutput = "<#{tag_name} title='1'/>foo &lt;bad&gt;bar&lt;/bad&gt; baz"
xhtmloutput = htmloutput
htmloutput += '<br/>' if tag_name == 'br'
rexmloutput = "<#{tag_name} title='1' />"
end
check_sanitization(input, xhtmloutput, xhtmloutput, rexmloutput)
end
end
Sanitize::ALLOWED_ELEMENTS.each do |tag_name|
Sanitizer::ALLOWED_ELEMENTS.each do |tag_name|
define_method "test_should_forbid_#{tag_name.upcase}_tag" do
assert_equal "&lt;#{tag_name.upcase} title=\"1\">foo &lt;bad>bar&lt;/bad> baz&lt;/#{tag_name.upcase}>",
sanitize_html("<#{tag_name.upcase} title='1'>foo <bad>bar</bad> baz</#{tag_name.upcase}>")
input = "<#{tag_name.upcase} title='1'>foo <bad>bar</bad> baz</#{tag_name.upcase}>"
output = "&lt;#{tag_name.upcase} title=\"1\"&gt;foo &lt;bad&gt;bar&lt;/bad&gt; baz&lt;/#{tag_name.upcase}&gt;"
xhtmloutput = "&lt;#{tag_name.upcase} title='1'&gt;foo &lt;bad&gt;bar&lt;/bad&gt; baz&lt;/#{tag_name.upcase}&gt;"
check_sanitization(input, output, xhtmloutput, output)
end
end
Sanitize::ALLOWED_ATTRIBUTES.each do |attribute_name|
if attribute_name != 'style'
Sanitizer::ALLOWED_ATTRIBUTES.each do |attribute_name|
next if attribute_name == 'style' || attribute_name.include?(':')
define_method "test_should_allow_#{attribute_name}_attribute" do
assert_equal "<p #{attribute_name}=\"foo\">foo &lt;bad>bar&lt;/bad> baz</p>",
sanitize_html("<p #{attribute_name}='foo'>foo <bad>bar</bad> baz</p>")
end
input = "<p #{attribute_name}='foo'>foo <bad>bar</bad> baz</p>"
output = "<p #{attribute_name}='foo'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</p>"
htmloutput = "<p #{attribute_name.downcase}='foo'>foo &lt;bad&gt;bar&lt;/bad&gt; baz</p>"
check_sanitization(input, output, output, output)
end
end
Sanitize::ALLOWED_ATTRIBUTES.each do |attribute_name|
Sanitizer::ALLOWED_ATTRIBUTES.each do |attribute_name|
define_method "test_should_forbid_#{attribute_name.upcase}_attribute" do
assert_equal "<p>foo &lt;bad>bar&lt;/bad> baz</p>",
sanitize_html("<p #{attribute_name.upcase}='display: none;'>foo <bad>bar</bad> baz</p>")
input = "<p #{attribute_name.upcase}='display: none;'>foo <bad>bar</bad> baz</p>"
output = "<p>foo &lt;bad&gt;bar&lt;/bad&gt; baz</p>"
check_sanitization(input, output, output, output)
end
end
Sanitize::ALLOWED_PROTOCOLS.each do |protocol|
Sanitizer::ALLOWED_PROTOCOLS.each do |protocol|
define_method "test_should_allow_#{protocol}_uris" do
assert_equal "<a href=\"#{protocol}\">foo</a>",
sanitize_html(%(<a href="#{protocol}">foo</a>))
input = %(<a href="#{protocol}">foo</a>)
output = "<a href='#{protocol}'>foo</a>"
check_sanitization(input, output, output, output)
end
end
Sanitize::ALLOWED_PROTOCOLS.each do |protocol|
Sanitizer::ALLOWED_PROTOCOLS.each do |protocol|
define_method "test_should_allow_uppercase_#{protocol}_uris" do
assert_equal "<a href=\"#{protocol.upcase}\">foo</a>",
sanitize_html(%(<a href="#{protocol.upcase}">foo</a>))
input = %(<a href="#{protocol.upcase}">foo</a>)
output = "<a href='#{protocol.upcase}'>foo</a>"
check_sanitization(input, output, output, output)
end
end
def test_should_allow_anchors
assert_equal "<a href=\"foo\">&lt;script>baz&lt;/script></a>",
sanitize_html("<a href='foo' onclick='bar'><script>baz</script></a>")
Sanitizer::SVG_ALLOW_LOCAL_HREF.each do |tag_name|
next unless Sanitizer::ALLOWED_ELEMENTS.include?(tag_name)
define_method "test_#{tag_name}_should_allow_local_href_with_ns_decl" do
input = %(<#{tag_name} xlink:href="#foo" xmlns:xlink='http://www.w3.org/1999/xlink'/>)
output = "<#{tag_name.downcase} xlink:href='#foo' xmlns:xlink='http://www.w3.org/1999/xlink'/>"
xhtmloutput = "<#{tag_name} xlink:href='#foo' xmlns:xlink='http://www.w3.org/1999/xlink'/>"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
# RFC 3986, sec 4.2
def test_allow_colons_in_path_component
assert_equal "<a href=\"./this:that\">foo</a>",
sanitize_html("<a href=\"./this:that\">foo</a>")
define_method "test_#{tag_name}_should_allow_local_href_with_newline_and_ns_decl" do
input = %(<#{tag_name} xlink:href="\n#foo" xmlns:xlink='http://www.w3.org/1999/xlink'/>)
output = "<#{tag_name.downcase} xlink:href='\n#foo' xmlns:xlink='http://www.w3.org/1999/xlink'/>"
xhtmloutput = "<#{tag_name} xlink:href='\n#foo' xmlns:xlink='http://www.w3.org/1999/xlink'/>"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
%w(src width height alt).each do |img_attr|
define_method "test_should_allow_image_#{img_attr}_attribute" do
assert_equal "<img #{img_attr}=\"foo\" />",
sanitize_html("<img #{img_attr}='foo' onclick='bar' />")
define_method "test_#{tag_name}_should_forbid_local_href_without_ns_decl" do
input = %(<#{tag_name} xlink:href="#foo"/>)
output = "&lt;#{tag_name.downcase} xlink:href='#foo'/>"
xhtmloutput = "&lt;#{tag_name} xlink:href=&#39;#foo&#39;&gt;&lt;/#{tag_name}&gt;"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
define_method "test_#{tag_name}_should_forbid_local_href_with_newline_without_ns_decl" do
input = %(<#{tag_name} xlink:href="\n#foo"/>)
output = "&lt;#{tag_name.downcase} xlink:href='\n#foo'/>"
xhtmloutput = "&lt;#{tag_name} xlink:href=&#39;\n#foo&#39;&gt;&lt;/#{tag_name}&gt;"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
define_method "test_#{tag_name}_should_forbid_nonlocal_href_with_ns_decl" do
input = %(<#{tag_name} xlink:href="http://bad.com/foo" xmlns:xlink='http://www.w3.org/1999/xlink'/>)
output = "<#{tag_name.downcase} xmlns:xlink='http://www.w3.org/1999/xlink'/>"
xhtmloutput = "<#{tag_name} xmlns:xlink='http://www.w3.org/1999/xlink'/>"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
define_method "test_#{tag_name}_should_forbid_nonlocal_href_with_newline_and_ns_decl" do
input = %(<#{tag_name} xlink:href="\nhttp://bad.com/foo" xmlns:xlink='http://www.w3.org/1999/xlink'/>)
output = "<#{tag_name.downcase} xmlns:xlink='http://www.w3.org/1999/xlink'/>"
xhtmloutput = "<#{tag_name} xmlns:xlink='http://www.w3.org/1999/xlink'/>"
check_sanitization(input, xhtmloutput, xhtmloutput, xhtmloutput)
end
end
def test_should_handle_non_html
assert_equal 'abc', sanitize_html("abc")
def test_should_handle_astral_plane_characters
input = "<p>&#x1d4b5; &#x1d538;</p>"
output = "<p>\360\235\222\265 \360\235\224\270</p>"
check_sanitization(input, output, output, output)
input = "<p><tspan>\360\235\224\270</tspan> a</p>"
output = "<p><tspan>\360\235\224\270</tspan> a</p>"
check_sanitization(input, output, output, output)
end
def test_should_handle_blank_text
assert_equal '', sanitize_html('')
end
[%w(img src), %w(a href)].each do |(tag, attr)|
define_method "test_should_strip_#{attr}_attribute_in_#{tag}_with_bad_protocols" do
assert_equal %(<#{tag} title="1">boo</#{tag}>), sanitize_html(%(<#{tag} #{attr}="javascript:XSS" title="1">boo</#{tag}>))
JSON::parse(open(File.expand_path(File.join(File.dirname(__FILE__), '/../sanitizer.dat'))).read).each do |test|
define_method "test_#{test['name']}" do
check_sanitization(
test['input'],
test['output'],
test['xhtml'] || test['output'],
test['rexml'] || test['output']
)
end
end
[%w(img src), %w(a href)].each do |(tag, attr)|
define_method "test_should_strip_#{attr}_attribute_in_#{tag}_with_bad_protocols_and_whitespace" do
assert_equal %(<#{tag} title="1">boo</#{tag}>), sanitize_html(%(<#{tag} #{attr}=" javascript:XSS" title="1">boo</#{tag}>))
end
end
[%(<img src="javascript:alert('XSS');" />),
%(<img src=javascript:alert('XSS') />),
%(<img src="JaVaScRiPt:alert('XSS')" />),
%(<img src='javascript:alert(&quot;XSS&quot;)' />),
%(<img src='javascript:alert(String.fromCharCode(88,83,83))' />),
%(<img src='&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;' />),
%(<img src='&#0000106;&#0000097;&#0000118;&#0000097;&#0000115;&#0000099;&#0000114;&#0000105;&#0000112;&#0000116;&#0000058;&#0000097;&#0000108;&#0000101;&#0000114;&#0000116;&#0000040;&#0000039;&#0000088;&#0000083;&#0000083;&#0000039;&#0000041' />),
%(<img src='&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;&#x61;&#x6C;&#x65;&#x72;&#x74;&#x28;&#x27;&#x58;&#x53;&#x53;&#x27;&#x29' />),
%(<img src="jav\tascript:alert('XSS');" />),
%(<img src="jav&#x09;ascript:alert('XSS');" />),
%(<img src="jav&#x0A;ascript:alert('XSS');" />),
%(<img src="jav&#x0D;ascript:alert('XSS');" />),
%(<img src=" &#14; javascript:alert('XSS');" />),
%(<img src="&#x20;javascript:alert('XSS');" />),
%(<img src="&#xA0;javascript:alert('XSS');" />)].each_with_index do |img_hack, i|
define_method "test_should_not_fall_for_xss_image_hack_#{i}" do
assert_equal "<img />", sanitize_html(img_hack)
end
end
def test_should_sanitize_tag_broken_up_by_null
assert_equal "&lt;scr>alert(\"XSS\")&lt;/scr>", sanitize_html(%(<scr\0ipt>alert(\"XSS\")</scr\0ipt>))
end
def test_should_sanitize_invalid_script_tag
assert_equal "&lt;script />&lt;/script>", sanitize_html(%(<script/XSS SRC="http://ha.ckers.org/xss.js"></script>))
end
def test_should_sanitize_script_tag_with_multiple_open_brackets
assert_equal "&lt;&lt;script>alert(\"XSS\");//&lt;&lt;/script>", sanitize_html(%(<<script>alert("XSS");//<</script>))
assert_equal %(&lt;iframe src="http:" />&lt;), sanitize_html(%(<iframe src=http://ha.ckers.org/scriptlet.html\n<))
end
def test_should_sanitize_unclosed_script
assert_equal "&lt;script src=\"http:\" /><b>", sanitize_html(%(<script src=http://ha.ckers.org/xss.js?<b>))
end
def test_should_sanitize_half_open_scripts
assert_equal "<img>", sanitize_html(%(<img src="javascript:alert('XSS')"))
end
def test_should_not_fall_for_ridiculous_hack
img_hack = %(<img\nsrc\n=\n"\nj\na\nv\na\ns\nc\nr\ni\np\nt\n:\na\nl\ne\nr\nt\n(\n'\nX\nS\nS\n'\n)\n"\n />)
assert_equal "<img />", sanitize_html(img_hack)
end
def test_platypus
assert_equal %(<a href=\"http://www.ragingplatypus.com/\" style=\"display: block; width: 100%; height: 100%; background-color: black; background-image: ; background-x: center; background-y: center;\">never trust your upstream platypus</a>),
sanitize_html(%(<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a>))
end
def test_xul
assert_equal %(<p style="">fubar</p>),
sanitize_html(%(<p style="-moz-binding:url('http://ha.ckers.org/xssmoz.xml#xss')">fubar</p>))
end
def test_input_image
assert_equal %(<input type="image" />),
sanitize_html(%(<input type="image" src="javascript:alert('XSS');" />))
end
def test_non_alpha_non_digit
assert_equal "&lt;script />&lt;/script>",
sanitize_html(%(<script/XSS src="http://ha.ckers.org/xss.js"></script>))
assert_equal "<a>foo</a>",
sanitize_html('<a onclick!#$%&()*~+-_.,:;?@[/|\]^`=alert("XSS")>foo</a>')
assert_equal "<img />",
sanitize_html('<img/src="http://ha.ckers.org/xss.js"/>')
end
def test_img_dynsrc_lowsrc
assert_equal "<img />",
sanitize_html(%(<img dynsrc="javascript:alert('XSS')" />))
assert_equal "<img />",
sanitize_html(%(<img lowsrc="javascript:alert('XSS')" />))
end
def test_div_background_image_unicode_encoded
assert_equal '<div style="">foo</div>',
sanitize_html(%(<div style="background-image:\0075\0072\006C\0028'\006a\0061\0076\0061\0073\0063\0072\0069\0070\0074\003a\0061\006c\0065\0072\0074\0028.1027\0058.1053\0053\0027\0029'\0029">foo</div>))
end
def test_div_expression
assert_equal '<div style="">foo</div>',
sanitize_html(%(<div style="width: expression(alert('XSS'));">foo</div>))
end
def test_img_vbscript
assert_equal '<img />',
sanitize_html(%(<img src='vbscript:msgbox("XSS")' />))
end
end

View file

@ -1,5 +1,6 @@
require 'cgi'
require 'html5/tokenizer'
require 'set'
module HTML5
@ -19,25 +20,25 @@ module HTML5
module HTMLSanitizeModule
ACCEPTABLE_ELEMENTS = %w[a abbr acronym address area audio b big blockquote br
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]
MATHML_ELEMENTS = %w[annotation annotation-xml maction math merror mfrac
MATHML_ELEMENTS = Set.new %w[annotation annotation-xml maction math 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 = %w[a animate animateColor animateMotion animateTransform
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]
ACCEPTABLE_ATTRIBUTES = %w[abbr accept accept-charset accesskey action
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
@ -46,7 +47,7 @@ module HTML5
selected shape size span src start style summary tabindex target title
type usemap valign value vspace width xml:lang]
MATHML_ATTRIBUTES = %w[actiontype align close columnalign columnalign
MATHML_ATTRIBUTES = Set.new %w[actiontype align close columnalign columnalign
columnalign columnlines columnspacing columnspan depth display
displaystyle encoding equalcolumns equalrows fence fontstyle fontweight
frame height linethickness lspace mathbackground mathcolor mathvariant
@ -54,7 +55,7 @@ module HTML5
rowspacing rowspan rspace scriptlevel selection separator separators
stretchy width width xlink:href xlink:show xlink:type xmlns xmlns:xlink]
SVG_ATTRIBUTES = %w[accent-height accumulate additive alphabetic
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
content cx cy d dx dy descent display dur end fill fill-opacity fill-rule
@ -76,16 +77,16 @@ module HTML5
xlink:show xlink:title xlink:type xml:base xml:lang xml:space xmlns
xmlns:xlink y y1 y2 zoomAndPan]
ATTR_VAL_IS_URI = %w[href src cite action longdesc xlink:href xml:base]
ATTR_VAL_IS_URI = Set.new %w[href src cite action longdesc xlink:href xml:base]
SVG_ATTR_VAL_ALLOWS_REF = %w[clip-path color-profile cursor fill
SVG_ATTR_VAL_ALLOWS_REF = Set.new %w[clip-path color-profile cursor fill
filter marker marker-start marker-mid marker-end mask stroke]
SVG_ALLOW_LOCAL_HREF = %w[altGlyph animate animateColor animateMotion
SVG_ALLOW_LOCAL_HREF = Set.new %w[altGlyph animate animateColor animateMotion
animateTransform cursor feImage filter linearGradient pattern
radialGradient textpath tref set use]
ACCEPTABLE_CSS_PROPERTIES = %w[azimuth background-color
ACCEPTABLE_CSS_PROPERTIES = Set.new %w[azimuth background-color
border-bottom-color border-collapse border-color border-left-color
border-right-color border-top-color clear color cursor direction
display elevation float font font-family font-size font-style
@ -95,16 +96,16 @@ module HTML5
text-align text-decoration text-indent unicode-bidi vertical-align
voice-family volume white-space width]
ACCEPTABLE_CSS_KEYWORDS = %w[auto aqua black block blue bold both bottom
ACCEPTABLE_CSS_KEYWORDS = Set.new %w[auto aqua black block blue bold both bottom
brown center collapse dashed dotted fuchsia gray green !important
italic left lime maroon medium none navy normal nowrap olive pointer
purple red right solid silver teal top transparent underline white
yellow]
ACCEPTABLE_SVG_PROPERTIES = %w[fill fill-opacity fill-rule stroke
ACCEPTABLE_SVG_PROPERTIES = Set.new %w[fill fill-opacity fill-rule stroke
stroke-width stroke-linecap stroke-linejoin stroke-opacity]
ACCEPTABLE_PROTOCOLS = %w[ed2k ftp http https irc mailto news gopher nntp
ACCEPTABLE_PROTOCOLS = Set.new %w[ed2k ftp http https irc mailto news gopher nntp
telnet webcal xmpp callto feed urn aim rsync tag ssh sftp rtsp afs]
# subclasses may define their own versions of these constants

Some files were not shown because too many files have changed in this diff Show more