refinerycms 0.9.6.34 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -8
- data/Gemfile +50 -0
- data/Rakefile +1 -1
- data/bin/refinery +22 -11
- data/bin/refinery-update-core +45 -27
- data/changelog.md +313 -0
- data/config.ru +5 -0
- data/config/acts_as_indexed_config.rb +7 -0
- data/config/amazon_s3.yml.example +3 -3
- data/config/application.rb +7 -11
- data/config/boot.rb +15 -1
- data/config/cucumber.yml +8 -0
- data/config/database.yml.example +24 -0
- data/config/environments/cucumber.rb +27 -0
- data/config/environments/development.rb +0 -1
- data/config/environments/production.rb +2 -1
- data/config/i18n-js.yml +6 -0
- data/config/initializers/field_with_error_fix.rb +3 -0
- data/config/preinitializer.rb +20 -18
- data/config/routes.rb +8 -3
- data/db/migrate/20100125003944_rename_title_to_name_on_user_plugins.rb +9 -0
- data/db/migrate/20100125033146_migrate_old_plugin_titles_to_plugin_names_for_users.rb +61 -0
- data/db/migrate/20100419001048_change_image_grid_thumbnail_size_and_regenerate.rb +13 -0
- data/db/migrate/20100522020225_rename_permissions_for_resources_plugin_to_files.rb +15 -0
- data/db/migrate/20100525084518_remove_take_down_for_maintenance_page.rb +19 -0
- data/db/migrate/20100525110237_add_small_and_large_thumbnail_sizes.rb +14 -0
- data/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb +31 -0
- data/db/migrate/20100606173919_create_page_translations.rb +12 -0
- data/db/migrate/20100608062447_add_scoping_to_refinery_settings.rb +9 -0
- data/db/migrate/20100623220402_add_restricted_to_refinery_settings.rb +9 -0
- data/db/migrate/20100624024501_add_roles.rb +24 -0
- data/db/migrate/20100629081543_add_callback_proc_as_string_to_refinery_settings.rb +9 -0
- data/db/migrate/20100701053151_remove_superuser_from_users.rb +20 -0
- data/db/migrate/20100702022630_add_spam_to_inquiries.rb +11 -0
- data/db/schema.rb +28 -10
- data/db/seeds.rb +6 -119
- data/db/seeds/inquiry_settings.rb +2 -0
- data/db/seeds/pages.rb +81 -0
- data/db/seeds/refinery_settings.rb +19 -0
- data/features/refinery/dashboard.feature +4 -0
- data/features/refinery/manage_files.feature +4 -0
- data/features/refinery/manage_images.feature +4 -0
- data/features/refinery/manage_inquiries.feature +4 -0
- data/features/refinery/manage_pages.feature +39 -0
- data/features/refinery/manage_refinery_settings.feature +4 -0
- data/features/refinery/manage_users.feature +29 -0
- data/features/refinery/site_bar.feature +22 -0
- data/features/step_definitions/refinery/page_steps.rb +23 -0
- data/features/step_definitions/refinery/user_steps.rb +33 -0
- data/features/step_definitions/web_steps.rb +271 -0
- data/features/support/env.rb +63 -0
- data/features/support/factories.rb +19 -0
- data/features/support/negative_expectations_helper.rb +57 -0
- data/features/support/paths.rb +39 -0
- data/lib/gemspec.rb +35 -0
- data/lib/refinery/tasks/refinery.rake +0 -30
- data/lib/tasks/cucumber.rake +53 -0
- data/lib/tasks/rspec.rake +144 -0
- data/public/images/refinery/admin_bg.png +0 -0
- data/public/images/refinery/cross.png +0 -0
- data/public/images/refinery/icons/bin.png +0 -0
- data/public/images/refinery/icons/bin_closed.png +0 -0
- data/public/images/refinery/icons/doc.png +0 -0
- data/public/images/refinery/icons/email.png +0 -0
- data/public/images/refinery/icons/flags/ad.png +0 -0
- data/public/images/refinery/icons/flags/ae.png +0 -0
- data/public/images/refinery/icons/flags/af.png +0 -0
- data/public/images/refinery/icons/flags/ag.png +0 -0
- data/public/images/refinery/icons/flags/ai.png +0 -0
- data/public/images/refinery/icons/flags/al.png +0 -0
- data/public/images/refinery/icons/flags/am.png +0 -0
- data/public/images/refinery/icons/flags/an.png +0 -0
- data/public/images/refinery/icons/flags/ao.png +0 -0
- data/public/images/refinery/icons/flags/ar.png +0 -0
- data/public/images/refinery/icons/flags/as.png +0 -0
- data/public/images/refinery/icons/flags/at.png +0 -0
- data/public/images/refinery/icons/flags/au.png +0 -0
- data/public/images/refinery/icons/flags/aw.png +0 -0
- data/public/images/refinery/icons/flags/ax.png +0 -0
- data/public/images/refinery/icons/flags/az.png +0 -0
- data/public/images/refinery/icons/flags/ba.png +0 -0
- data/public/images/refinery/icons/flags/bb.png +0 -0
- data/public/images/refinery/icons/flags/bd.png +0 -0
- data/public/images/refinery/icons/flags/be.png +0 -0
- data/public/images/refinery/icons/flags/bf.png +0 -0
- data/public/images/refinery/icons/flags/bg.png +0 -0
- data/public/images/refinery/icons/flags/bh.png +0 -0
- data/public/images/refinery/icons/flags/bi.png +0 -0
- data/public/images/refinery/icons/flags/bj.png +0 -0
- data/public/images/refinery/icons/flags/bm.png +0 -0
- data/public/images/refinery/icons/flags/bn.png +0 -0
- data/public/images/refinery/icons/flags/bo.png +0 -0
- data/public/images/refinery/icons/flags/bs.png +0 -0
- data/public/images/refinery/icons/flags/bt.png +0 -0
- data/public/images/refinery/icons/flags/bv.png +0 -0
- data/public/images/refinery/icons/flags/bw.png +0 -0
- data/public/images/refinery/icons/flags/by.png +0 -0
- data/public/images/refinery/icons/flags/bz.png +0 -0
- data/public/images/refinery/icons/flags/ca.png +0 -0
- data/public/images/refinery/icons/flags/catalonia.png +0 -0
- data/public/images/refinery/icons/flags/cc.png +0 -0
- data/public/images/refinery/icons/flags/cd.png +0 -0
- data/public/images/refinery/icons/flags/cf.png +0 -0
- data/public/images/refinery/icons/flags/cg.png +0 -0
- data/public/images/refinery/icons/flags/ch.png +0 -0
- data/public/images/refinery/icons/flags/ci.png +0 -0
- data/public/images/refinery/icons/flags/ck.png +0 -0
- data/public/images/refinery/icons/flags/cl.png +0 -0
- data/public/images/refinery/icons/flags/cm.png +0 -0
- data/public/images/refinery/icons/flags/cn.png +0 -0
- data/public/images/refinery/icons/flags/co.png +0 -0
- data/public/images/refinery/icons/flags/cr.png +0 -0
- data/public/images/refinery/icons/flags/cs.png +0 -0
- data/public/images/refinery/icons/flags/cu.png +0 -0
- data/public/images/refinery/icons/flags/cv.png +0 -0
- data/public/images/refinery/icons/flags/cx.png +0 -0
- data/public/images/refinery/icons/flags/cy.png +0 -0
- data/public/images/refinery/icons/flags/cz.png +0 -0
- data/public/images/refinery/icons/flags/da.png +0 -0
- data/public/images/refinery/icons/flags/de.png +0 -0
- data/public/images/refinery/icons/flags/dj.png +0 -0
- data/public/images/refinery/icons/flags/dm.png +0 -0
- data/public/images/refinery/icons/flags/do.png +0 -0
- data/public/images/refinery/icons/flags/dz.png +0 -0
- data/public/images/refinery/icons/flags/ec.png +0 -0
- data/public/images/refinery/icons/flags/ee.png +0 -0
- data/public/images/refinery/icons/flags/eg.png +0 -0
- data/public/images/refinery/icons/flags/eh.png +0 -0
- data/public/images/refinery/icons/flags/en.png +0 -0
- data/public/images/refinery/icons/flags/england.png +0 -0
- data/public/images/refinery/icons/flags/er.png +0 -0
- data/public/images/refinery/icons/flags/es.png +0 -0
- data/public/images/refinery/icons/flags/et.png +0 -0
- data/public/images/refinery/icons/flags/europeanunion.png +0 -0
- data/public/images/refinery/icons/flags/fam.png +0 -0
- data/public/images/refinery/icons/flags/fi.png +0 -0
- data/public/images/refinery/icons/flags/fj.png +0 -0
- data/public/images/refinery/icons/flags/fk.png +0 -0
- data/public/images/refinery/icons/flags/fm.png +0 -0
- data/public/images/refinery/icons/flags/fo.png +0 -0
- data/public/images/refinery/icons/flags/fr.png +0 -0
- data/public/images/refinery/icons/flags/ga.png +0 -0
- data/public/images/refinery/icons/flags/gb.png +0 -0
- data/public/images/refinery/icons/flags/gd.png +0 -0
- data/public/images/refinery/icons/flags/ge.png +0 -0
- data/public/images/refinery/icons/flags/gf.png +0 -0
- data/public/images/refinery/icons/flags/gh.png +0 -0
- data/public/images/refinery/icons/flags/gi.png +0 -0
- data/public/images/refinery/icons/flags/gl.png +0 -0
- data/public/images/refinery/icons/flags/gm.png +0 -0
- data/public/images/refinery/icons/flags/gn.png +0 -0
- data/public/images/refinery/icons/flags/gp.png +0 -0
- data/public/images/refinery/icons/flags/gq.png +0 -0
- data/public/images/refinery/icons/flags/gr.png +0 -0
- data/public/images/refinery/icons/flags/gs.png +0 -0
- data/public/images/refinery/icons/flags/gt.png +0 -0
- data/public/images/refinery/icons/flags/gu.png +0 -0
- data/public/images/refinery/icons/flags/gw.png +0 -0
- data/public/images/refinery/icons/flags/gy.png +0 -0
- data/public/images/refinery/icons/flags/hk.png +0 -0
- data/public/images/refinery/icons/flags/hm.png +0 -0
- data/public/images/refinery/icons/flags/hn.png +0 -0
- data/public/images/refinery/icons/flags/hr.png +0 -0
- data/public/images/refinery/icons/flags/ht.png +0 -0
- data/public/images/refinery/icons/flags/hu.png +0 -0
- data/public/images/refinery/icons/flags/id.png +0 -0
- data/public/images/refinery/icons/flags/ie.png +0 -0
- data/public/images/refinery/icons/flags/il.png +0 -0
- data/public/images/refinery/icons/flags/in.png +0 -0
- data/public/images/refinery/icons/flags/io.png +0 -0
- data/public/images/refinery/icons/flags/iq.png +0 -0
- data/public/images/refinery/icons/flags/ir.png +0 -0
- data/public/images/refinery/icons/flags/is.png +0 -0
- data/public/images/refinery/icons/flags/it.png +0 -0
- data/public/images/refinery/icons/flags/jm.png +0 -0
- data/public/images/refinery/icons/flags/jo.png +0 -0
- data/public/images/refinery/icons/flags/jp.png +0 -0
- data/public/images/refinery/icons/flags/ke.png +0 -0
- data/public/images/refinery/icons/flags/kg.png +0 -0
- data/public/images/refinery/icons/flags/kh.png +0 -0
- data/public/images/refinery/icons/flags/ki.png +0 -0
- data/public/images/refinery/icons/flags/km.png +0 -0
- data/public/images/refinery/icons/flags/kn.png +0 -0
- data/public/images/refinery/icons/flags/kp.png +0 -0
- data/public/images/refinery/icons/flags/kr.png +0 -0
- data/public/images/refinery/icons/flags/kw.png +0 -0
- data/public/images/refinery/icons/flags/ky.png +0 -0
- data/public/images/refinery/icons/flags/kz.png +0 -0
- data/public/images/refinery/icons/flags/la.png +0 -0
- data/public/images/refinery/icons/flags/lb.png +0 -0
- data/public/images/refinery/icons/flags/lc.png +0 -0
- data/public/images/refinery/icons/flags/li.png +0 -0
- data/public/images/refinery/icons/flags/lk.png +0 -0
- data/public/images/refinery/icons/flags/lr.png +0 -0
- data/public/images/refinery/icons/flags/ls.png +0 -0
- data/public/images/refinery/icons/flags/lt.png +0 -0
- data/public/images/refinery/icons/flags/lu.png +0 -0
- data/public/images/refinery/icons/flags/lv.png +0 -0
- data/public/images/refinery/icons/flags/ly.png +0 -0
- data/public/images/refinery/icons/flags/ma.png +0 -0
- data/public/images/refinery/icons/flags/mc.png +0 -0
- data/public/images/refinery/icons/flags/md.png +0 -0
- data/public/images/refinery/icons/flags/me.png +0 -0
- data/public/images/refinery/icons/flags/mg.png +0 -0
- data/public/images/refinery/icons/flags/mh.png +0 -0
- data/public/images/refinery/icons/flags/mk.png +0 -0
- data/public/images/refinery/icons/flags/ml.png +0 -0
- data/public/images/refinery/icons/flags/mm.png +0 -0
- data/public/images/refinery/icons/flags/mn.png +0 -0
- data/public/images/refinery/icons/flags/mo.png +0 -0
- data/public/images/refinery/icons/flags/mp.png +0 -0
- data/public/images/refinery/icons/flags/mq.png +0 -0
- data/public/images/refinery/icons/flags/mr.png +0 -0
- data/public/images/refinery/icons/flags/ms.png +0 -0
- data/public/images/refinery/icons/flags/mt.png +0 -0
- data/public/images/refinery/icons/flags/mu.png +0 -0
- data/public/images/refinery/icons/flags/mv.png +0 -0
- data/public/images/refinery/icons/flags/mw.png +0 -0
- data/public/images/refinery/icons/flags/mx.png +0 -0
- data/public/images/refinery/icons/flags/my.png +0 -0
- data/public/images/refinery/icons/flags/mz.png +0 -0
- data/public/images/refinery/icons/flags/na.png +0 -0
- data/public/images/refinery/icons/flags/nb.png +0 -0
- data/public/images/refinery/icons/flags/nc.png +0 -0
- data/public/images/refinery/icons/flags/ne.png +0 -0
- data/public/images/refinery/icons/flags/nf.png +0 -0
- data/public/images/refinery/icons/flags/ng.png +0 -0
- data/public/images/refinery/icons/flags/ni.png +0 -0
- data/public/images/refinery/icons/flags/nl.png +0 -0
- data/public/images/refinery/icons/flags/nn.png +0 -0
- data/public/images/refinery/icons/flags/np.png +0 -0
- data/public/images/refinery/icons/flags/nr.png +0 -0
- data/public/images/refinery/icons/flags/nu.png +0 -0
- data/public/images/refinery/icons/flags/nz.png +0 -0
- data/public/images/refinery/icons/flags/om.png +0 -0
- data/public/images/refinery/icons/flags/pa.png +0 -0
- data/public/images/refinery/icons/flags/pe.png +0 -0
- data/public/images/refinery/icons/flags/pf.png +0 -0
- data/public/images/refinery/icons/flags/pg.png +0 -0
- data/public/images/refinery/icons/flags/ph.png +0 -0
- data/public/images/refinery/icons/flags/pk.png +0 -0
- data/public/images/refinery/icons/flags/pl.png +0 -0
- data/public/images/refinery/icons/flags/pm.png +0 -0
- data/public/images/refinery/icons/flags/pn.png +0 -0
- data/public/images/refinery/icons/flags/pr.png +0 -0
- data/public/images/refinery/icons/flags/ps.png +0 -0
- data/public/images/refinery/icons/flags/pt-BR.png +0 -0
- data/public/images/refinery/icons/flags/pt.png +0 -0
- data/public/images/refinery/icons/flags/pw.png +0 -0
- data/public/images/refinery/icons/flags/py.png +0 -0
- data/public/images/refinery/icons/flags/qa.png +0 -0
- data/public/images/refinery/icons/flags/re.png +0 -0
- data/public/images/refinery/icons/flags/ro.png +0 -0
- data/public/images/refinery/icons/flags/rs.png +0 -0
- data/public/images/refinery/icons/flags/ru.png +0 -0
- data/public/images/refinery/icons/flags/rw.png +0 -0
- data/public/images/refinery/icons/flags/sa.png +0 -0
- data/public/images/refinery/icons/flags/sb.png +0 -0
- data/public/images/refinery/icons/flags/sc.png +0 -0
- data/public/images/refinery/icons/flags/scotland.png +0 -0
- data/public/images/refinery/icons/flags/sd.png +0 -0
- data/public/images/refinery/icons/flags/se.png +0 -0
- data/public/images/refinery/icons/flags/sg.png +0 -0
- data/public/images/refinery/icons/flags/sh.png +0 -0
- data/public/images/refinery/icons/flags/si.png +0 -0
- data/public/images/refinery/icons/flags/sj.png +0 -0
- data/public/images/refinery/icons/flags/sk.png +0 -0
- data/public/images/refinery/icons/flags/sl.png +0 -0
- data/public/images/refinery/icons/flags/sm.png +0 -0
- data/public/images/refinery/icons/flags/sn.png +0 -0
- data/public/images/refinery/icons/flags/so.png +0 -0
- data/public/images/refinery/icons/flags/sr.png +0 -0
- data/public/images/refinery/icons/flags/st.png +0 -0
- data/public/images/refinery/icons/flags/sv.png +0 -0
- data/public/images/refinery/icons/flags/sy.png +0 -0
- data/public/images/refinery/icons/flags/sz.png +0 -0
- data/public/images/refinery/icons/flags/tc.png +0 -0
- data/public/images/refinery/icons/flags/td.png +0 -0
- data/public/images/refinery/icons/flags/tf.png +0 -0
- data/public/images/refinery/icons/flags/tg.png +0 -0
- data/public/images/refinery/icons/flags/th.png +0 -0
- data/public/images/refinery/icons/flags/tj.png +0 -0
- data/public/images/refinery/icons/flags/tk.png +0 -0
- data/public/images/refinery/icons/flags/tl.png +0 -0
- data/public/images/refinery/icons/flags/tm.png +0 -0
- data/public/images/refinery/icons/flags/tn.png +0 -0
- data/public/images/refinery/icons/flags/to.png +0 -0
- data/public/images/refinery/icons/flags/tr.png +0 -0
- data/public/images/refinery/icons/flags/tt.png +0 -0
- data/public/images/refinery/icons/flags/tv.png +0 -0
- data/public/images/refinery/icons/flags/tw.png +0 -0
- data/public/images/refinery/icons/flags/tz.png +0 -0
- data/public/images/refinery/icons/flags/ua.png +0 -0
- data/public/images/refinery/icons/flags/ug.png +0 -0
- data/public/images/refinery/icons/flags/um.png +0 -0
- data/public/images/refinery/icons/flags/us.png +0 -0
- data/public/images/refinery/icons/flags/uy.png +0 -0
- data/public/images/refinery/icons/flags/uz.png +0 -0
- data/public/images/refinery/icons/flags/va.png +0 -0
- data/public/images/refinery/icons/flags/vc.png +0 -0
- data/public/images/refinery/icons/flags/ve.png +0 -0
- data/public/images/refinery/icons/flags/vg.png +0 -0
- data/public/images/refinery/icons/flags/vi.png +0 -0
- data/public/images/refinery/icons/flags/vn.png +0 -0
- data/public/images/refinery/icons/flags/vu.png +0 -0
- data/public/images/refinery/icons/flags/wales.png +0 -0
- data/public/images/refinery/icons/flags/wf.png +0 -0
- data/public/images/refinery/icons/flags/ws.png +0 -0
- data/public/images/refinery/icons/flags/ye.png +0 -0
- data/public/images/refinery/icons/flags/yt.png +0 -0
- data/public/images/refinery/icons/flags/za.png +0 -0
- data/public/images/refinery/icons/flags/zm.png +0 -0
- data/public/images/refinery/icons/flags/zw.png +0 -0
- data/public/images/refinery/icons/folder_page_white.png +0 -0
- data/public/images/refinery/icons/img.png +0 -0
- data/public/images/refinery/icons/music.png +0 -0
- data/public/images/refinery/icons/page_white_gear.png +0 -0
- data/public/images/refinery/icons/pdf.png +0 -0
- data/public/images/refinery/icons/ppt.png +0 -0
- data/public/images/refinery/icons/xls.png +0 -0
- data/public/images/refinery/icons/zip.png +0 -0
- data/public/images/refinery/logo-site-bar.png +0 -0
- data/public/images/refinery/nav_inactive_background.png +0 -0
- data/public/images/refinery/orange_button.png +0 -0
- data/public/images/refinery/text_field_background.png +0 -0
- data/public/images/refinery/tooltip-nib.png +0 -0
- data/public/images/wymeditor/skins/refinery/text_indent.png +0 -0
- data/public/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
- data/public/javascripts/admin.js +6 -8
- data/public/javascripts/i18n-messages.js +2 -0
- data/public/javascripts/jquery-min.js +154 -0
- data/public/javascripts/jquery-ui-custom-min.js +244 -0
- data/public/javascripts/jquery/jquery.corner.js +314 -216
- data/public/javascripts/jquery/jquery.html5-placeholder-shim.js +81 -0
- data/public/javascripts/jquery/jquery.nestedsortables.js +186 -0
- data/public/javascripts/jquery/jquery.textTruncate.js +174 -0
- data/public/javascripts/jquery/jquery.timers.js +138 -0
- data/public/javascripts/refinery/admin.js +352 -153
- data/public/javascripts/refinery/boot_wym.js +81 -46
- data/public/javascripts/refinery/i18n.js +340 -0
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +359 -363
- data/public/javascripts/wymeditor/lang/en.js +46 -46
- data/public/javascripts/wymeditor/lang/nl.js +5 -3
- data/public/javascripts/wymeditor/lang/pt-br.js +3 -2
- data/public/javascripts/wymeditor/lang/sl.js +47 -0
- data/public/javascripts/wymeditor/skins/refinery/skin.js +23 -23
- data/public/robots.txt +1 -0
- data/public/stylesheets/application.css +3 -3
- data/public/stylesheets/formatting.css +3 -3
- data/public/stylesheets/home.css +2 -2
- data/public/stylesheets/ie7.css +1 -0
- data/public/stylesheets/refinery/application.css +4 -2
- data/public/stylesheets/refinery/formatting.css +15 -15
- data/public/stylesheets/refinery/ie.css +20 -0
- data/public/stylesheets/refinery/refinery.css +680 -462
- data/public/stylesheets/refinery/site_bar.css +68 -25
- data/public/stylesheets/refinery/theme.css +14 -14
- data/public/stylesheets/refinery/tooltips.css +28 -32
- data/public/stylesheets/refinery/ui.css +25 -10
- data/public/stylesheets/wymeditor/skins/refinery/skin.css +148 -149
- data/public/stylesheets/wymeditor/skins/refinery/wymiframe.css +67 -63
- data/readme.md +48 -17
- data/script/about +1 -1
- data/script/autospec +6 -0
- data/script/console +1 -1
- data/script/cucumber +10 -0
- data/script/dbconsole +1 -1
- data/script/destroy +1 -1
- data/script/generate +1 -1
- data/script/performance/benchmarker +1 -1
- data/script/performance/profiler +1 -1
- data/script/performance/request +1 -1
- data/script/plugin +1 -1
- data/script/process/inspector +1 -1
- data/script/process/reaper +1 -1
- data/script/process/spawner +1 -1
- data/script/runner +1 -1
- data/script/server +1 -1
- data/script/spec +10 -0
- data/test/fixtures/images.yml +1 -2
- data/test/fixtures/pages.yml +4 -4
- data/test/fixtures/user_plugins.yml +20 -24
- data/test/functional/dashboard_controller_test.rb +2 -1
- data/test/functional/images_controller_test.rb +3 -10
- data/test/unit/image_test.rb +1 -1
- data/test/unit/inquiry_test.rb +6 -6
- data/test/unit/page_test.rb +31 -1
- data/test/unit/refinery_setting_test.rb +1 -1
- data/themes/demolicious/stylesheets/application.css +23 -12
- data/themes/demolicious/stylesheets/formatting.css +3 -3
- data/themes/demolicious/stylesheets/home.css +1 -4
- data/themes/demolicious/views/layouts/application.html.erb +5 -5
- data/themes/demolicious/views/pages/home.html.erb +1 -1
- data/themes/hemingway/stylesheets/application.css +1 -1
- data/themes/hemingway/views/layouts/application.html.erb +1 -0
- data/todo.md +19 -5
- data/vendor/plugins/authentication/app/controllers/admin/users_controller.rb +13 -18
- data/vendor/plugins/authentication/app/controllers/sessions_controller.rb +21 -6
- data/vendor/plugins/authentication/app/controllers/users_controller.rb +57 -49
- data/vendor/plugins/authentication/app/models/role.rb +16 -0
- data/vendor/plugins/authentication/app/models/user.rb +21 -8
- data/vendor/plugins/authentication/app/models/user_mailer.rb +3 -2
- data/vendor/plugins/authentication/app/models/user_session.rb +1 -1
- data/vendor/plugins/authentication/app/views/admin/users/_form.html.erb +29 -10
- data/vendor/plugins/authentication/app/views/admin/users/_user.html.erb +11 -10
- data/vendor/plugins/authentication/app/views/admin/users/index.html.erb +2 -3
- data/vendor/plugins/authentication/app/views/sessions/new.html.erb +15 -18
- data/vendor/plugins/authentication/app/views/users/forgot.html.erb +14 -9
- data/vendor/plugins/authentication/app/views/users/new.html.erb +11 -13
- data/vendor/plugins/authentication/app/views/users/reset.html.erb +14 -9
- data/vendor/plugins/authentication/config/locales/da.yml +71 -0
- data/vendor/plugins/authentication/config/locales/de.yml +75 -0
- data/vendor/plugins/authentication/config/locales/en.yml +75 -0
- data/vendor/plugins/authentication/config/locales/es.yml +79 -0
- data/vendor/plugins/authentication/config/locales/fr.yml +79 -0
- data/vendor/plugins/authentication/config/locales/it.yml +68 -0
- data/vendor/plugins/authentication/config/locales/nb.yml +68 -0
- data/vendor/plugins/authentication/config/locales/nl.yml +83 -0
- data/vendor/plugins/authentication/config/locales/pt-BR.yml +64 -0
- data/vendor/plugins/authentication/config/locales/sl.yml +78 -0
- data/vendor/plugins/authentication/config/routes.rb +4 -5
- data/vendor/plugins/authentication/lib/authenticated_system.rb +5 -1
- data/vendor/plugins/authentication/rails/init.rb +5 -1
- data/vendor/plugins/authentication/{authentication.md → readme.md} +0 -0
- data/vendor/plugins/authentication/test/unit/user_mailer_test.rb +1 -1
- data/vendor/plugins/dashboard/app/controllers/admin/dashboard_controller.rb +17 -7
- data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +5 -9
- data/vendor/plugins/dashboard/app/views/admin/dashboard/_recent_activity.html.erb +10 -12
- data/vendor/plugins/dashboard/app/views/admin/dashboard/_recent_inquiries.html.erb +12 -0
- data/vendor/plugins/dashboard/app/views/admin/dashboard/index.html.erb +34 -11
- data/vendor/plugins/dashboard/config/locales/da.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/de.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/en.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/es.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/fr.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/it.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/nb.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/nl.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/pt-BR.yml +22 -0
- data/vendor/plugins/dashboard/config/locales/sl.yml +22 -0
- data/vendor/plugins/dashboard/config/routes.rb +2 -1
- data/vendor/plugins/dashboard/rails/init.rb +6 -0
- data/vendor/plugins/dashboard/{dashboard.md → readme.md} +0 -0
- data/vendor/plugins/i18n-js/README.rdoc +249 -0
- data/vendor/plugins/i18n-js/Rakefile +23 -0
- data/vendor/plugins/i18n-js/init.rb +1 -0
- data/vendor/plugins/i18n-js/install.rb +7 -0
- data/vendor/plugins/i18n-js/lib/i18n-js.rb +132 -0
- data/vendor/plugins/i18n-js/lib/i18n-js.yml +4 -0
- data/vendor/plugins/i18n-js/lib/i18n.js +339 -0
- data/vendor/plugins/i18n-js/lib/tasks/i18n-js_tasks.rake +16 -0
- data/vendor/plugins/i18n-js/test/i18n-test.html +50 -0
- data/vendor/plugins/i18n-js/test/i18n-test.js +661 -0
- data/vendor/plugins/i18n-js/test/i18n_js_test.rb +168 -0
- data/vendor/plugins/i18n-js/test/jsunittest/jsunittest.js +1017 -0
- data/vendor/plugins/i18n-js/test/jsunittest/unittest.css +54 -0
- data/vendor/plugins/i18n-js/test/resources/custom_path.yml +4 -0
- data/vendor/plugins/i18n-js/test/resources/default.yml +4 -0
- data/vendor/plugins/i18n-js/test/resources/locales.yml +76 -0
- data/vendor/plugins/i18n-js/test/resources/multiple_files.yml +6 -0
- data/vendor/plugins/i18n-js/test/resources/no_scope.yml +3 -0
- data/vendor/plugins/i18n-js/test/resources/simple_scope.yml +4 -0
- data/vendor/plugins/i18n-js/test/test_helper.rb +24 -0
- data/vendor/plugins/i18n/config/locales/ar.yml +121 -0
- data/vendor/plugins/i18n/config/locales/bg.yml +198 -0
- data/vendor/plugins/i18n/config/locales/bn-IN.yml +180 -0
- data/vendor/plugins/i18n/config/locales/bs.yml +114 -0
- data/vendor/plugins/i18n/config/locales/ca-ES.yml +155 -0
- data/vendor/plugins/i18n/config/locales/cz.rb +166 -0
- data/vendor/plugins/i18n/config/locales/da.yml +167 -0
- data/vendor/plugins/i18n/config/locales/de-AT.yml +140 -0
- data/vendor/plugins/i18n/config/locales/de.yml +141 -0
- data/vendor/plugins/i18n/config/locales/dsb.yml +182 -0
- data/vendor/plugins/i18n/config/locales/el.yml +191 -0
- data/vendor/plugins/i18n/config/locales/es-AR.yml +168 -0
- data/vendor/plugins/i18n/config/locales/es-CO.yml +146 -0
- data/vendor/plugins/i18n/config/locales/es-MX.yml +118 -0
- data/vendor/plugins/i18n/config/locales/es.yml +186 -0
- data/vendor/plugins/i18n/config/locales/et.yml +109 -0
- data/vendor/plugins/i18n/config/locales/fa.yml +119 -0
- data/vendor/plugins/i18n/config/locales/fi.yml +154 -0
- data/vendor/plugins/i18n/config/locales/fr-CH.yml +123 -0
- data/vendor/plugins/i18n/config/locales/fr.yml +140 -0
- data/vendor/plugins/i18n/config/locales/fun/en-AU.rb +105 -0
- data/vendor/plugins/i18n/config/locales/fun/gibberish.rb +109 -0
- data/vendor/plugins/i18n/config/locales/fur.yml +141 -0
- data/vendor/plugins/i18n/config/locales/gl-ES.yml +193 -0
- data/vendor/plugins/i18n/config/locales/he.yml +103 -0
- data/vendor/plugins/i18n/config/locales/hr.yml +116 -0
- data/vendor/plugins/i18n/config/locales/hsb.yml +190 -0
- data/vendor/plugins/i18n/config/locales/hu.yml +144 -0
- data/vendor/plugins/i18n/config/locales/id.yml +122 -0
- data/vendor/plugins/i18n/config/locales/is.yml +142 -0
- data/vendor/plugins/i18n/config/locales/it.yml +146 -0
- data/vendor/plugins/i18n/config/locales/ja.yml +139 -0
- data/vendor/plugins/i18n/config/locales/ko.yml +153 -0
- data/vendor/plugins/i18n/config/locales/lo.yml +201 -0
- data/vendor/plugins/i18n/config/locales/lt.yml +141 -0
- data/vendor/plugins/i18n/config/locales/lv.yml +132 -0
- data/vendor/plugins/i18n/config/locales/mk.yml +115 -0
- data/vendor/plugins/i18n/config/locales/nb.yml +103 -0
- data/vendor/plugins/i18n/config/locales/nl.yml +173 -0
- data/vendor/plugins/i18n/config/locales/nn.yml +96 -0
- data/vendor/plugins/i18n/config/locales/pl.yml +127 -0
- data/vendor/plugins/i18n/config/locales/pt-BR.yml +148 -0
- data/vendor/plugins/i18n/config/locales/pt-PT.yml +220 -0
- data/vendor/plugins/i18n/config/locales/rm.yml +134 -0
- data/vendor/plugins/i18n/config/locales/ro.yml +152 -0
- data/vendor/plugins/i18n/config/locales/ru.yml +210 -0
- data/vendor/plugins/i18n/config/locales/sk.yml +139 -0
- data/vendor/plugins/i18n/config/locales/sl.yml +190 -0
- data/vendor/plugins/i18n/config/locales/sr-Latn.yml +116 -0
- data/vendor/plugins/i18n/config/locales/sr.yml +116 -0
- data/vendor/plugins/i18n/config/locales/sv-SE.yml +191 -0
- data/vendor/plugins/i18n/config/locales/sw.yml +123 -0
- data/vendor/plugins/i18n/config/locales/th.rb +222 -0
- data/vendor/plugins/i18n/config/locales/tr.yml +139 -0
- data/vendor/plugins/i18n/config/locales/uk.yml +237 -0
- data/vendor/plugins/i18n/config/locales/vi.yml +198 -0
- data/vendor/plugins/i18n/config/locales/zh-CN.yml +131 -0
- data/vendor/plugins/i18n/config/locales/zh-TW.yml +132 -0
- data/vendor/plugins/i18n/lib/i18n.rb +115 -0
- data/vendor/plugins/i18n/lib/i18n_filter.rb +48 -0
- data/vendor/plugins/i18n/lib/routing_filter/MIT-LICENSE +20 -0
- data/vendor/plugins/i18n/lib/routing_filter/README.markdown +123 -0
- data/vendor/plugins/i18n/lib/routing_filter/VERSION +1 -0
- data/vendor/plugins/i18n/lib/routing_filter/routing_filter.rb +96 -0
- data/vendor/plugins/i18n/lib/routing_filter/routing_filter/base.rb +31 -0
- data/vendor/plugins/i18n/lib/routing_filter/routing_filter/force_extension.rb +57 -0
- data/vendor/plugins/i18n/lib/routing_filter/routing_filter/pagination.rb +33 -0
- data/vendor/plugins/i18n/lib/routing_filter/routing_filter/uuid_token.rb +78 -0
- data/vendor/plugins/i18n/rails/init.rb +4 -0
- data/vendor/plugins/images/app/controllers/admin/images_controller.rb +6 -7
- data/vendor/plugins/images/app/models/image.rb +24 -6
- data/vendor/plugins/images/app/views/admin/images/_existing_image.erb +50 -0
- data/vendor/plugins/images/app/views/admin/images/_form.html.erb +15 -7
- data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +5 -5
- data/vendor/plugins/images/app/views/admin/images/_list_view.html.erb +3 -1
- data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +10 -10
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +5 -8
- data/vendor/plugins/images/app/views/admin/images/insert.html.erb +16 -38
- data/vendor/plugins/images/config/locales/da.yml +44 -0
- data/vendor/plugins/images/config/locales/de.yml +45 -0
- data/vendor/plugins/images/config/locales/en.yml +44 -0
- data/vendor/plugins/images/config/locales/es.yml +45 -0
- data/vendor/plugins/images/config/locales/fr.yml +44 -0
- data/vendor/plugins/images/config/locales/it.yml +42 -0
- data/vendor/plugins/images/config/locales/nb.yml +43 -0
- data/vendor/plugins/images/config/locales/nl.yml +44 -0
- data/vendor/plugins/images/config/locales/pt-BR.yml +46 -0
- data/vendor/plugins/images/config/locales/sl.yml +44 -0
- data/vendor/plugins/images/config/routes.rb +1 -1
- data/vendor/plugins/images/lib/tasks/images.rake +6 -6
- data/vendor/plugins/images/rails/init.rb +5 -1
- data/vendor/plugins/images/readme.md +58 -0
- data/vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb +16 -7
- data/vendor/plugins/inquiries/app/controllers/admin/inquiry_settings_controller.rb +5 -9
- data/vendor/plugins/inquiries/app/controllers/inquiries_controller.rb +14 -12
- data/vendor/plugins/inquiries/app/models/inquiry.rb +133 -6
- data/vendor/plugins/inquiries/app/models/inquiry_mailer.rb +2 -2
- data/vendor/plugins/inquiries/app/models/inquiry_setting.rb +51 -2
- data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +16 -8
- data/vendor/plugins/inquiries/app/views/admin/inquiries/_submenu.html.erb +27 -0
- data/vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb +3 -18
- data/vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb +23 -12
- data/vendor/plugins/inquiries/app/views/admin/inquiries/spam.html.erb +20 -0
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_confirmation_email_form.html.erb +21 -14
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_inquiry_setting.html.erb +11 -0
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_notification_recipients_form.html.erb +21 -14
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_subject_form.html.erb +9 -0
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/edit.html.erb +2 -0
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +7 -17
- data/vendor/plugins/inquiries/app/views/inquiries/new.html.erb +4 -5
- data/vendor/plugins/inquiries/config/locales/da.yml +67 -0
- data/vendor/plugins/inquiries/config/locales/de.yml +71 -0
- data/vendor/plugins/inquiries/config/locales/en.yml +75 -0
- data/vendor/plugins/inquiries/config/locales/es.yml +68 -0
- data/vendor/plugins/inquiries/config/locales/fr.yml +65 -0
- data/vendor/plugins/inquiries/config/locales/it.yml +66 -0
- data/vendor/plugins/inquiries/config/locales/nb.yml +67 -0
- data/vendor/plugins/inquiries/config/locales/nl.yml +71 -0
- data/vendor/plugins/inquiries/config/locales/pt-BR.yml +75 -0
- data/vendor/plugins/inquiries/config/locales/sl.yml +68 -0
- data/vendor/plugins/inquiries/config/routes.rb +4 -3
- data/vendor/plugins/inquiries/rails/init.rb +6 -3
- data/vendor/plugins/inquiries/readme.md +31 -0
- data/vendor/plugins/model_translations/MIT-LICENSE +20 -0
- data/vendor/plugins/model_translations/README.rdoc +90 -0
- data/vendor/plugins/model_translations/Rakefile +23 -0
- data/vendor/plugins/model_translations/init.rb +1 -0
- data/vendor/plugins/model_translations/lib/active_record/model_translations.rb +55 -0
- data/vendor/plugins/model_translations/test/model_translations_test.rb +88 -0
- data/vendor/plugins/model_translations/test/test_helper.rb +3 -0
- data/vendor/plugins/pages/app/controllers/admin/page_dialogs_controller.rb +29 -0
- data/vendor/plugins/pages/app/controllers/admin/page_parts_controller.rb +2 -0
- data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +37 -10
- data/vendor/plugins/pages/app/controllers/pages_controller.rb +24 -2
- data/vendor/plugins/pages/app/models/page.rb +90 -15
- data/vendor/plugins/pages/app/models/page_part.rb +1 -1
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
- data/vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb +59 -74
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +14 -39
- data/vendor/plugins/pages/app/views/admin/pages/_form_advanced_options.html.erb +56 -50
- data/vendor/plugins/pages/app/views/admin/pages/_form_advanced_options_seo.html.erb +23 -21
- data/vendor/plugins/pages/app/views/admin/pages/_form_page_parts.html.erb +37 -0
- data/vendor/plugins/pages/app/views/admin/pages/_page.html.erb +10 -11
- data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +3 -2
- data/vendor/plugins/pages/app/views/admin/pages/index.html.erb +7 -7
- data/vendor/plugins/pages/app/views/pages/home.html.erb +1 -1
- data/vendor/plugins/pages/config/locales/da.yml +53 -0
- data/vendor/plugins/pages/config/locales/de.yml +53 -0
- data/vendor/plugins/pages/config/locales/en.yml +95 -0
- data/vendor/plugins/pages/config/locales/es.yml +53 -0
- data/vendor/plugins/pages/config/locales/fr.yml +53 -0
- data/vendor/plugins/pages/config/locales/it.yml +53 -0
- data/vendor/plugins/pages/config/locales/nb.yml +53 -0
- data/vendor/plugins/pages/config/locales/nl.yml +54 -0
- data/vendor/plugins/pages/config/locales/pt-BR.yml +61 -0
- data/vendor/plugins/pages/config/locales/sl.yml +96 -0
- data/vendor/plugins/pages/config/routes.rb +2 -2
- data/vendor/plugins/pages/rails/init.rb +5 -1
- data/vendor/plugins/pages/readme.md +156 -0
- data/vendor/plugins/refinery/app/controllers/admin/refinery_core_controller.rb +4 -2
- data/vendor/plugins/refinery/app/controllers/refinery/fast_controller.rb +7 -0
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +42 -9
- data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +14 -15
- data/vendor/plugins/refinery/app/views/admin/_menu_tab.html.erb +4 -0
- data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +10 -5
- data/vendor/plugins/refinery/app/views/layouts/application.html.erb +3 -3
- data/vendor/plugins/refinery/app/views/shared/_content_page.html.erb +28 -29
- data/vendor/plugins/refinery/app/views/shared/_draft_page_message.html.erb +3 -0
- data/vendor/plugins/refinery/app/views/shared/_google_analytics.html.erb +2 -1
- data/vendor/plugins/refinery/app/views/shared/_head.html.erb +1 -0
- data/vendor/plugins/refinery/app/views/shared/_header.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/_ie6check.html.erb +44 -4
- data/vendor/plugins/refinery/app/views/shared/_language_switcher.html.erb +5 -0
- data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +17 -8
- data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +19 -21
- data/vendor/plugins/refinery/app/views/shared/_message.html.erb +6 -1
- data/vendor/plugins/refinery/app/views/shared/_site_bar.html.erb +38 -15
- data/vendor/plugins/refinery/app/views/shared/admin/_continue_editing.html.erb +1 -2
- data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +58 -14
- data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +7 -6
- data/vendor/plugins/refinery/app/views/shared/admin/_make_sortable.html.erb +10 -9
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +7 -4
- data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +3 -4
- data/vendor/plugins/refinery/app/views/shared/admin/_sortable_list.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/welcome.html.erb +5 -7
- data/vendor/plugins/refinery/app/views/wymiframe.html.erb +13 -5
- data/vendor/plugins/refinery/config/locales/da.yml +71 -0
- data/vendor/plugins/refinery/config/locales/de.yml +67 -0
- data/vendor/plugins/refinery/config/locales/en.yml +59 -0
- data/vendor/plugins/refinery/config/locales/es.yml +64 -0
- data/vendor/plugins/refinery/config/locales/fr.yml +67 -0
- data/vendor/plugins/refinery/config/locales/it.yml +68 -0
- data/vendor/plugins/refinery/config/locales/nb.yml +64 -0
- data/vendor/plugins/refinery/config/locales/nl.yml +63 -0
- data/vendor/plugins/refinery/config/locales/pt-BR.yml +60 -0
- data/vendor/plugins/refinery/config/locales/sl.yml +61 -0
- data/vendor/plugins/refinery/config/routes.rb +4 -4
- data/vendor/plugins/refinery/crud.md +2 -2
- data/vendor/plugins/refinery/lib/crud.rb +34 -25
- data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +9 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/config/locales/en.yml +16 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/config/locales/nl.yml +16 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/config/routes.rb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/migration.rb +1 -14
- data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +1 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/rails/init.rb +3 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/seed.rb +15 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +10 -11
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +5 -6
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/show.html.erb +1 -1
- data/vendor/plugins/refinery/lib/refinery.rb +22 -1
- data/vendor/plugins/refinery/lib/refinery/activity.rb +1 -1
- data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +56 -10
- data/vendor/plugins/refinery/lib/refinery/application_controller.rb +39 -14
- data/vendor/plugins/refinery/lib/refinery/application_helper.rb +62 -12
- data/vendor/plugins/refinery/lib/refinery/base_presenter.rb +1 -1
- data/vendor/plugins/refinery/lib/refinery/form_helpers.rb +37 -2
- data/vendor/plugins/refinery/lib/refinery/html_truncation_helper.rb +10 -100
- data/vendor/plugins/refinery/lib/refinery/initializer.rb +15 -1
- data/vendor/plugins/refinery/lib/refinery/plugin.rb +26 -14
- data/vendor/plugins/refinery/lib/refinery/plugins.rb +21 -8
- data/vendor/plugins/refinery/lib/tasks/doc.rake +24 -24
- data/vendor/plugins/refinery/lib/tasks/refinery.rake +232 -9
- data/vendor/plugins/refinery/lib/tasks/yard.rake +22 -22
- data/vendor/plugins/refinery/plugins.md +6 -6
- data/vendor/plugins/refinery/rails/init.rb +8 -1
- data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +4 -0
- data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +11 -12
- data/vendor/plugins/refinery_dialogs/app/views/layouts/admin_dialog.html.erb +4 -2
- data/vendor/plugins/refinery_dialogs/config/routes.rb +1 -1
- data/vendor/plugins/refinery_dialogs/rails/init.rb +4 -0
- data/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb +39 -0
- data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +67 -10
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +30 -6
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +10 -11
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/edit.html.erb +0 -3
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/index.html.erb +13 -4
- data/vendor/plugins/refinery_settings/config/locales/da.yml +49 -0
- data/vendor/plugins/refinery_settings/config/locales/de.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/en.yml +45 -0
- data/vendor/plugins/refinery_settings/config/locales/es.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/fr.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/it.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/nb.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/nl.yml +46 -0
- data/vendor/plugins/refinery_settings/config/locales/pt-BR.yml +23 -0
- data/vendor/plugins/refinery_settings/config/locales/sl.yml +24 -0
- data/vendor/plugins/refinery_settings/config/routes.rb +1 -1
- data/vendor/plugins/refinery_settings/rails/init.rb +5 -8
- data/vendor/plugins/refinery_settings/{settings.md → readme.md} +0 -0
- data/vendor/plugins/resources/app/controllers/admin/resources_controller.rb +2 -7
- data/vendor/plugins/resources/app/models/resource.rb +8 -3
- data/vendor/plugins/resources/app/views/admin/resources/_existing_resource.html.erb +34 -0
- data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +15 -7
- data/vendor/plugins/resources/app/views/admin/resources/_resource.html.erb +12 -12
- data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +8 -6
- data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +4 -40
- data/vendor/plugins/resources/config/locales/da.yml +34 -0
- data/vendor/plugins/resources/config/locales/de.yml +32 -0
- data/vendor/plugins/resources/config/locales/en.yml +32 -0
- data/vendor/plugins/resources/config/locales/es.yml +34 -0
- data/vendor/plugins/resources/config/locales/fr.yml +34 -0
- data/vendor/plugins/resources/config/locales/it.yml +33 -0
- data/vendor/plugins/resources/config/locales/nb.yml +34 -0
- data/vendor/plugins/resources/config/locales/nl.yml +34 -0
- data/vendor/plugins/resources/config/locales/pt-BR.yml +34 -0
- data/vendor/plugins/resources/config/locales/sl.yml +34 -0
- data/vendor/plugins/resources/config/routes.rb +1 -3
- data/vendor/plugins/resources/rails/init.rb +5 -1
- data/vendor/plugins/resources/{resources.md → readme.md} +0 -0
- data/vendor/plugins/themes/lib/theme_server.rb +1 -1
- data/vendor/plugins/themes/rails/init.rb +4 -1
- data/vendor/plugins/themes/readme.md +113 -0
- data/vendor/plugins/{rails_indexes → translate}/MIT-LICENSE +0 -0
- data/vendor/plugins/translate/README +61 -0
- data/vendor/plugins/translate/REFINERY_README +8 -0
- data/vendor/plugins/translate/Rakefile +11 -0
- data/vendor/plugins/translate/init.rb +8 -0
- data/vendor/plugins/translate/lib/translate.rb +13 -0
- data/vendor/plugins/translate/lib/translate/file.rb +35 -0
- data/vendor/plugins/translate/lib/translate/keys.rb +123 -0
- data/vendor/plugins/translate/lib/translate/log.rb +39 -0
- data/vendor/plugins/translate/lib/translate/storage.rb +20 -0
- data/vendor/plugins/translate/tasks/translate.rake +182 -0
- metadata +574 -366
- data/.gems +0 -0
- data/VERSION +0 -1
- data/bin/refinery-override +0 -76
- data/public/images/thickbox/cross.png +0 -0
- data/public/images/thickbox/loadingAnimation.gif +0 -0
- data/public/images/thickbox/macFFBgHack.png +0 -0
- data/public/javascripts/jquery-ui-1.8.min.js +0 -374
- data/vendor/plugins/acts_as_indexed/CHANGELOG +0 -78
- data/vendor/plugins/acts_as_indexed/MIT-LICENSE +0 -20
- data/vendor/plugins/acts_as_indexed/README.rdoc +0 -114
- data/vendor/plugins/acts_as_indexed/Rakefile +0 -35
- data/vendor/plugins/acts_as_indexed/init.rb +0 -2
- data/vendor/plugins/acts_as_indexed/lib/acts_as_indexed.rb +0 -224
- data/vendor/plugins/acts_as_indexed/lib/search_atom.rb +0 -109
- data/vendor/plugins/acts_as_indexed/lib/search_index.rb +0 -329
- data/vendor/plugins/acts_as_indexed/lib/will_paginate_search.rb +0 -29
- data/vendor/plugins/acts_as_indexed/test/abstract_unit.rb +0 -47
- data/vendor/plugins/acts_as_indexed/test/acts_as_indexed_test.rb +0 -102
- data/vendor/plugins/acts_as_indexed/test/database.yml +0 -10
- data/vendor/plugins/acts_as_indexed/test/fixtures/post.rb +0 -5
- data/vendor/plugins/acts_as_indexed/test/fixtures/posts.yml +0 -31
- data/vendor/plugins/acts_as_indexed/test/schema.rb +0 -6
- data/vendor/plugins/authlogic/CHANGELOG.rdoc +0 -345
- data/vendor/plugins/authlogic/LICENSE +0 -20
- data/vendor/plugins/authlogic/README.rdoc +0 -246
- data/vendor/plugins/authlogic/Rakefile +0 -42
- data/vendor/plugins/authlogic/VERSION.yml +0 -5
- data/vendor/plugins/authlogic/authlogic.gemspec +0 -217
- data/vendor/plugins/authlogic/generators/session/session_generator.rb +0 -9
- data/vendor/plugins/authlogic/generators/session/templates/session.rb +0 -2
- data/vendor/plugins/authlogic/init.rb +0 -1
- data/vendor/plugins/authlogic/lib/authlogic.rb +0 -64
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/base.rb +0 -107
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/email.rb +0 -110
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/logged_in_status.rb +0 -60
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb +0 -141
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/magic_columns.rb +0 -24
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/password.rb +0 -355
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/perishable_token.rb +0 -105
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/persistence_token.rb +0 -68
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/restful_authentication.rb +0 -61
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/session_maintenance.rb +0 -139
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/single_access_token.rb +0 -65
- data/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/validations_scope.rb +0 -32
- data/vendor/plugins/authlogic/lib/authlogic/authenticates_many/association.rb +0 -42
- data/vendor/plugins/authlogic/lib/authlogic/authenticates_many/base.rb +0 -55
- data/vendor/plugins/authlogic/lib/authlogic/controller_adapters/abstract_adapter.rb +0 -67
- data/vendor/plugins/authlogic/lib/authlogic/controller_adapters/merb_adapter.rb +0 -30
- data/vendor/plugins/authlogic/lib/authlogic/controller_adapters/rails_adapter.rb +0 -48
- data/vendor/plugins/authlogic/lib/authlogic/controller_adapters/sinatra_adapter.rb +0 -61
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/aes256.rb +0 -43
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/bcrypt.rb +0 -90
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/md5.rb +0 -34
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/sha1.rb +0 -35
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/sha256.rb +0 -50
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/sha512.rb +0 -50
- data/vendor/plugins/authlogic/lib/authlogic/crypto_providers/wordpress.rb +0 -43
- data/vendor/plugins/authlogic/lib/authlogic/i18n.rb +0 -83
- data/vendor/plugins/authlogic/lib/authlogic/i18n/translator.rb +0 -15
- data/vendor/plugins/authlogic/lib/authlogic/random.rb +0 -33
- data/vendor/plugins/authlogic/lib/authlogic/regex.rb +0 -25
- data/vendor/plugins/authlogic/lib/authlogic/session/activation.rb +0 -58
- data/vendor/plugins/authlogic/lib/authlogic/session/active_record_trickery.rb +0 -64
- data/vendor/plugins/authlogic/lib/authlogic/session/base.rb +0 -37
- data/vendor/plugins/authlogic/lib/authlogic/session/brute_force_protection.rb +0 -96
- data/vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb +0 -99
- data/vendor/plugins/authlogic/lib/authlogic/session/cookies.rb +0 -130
- data/vendor/plugins/authlogic/lib/authlogic/session/existence.rb +0 -93
- data/vendor/plugins/authlogic/lib/authlogic/session/foundation.rb +0 -63
- data/vendor/plugins/authlogic/lib/authlogic/session/http_auth.rb +0 -58
- data/vendor/plugins/authlogic/lib/authlogic/session/id.rb +0 -41
- data/vendor/plugins/authlogic/lib/authlogic/session/klass.rb +0 -78
- data/vendor/plugins/authlogic/lib/authlogic/session/magic_columns.rb +0 -95
- data/vendor/plugins/authlogic/lib/authlogic/session/magic_states.rb +0 -59
- data/vendor/plugins/authlogic/lib/authlogic/session/params.rb +0 -101
- data/vendor/plugins/authlogic/lib/authlogic/session/password.rb +0 -240
- data/vendor/plugins/authlogic/lib/authlogic/session/perishable_token.rb +0 -18
- data/vendor/plugins/authlogic/lib/authlogic/session/persistence.rb +0 -70
- data/vendor/plugins/authlogic/lib/authlogic/session/priority_record.rb +0 -34
- data/vendor/plugins/authlogic/lib/authlogic/session/scopes.rb +0 -101
- data/vendor/plugins/authlogic/lib/authlogic/session/session.rb +0 -62
- data/vendor/plugins/authlogic/lib/authlogic/session/timeout.rb +0 -82
- data/vendor/plugins/authlogic/lib/authlogic/session/unauthorized_record.rb +0 -50
- data/vendor/plugins/authlogic/lib/authlogic/session/validation.rb +0 -82
- data/vendor/plugins/authlogic/lib/authlogic/test_case.rb +0 -120
- data/vendor/plugins/authlogic/lib/authlogic/test_case/mock_controller.rb +0 -45
- data/vendor/plugins/authlogic/lib/authlogic/test_case/mock_cookie_jar.rb +0 -14
- data/vendor/plugins/authlogic/lib/authlogic/test_case/mock_logger.rb +0 -10
- data/vendor/plugins/authlogic/lib/authlogic/test_case/mock_request.rb +0 -19
- data/vendor/plugins/authlogic/lib/authlogic/test_case/rails_request_adapter.rb +0 -30
- data/vendor/plugins/authlogic/rails/init.rb +0 -1
- data/vendor/plugins/authlogic/shoulda_macros/authlogic.rb +0 -69
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/base_test.rb +0 -18
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/email_test.rb +0 -97
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/logged_in_status_test.rb +0 -36
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/login_test.rb +0 -109
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/magic_columns_test.rb +0 -27
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/password_test.rb +0 -236
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/perishable_token_test.rb +0 -90
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/persistence_token_test.rb +0 -55
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/restful_authentication_test.rb +0 -40
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/session_maintenance_test.rb +0 -84
- data/vendor/plugins/authlogic/test/acts_as_authentic_test/single_access_test.rb +0 -44
- data/vendor/plugins/authlogic/test/authenticates_many_test.rb +0 -16
- data/vendor/plugins/authlogic/test/crypto_provider_test/aes256_test.rb +0 -14
- data/vendor/plugins/authlogic/test/crypto_provider_test/bcrypt_test.rb +0 -14
- data/vendor/plugins/authlogic/test/crypto_provider_test/sha1_test.rb +0 -23
- data/vendor/plugins/authlogic/test/crypto_provider_test/sha256_test.rb +0 -14
- data/vendor/plugins/authlogic/test/crypto_provider_test/sha512_test.rb +0 -14
- data/vendor/plugins/authlogic/test/fixtures/companies.yml +0 -5
- data/vendor/plugins/authlogic/test/fixtures/employees.yml +0 -17
- data/vendor/plugins/authlogic/test/fixtures/projects.yml +0 -3
- data/vendor/plugins/authlogic/test/fixtures/users.yml +0 -24
- data/vendor/plugins/authlogic/test/i18n_test.rb +0 -33
- data/vendor/plugins/authlogic/test/libs/affiliate.rb +0 -7
- data/vendor/plugins/authlogic/test/libs/company.rb +0 -6
- data/vendor/plugins/authlogic/test/libs/employee.rb +0 -7
- data/vendor/plugins/authlogic/test/libs/employee_session.rb +0 -2
- data/vendor/plugins/authlogic/test/libs/ldaper.rb +0 -3
- data/vendor/plugins/authlogic/test/libs/ordered_hash.rb +0 -9
- data/vendor/plugins/authlogic/test/libs/project.rb +0 -3
- data/vendor/plugins/authlogic/test/libs/user.rb +0 -5
- data/vendor/plugins/authlogic/test/libs/user_session.rb +0 -6
- data/vendor/plugins/authlogic/test/random_test.rb +0 -49
- data/vendor/plugins/authlogic/test/session_test/activation_test.rb +0 -43
- data/vendor/plugins/authlogic/test/session_test/active_record_trickery_test.rb +0 -36
- data/vendor/plugins/authlogic/test/session_test/brute_force_protection_test.rb +0 -101
- data/vendor/plugins/authlogic/test/session_test/callbacks_test.rb +0 -6
- data/vendor/plugins/authlogic/test/session_test/cookies_test.rb +0 -112
- data/vendor/plugins/authlogic/test/session_test/credentials_test.rb +0 -0
- data/vendor/plugins/authlogic/test/session_test/existence_test.rb +0 -64
- data/vendor/plugins/authlogic/test/session_test/http_auth_test.rb +0 -28
- data/vendor/plugins/authlogic/test/session_test/id_test.rb +0 -17
- data/vendor/plugins/authlogic/test/session_test/klass_test.rb +0 -40
- data/vendor/plugins/authlogic/test/session_test/magic_columns_test.rb +0 -62
- data/vendor/plugins/authlogic/test/session_test/magic_states_test.rb +0 -60
- data/vendor/plugins/authlogic/test/session_test/params_test.rb +0 -53
- data/vendor/plugins/authlogic/test/session_test/password_test.rb +0 -106
- data/vendor/plugins/authlogic/test/session_test/perishability_test.rb +0 -15
- data/vendor/plugins/authlogic/test/session_test/persistence_test.rb +0 -21
- data/vendor/plugins/authlogic/test/session_test/scopes_test.rb +0 -60
- data/vendor/plugins/authlogic/test/session_test/session_test.rb +0 -59
- data/vendor/plugins/authlogic/test/session_test/timeout_test.rb +0 -52
- data/vendor/plugins/authlogic/test/session_test/unauthorized_record_test.rb +0 -13
- data/vendor/plugins/authlogic/test/session_test/validation_test.rb +0 -23
- data/vendor/plugins/authlogic/test/test_helper.rb +0 -182
- data/vendor/plugins/friendly_id/Changelog.md +0 -243
- data/vendor/plugins/friendly_id/Contributors.md +0 -30
- data/vendor/plugins/friendly_id/Gemfile +0 -2
- data/vendor/plugins/friendly_id/Guide.md +0 -509
- data/vendor/plugins/friendly_id/LICENSE +0 -19
- data/vendor/plugins/friendly_id/README.md +0 -76
- data/vendor/plugins/friendly_id/Rakefile +0 -68
- data/vendor/plugins/friendly_id/extras/README.txt +0 -3
- data/vendor/plugins/friendly_id/extras/bench.rb +0 -59
- data/vendor/plugins/friendly_id/extras/extras.rb +0 -31
- data/vendor/plugins/friendly_id/extras/prof.rb +0 -14
- data/vendor/plugins/friendly_id/extras/template-gem.rb +0 -26
- data/vendor/plugins/friendly_id/extras/template-plugin.rb +0 -28
- data/vendor/plugins/friendly_id/friendly_id.gemspec +0 -40
- data/vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb +0 -28
- data/vendor/plugins/friendly_id/generators/friendly_id/templates/create_slugs.rb +0 -18
- data/vendor/plugins/friendly_id/lib/friendly_id.rb +0 -67
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2.rb +0 -47
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/configuration.rb +0 -66
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/finders.rb +0 -140
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/simple_model.rb +0 -162
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/slug.rb +0 -111
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/slugged_model.rb +0 -323
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/tasks.rb +0 -66
- data/vendor/plugins/friendly_id/lib/friendly_id/active_record2/tasks/friendly_id.rake +0 -19
- data/vendor/plugins/friendly_id/lib/friendly_id/configuration.rb +0 -132
- data/vendor/plugins/friendly_id/lib/friendly_id/finders.rb +0 -106
- data/vendor/plugins/friendly_id/lib/friendly_id/slug_string.rb +0 -292
- data/vendor/plugins/friendly_id/lib/friendly_id/slugged.rb +0 -91
- data/vendor/plugins/friendly_id/lib/friendly_id/status.rb +0 -35
- data/vendor/plugins/friendly_id/lib/friendly_id/test.rb +0 -175
- data/vendor/plugins/friendly_id/lib/friendly_id/version.rb +0 -8
- data/vendor/plugins/friendly_id/rails/init.rb +0 -2
- data/vendor/plugins/friendly_id/test/active_record2/basic_slugged_model_test.rb +0 -14
- data/vendor/plugins/friendly_id/test/active_record2/cached_slug_test.rb +0 -61
- data/vendor/plugins/friendly_id/test/active_record2/core.rb +0 -93
- data/vendor/plugins/friendly_id/test/active_record2/custom_normalizer_test.rb +0 -20
- data/vendor/plugins/friendly_id/test/active_record2/custom_table_name_test.rb +0 -22
- data/vendor/plugins/friendly_id/test/active_record2/deprecated_test.rb +0 -23
- data/vendor/plugins/friendly_id/test/active_record2/scoped_model_test.rb +0 -111
- data/vendor/plugins/friendly_id/test/active_record2/simple_test.rb +0 -59
- data/vendor/plugins/friendly_id/test/active_record2/slug_test.rb +0 -34
- data/vendor/plugins/friendly_id/test/active_record2/slugged.rb +0 -30
- data/vendor/plugins/friendly_id/test/active_record2/slugged_status_test.rb +0 -61
- data/vendor/plugins/friendly_id/test/active_record2/sti_test.rb +0 -22
- data/vendor/plugins/friendly_id/test/active_record2/support/database.mysql.yml +0 -4
- data/vendor/plugins/friendly_id/test/active_record2/support/database.postgres.yml +0 -6
- data/vendor/plugins/friendly_id/test/active_record2/support/database.sqlite3.yml +0 -2
- data/vendor/plugins/friendly_id/test/active_record2/support/models.rb +0 -78
- data/vendor/plugins/friendly_id/test/active_record2/tasks_test.rb +0 -82
- data/vendor/plugins/friendly_id/test/active_record2/test_helper.rb +0 -114
- data/vendor/plugins/friendly_id/test/friendly_id_test.rb +0 -60
- data/vendor/plugins/friendly_id/test/slug_string_test.rb +0 -78
- data/vendor/plugins/friendly_id/test/test_helper.rb +0 -9
- data/vendor/plugins/hpricot/CHANGELOG +0 -88
- data/vendor/plugins/hpricot/COPYING +0 -18
- data/vendor/plugins/hpricot/README +0 -275
- data/vendor/plugins/hpricot/Rakefile +0 -272
- data/vendor/plugins/hpricot/ext/fast_xs/FastXsService.java +0 -1030
- data/vendor/plugins/hpricot/ext/fast_xs/extconf.rb +0 -4
- data/vendor/plugins/hpricot/ext/fast_xs/fast_xs.c +0 -201
- data/vendor/plugins/hpricot/ext/hpricot_scan/HpricotCss.java +0 -831
- data/vendor/plugins/hpricot/ext/hpricot_scan/HpricotScanService.java +0 -2086
- data/vendor/plugins/hpricot/ext/hpricot_scan/MANIFEST +0 -0
- data/vendor/plugins/hpricot/ext/hpricot_scan/extconf.rb +0 -6
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_common.rl +0 -76
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_css.c +0 -3503
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_css.java.rl +0 -155
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_css.rl +0 -115
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_scan.c +0 -6927
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_scan.h +0 -79
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_scan.java.rl +0 -1152
- data/vendor/plugins/hpricot/ext/hpricot_scan/hpricot_scan.rl +0 -788
- data/vendor/plugins/hpricot/extras/mingw-rbconfig.rb +0 -176
- data/vendor/plugins/hpricot/hpricot.gemspec +0 -17
- data/vendor/plugins/hpricot/lib/hpricot.rb +0 -26
- data/vendor/plugins/hpricot/lib/hpricot/blankslate.rb +0 -63
- data/vendor/plugins/hpricot/lib/hpricot/builder.rb +0 -216
- data/vendor/plugins/hpricot/lib/hpricot/elements.rb +0 -510
- data/vendor/plugins/hpricot/lib/hpricot/htmlinfo.rb +0 -691
- data/vendor/plugins/hpricot/lib/hpricot/inspect.rb +0 -103
- data/vendor/plugins/hpricot/lib/hpricot/modules.rb +0 -40
- data/vendor/plugins/hpricot/lib/hpricot/parse.rb +0 -38
- data/vendor/plugins/hpricot/lib/hpricot/tag.rb +0 -219
- data/vendor/plugins/hpricot/lib/hpricot/tags.rb +0 -164
- data/vendor/plugins/hpricot/lib/hpricot/traverse.rb +0 -839
- data/vendor/plugins/hpricot/lib/hpricot/xchar.rb +0 -94
- data/vendor/plugins/hpricot/setup.rb +0 -1585
- data/vendor/plugins/hpricot/test/files/basic.xhtml +0 -17
- data/vendor/plugins/hpricot/test/files/boingboing.html +0 -2266
- data/vendor/plugins/hpricot/test/files/cy0.html +0 -3653
- data/vendor/plugins/hpricot/test/files/immob.html +0 -400
- data/vendor/plugins/hpricot/test/files/pace_application.html +0 -1320
- data/vendor/plugins/hpricot/test/files/tenderlove.html +0 -16
- data/vendor/plugins/hpricot/test/files/uswebgen.html +0 -220
- data/vendor/plugins/hpricot/test/files/utf8.html +0 -1054
- data/vendor/plugins/hpricot/test/files/week9.html +0 -1723
- data/vendor/plugins/hpricot/test/files/why.xml +0 -19
- data/vendor/plugins/hpricot/test/load_files.rb +0 -7
- data/vendor/plugins/hpricot/test/nokogiri-bench.rb +0 -64
- data/vendor/plugins/hpricot/test/test_alter.rb +0 -96
- data/vendor/plugins/hpricot/test/test_builder.rb +0 -37
- data/vendor/plugins/hpricot/test/test_parser.rb +0 -428
- data/vendor/plugins/hpricot/test/test_paths.rb +0 -25
- data/vendor/plugins/hpricot/test/test_preserved.rb +0 -88
- data/vendor/plugins/hpricot/test/test_xml.rb +0 -28
- data/vendor/plugins/images/images.md +0 -53
- data/vendor/plugins/inquiries/inquiries.md +0 -31
- data/vendor/plugins/pages/pages.md +0 -146
- data/vendor/plugins/rails_indexes/README.textile +0 -46
- data/vendor/plugins/rails_indexes/Rakefile +0 -23
- data/vendor/plugins/rails_indexes/lib/indexer.rb +0 -303
- data/vendor/plugins/rails_indexes/tasks/indexer.rake +0 -18
- data/vendor/plugins/rails_indexes/test/fixtures/app/controllers/users_controller.rb +0 -8
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/address.rb +0 -5
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/company.rb +0 -11
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/country.rb +0 -4
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/freelancer.rb +0 -3
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/gift.rb +0 -10
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/god.rb +0 -3
- data/vendor/plugins/rails_indexes/test/fixtures/app/models/user.rb +0 -17
- data/vendor/plugins/rails_indexes/test/fixtures/app/sweepers/user_sweeper.rb +0 -9
- data/vendor/plugins/rails_indexes/test/fixtures/schema.rb +0 -46
- data/vendor/plugins/rails_indexes/test/rails_indexes_test.rb +0 -83
- data/vendor/plugins/rails_indexes/test/test_helper.rb +0 -30
- data/vendor/plugins/refinery/app/views/admin/_footer.html.erb +0 -7
- data/vendor/plugins/refinery/app/views/shared/_submenu.html.erb +0 -5
- data/vendor/plugins/refinery/app/views/shared/_submenu_branch.html.erb +0 -10
- data/vendor/plugins/themes/themes.md +0 -113
- data/vendor/plugins/will_paginate/.manifest +0 -43
- data/vendor/plugins/will_paginate/CHANGELOG.rdoc +0 -139
- data/vendor/plugins/will_paginate/LICENSE +0 -18
- data/vendor/plugins/will_paginate/README.rdoc +0 -107
- data/vendor/plugins/will_paginate/Rakefile +0 -53
- data/vendor/plugins/will_paginate/examples/apple-circle.gif +0 -0
- data/vendor/plugins/will_paginate/examples/index.haml +0 -69
- data/vendor/plugins/will_paginate/examples/index.html +0 -92
- data/vendor/plugins/will_paginate/examples/pagination.css +0 -90
- data/vendor/plugins/will_paginate/examples/pagination.sass +0 -91
- data/vendor/plugins/will_paginate/init.rb +0 -1
- data/vendor/plugins/will_paginate/lib/will_paginate.rb +0 -90
- data/vendor/plugins/will_paginate/lib/will_paginate/array.rb +0 -16
- data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +0 -146
- data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +0 -43
- data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +0 -264
- data/vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb +0 -170
- data/vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb +0 -37
- data/vendor/plugins/will_paginate/lib/will_paginate/version.rb +0 -9
- data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +0 -408
- data/vendor/plugins/will_paginate/test/boot.rb +0 -21
- data/vendor/plugins/will_paginate/test/collection_test.rb +0 -143
- data/vendor/plugins/will_paginate/test/console +0 -8
- data/vendor/plugins/will_paginate/test/database.yml +0 -22
- data/vendor/plugins/will_paginate/test/finder_test.rb +0 -473
- data/vendor/plugins/will_paginate/test/fixtures/admin.rb +0 -3
- data/vendor/plugins/will_paginate/test/fixtures/developer.rb +0 -14
- data/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +0 -13
- data/vendor/plugins/will_paginate/test/fixtures/project.rb +0 -15
- data/vendor/plugins/will_paginate/test/fixtures/projects.yml +0 -6
- data/vendor/plugins/will_paginate/test/fixtures/replies.yml +0 -29
- data/vendor/plugins/will_paginate/test/fixtures/reply.rb +0 -7
- data/vendor/plugins/will_paginate/test/fixtures/schema.rb +0 -38
- data/vendor/plugins/will_paginate/test/fixtures/topic.rb +0 -10
- data/vendor/plugins/will_paginate/test/fixtures/topics.yml +0 -30
- data/vendor/plugins/will_paginate/test/fixtures/user.rb +0 -2
- data/vendor/plugins/will_paginate/test/fixtures/users.yml +0 -35
- data/vendor/plugins/will_paginate/test/helper.rb +0 -37
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb +0 -43
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +0 -75
- data/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +0 -11
- data/vendor/plugins/will_paginate/test/lib/view_test_process.rb +0 -179
- data/vendor/plugins/will_paginate/test/tasks.rake +0 -59
- data/vendor/plugins/will_paginate/test/view_test.rb +0 -373
- data/vendor/plugins/will_paginate/will_paginate.gemspec +0 -19
@@ -1,272 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/gempackagetask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/testtask'
|
6
|
-
require 'fileutils'
|
7
|
-
include FileUtils
|
8
|
-
|
9
|
-
RbConfig = Config unless defined?(RbConfig)
|
10
|
-
|
11
|
-
NAME = "hpricot"
|
12
|
-
REV = (`#{ENV['GIT'] || "git"} rev-list HEAD`.split.length + 1).to_s
|
13
|
-
VERS = ENV['VERSION'] || "0.8" + (REV ? ".#{REV}" : "")
|
14
|
-
PKG = "#{NAME}-#{VERS}"
|
15
|
-
BIN = "*.{bundle,jar,so,o,obj,pdb,lib,def,exp,class}"
|
16
|
-
CLEAN.include ["ext/hpricot_scan/#{BIN}", "ext/fast_xs/#{BIN}", "lib/**/#{BIN}",
|
17
|
-
'ext/fast_xs/Makefile', 'ext/hpricot_scan/Makefile',
|
18
|
-
'**/.*.sw?', '*.gem', '.config', 'pkg']
|
19
|
-
RDOC_OPTS = ['--quiet', '--title', 'The Hpricot Reference', '--main', 'README', '--inline-source']
|
20
|
-
PKG_FILES = %w(CHANGELOG COPYING README Rakefile) +
|
21
|
-
Dir.glob("{bin,doc,test,lib,extras}/**/*") +
|
22
|
-
Dir.glob("ext/**/*.{h,java,c,rb,rl}") +
|
23
|
-
%w[ext/hpricot_scan/hpricot_scan.c ext/hpricot_scan/hpricot_css.c ext/hpricot_scan/HpricotScanService.java] # needed because they are generated later
|
24
|
-
RAGEL_C_CODE_GENERATION_STYLES = {
|
25
|
-
"table_driven" => 'T0',
|
26
|
-
"faster_table_driven" => 'T1',
|
27
|
-
"flat_table_driven" => 'F0',
|
28
|
-
"faster_flat_table_driven" => 'F1',
|
29
|
-
"goto_driven" => 'G0',
|
30
|
-
"faster_goto_driven" => 'G1',
|
31
|
-
"really_fast goto_driven" => 'G2'
|
32
|
-
# "n_way_split_really_fast_goto_driven" => 'P<N>'
|
33
|
-
}
|
34
|
-
DEFAULT_RAGEL_C_CODE_GENERATION = "really_fast goto_driven"
|
35
|
-
SPEC =
|
36
|
-
Gem::Specification.new do |s|
|
37
|
-
s.name = NAME
|
38
|
-
s.version = VERS
|
39
|
-
s.platform = Gem::Platform::RUBY
|
40
|
-
s.has_rdoc = true
|
41
|
-
s.rdoc_options += RDOC_OPTS
|
42
|
-
s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"]
|
43
|
-
s.summary = "a swift, liberal HTML parser with a fantastic library"
|
44
|
-
s.description = s.summary
|
45
|
-
s.author = "why the lucky stiff"
|
46
|
-
s.email = 'why@ruby-lang.org'
|
47
|
-
s.homepage = 'http://code.whytheluckystiff.net/hpricot/'
|
48
|
-
s.rubyforge_project = 'hobix'
|
49
|
-
s.files = PKG_FILES
|
50
|
-
s.require_paths = ["lib"]
|
51
|
-
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
52
|
-
s.bindir = "bin"
|
53
|
-
end
|
54
|
-
|
55
|
-
Win32Spec = SPEC.dup
|
56
|
-
Win32Spec.platform = 'x86-mswin32'
|
57
|
-
Win32Spec.files = PKG_FILES + ["lib/hpricot_scan.so", "lib/fast_xs.so"]
|
58
|
-
Win32Spec.extensions = []
|
59
|
-
|
60
|
-
WIN32_PKG_DIR = "#{PKG}-mswin32"
|
61
|
-
|
62
|
-
desc "Does a full compile, test run"
|
63
|
-
if defined?(JRUBY_VERSION)
|
64
|
-
task :default => [:compile_java, :test]
|
65
|
-
else
|
66
|
-
task :default => [:compile, :test]
|
67
|
-
end
|
68
|
-
|
69
|
-
desc "Packages up Hpricot."
|
70
|
-
task :package => [:clean, :ragel]
|
71
|
-
|
72
|
-
desc "Releases packages for all Hpricot packages and platforms."
|
73
|
-
task :release => [:package, :package_win32, :package_jruby]
|
74
|
-
|
75
|
-
|
76
|
-
desc "Run all the tests"
|
77
|
-
Rake::TestTask.new do |t|
|
78
|
-
t.libs << "test"
|
79
|
-
t.test_files = FileList['test/test_*.rb']
|
80
|
-
t.verbose = true
|
81
|
-
end
|
82
|
-
|
83
|
-
Rake::RDocTask.new do |rdoc|
|
84
|
-
rdoc.rdoc_dir = 'doc/rdoc'
|
85
|
-
rdoc.options += RDOC_OPTS
|
86
|
-
rdoc.main = "README"
|
87
|
-
rdoc.rdoc_files.add ['README', 'CHANGELOG', 'COPYING', 'lib/**/*.rb']
|
88
|
-
end
|
89
|
-
|
90
|
-
Rake::GemPackageTask.new(SPEC) do |p|
|
91
|
-
p.need_tar = true
|
92
|
-
p.gem_spec = SPEC
|
93
|
-
end
|
94
|
-
|
95
|
-
['hpricot_scan', 'fast_xs'].each do |extension|
|
96
|
-
ext = "ext/#{extension}"
|
97
|
-
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
98
|
-
ext_files = FileList[
|
99
|
-
"#{ext}/*.c",
|
100
|
-
"#{ext}/*.h",
|
101
|
-
"#{ext}/*.rl",
|
102
|
-
"#{ext}/extconf.rb",
|
103
|
-
"#{ext}/Makefile",
|
104
|
-
"lib"
|
105
|
-
]
|
106
|
-
|
107
|
-
desc "Builds just the #{extension} extension"
|
108
|
-
task extension.to_sym => [:ragel, "#{ext}/Makefile", ext_so ]
|
109
|
-
|
110
|
-
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
111
|
-
Dir.chdir(ext) do ruby "extconf.rb" end
|
112
|
-
end
|
113
|
-
|
114
|
-
file ext_so => ext_files do
|
115
|
-
Dir.chdir(ext) do
|
116
|
-
sh(RUBY_PLATFORM =~ /mswin/ ? 'nmake' : 'make')
|
117
|
-
end
|
118
|
-
cp ext_so, "lib"
|
119
|
-
end
|
120
|
-
|
121
|
-
desc "Cross-compile the #{extension} extension for win32"
|
122
|
-
file "#{extension}_win32" => [WIN32_PKG_DIR] do
|
123
|
-
cp "extras/mingw-rbconfig.rb", "#{WIN32_PKG_DIR}/ext/#{extension}/rbconfig.rb"
|
124
|
-
sh "cd #{WIN32_PKG_DIR}/ext/#{extension}/ && ruby -I. extconf.rb && make"
|
125
|
-
mv "#{WIN32_PKG_DIR}/ext/#{extension}/#{extension}.so", "#{WIN32_PKG_DIR}/lib"
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
task "lib" do
|
130
|
-
directory "lib"
|
131
|
-
end
|
132
|
-
|
133
|
-
desc "Compiles the Ruby extension"
|
134
|
-
task :compile => [:hpricot_scan, :fast_xs] do
|
135
|
-
if Dir.glob(File.join("lib","hpricot_scan.*")).length == 0
|
136
|
-
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
137
|
-
STDERR.puts "Gem actually failed to build. Your system is"
|
138
|
-
STDERR.puts "NOT configured properly to build hpricot."
|
139
|
-
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
140
|
-
exit(1)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
desc "Determines the Ragel version and displays it on the console along with the location of the Ragel binary."
|
145
|
-
task :ragel_version do
|
146
|
-
@ragel_v = `ragel -v`[/(version )(\S*)/,2].to_f
|
147
|
-
puts "Using ragel version: #{@ragel_v}, location: #{`which ragel`}"
|
148
|
-
@ragel_v
|
149
|
-
end
|
150
|
-
|
151
|
-
desc "Generates the C scanner code with Ragel."
|
152
|
-
task :ragel => [:ragel_version] do
|
153
|
-
if @ragel_v >= 6.1
|
154
|
-
@ragel_c_code_generation_style = RAGEL_C_CODE_GENERATION_STYLES[DEFAULT_RAGEL_C_CODE_GENERATION]
|
155
|
-
Dir.chdir("ext/hpricot_scan") do
|
156
|
-
sh %{ragel hpricot_scan.rl -#{@ragel_c_code_generation_style} -o hpricot_scan.c}
|
157
|
-
sh %{ragel hpricot_css.rl -#{@ragel_c_code_generation_style} -o hpricot_css.c}
|
158
|
-
end
|
159
|
-
else
|
160
|
-
STDERR.puts "Ragel 6.1 or greater is required."
|
161
|
-
exit(1)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
# Java only supports the table-driven code
|
166
|
-
# generation style at this point.
|
167
|
-
desc "Generates the Java scanner code using the Ragel table-driven code generation style."
|
168
|
-
task :ragel_java => [:ragel_version] do
|
169
|
-
if @ragel_v >= 6.1
|
170
|
-
puts "compiling with ragel version #{@ragel_v}"
|
171
|
-
Dir.chdir("ext/hpricot_scan") do
|
172
|
-
sh %{ragel -J -o HpricotCss.java hpricot_css.java.rl}
|
173
|
-
sh %{ragel -J -o HpricotScanService.java hpricot_scan.java.rl}
|
174
|
-
end
|
175
|
-
else
|
176
|
-
STDERR.puts "Ragel 6.1 or greater is required."
|
177
|
-
exit(1)
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
### Win32 Packages ###
|
182
|
-
|
183
|
-
desc "Package up the Win32 distribution."
|
184
|
-
file WIN32_PKG_DIR => [:package] do
|
185
|
-
sh "tar zxf pkg/#{PKG}.tgz"
|
186
|
-
mv PKG, WIN32_PKG_DIR
|
187
|
-
end
|
188
|
-
|
189
|
-
desc "Build the binary RubyGems package for win32"
|
190
|
-
task :package_win32 => ["fast_xs_win32", "hpricot_scan_win32"] do
|
191
|
-
Dir.chdir("#{WIN32_PKG_DIR}") do
|
192
|
-
Gem::Builder.new(Win32Spec).build
|
193
|
-
verbose(true) {
|
194
|
-
mv Dir["*.gem"].first, "../pkg/"
|
195
|
-
}
|
196
|
-
end
|
197
|
-
end
|
198
|
-
|
199
|
-
CLEAN.include WIN32_PKG_DIR
|
200
|
-
|
201
|
-
### JRuby Packages ###
|
202
|
-
|
203
|
-
def java_classpath_arg # myriad of ways to discover JRuby classpath
|
204
|
-
begin
|
205
|
-
cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
|
206
|
-
cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
|
207
|
-
jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
|
208
|
-
rescue => e
|
209
|
-
end
|
210
|
-
unless jruby_cpath
|
211
|
-
jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
|
212
|
-
FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
|
213
|
-
end
|
214
|
-
jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
|
215
|
-
end
|
216
|
-
|
217
|
-
def compile_java(filenames, jarname)
|
218
|
-
sh %{javac -source 1.5 -target 1.5 #{java_classpath_arg} #{filenames.join(" ")}}
|
219
|
-
sh %{jar cf #{jarname} *.class}
|
220
|
-
end
|
221
|
-
|
222
|
-
task :hpricot_scan_java => [:ragel_java] do
|
223
|
-
Dir.chdir "ext/hpricot_scan" do
|
224
|
-
compile_java(["HpricotScanService.java", "HpricotCss.java"], "hpricot_scan.jar")
|
225
|
-
end
|
226
|
-
end
|
227
|
-
|
228
|
-
task :fast_xs_java do
|
229
|
-
Dir.chdir "ext/fast_xs" do
|
230
|
-
compile_java(["FastXsService.java"], "fast_xs.jar")
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
desc "Compiles the JRuby extensions"
|
235
|
-
task :compile_java => [:hpricot_scan_java, :fast_xs_java] do
|
236
|
-
%w(hpricot_scan fast_xs).each {|ext| mv "ext/#{ext}/#{ext}.jar", "lib"}
|
237
|
-
end
|
238
|
-
|
239
|
-
JRubySpec = SPEC.dup
|
240
|
-
JRubySpec.platform = 'java'
|
241
|
-
JRubySpec.files = PKG_FILES + ["lib/hpricot_scan.jar", "lib/fast_xs.jar"]
|
242
|
-
JRubySpec.extensions = []
|
243
|
-
|
244
|
-
JRUBY_PKG_DIR = "#{PKG}-java"
|
245
|
-
|
246
|
-
desc "Package up the JRuby distribution."
|
247
|
-
file JRUBY_PKG_DIR => [:ragel_java, :package] do
|
248
|
-
sh "tar zxf pkg/#{PKG}.tgz"
|
249
|
-
mv PKG, JRUBY_PKG_DIR
|
250
|
-
end
|
251
|
-
|
252
|
-
desc "Build the RubyGems package for JRuby"
|
253
|
-
task :package_jruby => JRUBY_PKG_DIR do
|
254
|
-
Dir.chdir("#{JRUBY_PKG_DIR}") do
|
255
|
-
Rake::Task[:compile_java].invoke
|
256
|
-
Gem::Builder.new(JRubySpec).build
|
257
|
-
verbose(true) {
|
258
|
-
mv Dir["*.gem"].first, "../pkg/#{JRUBY_PKG_DIR}.gem"
|
259
|
-
}
|
260
|
-
end
|
261
|
-
end
|
262
|
-
|
263
|
-
CLEAN.include JRUBY_PKG_DIR
|
264
|
-
|
265
|
-
task :install do
|
266
|
-
sh %{rake package}
|
267
|
-
sh %{sudo gem install pkg/#{NAME}-#{VERS}}
|
268
|
-
end
|
269
|
-
|
270
|
-
task :uninstall => [:clean] do
|
271
|
-
sh %{sudo gem uninstall #{NAME}}
|
272
|
-
end
|
@@ -1,1030 +0,0 @@
|
|
1
|
-
|
2
|
-
import java.io.IOException;
|
3
|
-
import java.io.StringWriter;
|
4
|
-
import java.io.Writer;
|
5
|
-
import java.util.HashMap;
|
6
|
-
import java.util.Map;
|
7
|
-
import java.util.TreeMap;
|
8
|
-
import org.jruby.Ruby;
|
9
|
-
import org.jruby.RubyModule;
|
10
|
-
import org.jruby.runtime.CallbackFactory;
|
11
|
-
import org.jruby.runtime.builtin.IRubyObject;
|
12
|
-
import org.jruby.runtime.load.BasicLibraryService;
|
13
|
-
import org.jruby.util.collections.IntHashMap;
|
14
|
-
|
15
|
-
public class FastXsService implements BasicLibraryService {
|
16
|
-
|
17
|
-
public boolean basicLoad(final Ruby runtime) throws IOException {
|
18
|
-
RubyModule string = runtime.getModule("String");
|
19
|
-
CallbackFactory fact = runtime.callbackFactory(FastXsService.class);
|
20
|
-
string.defineMethod("fast_xs",fact.getFastSingletonMethod("fast_xs"));
|
21
|
-
return true;
|
22
|
-
}
|
23
|
-
|
24
|
-
public static IRubyObject fast_xs(IRubyObject recv) {
|
25
|
-
String string = recv.convertToString().getUnicodeValue();
|
26
|
-
StringWriter writer = new StringWriter ((int)(string.length() * 1.5));
|
27
|
-
try {
|
28
|
-
Entities.FAST_XS.escape(writer, string);
|
29
|
-
return recv.getRuntime().newString(writer.toString());
|
30
|
-
} catch (IOException e) {
|
31
|
-
throw recv.getRuntime().newIOErrorFromException(e);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
// From Apache commons-lang,
|
37
|
-
// http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java?revision=560660&view=markup
|
38
|
-
/*
|
39
|
-
* Licensed to the Apache Software Foundation (ASF) under one or more
|
40
|
-
* contributor license agreements. See the NOTICE file distributed with
|
41
|
-
* this work for additional information regarding copyright ownership.
|
42
|
-
* The ASF licenses this file to You under the Apache License, Version 2.0
|
43
|
-
* (the "License"); you may not use this file except in compliance with
|
44
|
-
* the License. You may obtain a copy of the License at
|
45
|
-
*
|
46
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
47
|
-
*
|
48
|
-
* Unless required by applicable law or agreed to in writing, software
|
49
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
50
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
51
|
-
* See the License for the specific language governing permissions and
|
52
|
-
* limitations under the License.
|
53
|
-
*/
|
54
|
-
|
55
|
-
/**
|
56
|
-
* <p>
|
57
|
-
* Provides HTML and XML entity utilities.
|
58
|
-
* </p>
|
59
|
-
*
|
60
|
-
* @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO Entities</a>
|
61
|
-
* @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO Latin-1</a>
|
62
|
-
* @see <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">HTML 4.0 Character entity references</a>
|
63
|
-
* @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character References</a>
|
64
|
-
* @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a>
|
65
|
-
*
|
66
|
-
* @author <a href="mailto:alex@purpletech.com">Alexander Day Chaffee</a>
|
67
|
-
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
|
68
|
-
* @since 2.0
|
69
|
-
* @version $Id$
|
70
|
-
*/
|
71
|
-
class Entities {
|
72
|
-
|
73
|
-
private static final String[][] BASIC_ARRAY = {{"quot", "34"}, // " - double-quote
|
74
|
-
{"amp", "38"}, // & - ampersand
|
75
|
-
{"lt", "60"}, // < - less-than
|
76
|
-
{"gt", "62"}, // > - greater-than
|
77
|
-
};
|
78
|
-
|
79
|
-
private static final String[][] APOS_ARRAY = {{"apos", "39"}, // XML apostrophe
|
80
|
-
};
|
81
|
-
|
82
|
-
// package scoped for testing
|
83
|
-
static final String[][] ISO8859_1_ARRAY = {{"nbsp", "160"}, // non-breaking space
|
84
|
-
{"iexcl", "161"}, // inverted exclamation mark
|
85
|
-
{"cent", "162"}, // cent sign
|
86
|
-
{"pound", "163"}, // pound sign
|
87
|
-
{"curren", "164"}, // currency sign
|
88
|
-
{"yen", "165"}, // yen sign = yuan sign
|
89
|
-
{"brvbar", "166"}, // broken bar = broken vertical bar
|
90
|
-
{"sect", "167"}, // section sign
|
91
|
-
{"uml", "168"}, // diaeresis = spacing diaeresis
|
92
|
-
{"copy", "169"}, // © - copyright sign
|
93
|
-
{"ordf", "170"}, // feminine ordinal indicator
|
94
|
-
{"laquo", "171"}, // left-pointing double angle quotation mark = left pointing guillemet
|
95
|
-
{"not", "172"}, // not sign
|
96
|
-
{"shy", "173"}, // soft hyphen = discretionary hyphen
|
97
|
-
{"reg", "174"}, // ® - registered trademark sign
|
98
|
-
{"macr", "175"}, // macron = spacing macron = overline = APL overbar
|
99
|
-
{"deg", "176"}, // degree sign
|
100
|
-
{"plusmn", "177"}, // plus-minus sign = plus-or-minus sign
|
101
|
-
{"sup2", "178"}, // superscript two = superscript digit two = squared
|
102
|
-
{"sup3", "179"}, // superscript three = superscript digit three = cubed
|
103
|
-
{"acute", "180"}, // acute accent = spacing acute
|
104
|
-
{"micro", "181"}, // micro sign
|
105
|
-
{"para", "182"}, // pilcrow sign = paragraph sign
|
106
|
-
{"middot", "183"}, // middle dot = Georgian comma = Greek middle dot
|
107
|
-
{"cedil", "184"}, // cedilla = spacing cedilla
|
108
|
-
{"sup1", "185"}, // superscript one = superscript digit one
|
109
|
-
{"ordm", "186"}, // masculine ordinal indicator
|
110
|
-
{"raquo", "187"}, // right-pointing double angle quotation mark = right pointing guillemet
|
111
|
-
{"frac14", "188"}, // vulgar fraction one quarter = fraction one quarter
|
112
|
-
{"frac12", "189"}, // vulgar fraction one half = fraction one half
|
113
|
-
{"frac34", "190"}, // vulgar fraction three quarters = fraction three quarters
|
114
|
-
{"iquest", "191"}, // inverted question mark = turned question mark
|
115
|
-
{"Agrave", "192"}, // À - uppercase A, grave accent
|
116
|
-
{"Aacute", "193"}, // Á - uppercase A, acute accent
|
117
|
-
{"Acirc", "194"}, // Â - uppercase A, circumflex accent
|
118
|
-
{"Atilde", "195"}, // Ã - uppercase A, tilde
|
119
|
-
{"Auml", "196"}, // Ä - uppercase A, umlaut
|
120
|
-
{"Aring", "197"}, // Å - uppercase A, ring
|
121
|
-
{"AElig", "198"}, // Æ - uppercase AE
|
122
|
-
{"Ccedil", "199"}, // Ç - uppercase C, cedilla
|
123
|
-
{"Egrave", "200"}, // È - uppercase E, grave accent
|
124
|
-
{"Eacute", "201"}, // É - uppercase E, acute accent
|
125
|
-
{"Ecirc", "202"}, // Ê - uppercase E, circumflex accent
|
126
|
-
{"Euml", "203"}, // Ë - uppercase E, umlaut
|
127
|
-
{"Igrave", "204"}, // Ì - uppercase I, grave accent
|
128
|
-
{"Iacute", "205"}, // Í - uppercase I, acute accent
|
129
|
-
{"Icirc", "206"}, // Î - uppercase I, circumflex accent
|
130
|
-
{"Iuml", "207"}, // Ï - uppercase I, umlaut
|
131
|
-
{"ETH", "208"}, // Ð - uppercase Eth, Icelandic
|
132
|
-
{"Ntilde", "209"}, // Ñ - uppercase N, tilde
|
133
|
-
{"Ograve", "210"}, // Ò - uppercase O, grave accent
|
134
|
-
{"Oacute", "211"}, // Ó - uppercase O, acute accent
|
135
|
-
{"Ocirc", "212"}, // Ô - uppercase O, circumflex accent
|
136
|
-
{"Otilde", "213"}, // Õ - uppercase O, tilde
|
137
|
-
{"Ouml", "214"}, // Ö - uppercase O, umlaut
|
138
|
-
{"times", "215"}, // multiplication sign
|
139
|
-
{"Oslash", "216"}, // Ø - uppercase O, slash
|
140
|
-
{"Ugrave", "217"}, // Ù - uppercase U, grave accent
|
141
|
-
{"Uacute", "218"}, // Ú - uppercase U, acute accent
|
142
|
-
{"Ucirc", "219"}, // Û - uppercase U, circumflex accent
|
143
|
-
{"Uuml", "220"}, // Ü - uppercase U, umlaut
|
144
|
-
{"Yacute", "221"}, // Ý - uppercase Y, acute accent
|
145
|
-
{"THORN", "222"}, // Þ - uppercase THORN, Icelandic
|
146
|
-
{"szlig", "223"}, // ß - lowercase sharps, German
|
147
|
-
{"agrave", "224"}, // à - lowercase a, grave accent
|
148
|
-
{"aacute", "225"}, // á - lowercase a, acute accent
|
149
|
-
{"acirc", "226"}, // â - lowercase a, circumflex accent
|
150
|
-
{"atilde", "227"}, // ã - lowercase a, tilde
|
151
|
-
{"auml", "228"}, // ä - lowercase a, umlaut
|
152
|
-
{"aring", "229"}, // å - lowercase a, ring
|
153
|
-
{"aelig", "230"}, // æ - lowercase ae
|
154
|
-
{"ccedil", "231"}, // ç - lowercase c, cedilla
|
155
|
-
{"egrave", "232"}, // è - lowercase e, grave accent
|
156
|
-
{"eacute", "233"}, // é - lowercase e, acute accent
|
157
|
-
{"ecirc", "234"}, // ê - lowercase e, circumflex accent
|
158
|
-
{"euml", "235"}, // ë - lowercase e, umlaut
|
159
|
-
{"igrave", "236"}, // ì - lowercase i, grave accent
|
160
|
-
{"iacute", "237"}, // í - lowercase i, acute accent
|
161
|
-
{"icirc", "238"}, // î - lowercase i, circumflex accent
|
162
|
-
{"iuml", "239"}, // ï - lowercase i, umlaut
|
163
|
-
{"eth", "240"}, // ð - lowercase eth, Icelandic
|
164
|
-
{"ntilde", "241"}, // ñ - lowercase n, tilde
|
165
|
-
{"ograve", "242"}, // ò - lowercase o, grave accent
|
166
|
-
{"oacute", "243"}, // ó - lowercase o, acute accent
|
167
|
-
{"ocirc", "244"}, // ô - lowercase o, circumflex accent
|
168
|
-
{"otilde", "245"}, // õ - lowercase o, tilde
|
169
|
-
{"ouml", "246"}, // ö - lowercase o, umlaut
|
170
|
-
{"divide", "247"}, // division sign
|
171
|
-
{"oslash", "248"}, // ø - lowercase o, slash
|
172
|
-
{"ugrave", "249"}, // ù - lowercase u, grave accent
|
173
|
-
{"uacute", "250"}, // ú - lowercase u, acute accent
|
174
|
-
{"ucirc", "251"}, // û - lowercase u, circumflex accent
|
175
|
-
{"uuml", "252"}, // ü - lowercase u, umlaut
|
176
|
-
{"yacute", "253"}, // ý - lowercase y, acute accent
|
177
|
-
{"thorn", "254"}, // þ - lowercase thorn, Icelandic
|
178
|
-
{"yuml", "255"}, // ÿ - lowercase y, umlaut
|
179
|
-
};
|
180
|
-
|
181
|
-
// http://www.w3.org/TR/REC-html40/sgml/entities.html
|
182
|
-
// package scoped for testing
|
183
|
-
static final String[][] HTML40_ARRAY = {
|
184
|
-
// <!-- Latin Extended-B -->
|
185
|
-
{"fnof", "402"}, // latin small f with hook = function= florin, U+0192 ISOtech -->
|
186
|
-
// <!-- Greek -->
|
187
|
-
{"Alpha", "913"}, // greek capital letter alpha, U+0391 -->
|
188
|
-
{"Beta", "914"}, // greek capital letter beta, U+0392 -->
|
189
|
-
{"Gamma", "915"}, // greek capital letter gamma,U+0393 ISOgrk3 -->
|
190
|
-
{"Delta", "916"}, // greek capital letter delta,U+0394 ISOgrk3 -->
|
191
|
-
{"Epsilon", "917"}, // greek capital letter epsilon, U+0395 -->
|
192
|
-
{"Zeta", "918"}, // greek capital letter zeta, U+0396 -->
|
193
|
-
{"Eta", "919"}, // greek capital letter eta, U+0397 -->
|
194
|
-
{"Theta", "920"}, // greek capital letter theta,U+0398 ISOgrk3 -->
|
195
|
-
{"Iota", "921"}, // greek capital letter iota, U+0399 -->
|
196
|
-
{"Kappa", "922"}, // greek capital letter kappa, U+039A -->
|
197
|
-
{"Lambda", "923"}, // greek capital letter lambda,U+039B ISOgrk3 -->
|
198
|
-
{"Mu", "924"}, // greek capital letter mu, U+039C -->
|
199
|
-
{"Nu", "925"}, // greek capital letter nu, U+039D -->
|
200
|
-
{"Xi", "926"}, // greek capital letter xi, U+039E ISOgrk3 -->
|
201
|
-
{"Omicron", "927"}, // greek capital letter omicron, U+039F -->
|
202
|
-
{"Pi", "928"}, // greek capital letter pi, U+03A0 ISOgrk3 -->
|
203
|
-
{"Rho", "929"}, // greek capital letter rho, U+03A1 -->
|
204
|
-
// <!-- there is no Sigmaf, and no U+03A2 character either -->
|
205
|
-
{"Sigma", "931"}, // greek capital letter sigma,U+03A3 ISOgrk3 -->
|
206
|
-
{"Tau", "932"}, // greek capital letter tau, U+03A4 -->
|
207
|
-
{"Upsilon", "933"}, // greek capital letter upsilon,U+03A5 ISOgrk3 -->
|
208
|
-
{"Phi", "934"}, // greek capital letter phi,U+03A6 ISOgrk3 -->
|
209
|
-
{"Chi", "935"}, // greek capital letter chi, U+03A7 -->
|
210
|
-
{"Psi", "936"}, // greek capital letter psi,U+03A8 ISOgrk3 -->
|
211
|
-
{"Omega", "937"}, // greek capital letter omega,U+03A9 ISOgrk3 -->
|
212
|
-
{"alpha", "945"}, // greek small letter alpha,U+03B1 ISOgrk3 -->
|
213
|
-
{"beta", "946"}, // greek small letter beta, U+03B2 ISOgrk3 -->
|
214
|
-
{"gamma", "947"}, // greek small letter gamma,U+03B3 ISOgrk3 -->
|
215
|
-
{"delta", "948"}, // greek small letter delta,U+03B4 ISOgrk3 -->
|
216
|
-
{"epsilon", "949"}, // greek small letter epsilon,U+03B5 ISOgrk3 -->
|
217
|
-
{"zeta", "950"}, // greek small letter zeta, U+03B6 ISOgrk3 -->
|
218
|
-
{"eta", "951"}, // greek small letter eta, U+03B7 ISOgrk3 -->
|
219
|
-
{"theta", "952"}, // greek small letter theta,U+03B8 ISOgrk3 -->
|
220
|
-
{"iota", "953"}, // greek small letter iota, U+03B9 ISOgrk3 -->
|
221
|
-
{"kappa", "954"}, // greek small letter kappa,U+03BA ISOgrk3 -->
|
222
|
-
{"lambda", "955"}, // greek small letter lambda,U+03BB ISOgrk3 -->
|
223
|
-
{"mu", "956"}, // greek small letter mu, U+03BC ISOgrk3 -->
|
224
|
-
{"nu", "957"}, // greek small letter nu, U+03BD ISOgrk3 -->
|
225
|
-
{"xi", "958"}, // greek small letter xi, U+03BE ISOgrk3 -->
|
226
|
-
{"omicron", "959"}, // greek small letter omicron, U+03BF NEW -->
|
227
|
-
{"pi", "960"}, // greek small letter pi, U+03C0 ISOgrk3 -->
|
228
|
-
{"rho", "961"}, // greek small letter rho, U+03C1 ISOgrk3 -->
|
229
|
-
{"sigmaf", "962"}, // greek small letter final sigma,U+03C2 ISOgrk3 -->
|
230
|
-
{"sigma", "963"}, // greek small letter sigma,U+03C3 ISOgrk3 -->
|
231
|
-
{"tau", "964"}, // greek small letter tau, U+03C4 ISOgrk3 -->
|
232
|
-
{"upsilon", "965"}, // greek small letter upsilon,U+03C5 ISOgrk3 -->
|
233
|
-
{"phi", "966"}, // greek small letter phi, U+03C6 ISOgrk3 -->
|
234
|
-
{"chi", "967"}, // greek small letter chi, U+03C7 ISOgrk3 -->
|
235
|
-
{"psi", "968"}, // greek small letter psi, U+03C8 ISOgrk3 -->
|
236
|
-
{"omega", "969"}, // greek small letter omega,U+03C9 ISOgrk3 -->
|
237
|
-
{"thetasym", "977"}, // greek small letter theta symbol,U+03D1 NEW -->
|
238
|
-
{"upsih", "978"}, // greek upsilon with hook symbol,U+03D2 NEW -->
|
239
|
-
{"piv", "982"}, // greek pi symbol, U+03D6 ISOgrk3 -->
|
240
|
-
// <!-- General Punctuation -->
|
241
|
-
{"bull", "8226"}, // bullet = black small circle,U+2022 ISOpub -->
|
242
|
-
// <!-- bullet is NOT the same as bullet operator, U+2219 -->
|
243
|
-
{"hellip", "8230"}, // horizontal ellipsis = three dot leader,U+2026 ISOpub -->
|
244
|
-
{"prime", "8242"}, // prime = minutes = feet, U+2032 ISOtech -->
|
245
|
-
{"Prime", "8243"}, // double prime = seconds = inches,U+2033 ISOtech -->
|
246
|
-
{"oline", "8254"}, // overline = spacing overscore,U+203E NEW -->
|
247
|
-
{"frasl", "8260"}, // fraction slash, U+2044 NEW -->
|
248
|
-
// <!-- Letterlike Symbols -->
|
249
|
-
{"weierp", "8472"}, // script capital P = power set= Weierstrass p, U+2118 ISOamso -->
|
250
|
-
{"image", "8465"}, // blackletter capital I = imaginary part,U+2111 ISOamso -->
|
251
|
-
{"real", "8476"}, // blackletter capital R = real part symbol,U+211C ISOamso -->
|
252
|
-
{"trade", "8482"}, // trade mark sign, U+2122 ISOnum -->
|
253
|
-
{"alefsym", "8501"}, // alef symbol = first transfinite cardinal,U+2135 NEW -->
|
254
|
-
// <!-- alef symbol is NOT the same as hebrew letter alef,U+05D0 although the
|
255
|
-
// same glyph could be used to depict both characters -->
|
256
|
-
// <!-- Arrows -->
|
257
|
-
{"larr", "8592"}, // leftwards arrow, U+2190 ISOnum -->
|
258
|
-
{"uarr", "8593"}, // upwards arrow, U+2191 ISOnum-->
|
259
|
-
{"rarr", "8594"}, // rightwards arrow, U+2192 ISOnum -->
|
260
|
-
{"darr", "8595"}, // downwards arrow, U+2193 ISOnum -->
|
261
|
-
{"harr", "8596"}, // left right arrow, U+2194 ISOamsa -->
|
262
|
-
{"crarr", "8629"}, // downwards arrow with corner leftwards= carriage return, U+21B5 NEW -->
|
263
|
-
{"lArr", "8656"}, // leftwards double arrow, U+21D0 ISOtech -->
|
264
|
-
// <!-- ISO 10646 does not say that lArr is the same as the 'is implied by'
|
265
|
-
// arrow but also does not have any other character for that function.
|
266
|
-
// So ? lArr canbe used for 'is implied by' as ISOtech suggests -->
|
267
|
-
{"uArr", "8657"}, // upwards double arrow, U+21D1 ISOamsa -->
|
268
|
-
{"rArr", "8658"}, // rightwards double arrow,U+21D2 ISOtech -->
|
269
|
-
// <!-- ISO 10646 does not say this is the 'implies' character but does not
|
270
|
-
// have another character with this function so ?rArr can be used for
|
271
|
-
// 'implies' as ISOtech suggests -->
|
272
|
-
{"dArr", "8659"}, // downwards double arrow, U+21D3 ISOamsa -->
|
273
|
-
{"hArr", "8660"}, // left right double arrow,U+21D4 ISOamsa -->
|
274
|
-
// <!-- Mathematical Operators -->
|
275
|
-
{"forall", "8704"}, // for all, U+2200 ISOtech -->
|
276
|
-
{"part", "8706"}, // partial differential, U+2202 ISOtech -->
|
277
|
-
{"exist", "8707"}, // there exists, U+2203 ISOtech -->
|
278
|
-
{"empty", "8709"}, // empty set = null set = diameter,U+2205 ISOamso -->
|
279
|
-
{"nabla", "8711"}, // nabla = backward difference,U+2207 ISOtech -->
|
280
|
-
{"isin", "8712"}, // element of, U+2208 ISOtech -->
|
281
|
-
{"notin", "8713"}, // not an element of, U+2209 ISOtech -->
|
282
|
-
{"ni", "8715"}, // contains as member, U+220B ISOtech -->
|
283
|
-
// <!-- should there be a more memorable name than 'ni'? -->
|
284
|
-
{"prod", "8719"}, // n-ary product = product sign,U+220F ISOamsb -->
|
285
|
-
// <!-- prod is NOT the same character as U+03A0 'greek capital letter pi'
|
286
|
-
// though the same glyph might be used for both -->
|
287
|
-
{"sum", "8721"}, // n-ary summation, U+2211 ISOamsb -->
|
288
|
-
// <!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
|
289
|
-
// though the same glyph might be used for both -->
|
290
|
-
{"minus", "8722"}, // minus sign, U+2212 ISOtech -->
|
291
|
-
{"lowast", "8727"}, // asterisk operator, U+2217 ISOtech -->
|
292
|
-
{"radic", "8730"}, // square root = radical sign,U+221A ISOtech -->
|
293
|
-
{"prop", "8733"}, // proportional to, U+221D ISOtech -->
|
294
|
-
{"infin", "8734"}, // infinity, U+221E ISOtech -->
|
295
|
-
{"ang", "8736"}, // angle, U+2220 ISOamso -->
|
296
|
-
{"and", "8743"}, // logical and = wedge, U+2227 ISOtech -->
|
297
|
-
{"or", "8744"}, // logical or = vee, U+2228 ISOtech -->
|
298
|
-
{"cap", "8745"}, // intersection = cap, U+2229 ISOtech -->
|
299
|
-
{"cup", "8746"}, // union = cup, U+222A ISOtech -->
|
300
|
-
{"int", "8747"}, // integral, U+222B ISOtech -->
|
301
|
-
{"there4", "8756"}, // therefore, U+2234 ISOtech -->
|
302
|
-
{"sim", "8764"}, // tilde operator = varies with = similar to,U+223C ISOtech -->
|
303
|
-
// <!-- tilde operator is NOT the same character as the tilde, U+007E,although
|
304
|
-
// the same glyph might be used to represent both -->
|
305
|
-
{"cong", "8773"}, // approximately equal to, U+2245 ISOtech -->
|
306
|
-
{"asymp", "8776"}, // almost equal to = asymptotic to,U+2248 ISOamsr -->
|
307
|
-
{"ne", "8800"}, // not equal to, U+2260 ISOtech -->
|
308
|
-
{"equiv", "8801"}, // identical to, U+2261 ISOtech -->
|
309
|
-
{"le", "8804"}, // less-than or equal to, U+2264 ISOtech -->
|
310
|
-
{"ge", "8805"}, // greater-than or equal to,U+2265 ISOtech -->
|
311
|
-
{"sub", "8834"}, // subset of, U+2282 ISOtech -->
|
312
|
-
{"sup", "8835"}, // superset of, U+2283 ISOtech -->
|
313
|
-
// <!-- note that nsup, 'not a superset of, U+2283' is not covered by the
|
314
|
-
// Symbol font encoding and is not included. Should it be, for symmetry?
|
315
|
-
// It is in ISOamsn --> <!ENTITY nsub", "8836"},
|
316
|
-
// not a subset of, U+2284 ISOamsn -->
|
317
|
-
{"sube", "8838"}, // subset of or equal to, U+2286 ISOtech -->
|
318
|
-
{"supe", "8839"}, // superset of or equal to,U+2287 ISOtech -->
|
319
|
-
{"oplus", "8853"}, // circled plus = direct sum,U+2295 ISOamsb -->
|
320
|
-
{"otimes", "8855"}, // circled times = vector product,U+2297 ISOamsb -->
|
321
|
-
{"perp", "8869"}, // up tack = orthogonal to = perpendicular,U+22A5 ISOtech -->
|
322
|
-
{"sdot", "8901"}, // dot operator, U+22C5 ISOamsb -->
|
323
|
-
// <!-- dot operator is NOT the same character as U+00B7 middle dot -->
|
324
|
-
// <!-- Miscellaneous Technical -->
|
325
|
-
{"lceil", "8968"}, // left ceiling = apl upstile,U+2308 ISOamsc -->
|
326
|
-
{"rceil", "8969"}, // right ceiling, U+2309 ISOamsc -->
|
327
|
-
{"lfloor", "8970"}, // left floor = apl downstile,U+230A ISOamsc -->
|
328
|
-
{"rfloor", "8971"}, // right floor, U+230B ISOamsc -->
|
329
|
-
{"lang", "9001"}, // left-pointing angle bracket = bra,U+2329 ISOtech -->
|
330
|
-
// <!-- lang is NOT the same character as U+003C 'less than' or U+2039 'single left-pointing angle quotation
|
331
|
-
// mark' -->
|
332
|
-
{"rang", "9002"}, // right-pointing angle bracket = ket,U+232A ISOtech -->
|
333
|
-
// <!-- rang is NOT the same character as U+003E 'greater than' or U+203A
|
334
|
-
// 'single right-pointing angle quotation mark' -->
|
335
|
-
// <!-- Geometric Shapes -->
|
336
|
-
{"loz", "9674"}, // lozenge, U+25CA ISOpub -->
|
337
|
-
// <!-- Miscellaneous Symbols -->
|
338
|
-
{"spades", "9824"}, // black spade suit, U+2660 ISOpub -->
|
339
|
-
// <!-- black here seems to mean filled as opposed to hollow -->
|
340
|
-
{"clubs", "9827"}, // black club suit = shamrock,U+2663 ISOpub -->
|
341
|
-
{"hearts", "9829"}, // black heart suit = valentine,U+2665 ISOpub -->
|
342
|
-
{"diams", "9830"}, // black diamond suit, U+2666 ISOpub -->
|
343
|
-
|
344
|
-
// <!-- Latin Extended-A -->
|
345
|
-
{"OElig", "338"}, // -- latin capital ligature OE,U+0152 ISOlat2 -->
|
346
|
-
{"oelig", "339"}, // -- latin small ligature oe, U+0153 ISOlat2 -->
|
347
|
-
// <!-- ligature is a misnomer, this is a separate character in some languages -->
|
348
|
-
{"Scaron", "352"}, // -- latin capital letter S with caron,U+0160 ISOlat2 -->
|
349
|
-
{"scaron", "353"}, // -- latin small letter s with caron,U+0161 ISOlat2 -->
|
350
|
-
{"Yuml", "376"}, // -- latin capital letter Y with diaeresis,U+0178 ISOlat2 -->
|
351
|
-
// <!-- Spacing Modifier Letters -->
|
352
|
-
{"circ", "710"}, // -- modifier letter circumflex accent,U+02C6 ISOpub -->
|
353
|
-
{"tilde", "732"}, // small tilde, U+02DC ISOdia -->
|
354
|
-
// <!-- General Punctuation -->
|
355
|
-
{"ensp", "8194"}, // en space, U+2002 ISOpub -->
|
356
|
-
{"emsp", "8195"}, // em space, U+2003 ISOpub -->
|
357
|
-
{"thinsp", "8201"}, // thin space, U+2009 ISOpub -->
|
358
|
-
{"zwnj", "8204"}, // zero width non-joiner,U+200C NEW RFC 2070 -->
|
359
|
-
{"zwj", "8205"}, // zero width joiner, U+200D NEW RFC 2070 -->
|
360
|
-
{"lrm", "8206"}, // left-to-right mark, U+200E NEW RFC 2070 -->
|
361
|
-
{"rlm", "8207"}, // right-to-left mark, U+200F NEW RFC 2070 -->
|
362
|
-
{"ndash", "8211"}, // en dash, U+2013 ISOpub -->
|
363
|
-
{"mdash", "8212"}, // em dash, U+2014 ISOpub -->
|
364
|
-
{"lsquo", "8216"}, // left single quotation mark,U+2018 ISOnum -->
|
365
|
-
{"rsquo", "8217"}, // right single quotation mark,U+2019 ISOnum -->
|
366
|
-
{"sbquo", "8218"}, // single low-9 quotation mark, U+201A NEW -->
|
367
|
-
{"ldquo", "8220"}, // left double quotation mark,U+201C ISOnum -->
|
368
|
-
{"rdquo", "8221"}, // right double quotation mark,U+201D ISOnum -->
|
369
|
-
{"bdquo", "8222"}, // double low-9 quotation mark, U+201E NEW -->
|
370
|
-
{"dagger", "8224"}, // dagger, U+2020 ISOpub -->
|
371
|
-
{"Dagger", "8225"}, // double dagger, U+2021 ISOpub -->
|
372
|
-
{"permil", "8240"}, // per mille sign, U+2030 ISOtech -->
|
373
|
-
{"lsaquo", "8249"}, // single left-pointing angle quotation mark,U+2039 ISO proposed -->
|
374
|
-
// <!-- lsaquo is proposed but not yet ISO standardized -->
|
375
|
-
{"rsaquo", "8250"}, // single right-pointing angle quotation mark,U+203A ISO proposed -->
|
376
|
-
// <!-- rsaquo is proposed but not yet ISO standardized -->
|
377
|
-
{"euro", "8364"}, // -- euro sign, U+20AC NEW -->
|
378
|
-
};
|
379
|
-
|
380
|
-
/**
|
381
|
-
* <p>
|
382
|
-
* The set of entities supported by standard XML.
|
383
|
-
* </p>
|
384
|
-
*/
|
385
|
-
public static final Entities XML;
|
386
|
-
|
387
|
-
/**
|
388
|
-
* <p>
|
389
|
-
* The set of entities supported by HTML 3.2.
|
390
|
-
* </p>
|
391
|
-
*/
|
392
|
-
public static final Entities HTML32;
|
393
|
-
|
394
|
-
/**
|
395
|
-
* <p>
|
396
|
-
* The set of entities supported by HTML 4.0.
|
397
|
-
* </p>
|
398
|
-
*/
|
399
|
-
public static final Entities HTML40;
|
400
|
-
|
401
|
-
/**
|
402
|
-
* <p>
|
403
|
-
* The set of entities supported by the Ruby fast_xs extension.
|
404
|
-
* </p>
|
405
|
-
*/
|
406
|
-
public static final Entities FAST_XS;
|
407
|
-
|
408
|
-
static {
|
409
|
-
XML = new Entities();
|
410
|
-
XML.addEntities(BASIC_ARRAY);
|
411
|
-
XML.addEntities(APOS_ARRAY);
|
412
|
-
}
|
413
|
-
|
414
|
-
static {
|
415
|
-
HTML32 = new Entities();
|
416
|
-
HTML32.addEntities(BASIC_ARRAY);
|
417
|
-
HTML32.addEntities(ISO8859_1_ARRAY);
|
418
|
-
}
|
419
|
-
|
420
|
-
static {
|
421
|
-
HTML40 = new Entities();
|
422
|
-
fillWithHtml40Entities(HTML40);
|
423
|
-
}
|
424
|
-
|
425
|
-
static {
|
426
|
-
FAST_XS = new Entities();
|
427
|
-
FAST_XS.addEntities(BASIC_ARRAY);
|
428
|
-
}
|
429
|
-
|
430
|
-
/**
|
431
|
-
* <p>
|
432
|
-
* Fills the specified entities instance with HTML 40 entities.
|
433
|
-
* </p>
|
434
|
-
*
|
435
|
-
* @param entities
|
436
|
-
* the instance to be filled.
|
437
|
-
*/
|
438
|
-
static void fillWithHtml40Entities(Entities entities) {
|
439
|
-
entities.addEntities(BASIC_ARRAY);
|
440
|
-
entities.addEntities(ISO8859_1_ARRAY);
|
441
|
-
entities.addEntities(HTML40_ARRAY);
|
442
|
-
}
|
443
|
-
|
444
|
-
static interface EntityMap {
|
445
|
-
/**
|
446
|
-
* <p>
|
447
|
-
* Add an entry to this entity map.
|
448
|
-
* </p>
|
449
|
-
*
|
450
|
-
* @param name
|
451
|
-
* the entity name
|
452
|
-
* @param value
|
453
|
-
* the entity value
|
454
|
-
*/
|
455
|
-
void add(String name, int value);
|
456
|
-
|
457
|
-
/**
|
458
|
-
* <p>
|
459
|
-
* Returns the name of the entity identified by the specified value.
|
460
|
-
* </p>
|
461
|
-
*
|
462
|
-
* @param value
|
463
|
-
* the value to locate
|
464
|
-
* @return entity name associated with the specified value
|
465
|
-
*/
|
466
|
-
String name(int value);
|
467
|
-
|
468
|
-
/**
|
469
|
-
* <p>
|
470
|
-
* Returns the value of the entity identified by the specified name.
|
471
|
-
* </p>
|
472
|
-
*
|
473
|
-
* @param name
|
474
|
-
* the name to locate
|
475
|
-
* @return entity value associated with the specified name
|
476
|
-
*/
|
477
|
-
int value(String name);
|
478
|
-
}
|
479
|
-
|
480
|
-
static class PrimitiveEntityMap implements EntityMap {
|
481
|
-
private Map mapNameToValue = new HashMap();
|
482
|
-
|
483
|
-
private IntHashMap mapValueToName = new IntHashMap();
|
484
|
-
|
485
|
-
/**
|
486
|
-
* {@inheritDoc}
|
487
|
-
*/
|
488
|
-
public void add(String name, int value) {
|
489
|
-
mapNameToValue.put(name, new Integer(value));
|
490
|
-
mapValueToName.put(value, name);
|
491
|
-
}
|
492
|
-
|
493
|
-
/**
|
494
|
-
* {@inheritDoc}
|
495
|
-
*/
|
496
|
-
public String name(int value) {
|
497
|
-
return (String) mapValueToName.get(value);
|
498
|
-
}
|
499
|
-
|
500
|
-
/**
|
501
|
-
* {@inheritDoc}
|
502
|
-
*/
|
503
|
-
public int value(String name) {
|
504
|
-
Object value = mapNameToValue.get(name);
|
505
|
-
if (value == null) {
|
506
|
-
return -1;
|
507
|
-
}
|
508
|
-
return ((Integer) value).intValue();
|
509
|
-
}
|
510
|
-
}
|
511
|
-
|
512
|
-
static abstract class MapIntMap implements Entities.EntityMap {
|
513
|
-
protected Map mapNameToValue;
|
514
|
-
|
515
|
-
protected Map mapValueToName;
|
516
|
-
|
517
|
-
/**
|
518
|
-
* {@inheritDoc}
|
519
|
-
*/
|
520
|
-
public void add(String name, int value) {
|
521
|
-
mapNameToValue.put(name, new Integer(value));
|
522
|
-
mapValueToName.put(new Integer(value), name);
|
523
|
-
}
|
524
|
-
|
525
|
-
/**
|
526
|
-
* {@inheritDoc}
|
527
|
-
*/
|
528
|
-
public String name(int value) {
|
529
|
-
return (String) mapValueToName.get(new Integer(value));
|
530
|
-
}
|
531
|
-
|
532
|
-
/**
|
533
|
-
* {@inheritDoc}
|
534
|
-
*/
|
535
|
-
public int value(String name) {
|
536
|
-
Object value = mapNameToValue.get(name);
|
537
|
-
if (value == null) {
|
538
|
-
return -1;
|
539
|
-
}
|
540
|
-
return ((Integer) value).intValue();
|
541
|
-
}
|
542
|
-
}
|
543
|
-
|
544
|
-
static class HashEntityMap extends MapIntMap {
|
545
|
-
/**
|
546
|
-
* Constructs a new instance of <code>HashEntityMap</code>.
|
547
|
-
*/
|
548
|
-
public HashEntityMap() {
|
549
|
-
mapNameToValue = new HashMap();
|
550
|
-
mapValueToName = new HashMap();
|
551
|
-
}
|
552
|
-
}
|
553
|
-
|
554
|
-
static class TreeEntityMap extends MapIntMap {
|
555
|
-
/**
|
556
|
-
* Constructs a new instance of <code>TreeEntityMap</code>.
|
557
|
-
*/
|
558
|
-
public TreeEntityMap() {
|
559
|
-
mapNameToValue = new TreeMap();
|
560
|
-
mapValueToName = new TreeMap();
|
561
|
-
}
|
562
|
-
}
|
563
|
-
|
564
|
-
static class LookupEntityMap extends PrimitiveEntityMap {
|
565
|
-
private String[] lookupTable;
|
566
|
-
|
567
|
-
private int LOOKUP_TABLE_SIZE = 256;
|
568
|
-
|
569
|
-
/**
|
570
|
-
* {@inheritDoc}
|
571
|
-
*/
|
572
|
-
public String name(int value) {
|
573
|
-
if (value < LOOKUP_TABLE_SIZE) {
|
574
|
-
return lookupTable()[value];
|
575
|
-
}
|
576
|
-
return super.name(value);
|
577
|
-
}
|
578
|
-
|
579
|
-
/**
|
580
|
-
* <p>
|
581
|
-
* Returns the lookup table for this entity map. The lookup table is created if it has not been previously.
|
582
|
-
* </p>
|
583
|
-
*
|
584
|
-
* @return the lookup table
|
585
|
-
*/
|
586
|
-
private String[] lookupTable() {
|
587
|
-
if (lookupTable == null) {
|
588
|
-
createLookupTable();
|
589
|
-
}
|
590
|
-
return lookupTable;
|
591
|
-
}
|
592
|
-
|
593
|
-
/**
|
594
|
-
* <p>
|
595
|
-
* Creates an entity lookup table of LOOKUP_TABLE_SIZE elements, initialized with entity names.
|
596
|
-
* </p>
|
597
|
-
*/
|
598
|
-
private void createLookupTable() {
|
599
|
-
lookupTable = new String[LOOKUP_TABLE_SIZE];
|
600
|
-
for (int i = 0; i < LOOKUP_TABLE_SIZE; ++i) {
|
601
|
-
lookupTable[i] = super.name(i);
|
602
|
-
}
|
603
|
-
}
|
604
|
-
}
|
605
|
-
|
606
|
-
static class ArrayEntityMap implements EntityMap {
|
607
|
-
protected int growBy = 100;
|
608
|
-
|
609
|
-
protected int size = 0;
|
610
|
-
|
611
|
-
protected String[] names;
|
612
|
-
|
613
|
-
protected int[] values;
|
614
|
-
|
615
|
-
/**
|
616
|
-
* Constructs a new instance of <code>ArrayEntityMap</code>.
|
617
|
-
*/
|
618
|
-
public ArrayEntityMap() {
|
619
|
-
names = new String[growBy];
|
620
|
-
values = new int[growBy];
|
621
|
-
}
|
622
|
-
|
623
|
-
/**
|
624
|
-
* Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the array should
|
625
|
-
* grow.
|
626
|
-
*
|
627
|
-
* @param growBy
|
628
|
-
* array will be initialized to and will grow by this amount
|
629
|
-
*/
|
630
|
-
public ArrayEntityMap(int growBy) {
|
631
|
-
this.growBy = growBy;
|
632
|
-
names = new String[growBy];
|
633
|
-
values = new int[growBy];
|
634
|
-
}
|
635
|
-
|
636
|
-
/**
|
637
|
-
* {@inheritDoc}
|
638
|
-
*/
|
639
|
-
public void add(String name, int value) {
|
640
|
-
ensureCapacity(size + 1);
|
641
|
-
names[size] = name;
|
642
|
-
values[size] = value;
|
643
|
-
size++;
|
644
|
-
}
|
645
|
-
|
646
|
-
/**
|
647
|
-
* Verifies the capacity of the entity array, adjusting the size if necessary.
|
648
|
-
*
|
649
|
-
* @param capacity
|
650
|
-
* size the array should be
|
651
|
-
*/
|
652
|
-
protected void ensureCapacity(int capacity) {
|
653
|
-
if (capacity > names.length) {
|
654
|
-
int newSize = Math.max(capacity, size + growBy);
|
655
|
-
String[] newNames = new String[newSize];
|
656
|
-
System.arraycopy(names, 0, newNames, 0, size);
|
657
|
-
names = newNames;
|
658
|
-
int[] newValues = new int[newSize];
|
659
|
-
System.arraycopy(values, 0, newValues, 0, size);
|
660
|
-
values = newValues;
|
661
|
-
}
|
662
|
-
}
|
663
|
-
|
664
|
-
/**
|
665
|
-
* {@inheritDoc}
|
666
|
-
*/
|
667
|
-
public String name(int value) {
|
668
|
-
for (int i = 0; i < size; ++i) {
|
669
|
-
if (values[i] == value) {
|
670
|
-
return names[i];
|
671
|
-
}
|
672
|
-
}
|
673
|
-
return null;
|
674
|
-
}
|
675
|
-
|
676
|
-
/**
|
677
|
-
* {@inheritDoc}
|
678
|
-
*/
|
679
|
-
public int value(String name) {
|
680
|
-
for (int i = 0; i < size; ++i) {
|
681
|
-
if (names[i].equals(name)) {
|
682
|
-
return values[i];
|
683
|
-
}
|
684
|
-
}
|
685
|
-
return -1;
|
686
|
-
}
|
687
|
-
}
|
688
|
-
|
689
|
-
static class BinaryEntityMap extends ArrayEntityMap {
|
690
|
-
|
691
|
-
/**
|
692
|
-
* Constructs a new instance of <code>BinaryEntityMap</code>.
|
693
|
-
*/
|
694
|
-
public BinaryEntityMap() {
|
695
|
-
super();
|
696
|
-
}
|
697
|
-
|
698
|
-
/**
|
699
|
-
* Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the underlying array
|
700
|
-
* should grow.
|
701
|
-
*
|
702
|
-
* @param growBy
|
703
|
-
* array will be initialized to and will grow by this amount
|
704
|
-
*/
|
705
|
-
public BinaryEntityMap(int growBy) {
|
706
|
-
super(growBy);
|
707
|
-
}
|
708
|
-
|
709
|
-
/**
|
710
|
-
* Performs a binary search of the entity array for the specified key. This method is based on code in
|
711
|
-
* {@link java.util.Arrays}.
|
712
|
-
*
|
713
|
-
* @param key
|
714
|
-
* the key to be found
|
715
|
-
* @return the index of the entity array matching the specified key
|
716
|
-
*/
|
717
|
-
private int binarySearch(int key) {
|
718
|
-
int low = 0;
|
719
|
-
int high = size - 1;
|
720
|
-
|
721
|
-
while (low <= high) {
|
722
|
-
int mid = (low + high) >> 1;
|
723
|
-
int midVal = values[mid];
|
724
|
-
|
725
|
-
if (midVal < key) {
|
726
|
-
low = mid + 1;
|
727
|
-
} else if (midVal > key) {
|
728
|
-
high = mid - 1;
|
729
|
-
} else {
|
730
|
-
return mid; // key found
|
731
|
-
}
|
732
|
-
}
|
733
|
-
return -(low + 1); // key not found.
|
734
|
-
}
|
735
|
-
|
736
|
-
/**
|
737
|
-
* {@inheritDoc}
|
738
|
-
*/
|
739
|
-
public void add(String name, int value) {
|
740
|
-
ensureCapacity(size + 1);
|
741
|
-
int insertAt = binarySearch(value);
|
742
|
-
if (insertAt > 0) {
|
743
|
-
return; // note: this means you can't insert the same value twice
|
744
|
-
}
|
745
|
-
insertAt = -(insertAt + 1); // binarySearch returns it negative and off-by-one
|
746
|
-
System.arraycopy(values, insertAt, values, insertAt + 1, size - insertAt);
|
747
|
-
values[insertAt] = value;
|
748
|
-
System.arraycopy(names, insertAt, names, insertAt + 1, size - insertAt);
|
749
|
-
names[insertAt] = name;
|
750
|
-
size++;
|
751
|
-
}
|
752
|
-
|
753
|
-
/**
|
754
|
-
* {@inheritDoc}
|
755
|
-
*/
|
756
|
-
public String name(int value) {
|
757
|
-
int index = binarySearch(value);
|
758
|
-
if (index < 0) {
|
759
|
-
return null;
|
760
|
-
}
|
761
|
-
return names[index];
|
762
|
-
}
|
763
|
-
}
|
764
|
-
|
765
|
-
// package scoped for testing
|
766
|
-
EntityMap map = new Entities.LookupEntityMap();
|
767
|
-
|
768
|
-
/**
|
769
|
-
* <p>
|
770
|
-
* Adds entities to this entity.
|
771
|
-
* </p>
|
772
|
-
*
|
773
|
-
* @param entityArray
|
774
|
-
* array of entities to be added
|
775
|
-
*/
|
776
|
-
public void addEntities(String[][] entityArray) {
|
777
|
-
for (int i = 0; i < entityArray.length; ++i) {
|
778
|
-
addEntity(entityArray[i][0], Integer.parseInt(entityArray[i][1]));
|
779
|
-
}
|
780
|
-
}
|
781
|
-
|
782
|
-
/**
|
783
|
-
* <p>
|
784
|
-
* Add an entity to this entity.
|
785
|
-
* </p>
|
786
|
-
*
|
787
|
-
* @param name
|
788
|
-
* name of the entity
|
789
|
-
* @param value
|
790
|
-
* vale of the entity
|
791
|
-
*/
|
792
|
-
public void addEntity(String name, int value) {
|
793
|
-
map.add(name, value);
|
794
|
-
}
|
795
|
-
|
796
|
-
/**
|
797
|
-
* <p>
|
798
|
-
* Returns the name of the entity identified by the specified value.
|
799
|
-
* </p>
|
800
|
-
*
|
801
|
-
* @param value
|
802
|
-
* the value to locate
|
803
|
-
* @return entity name associated with the specified value
|
804
|
-
*/
|
805
|
-
public String entityName(int value) {
|
806
|
-
return map.name(value);
|
807
|
-
}
|
808
|
-
|
809
|
-
/**
|
810
|
-
* <p>
|
811
|
-
* Returns the value of the entity identified by the specified name.
|
812
|
-
* </p>
|
813
|
-
*
|
814
|
-
* @param name
|
815
|
-
* the name to locate
|
816
|
-
* @return entity value associated with the specified name
|
817
|
-
*/
|
818
|
-
public int entityValue(String name) {
|
819
|
-
return map.value(name);
|
820
|
-
}
|
821
|
-
|
822
|
-
/**
|
823
|
-
* <p>
|
824
|
-
* Escapes the characters in a <code>String</code>.
|
825
|
-
* </p>
|
826
|
-
*
|
827
|
-
* <p>
|
828
|
-
* For example, if you have called addEntity("foo", 0xA1), escape("\u00A1") will return
|
829
|
-
* "&foo;"
|
830
|
-
* </p>
|
831
|
-
*
|
832
|
-
* @param str
|
833
|
-
* The <code>String</code> to escape.
|
834
|
-
* @return A new escaped <code>String</code>.
|
835
|
-
*/
|
836
|
-
public String escape(String str) {
|
837
|
-
StringWriter stringWriter = createStringWriter(str);
|
838
|
-
try {
|
839
|
-
this.escape(stringWriter, str);
|
840
|
-
} catch (IOException e) {
|
841
|
-
// This should never happen because ALL the StringWriter methods called by #escape(Writer, String) do not
|
842
|
-
// throw IOExceptions.
|
843
|
-
throw new RuntimeException(e);
|
844
|
-
}
|
845
|
-
return stringWriter.toString();
|
846
|
-
}
|
847
|
-
|
848
|
-
/**
|
849
|
-
* <p>
|
850
|
-
* Escapes the characters in the <code>String</code> passed and writes the result to the <code>Writer</code>
|
851
|
-
* passed.
|
852
|
-
* </p>
|
853
|
-
*
|
854
|
-
* @param writer
|
855
|
-
* The <code>Writer</code> to write the results of the escaping to. Assumed to be a non-null value.
|
856
|
-
* @param str
|
857
|
-
* The <code>String</code> to escape. Assumed to be a non-null value.
|
858
|
-
* @throws IOException
|
859
|
-
* when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)}
|
860
|
-
* methods.
|
861
|
-
*
|
862
|
-
* @see #escape(String)
|
863
|
-
* @see Writer
|
864
|
-
*/
|
865
|
-
public void escape(Writer writer, String str) throws IOException {
|
866
|
-
int len = str.length();
|
867
|
-
for (int i = 0; i < len; i++) {
|
868
|
-
char c = str.charAt(i);
|
869
|
-
String entityName = this.entityName(c);
|
870
|
-
if (entityName == null) {
|
871
|
-
if (c > 0x7F) {
|
872
|
-
writer.write("&#");
|
873
|
-
writer.write(Integer.toString(c, 10));
|
874
|
-
writer.write(';');
|
875
|
-
} else {
|
876
|
-
writer.write(c);
|
877
|
-
}
|
878
|
-
} else {
|
879
|
-
writer.write('&');
|
880
|
-
writer.write(entityName);
|
881
|
-
writer.write(';');
|
882
|
-
}
|
883
|
-
}
|
884
|
-
}
|
885
|
-
|
886
|
-
/**
|
887
|
-
* <p>
|
888
|
-
* Unescapes the entities in a <code>String</code>.
|
889
|
-
* </p>
|
890
|
-
*
|
891
|
-
* <p>
|
892
|
-
* For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return
|
893
|
-
* "\u00A1"
|
894
|
-
* </p>
|
895
|
-
*
|
896
|
-
* @param str
|
897
|
-
* The <code>String</code> to escape.
|
898
|
-
* @return A new escaped <code>String</code>.
|
899
|
-
*/
|
900
|
-
public String unescape(String str) {
|
901
|
-
int firstAmp = str.indexOf('&');
|
902
|
-
if (firstAmp < 0) {
|
903
|
-
return str;
|
904
|
-
} else {
|
905
|
-
StringWriter stringWriter = createStringWriter(str);
|
906
|
-
try {
|
907
|
-
this.doUnescape(stringWriter, str, firstAmp);
|
908
|
-
} catch (IOException e) {
|
909
|
-
// This should never happen because ALL the StringWriter methods called by #escape(Writer, String)
|
910
|
-
// do not throw IOExceptions.
|
911
|
-
throw new RuntimeException(e);
|
912
|
-
}
|
913
|
-
return stringWriter.toString();
|
914
|
-
}
|
915
|
-
}
|
916
|
-
|
917
|
-
/**
|
918
|
-
* Make the StringWriter 10% larger than the source String to avoid growing the writer
|
919
|
-
*
|
920
|
-
* @param str The source string
|
921
|
-
* @return A newly created StringWriter
|
922
|
-
*/
|
923
|
-
private StringWriter createStringWriter(String str) {
|
924
|
-
return new StringWriter((int) (str.length() + (str.length() * 0.1)));
|
925
|
-
}
|
926
|
-
|
927
|
-
/**
|
928
|
-
* <p>
|
929
|
-
* Unescapes the escaped entities in the <code>String</code> passed and writes the result to the
|
930
|
-
* <code>Writer</code> passed.
|
931
|
-
* </p>
|
932
|
-
*
|
933
|
-
* @param writer
|
934
|
-
* The <code>Writer</code> to write the results to; assumed to be non-null.
|
935
|
-
* @param str
|
936
|
-
* The source <code>String</code> to unescape; assumed to be non-null.
|
937
|
-
* @throws IOException
|
938
|
-
* when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)}
|
939
|
-
* methods.
|
940
|
-
*
|
941
|
-
* @see #escape(String)
|
942
|
-
* @see Writer
|
943
|
-
*/
|
944
|
-
public void unescape(Writer writer, String str) throws IOException {
|
945
|
-
int firstAmp = str.indexOf('&');
|
946
|
-
if (firstAmp < 0) {
|
947
|
-
writer.write(str);
|
948
|
-
return;
|
949
|
-
} else {
|
950
|
-
doUnescape(writer, str, firstAmp);
|
951
|
-
}
|
952
|
-
}
|
953
|
-
|
954
|
-
/**
|
955
|
-
* Underlying unescape method that allows the optimisation of not starting from the 0 index again.
|
956
|
-
*
|
957
|
-
* @param writer
|
958
|
-
* The <code>Writer</code> to write the results to; assumed to be non-null.
|
959
|
-
* @param str
|
960
|
-
* The source <code>String</code> to unescape; assumed to be non-null.
|
961
|
-
* @param firstAmp
|
962
|
-
* The <code>int</code> index of the first ampersand in the source String.
|
963
|
-
* @throws IOException
|
964
|
-
* when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)}
|
965
|
-
* methods.
|
966
|
-
*/
|
967
|
-
private void doUnescape(Writer writer, String str, int firstAmp) throws IOException {
|
968
|
-
writer.write(str, 0, firstAmp);
|
969
|
-
int len = str.length();
|
970
|
-
for (int i = firstAmp; i < len; i++) {
|
971
|
-
char c = str.charAt(i);
|
972
|
-
if (c == '&') {
|
973
|
-
int nextIdx = i + 1;
|
974
|
-
int semiColonIdx = str.indexOf(';', nextIdx);
|
975
|
-
if (semiColonIdx == -1) {
|
976
|
-
writer.write(c);
|
977
|
-
continue;
|
978
|
-
}
|
979
|
-
int amphersandIdx = str.indexOf('&', i + 1);
|
980
|
-
if (amphersandIdx != -1 && amphersandIdx < semiColonIdx) {
|
981
|
-
// Then the text looks like &...&...;
|
982
|
-
writer.write(c);
|
983
|
-
continue;
|
984
|
-
}
|
985
|
-
String entityContent = str.substring(nextIdx, semiColonIdx);
|
986
|
-
int entityValue = -1;
|
987
|
-
int entityContentLen = entityContent.length();
|
988
|
-
if (entityContentLen > 0) {
|
989
|
-
if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or
|
990
|
-
// hexidecimal)
|
991
|
-
if (entityContentLen > 1) {
|
992
|
-
char isHexChar = entityContent.charAt(1);
|
993
|
-
try {
|
994
|
-
switch (isHexChar) {
|
995
|
-
case 'X' :
|
996
|
-
case 'x' : {
|
997
|
-
entityValue = Integer.parseInt(entityContent.substring(2), 16);
|
998
|
-
break;
|
999
|
-
}
|
1000
|
-
default : {
|
1001
|
-
entityValue = Integer.parseInt(entityContent.substring(1), 10);
|
1002
|
-
}
|
1003
|
-
}
|
1004
|
-
if (entityValue > 0xFFFF) {
|
1005
|
-
entityValue = -1;
|
1006
|
-
}
|
1007
|
-
} catch (NumberFormatException e) {
|
1008
|
-
entityValue = -1;
|
1009
|
-
}
|
1010
|
-
}
|
1011
|
-
} else { // escaped value content is an entity name
|
1012
|
-
entityValue = this.entityValue(entityContent);
|
1013
|
-
}
|
1014
|
-
}
|
1015
|
-
|
1016
|
-
if (entityValue == -1) {
|
1017
|
-
writer.write('&');
|
1018
|
-
writer.write(entityContent);
|
1019
|
-
writer.write(';');
|
1020
|
-
} else {
|
1021
|
-
writer.write(entityValue);
|
1022
|
-
}
|
1023
|
-
i = semiColonIdx; // move index up to the semi-colon
|
1024
|
-
} else {
|
1025
|
-
writer.write(c);
|
1026
|
-
}
|
1027
|
-
}
|
1028
|
-
}
|
1029
|
-
|
1030
|
-
}
|