qwik2md 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/qwik2md +17 -0
- data/lib/qwik2md/version.rb +3 -0
- data/lib/qwik2md.rb +39 -0
- data/qwik2md.gemspec +30 -0
- data/vendor/qwik/AUTHORS +10 -0
- data/vendor/qwik/COPYING +340 -0
- data/vendor/qwik/COPYRIGHT +346 -0
- data/vendor/qwik/lib/qwik/Makefile +63 -0
- data/vendor/qwik/lib/qwik/Rakefile +17 -0
- data/vendor/qwik/lib/qwik/act-aa.rb +83 -0
- data/vendor/qwik/lib/qwik/act-archive.rb +386 -0
- data/vendor/qwik/lib/qwik/act-attach.rb +304 -0
- data/vendor/qwik/lib/qwik/act-backup.rb +236 -0
- data/vendor/qwik/lib/qwik/act-basic.rb +325 -0
- data/vendor/qwik/lib/qwik/act-book.rb +161 -0
- data/vendor/qwik/lib/qwik/act-calc.rb +371 -0
- data/vendor/qwik/lib/qwik/act-charset.rb +251 -0
- data/vendor/qwik/lib/qwik/act-christel.rb +112 -0
- data/vendor/qwik/lib/qwik/act-chronology.rb +149 -0
- data/vendor/qwik/lib/qwik/act-code.rb +155 -0
- data/vendor/qwik/lib/qwik/act-comment.rb +554 -0
- data/vendor/qwik/lib/qwik/act-config.rb +49 -0
- data/vendor/qwik/lib/qwik/act-counter.rb +125 -0
- data/vendor/qwik/lib/qwik/act-day.rb +96 -0
- data/vendor/qwik/lib/qwik/act-describe.rb +135 -0
- data/vendor/qwik/lib/qwik/act-diary.rb +109 -0
- data/vendor/qwik/lib/qwik/act-edit.rb +317 -0
- data/vendor/qwik/lib/qwik/act-embed-html.rb +296 -0
- data/vendor/qwik/lib/qwik/act-emode.rb +150 -0
- data/vendor/qwik/lib/qwik/act-event.rb +187 -0
- data/vendor/qwik/lib/qwik/act-file.rb +303 -0
- data/vendor/qwik/lib/qwik/act-files.rb +771 -0
- data/vendor/qwik/lib/qwik/act-getpass.rb +295 -0
- data/vendor/qwik/lib/qwik/act-history.rb +136 -0
- data/vendor/qwik/lib/qwik/act-html.rb +204 -0
- data/vendor/qwik/lib/qwik/act-httpauth.rb +147 -0
- data/vendor/qwik/lib/qwik/act-include.rb +142 -0
- data/vendor/qwik/lib/qwik/act-interwiki.rb +189 -0
- data/vendor/qwik/lib/qwik/act-isearch.rb +109 -0
- data/vendor/qwik/lib/qwik/act-keywords.rb +137 -0
- data/vendor/qwik/lib/qwik/act-lang.rb +81 -0
- data/vendor/qwik/lib/qwik/act-license.rb +63 -0
- data/vendor/qwik/lib/qwik/act-list.rb +287 -0
- data/vendor/qwik/lib/qwik/act-login.rb +410 -0
- data/vendor/qwik/lib/qwik/act-logout.rb +60 -0
- data/vendor/qwik/lib/qwik/act-mail.rb +159 -0
- data/vendor/qwik/lib/qwik/act-map.rb +292 -0
- data/vendor/qwik/lib/qwik/act-md5.rb +42 -0
- data/vendor/qwik/lib/qwik/act-mdlb.rb +741 -0
- data/vendor/qwik/lib/qwik/act-media.rb +416 -0
- data/vendor/qwik/lib/qwik/act-member.rb +157 -0
- data/vendor/qwik/lib/qwik/act-menu.rb +142 -0
- data/vendor/qwik/lib/qwik/act-metadata.rb +323 -0
- data/vendor/qwik/lib/qwik/act-mlsubmitform.rb +49 -0
- data/vendor/qwik/lib/qwik/act-monitor.rb +167 -0
- data/vendor/qwik/lib/qwik/act-new.rb +418 -0
- data/vendor/qwik/lib/qwik/act-pagelist.rb +248 -0
- data/vendor/qwik/lib/qwik/act-password.rb +145 -0
- data/vendor/qwik/lib/qwik/act-plan.rb +210 -0
- data/vendor/qwik/lib/qwik/act-povray.rb +230 -0
- data/vendor/qwik/lib/qwik/act-presen.rb +380 -0
- data/vendor/qwik/lib/qwik/act-redirect.rb +133 -0
- data/vendor/qwik/lib/qwik/act-ring.rb +1071 -0
- data/vendor/qwik/lib/qwik/act-rrefs.rb +255 -0
- data/vendor/qwik/lib/qwik/act-ruby.rb +116 -0
- data/vendor/qwik/lib/qwik/act-sample.rb +170 -0
- data/vendor/qwik/lib/qwik/act-save.rb +295 -0
- data/vendor/qwik/lib/qwik/act-schedule.rb +374 -0
- data/vendor/qwik/lib/qwik/act-search.rb +180 -0
- data/vendor/qwik/lib/qwik/act-searchwords.rb +51 -0
- data/vendor/qwik/lib/qwik/act-sendpass.rb +83 -0
- data/vendor/qwik/lib/qwik/act-site.rb +89 -0
- data/vendor/qwik/lib/qwik/act-sitebackup.rb +419 -0
- data/vendor/qwik/lib/qwik/act-sitelog.rb +118 -0
- data/vendor/qwik/lib/qwik/act-smil.rb +299 -0
- data/vendor/qwik/lib/qwik/act-status.rb +220 -0
- data/vendor/qwik/lib/qwik/act-style.rb +608 -0
- data/vendor/qwik/lib/qwik/act-table.rb +263 -0
- data/vendor/qwik/lib/qwik/act-tableform.rb +241 -0
- data/vendor/qwik/lib/qwik/act-tag.rb +103 -0
- data/vendor/qwik/lib/qwik/act-text.rb +70 -0
- data/vendor/qwik/lib/qwik/act-textarea.rb +164 -0
- data/vendor/qwik/lib/qwik/act-theme.rb +346 -0
- data/vendor/qwik/lib/qwik/act-toc.rb +112 -0
- data/vendor/qwik/lib/qwik/act-typekey.rb +198 -0
- data/vendor/qwik/lib/qwik/act-under-const.rb +94 -0
- data/vendor/qwik/lib/qwik/act-webservice.rb +321 -0
- data/vendor/qwik/lib/qwik/act-wema.rb +558 -0
- data/vendor/qwik/lib/qwik/act-wysiwyg.rb +238 -0
- data/vendor/qwik/lib/qwik/action.rb +325 -0
- data/vendor/qwik/lib/qwik/autoreload.rb +98 -0
- data/vendor/qwik/lib/qwik/bench-bench.rb +28 -0
- data/vendor/qwik/lib/qwik/bench-emode.rb +47 -0
- data/vendor/qwik/lib/qwik/bench-format-xml.rb +70 -0
- data/vendor/qwik/lib/qwik/bench-large-table.rb +62 -0
- data/vendor/qwik/lib/qwik/bench-md5.rb +14 -0
- data/vendor/qwik/lib/qwik/bench-module-session.rb +19 -0
- data/vendor/qwik/lib/qwik/bench-page.rb +50 -0
- data/vendor/qwik/lib/qwik/bench-s-md5.rb +28 -0
- data/vendor/qwik/lib/qwik/bench-session.rb +25 -0
- data/vendor/qwik/lib/qwik/bench-textformat.rb +31 -0
- data/vendor/qwik/lib/qwik/catalog-factory.rb +91 -0
- data/vendor/qwik/lib/qwik/catalog-ja.rb +479 -0
- data/vendor/qwik/lib/qwik/catalog-ml-ja.rb +145 -0
- data/vendor/qwik/lib/qwik/check-act-monitor.rb +112 -0
- data/vendor/qwik/lib/qwik/check-act-monitor2.rb +46 -0
- data/vendor/qwik/lib/qwik/check-act-theme.rb +27 -0
- data/vendor/qwik/lib/qwik/check-event.rb +112 -0
- data/vendor/qwik/lib/qwik/check-event2.rb +55 -0
- data/vendor/qwik/lib/qwik/check-htree-rexml.rb +77 -0
- data/vendor/qwik/lib/qwik/check-htree.rb +51 -0
- data/vendor/qwik/lib/qwik/check-libxml.rb +135 -0
- data/vendor/qwik/lib/qwik/check-many-pages.rb +47 -0
- data/vendor/qwik/lib/qwik/check-monitor.rb +33 -0
- data/vendor/qwik/lib/qwik/check-observer.rb +67 -0
- data/vendor/qwik/lib/qwik/check-server.rb +61 -0
- data/vendor/qwik/lib/qwik/check-uuencode.rb +33 -0
- data/vendor/qwik/lib/qwik/check-webdav.rb +65 -0
- data/vendor/qwik/lib/qwik/check-xml-xpath.rb +27 -0
- data/vendor/qwik/lib/qwik/common-backtrace.rb +94 -0
- data/vendor/qwik/lib/qwik/common-basic.rb +111 -0
- data/vendor/qwik/lib/qwik/common-condition.rb +142 -0
- data/vendor/qwik/lib/qwik/common-error.rb +48 -0
- data/vendor/qwik/lib/qwik/common-gettext.rb +50 -0
- data/vendor/qwik/lib/qwik/common-javascript.rb +45 -0
- data/vendor/qwik/lib/qwik/common-notice.rb +132 -0
- data/vendor/qwik/lib/qwik/common-plain.rb +105 -0
- data/vendor/qwik/lib/qwik/common-plugin.rb +111 -0
- data/vendor/qwik/lib/qwik/common-res.rb +76 -0
- data/vendor/qwik/lib/qwik/common-resolve.rb +92 -0
- data/vendor/qwik/lib/qwik/common-send.rb +171 -0
- data/vendor/qwik/lib/qwik/common-session.rb +139 -0
- data/vendor/qwik/lib/qwik/common-surface.rb +261 -0
- data/vendor/qwik/lib/qwik/common-url.rb +90 -0
- data/vendor/qwik/lib/qwik/compat/Makefile +12 -0
- data/vendor/qwik/lib/qwik/compat/add_load_path.rb +1 -0
- data/vendor/qwik/lib/qwik/config.rb +299 -0
- data/vendor/qwik/lib/qwik/db-b-backup.rb +142 -0
- data/vendor/qwik/lib/qwik/db-backup.rb +184 -0
- data/vendor/qwik/lib/qwik/db-berkeley.rb +306 -0
- data/vendor/qwik/lib/qwik/db-filesystem.rb +305 -0
- data/vendor/qwik/lib/qwik/db-indexer.rb +154 -0
- data/vendor/qwik/lib/qwik/db-searchwords.rb +238 -0
- data/vendor/qwik/lib/qwik/description-ja.rb +267 -0
- data/vendor/qwik/lib/qwik/description.rb +256 -0
- data/vendor/qwik/lib/qwik/dev-add-copyright.rb +23 -0
- data/vendor/qwik/lib/qwik/dev-backup.rb +24 -0
- data/vendor/qwik/lib/qwik/dev-bench.rb +175 -0
- data/vendor/qwik/lib/qwik/dev-calctime.rb +52 -0
- data/vendor/qwik/lib/qwik/dev-css-compressor.rb +60 -0
- data/vendor/qwik/lib/qwik/dev-extract-catalog.rb +102 -0
- data/vendor/qwik/lib/qwik/dev-js-compressor.rb +73 -0
- data/vendor/qwik/lib/qwik/dev-release.rb +235 -0
- data/vendor/qwik/lib/qwik/dev-replace.rb +353 -0
- data/vendor/qwik/lib/qwik/dev-sendmail.rb +25 -0
- data/vendor/qwik/lib/qwik/farm.rb +283 -0
- data/vendor/qwik/lib/qwik/gettext.rb +56 -0
- data/vendor/qwik/lib/qwik/group-cond.rb +157 -0
- data/vendor/qwik/lib/qwik/group-config.rb +247 -0
- data/vendor/qwik/lib/qwik/group-confirm.rb +147 -0
- data/vendor/qwik/lib/qwik/group-db.rb +326 -0
- data/vendor/qwik/lib/qwik/group-mail.rb +195 -0
- data/vendor/qwik/lib/qwik/group-member.rb +307 -0
- data/vendor/qwik/lib/qwik/group-sendmail.rb +231 -0
- data/vendor/qwik/lib/qwik/group-site.rb +374 -0
- data/vendor/qwik/lib/qwik/group-sweep.rb +63 -0
- data/vendor/qwik/lib/qwik/group.rb +157 -0
- data/vendor/qwik/lib/qwik/helper.rb +6 -0
- data/vendor/qwik/lib/qwik/html-generator.rb +104 -0
- data/vendor/qwik/lib/qwik/html-to-wabisabi.rb +148 -0
- data/vendor/qwik/lib/qwik/htree-diff.rb +87 -0
- data/vendor/qwik/lib/qwik/htree-format-xml.rb +57 -0
- data/vendor/qwik/lib/qwik/htree-generator.rb +144 -0
- data/vendor/qwik/lib/qwik/htree-get.rb +251 -0
- data/vendor/qwik/lib/qwik/htree-html-generator.rb +179 -0
- data/vendor/qwik/lib/qwik/htree-template.rb +263 -0
- data/vendor/qwik/lib/qwik/htree-to-wabisabi.rb +171 -0
- data/vendor/qwik/lib/qwik/loadlib.rb +79 -0
- data/vendor/qwik/lib/qwik/logger.rb +115 -0
- data/vendor/qwik/lib/qwik/mail-body.rb +171 -0
- data/vendor/qwik/lib/qwik/mail-header.rb +474 -0
- data/vendor/qwik/lib/qwik/mail-multipart.rb +193 -0
- data/vendor/qwik/lib/qwik/mail-parse.rb +147 -0
- data/vendor/qwik/lib/qwik/mail.rb +341 -0
- data/vendor/qwik/lib/qwik/mailaddress.rb +83 -0
- data/vendor/qwik/lib/qwik/mdlb-model.rb +81 -0
- data/vendor/qwik/lib/qwik/mdlb-sample.rb +324 -0
- data/vendor/qwik/lib/qwik/ml-catalog-factory.rb +27 -0
- data/vendor/qwik/lib/qwik/ml-exception.rb +15 -0
- data/vendor/qwik/lib/qwik/ml-generator.rb +28 -0
- data/vendor/qwik/lib/qwik/ml-gettext.rb +137 -0
- data/vendor/qwik/lib/qwik/ml-logger.rb +82 -0
- data/vendor/qwik/lib/qwik/ml-memory.rb +65 -0
- data/vendor/qwik/lib/qwik/ml-msg-validator.rb +86 -0
- data/vendor/qwik/lib/qwik/ml-processor.rb +609 -0
- data/vendor/qwik/lib/qwik/ml-quickml-server.rb +122 -0
- data/vendor/qwik/lib/qwik/ml-sendmail.rb +0 -0
- data/vendor/qwik/lib/qwik/ml-server.rb +107 -0
- data/vendor/qwik/lib/qwik/ml-session.rb +348 -0
- data/vendor/qwik/lib/qwik/ml-sweeper.rb +101 -0
- data/vendor/qwik/lib/qwik/mock-logger.rb +65 -0
- data/vendor/qwik/lib/qwik/mock-sendmail.rb +78 -0
- data/vendor/qwik/lib/qwik/mock-socket.rb +82 -0
- data/vendor/qwik/lib/qwik/modulobe.rb +406 -0
- data/vendor/qwik/lib/qwik/mongrel-server.rb +72 -0
- data/vendor/qwik/lib/qwik/page-files.rb +249 -0
- data/vendor/qwik/lib/qwik/page-generate.rb +82 -0
- data/vendor/qwik/lib/qwik/page-get.rb +262 -0
- data/vendor/qwik/lib/qwik/page-images.rb +168 -0
- data/vendor/qwik/lib/qwik/page-put.rb +128 -0
- data/vendor/qwik/lib/qwik/page-rrefs.rb +154 -0
- data/vendor/qwik/lib/qwik/page-title.rb +0 -0
- data/vendor/qwik/lib/qwik/page-wikidb.rb +234 -0
- data/vendor/qwik/lib/qwik/page.rb +67 -0
- data/vendor/qwik/lib/qwik/pages.rb +444 -0
- data/vendor/qwik/lib/qwik/parse-plugin.rb +249 -0
- data/vendor/qwik/lib/qwik/parser-emode.rb +116 -0
- data/vendor/qwik/lib/qwik/parser-inline.rb +272 -0
- data/vendor/qwik/lib/qwik/parser.rb +349 -0
- data/vendor/qwik/lib/qwik/password.rb +183 -0
- data/vendor/qwik/lib/qwik/periodic.rb +79 -0
- data/vendor/qwik/lib/qwik/qp.rb +56 -0
- data/vendor/qwik/lib/qwik/qwik-service.rb +341 -0
- data/vendor/qwik/lib/qwik/qwik.rb +5 -0
- data/vendor/qwik/lib/qwik/qwikweb-adduser.rb +34 -0
- data/vendor/qwik/lib/qwik/qwikweb-catalog-validator.rb +110 -0
- data/vendor/qwik/lib/qwik/qwikweb-incgen.rb +28 -0
- data/vendor/qwik/lib/qwik/qwikweb-makesite.rb +41 -0
- data/vendor/qwik/lib/qwik/qwikweb-server.rb +44 -0
- data/vendor/qwik/lib/qwik/qwikweb-showpassword.rb +26 -0
- data/vendor/qwik/lib/qwik/qwikweb-watchlog.rb +67 -0
- data/vendor/qwik/lib/qwik/request-path.rb +304 -0
- data/vendor/qwik/lib/qwik/request-ua.rb +76 -0
- data/vendor/qwik/lib/qwik/request-webrick.rb +81 -0
- data/vendor/qwik/lib/qwik/request.rb +91 -0
- data/vendor/qwik/lib/qwik/resolve-tdiary.rb +292 -0
- data/vendor/qwik/lib/qwik/resolve.rb +121 -0
- data/vendor/qwik/lib/qwik/response.rb +228 -0
- data/vendor/qwik/lib/qwik/server-memory.rb +57 -0
- data/vendor/qwik/lib/qwik/server-webrick.rb +102 -0
- data/vendor/qwik/lib/qwik/server.rb +252 -0
- data/vendor/qwik/lib/qwik/site-config.rb +149 -0
- data/vendor/qwik/lib/qwik/site-db.rb +136 -0
- data/vendor/qwik/lib/qwik/site-event.rb +162 -0
- data/vendor/qwik/lib/qwik/site-files.rb +86 -0
- data/vendor/qwik/lib/qwik/site-group.rb +103 -0
- data/vendor/qwik/lib/qwik/site-index.rb +47 -0
- data/vendor/qwik/lib/qwik/site-log.rb +64 -0
- data/vendor/qwik/lib/qwik/site-member.rb +230 -0
- data/vendor/qwik/lib/qwik/site-monitor.rb +97 -0
- data/vendor/qwik/lib/qwik/site-pages.rb +62 -0
- data/vendor/qwik/lib/qwik/site-plan.rb +139 -0
- data/vendor/qwik/lib/qwik/site-report.rb +282 -0
- data/vendor/qwik/lib/qwik/site-resolve.rb +230 -0
- data/vendor/qwik/lib/qwik/site-rrefs.rb +18 -0
- data/vendor/qwik/lib/qwik/site-search.rb +180 -0
- data/vendor/qwik/lib/qwik/site-timeline.rb +153 -0
- data/vendor/qwik/lib/qwik/site-url.rb +189 -0
- data/vendor/qwik/lib/qwik/site.rb +76 -0
- data/vendor/qwik/lib/qwik/smil-time.rb +105 -0
- data/vendor/qwik/lib/qwik/smtp-session.rb +331 -0
- data/vendor/qwik/lib/qwik/template-generator.rb +149 -0
- data/vendor/qwik/lib/qwik/template.rb +85 -0
- data/vendor/qwik/lib/qwik/test-common.rb +10 -0
- data/vendor/qwik/lib/qwik/test-ml-info.rb +225 -0
- data/vendor/qwik/lib/qwik/test-module-ml.rb +142 -0
- data/vendor/qwik/lib/qwik/test-module-path.rb +110 -0
- data/vendor/qwik/lib/qwik/test-module-public.rb +70 -0
- data/vendor/qwik/lib/qwik/test-module-server.rb +98 -0
- data/vendor/qwik/lib/qwik/test-module-session.rb +264 -0
- data/vendor/qwik/lib/qwik/test-module-suite.rb +91 -0
- data/vendor/qwik/lib/qwik/test-ms-applemail.rb +59 -0
- data/vendor/qwik/lib/qwik/test-ms-attach.rb +174 -0
- data/vendor/qwik/lib/qwik/test-ms-basic.rb +40 -0
- data/vendor/qwik/lib/qwik/test-ms-close.rb +35 -0
- data/vendor/qwik/lib/qwik/test-ms-confirm.rb +75 -0
- data/vendor/qwik/lib/qwik/test-ms-ignore-spam.rb +57 -0
- data/vendor/qwik/lib/qwik/test-ms-japanese.rb +97 -0
- data/vendor/qwik/lib/qwik/test-ms-jfilename.rb +82 -0
- data/vendor/qwik/lib/qwik/test-ms-large.rb +58 -0
- data/vendor/qwik/lib/qwik/test-ms-member.rb +103 -0
- data/vendor/qwik/lib/qwik/test-ms-multipart.rb +84 -0
- data/vendor/qwik/lib/qwik/test-ms-org.rb +129 -0
- data/vendor/qwik/lib/qwik/test-ms-plan.rb +130 -0
- data/vendor/qwik/lib/qwik/test-ms-post.rb +53 -0
- data/vendor/qwik/lib/qwik/test-ms-quopri.rb +76 -0
- data/vendor/qwik/lib/qwik/test-sub-quopri.rb +45 -0
- data/vendor/qwik/lib/qwik/test-submit-base64.rb +59 -0
- data/vendor/qwik/lib/qwik/test-submit-forward.rb +61 -0
- data/vendor/qwik/lib/qwik/test-submit-html-mail.rb +52 -0
- data/vendor/qwik/lib/qwik/test-submit-japanese.rb +135 -0
- data/vendor/qwik/lib/qwik/test-submit-jfilename.rb +144 -0
- data/vendor/qwik/lib/qwik/test-submit-uuencode.rb +71 -0
- data/vendor/qwik/lib/qwik/test-suite-all.rb +8 -0
- data/vendor/qwik/lib/qwik/test-suite-basic.rb +9 -0
- data/vendor/qwik/lib/qwik/test-suite-ml.rb +9 -0
- data/vendor/qwik/lib/qwik/test-typekey.rb +64 -0
- data/vendor/qwik/lib/qwik/testunit.rb +45 -0
- data/vendor/qwik/lib/qwik/tokenizer-inline.rb +288 -0
- data/vendor/qwik/lib/qwik/tokenizer.rb +331 -0
- data/vendor/qwik/lib/qwik/typekey.rb +160 -0
- data/vendor/qwik/lib/qwik/util-basic.rb +135 -0
- data/vendor/qwik/lib/qwik/util-charset.rb +331 -0
- data/vendor/qwik/lib/qwik/util-css.rb +56 -0
- data/vendor/qwik/lib/qwik/util-csv-tokenizer.rb +113 -0
- data/vendor/qwik/lib/qwik/util-filename.rb +112 -0
- data/vendor/qwik/lib/qwik/util-pathname.rb +202 -0
- data/vendor/qwik/lib/qwik/util-pid.rb +58 -0
- data/vendor/qwik/lib/qwik/util-safe.rb +67 -0
- data/vendor/qwik/lib/qwik/util-sendmail.rb +273 -0
- data/vendor/qwik/lib/qwik/util-string.rb +202 -0
- data/vendor/qwik/lib/qwik/util-time.rb +125 -0
- data/vendor/qwik/lib/qwik/util-webrick.rb +176 -0
- data/vendor/qwik/lib/qwik/version.rb +11 -0
- data/vendor/qwik/lib/qwik/wabisabi-basic.rb +163 -0
- data/vendor/qwik/lib/qwik/wabisabi-diff.rb +130 -0
- data/vendor/qwik/lib/qwik/wabisabi-format-xml.rb +310 -0
- data/vendor/qwik/lib/qwik/wabisabi-generator.rb +262 -0
- data/vendor/qwik/lib/qwik/wabisabi-index.rb +174 -0
- data/vendor/qwik/lib/qwik/wabisabi-table.rb +212 -0
- data/vendor/qwik/lib/qwik/wabisabi-template.rb +295 -0
- data/vendor/qwik/lib/qwik/wabisabi-to-htree.rb +111 -0
- data/vendor/qwik/lib/qwik/wabisabi-to-wiki.rb +690 -0
- data/vendor/qwik/lib/qwik/wabisabi-traverse.rb +207 -0
- data/vendor/qwik/lib/qwik/wabisabi-validator.rb +116 -0
- data/vendor/qwik/lib/qwik/wabisabi.rb +5 -0
- metadata +492 -0
@@ -0,0 +1,263 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/act-edit'
|
7
|
+
require 'qwik/wabisabi-table'
|
8
|
+
|
9
|
+
module Qwik
|
10
|
+
class Action
|
11
|
+
D_PluginTable = {
|
12
|
+
:dt => 'Table edit plugin',
|
13
|
+
:dd => 'You can edit a table in the page.',
|
14
|
+
:dc => "* Example
|
15
|
+
{{table}}
|
16
|
+
{{table}}
|
17
|
+
You see a five by five table here.
|
18
|
+
You can edit the table in the page.
|
19
|
+
|
20
|
+
This is just a description page.
|
21
|
+
You should try this plugin on your own page.
|
22
|
+
"
|
23
|
+
}
|
24
|
+
|
25
|
+
D_PluginTable_ja = {
|
26
|
+
:dt => 'テーブル編集プラグイン',
|
27
|
+
:dd => 'ページ中でテーブルを編集できます。',
|
28
|
+
:dc => "* 例
|
29
|
+
{{table}}
|
30
|
+
{{table}}
|
31
|
+
ここに5x5のテーブルが見えます。
|
32
|
+
それぞれの項目は入力フィールドになっており、書き換えられます。
|
33
|
+
最後に「更新」を押すと、それらの入力が反映されます。
|
34
|
+
|
35
|
+
この画面は説明用の画面なので、編集できません。
|
36
|
+
自分のページで試してみてください。
|
37
|
+
"
|
38
|
+
}
|
39
|
+
|
40
|
+
def plg_table
|
41
|
+
content = nil
|
42
|
+
content = yield if block_given?
|
43
|
+
|
44
|
+
if content.nil? || content.empty? # no contents
|
45
|
+
content = Action.table_default_content
|
46
|
+
end
|
47
|
+
|
48
|
+
w = c_parse(content)
|
49
|
+
return p_error(_('You can only use a table.')) if 1 < w.length
|
50
|
+
|
51
|
+
table = w[0]
|
52
|
+
if table.nil? || table[0] != :table
|
53
|
+
return p_error(_('You can only use a table.'))
|
54
|
+
end
|
55
|
+
|
56
|
+
if WabisabiTable.error_check(table)
|
57
|
+
return p_error(_('You can only use text.'))
|
58
|
+
end
|
59
|
+
|
60
|
+
WabisabiTable.prepare(table)
|
61
|
+
|
62
|
+
# @table_num is global for an action.
|
63
|
+
@table_num = 0 if !defined?(@table_num)
|
64
|
+
@table_num += 1
|
65
|
+
num = @table_num
|
66
|
+
|
67
|
+
action = "#{@req.base}.#{num}.table"
|
68
|
+
div = [:div, {:class=>'table'},
|
69
|
+
[:form, {:method=>'POST', :action=>action},
|
70
|
+
table,
|
71
|
+
[:div, {:class=>'submit'},
|
72
|
+
[:input, {:type=>'submit', :value=>_('Update')}]]]]
|
73
|
+
return div
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.table_default_content
|
77
|
+
content = ''
|
78
|
+
content << "||A|B|C|D|E\n"
|
79
|
+
(1..5).each {|n|
|
80
|
+
content << "|#{n}||||||\n"
|
81
|
+
}
|
82
|
+
return content
|
83
|
+
end
|
84
|
+
|
85
|
+
def ext_table
|
86
|
+
num = @req.ext_args[0].to_i
|
87
|
+
return c_nerror(_('Error')) if num < 1
|
88
|
+
|
89
|
+
query = @req.query
|
90
|
+
new_table_str = table_construct(query)
|
91
|
+
|
92
|
+
begin
|
93
|
+
plugin_edit(:table, num) {
|
94
|
+
new_table_str
|
95
|
+
}
|
96
|
+
rescue NoCorrespondingPlugin
|
97
|
+
return c_nerror(_('Failed'))
|
98
|
+
rescue PageCollisionError
|
99
|
+
url = "#{@req.base}.html"
|
100
|
+
editing_content = [:pre, new_table_str]
|
101
|
+
message = edit_conflict_message(url, editing_content)
|
102
|
+
return mcomment_error(_('Page collision detected.')) {
|
103
|
+
message
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
c_make_log('table') # TABLE
|
108
|
+
|
109
|
+
url = "#{@req.base}.html"
|
110
|
+
return c_notice(_('Edit done.'), url){
|
111
|
+
[[:h2, _('Edit done.')],
|
112
|
+
[:p, [:a, {:href=>url}, _('Go back')]]]
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
def table_construct(query)
|
117
|
+
table = []
|
118
|
+
query.each {|k, v|
|
119
|
+
prefix, col, row = k.split('_')
|
120
|
+
next if prefix != 't' || col.nil? || row.nil?
|
121
|
+
col = col.to_i
|
122
|
+
row = row.to_i
|
123
|
+
table[row] = [] if table[row].nil?
|
124
|
+
table[row][col] = v
|
125
|
+
}
|
126
|
+
|
127
|
+
# Check last row
|
128
|
+
last_tr = table.last
|
129
|
+
empty = true
|
130
|
+
last_tr.each {|col|
|
131
|
+
if col && ! col.empty?
|
132
|
+
empty = false
|
133
|
+
end
|
134
|
+
}
|
135
|
+
if empty
|
136
|
+
table[table.length-1] = nil # Delete the last row.
|
137
|
+
end
|
138
|
+
|
139
|
+
str = ''
|
140
|
+
table.each_with_index {|row, y|
|
141
|
+
next if row.nil?
|
142
|
+
row.each_with_index {|col, x|
|
143
|
+
str << "|#{col}"
|
144
|
+
}
|
145
|
+
str << "\n"
|
146
|
+
}
|
147
|
+
|
148
|
+
return str
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
if $0 == __FILE__
|
154
|
+
require 'qwik/test-common'
|
155
|
+
$test = true
|
156
|
+
end
|
157
|
+
|
158
|
+
if defined?($test) && $test
|
159
|
+
class TestActTable < Test::Unit::TestCase
|
160
|
+
include TestSession
|
161
|
+
|
162
|
+
def test_plg_table
|
163
|
+
t_add_user
|
164
|
+
ok_wi([:div, {:class=>'error'},
|
165
|
+
[:strong, 'Error', ':'], ' ', 'You can only use a table.'],
|
166
|
+
"{{table
|
167
|
+
a
|
168
|
+
}}")
|
169
|
+
ok_wi([:div, {:class=>'error'},
|
170
|
+
[:strong, 'Error', ':'], ' ', 'You can only use a table.'],
|
171
|
+
"{{table
|
172
|
+
|a
|
173
|
+
|
174
|
+
|b
|
175
|
+
}}")
|
176
|
+
ok_wi([:div, {:class=>'table'},
|
177
|
+
[:form, {:action=>'1.1.table', :method=>'POST'},
|
178
|
+
[:table,
|
179
|
+
[:tr,
|
180
|
+
[:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
|
181
|
+
[:th, {:class=>'new_col'},
|
182
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_1_0'}]],
|
183
|
+
[:td, {:class=>'new_col_button'},
|
184
|
+
[:a, {:href=>"javascript:show_new_col();"}, ">>"]]],
|
185
|
+
[:tr, {:class=>'new_row'},
|
186
|
+
[:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_1'}]],
|
187
|
+
[:td, {:class=>'new_col'},
|
188
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_1_1'}]]],
|
189
|
+
[:tr, {:class=>'new_row_button_row'},
|
190
|
+
[:td, {:class=>'new_row_button'},
|
191
|
+
[:a, {:href=>"javascript:show_new_row();"}, 'v']]]],
|
192
|
+
[:div, {:class=>'submit'},
|
193
|
+
[:input, {:value=>'Update', :type=>'submit'}]]]],
|
194
|
+
"{{table
|
195
|
+
|a
|
196
|
+
}}")
|
197
|
+
ok_wi([:div, {:class=>'table'},
|
198
|
+
[:form, {:action=>'1.1.table', :method=>'POST'},
|
199
|
+
[:table,
|
200
|
+
[:tr,
|
201
|
+
[:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
|
202
|
+
[:th, [:input, {:size=>'1', :value=>'b', :name=>'t_1_0'}]],
|
203
|
+
[:th, {:class=>'new_col'},
|
204
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_2_0'}]],
|
205
|
+
[:td, {:class=>'new_col_button'},
|
206
|
+
[:a, {:href=>"javascript:show_new_col();"}, ">>"]]],
|
207
|
+
[:tr,
|
208
|
+
[:th, [:input, {:size=>'1', :value=>'c', :name=>'t_0_1'}]],
|
209
|
+
[:td, [:input, {:size=>'1', :value=>'d', :name=>'t_1_1'}]],
|
210
|
+
[:td, {:class=>'new_col'},
|
211
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_2_1'}]]],
|
212
|
+
[:tr, {:class=>'new_row'},
|
213
|
+
[:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_2'}]],
|
214
|
+
[:td, [:input, {:size=>'1', :value=>'', :name=>'t_1_2'}]],
|
215
|
+
[:td, {:class=>'new_col'},
|
216
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_2_2'}]]],
|
217
|
+
[:tr, {:class=>'new_row_button_row'},
|
218
|
+
[:td, {:class=>'new_row_button'},
|
219
|
+
[:a, {:href=>"javascript:show_new_row();"}, 'v']]]],
|
220
|
+
[:div, {:class=>'submit'},
|
221
|
+
[:input, {:value=>'Update', :type=>'submit'}]]]],
|
222
|
+
"{{table
|
223
|
+
|a|b
|
224
|
+
|c|d
|
225
|
+
}}")
|
226
|
+
end
|
227
|
+
|
228
|
+
def nutest_ext_table
|
229
|
+
t_add_user
|
230
|
+
page = @site.create_new
|
231
|
+
page.store("{{table
|
232
|
+
|a
|
233
|
+
}}")
|
234
|
+
|
235
|
+
res = session('/test/1.html')
|
236
|
+
expected = [:form, {:action=>'1.1.table', :method=>'POST'},
|
237
|
+
[:table,
|
238
|
+
[:tr,
|
239
|
+
[:th, [:input, {:size=>'1', :value=>'a', :name=>'t_0_0'}]],
|
240
|
+
[:th, {:class=>'new_col'},
|
241
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_1_0'}]],
|
242
|
+
[:td, {:class=>'new_col_button'},
|
243
|
+
[:a, {:href=>"javascript:show_new_col();"}, ">>"]]],
|
244
|
+
[:tr, {:class=>'new_row'},
|
245
|
+
[:th, [:input, {:size=>'1', :value=>'', :name=>'t_0_1'}]],
|
246
|
+
[:td, {:class=>'new_col'},
|
247
|
+
[:input, {:size=>'1', :value=>'', :name=>'t_1_1'}]]],
|
248
|
+
[:tr, {:class=>'new_row_button_row'},
|
249
|
+
[:td, {:class=>'new_row_button'},
|
250
|
+
[:a, {:href=>"javascript:show_new_row();"}, 'v']]]],
|
251
|
+
[:div, {:class=>'submit'},
|
252
|
+
[:input, {:value=>'Update', :type=>'submit'}]]]
|
253
|
+
ok_in(expected, "//div[@class='table']")
|
254
|
+
|
255
|
+
res = session("/test/1.1.table?t_0_0=bb")
|
256
|
+
ok_in(['Edit done.'], '//h2')
|
257
|
+
|
258
|
+
res = session('/test/1.html')
|
259
|
+
ok_xp([:input, {:size=>'2', :value=>'bb', :name=>'t_0_0'}],
|
260
|
+
"//div[@class='table']/form/input")
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
@@ -0,0 +1,241 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
|
7
|
+
module Qwik
|
8
|
+
class Action
|
9
|
+
def plg_tableform(dest=nil)
|
10
|
+
content = yield
|
11
|
+
return TableForm.generate(self, dest, content, @req.base)
|
12
|
+
end
|
13
|
+
|
14
|
+
def plg_form(dest=nil, method=nil)
|
15
|
+
str = yield
|
16
|
+
dest = @req.base unless dest && ! dest.empty?
|
17
|
+
action = dest.to_s.escape
|
18
|
+
action += '.html' if action[0] != ?.
|
19
|
+
http_method = nil
|
20
|
+
if method
|
21
|
+
http_method = 'GET' if method == 'GET'
|
22
|
+
http_method = 'POST' if method == 'POST'
|
23
|
+
end
|
24
|
+
hash = {:method=>http_method, :action=>action}
|
25
|
+
hash.delete_if {|k, v| v.nil? }
|
26
|
+
form = [:form, hash]
|
27
|
+
form += c_res(str)
|
28
|
+
return form
|
29
|
+
end
|
30
|
+
|
31
|
+
def req_user
|
32
|
+
return @req.user
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class TableForm
|
37
|
+
def self.generate(action, dest, str, pagename)
|
38
|
+
table = [:table, {:class=>'form'}]
|
39
|
+
|
40
|
+
str.each {|line|
|
41
|
+
line.chomp!
|
42
|
+
|
43
|
+
ar = line.split(/\|/)
|
44
|
+
ar.shift
|
45
|
+
|
46
|
+
case ar.length
|
47
|
+
when 1
|
48
|
+
table << [:tr, [:td, {:colspan=>2, :class=>'msg'}, ar.shift]]
|
49
|
+
|
50
|
+
when 2
|
51
|
+
midashi = ar.shift
|
52
|
+
td = []
|
53
|
+
nakami = ar.shift
|
54
|
+
nakami.sub!(/^\{\{/, "")
|
55
|
+
nakami.sub!(/\}\}$/, "")
|
56
|
+
|
57
|
+
if /^([^\(\)]+)\((.*)\)$/ =~ nakami
|
58
|
+
cmd, args = $1, $2
|
59
|
+
aa = args.split(/,/)
|
60
|
+
|
61
|
+
case cmd
|
62
|
+
when 'input'
|
63
|
+
td << gen_input(*aa)
|
64
|
+
|
65
|
+
when 'select'
|
66
|
+
td << gen_select(*aa)
|
67
|
+
|
68
|
+
when 'textarea'
|
69
|
+
name, w, h, msg = aa
|
70
|
+
msg = '' if !msg
|
71
|
+
msg.gsub!(/\\n/, "\n")
|
72
|
+
td << gen_textarea(name, w, h, msg)
|
73
|
+
|
74
|
+
when 'submit'
|
75
|
+
su = gen_submit(*aa)
|
76
|
+
su.attr[:class] = 'submit'
|
77
|
+
td << su
|
78
|
+
|
79
|
+
when 'show'
|
80
|
+
td << [:span, action.show(*aa)]
|
81
|
+
|
82
|
+
when 'ring_show'
|
83
|
+
td << [:span, action.plg_ring_show(*aa)]
|
84
|
+
|
85
|
+
when 'member_user'
|
86
|
+
#td << [:span, action.plg_member_user]
|
87
|
+
td << [:span, action.req_user]
|
88
|
+
|
89
|
+
end
|
90
|
+
else
|
91
|
+
td << [:span, nakami]
|
92
|
+
end
|
93
|
+
etd = [:td, {:class=>'nakami'}, td]
|
94
|
+
etr = [:tr, [:td, {:class=>'midashi'}, midashi], etd]
|
95
|
+
table << etr
|
96
|
+
else
|
97
|
+
table << [:tr, ar.to_s] #debug
|
98
|
+
end
|
99
|
+
}
|
100
|
+
|
101
|
+
action = "#{pagename.to_s.escape}.html"
|
102
|
+
action = "#{dest.to_s.escape}.html" if dest && ! dest.empty?
|
103
|
+
|
104
|
+
div = [:div, {:class=>'form'},
|
105
|
+
[:form, {:method=>'POST', :action=>action},
|
106
|
+
[:input, {:type=>'hidden', :name=>'page', :value=>pagename.escape}],
|
107
|
+
table]]
|
108
|
+
return div
|
109
|
+
end
|
110
|
+
|
111
|
+
def self.gen_input(name, value=nil, size=nil, maxsize=nil)
|
112
|
+
attr = {:name=>name}
|
113
|
+
attr[:value] = value if value
|
114
|
+
attr[:size] = size if size
|
115
|
+
attr[:maxsize] = maxsize if maxsize
|
116
|
+
return [:input, attr]
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.gen_input_password(n, v=nil)
|
120
|
+
attr = {:type=>'password', :name=>n}
|
121
|
+
attr[:value] = v if v
|
122
|
+
return [:input, attr]
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.gen_select(n, *aa)
|
126
|
+
return [:select, {:name=>n}] + aa.map {|a| [:option, {:name=>a}, a] }
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.gen_submit(v=nil, n=nil)
|
130
|
+
attr = {:type=>'submit'}
|
131
|
+
attr[:value] = v if v
|
132
|
+
attr[:name] = n if n
|
133
|
+
return [:input, attr]
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.gen_textarea(name, cols=nil, rows=nil, msg=nil)
|
137
|
+
msg ||= ''
|
138
|
+
msg.gsub!(/\\n/, "\n")
|
139
|
+
attr = {:name=>name}
|
140
|
+
attr[:cols] = cols if cols
|
141
|
+
attr[:rows] = rows if rows
|
142
|
+
return [:textarea, attr, msg]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
if $0 == __FILE__
|
148
|
+
require 'qwik/test-common'
|
149
|
+
$test = true
|
150
|
+
end
|
151
|
+
|
152
|
+
if defined?($test) && $test
|
153
|
+
class TestActTableForm < Test::Unit::TestCase
|
154
|
+
include TestSession
|
155
|
+
|
156
|
+
alias ok ok_eq
|
157
|
+
|
158
|
+
def test_form_element
|
159
|
+
c = Qwik::TableForm
|
160
|
+
ok([:input, {:name=>'n'}], c.gen_input('n'))
|
161
|
+
ok([:input, {:value=>'v', :name=>'n'}], c.gen_input('n', 'v'))
|
162
|
+
ok([:input, {:type=>'password', :name=>'n'}], c.gen_input_password('n'))
|
163
|
+
ok([:input, {:value=>'v', :type=>'submit'}], c.gen_submit('v'))
|
164
|
+
ok([:textarea, {:name=>'n'}, ''], c.gen_textarea('n'))
|
165
|
+
ok([:textarea, {:cols=>'40', :name=>'n', :rows=>'7'}, ''],
|
166
|
+
c.gen_textarea('n', '40', '7'))
|
167
|
+
ok([:textarea, {:cols=>'40', :name=>'n', :rows=>'7'}, 'msg'],
|
168
|
+
c.gen_textarea('n', '40', '7', 'msg'))
|
169
|
+
# does not work for now
|
170
|
+
ok([:textarea, {:cols=>'40', :name=>'n', :rows=>'7'}, "line1\nline2"],
|
171
|
+
c.gen_textarea('n', '40', '7', "line1\\nline2"))
|
172
|
+
ok([:select, {:name=>'n'}], c.gen_select('n'))
|
173
|
+
ok([:select, {:name=>'n'}, [:option, {:name=>'1'}, '1']],
|
174
|
+
c.gen_select('n', '1'))
|
175
|
+
end
|
176
|
+
|
177
|
+
def test_form_arg
|
178
|
+
ok_wi([:form, {:action=>'DestPage.html'}, [:p, 'a']],
|
179
|
+
"{{form(DestPage)\na\n}}")
|
180
|
+
ok_wi([:form, {:method=>'POST', :action=>'DestPage.html'}, [:p, 'a']],
|
181
|
+
"{{form(DestPage, POST)\na\n}}")
|
182
|
+
ok_wi([:form, {:action=>'1.html'}, [:dl, [:dt, 'k'], [:dd, 'v']]],
|
183
|
+
"{{form\n:k:v\n}}")
|
184
|
+
# test_real_situation
|
185
|
+
end
|
186
|
+
|
187
|
+
def test_tableform
|
188
|
+
ok_wi([:div, {:class=>'form'},
|
189
|
+
[:form, {:method=>'POST', :action=>'dest.html'},
|
190
|
+
[:input, {:value=>'1', :type=>'hidden', :name=>'page'}],
|
191
|
+
[:table, {:class=>'form'},
|
192
|
+
[:tr,
|
193
|
+
[:td, {:class=>'midashi'}, 'k'],
|
194
|
+
[:td, {:class=>'nakami'}, [[:span, 'v']]]]]]],
|
195
|
+
"{{tableform(dest)\n|k|v|\n}}")
|
196
|
+
|
197
|
+
ok_wi([:div, {:class=>'form'},
|
198
|
+
[:form, {:method=>'POST', :action=>'dest.html'},
|
199
|
+
[:input, {:value=>'1', :type=>'hidden', :name=>'page'}],
|
200
|
+
[:table, {:class=>'form'},
|
201
|
+
[:tr,
|
202
|
+
[:td, {:class=>'midashi'}, 'mail'],
|
203
|
+
[:td, {:class=>'nakami'},
|
204
|
+
[[:input, {:size=>'must',
|
205
|
+
:value=>'', :name=>'tomail'}]]]],
|
206
|
+
[:tr, [:td, {:class=>'msg', :colspan=>2},
|
207
|
+
'input your mail.']],
|
208
|
+
[:tr,
|
209
|
+
[:td, {:class=>'midashi'}, ''],
|
210
|
+
[:td, {:class=>'nakami'},
|
211
|
+
[[:input, {:value=>' GO ',
|
212
|
+
:type=>'submit', :class=>'submit'}]]]]]]],
|
213
|
+
"{{tableform(dest)
|
214
|
+
|mail|{{input(tomail,,must)}}|
|
215
|
+
|input your mail.|
|
216
|
+
||{{submit( GO )}}|
|
217
|
+
}}")
|
218
|
+
|
219
|
+
ok_wi([:div, {:class=>'form'},
|
220
|
+
[:form, {:method=>'POST', :action=>'1.html'},
|
221
|
+
[:input, {:value=>'1', :type=>'hidden', :name=>'page'}],
|
222
|
+
[:table, {:class=>'form'},
|
223
|
+
[:tr,
|
224
|
+
[:td, {:class=>'midashi'}, "項目"],
|
225
|
+
[:td, {:class=>'nakami'},
|
226
|
+
[[:input, {:size=>'must',
|
227
|
+
:value=>'default', :name=>'name'}]]]],
|
228
|
+
[:tr, [:td, {:class=>'msg', :colspan=>2}, "説明"]],
|
229
|
+
[:tr,
|
230
|
+
[:td, {:class=>'midashi'}, ''],
|
231
|
+
[:td, {:class=>'nakami'},
|
232
|
+
[[:input, {:value=>" 投稿 ",
|
233
|
+
:type=>'submit', :class=>'submit'}]]]]]]],
|
234
|
+
"{{tableform
|
235
|
+
|項目|{{input(name,default,must)}}|
|
236
|
+
|説明|
|
237
|
+
||{{submit( 投稿 )}}|
|
238
|
+
}}")
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
|
7
|
+
module Qwik
|
8
|
+
class Action
|
9
|
+
def plg_show_tags
|
10
|
+
page = @site[@req.base]
|
11
|
+
return if page.nil?
|
12
|
+
tags = page.get_tags
|
13
|
+
return nil if tags.nil?
|
14
|
+
div = [:div, {:class=>'tags'}]
|
15
|
+
tags.each {|tag|
|
16
|
+
div << [:a, {:href=>"#{tag}.tag"}, tag]
|
17
|
+
}
|
18
|
+
return div
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.tag_get_pages(site)
|
22
|
+
pages = Hash.new {|h, k| h[k] = []}
|
23
|
+
site.each {|page|
|
24
|
+
tags = page.get_tags
|
25
|
+
next if tags.nil?
|
26
|
+
tags.each {|tag|
|
27
|
+
pages[tag] << page.key
|
28
|
+
}
|
29
|
+
}
|
30
|
+
return pages
|
31
|
+
end
|
32
|
+
|
33
|
+
def ext_tag
|
34
|
+
target_tag = @req.base
|
35
|
+
|
36
|
+
all_pages = Action.tag_get_pages(@site)
|
37
|
+
pages = all_pages[target_tag]
|
38
|
+
return c_nerror('no such tag') if pages.empty?
|
39
|
+
|
40
|
+
div = [:div, {:class=>'tag_pages'}]
|
41
|
+
pages.each {|key|
|
42
|
+
page = @site[key]
|
43
|
+
body = surface_get_body(page)
|
44
|
+
div += body
|
45
|
+
}
|
46
|
+
return c_surface("tag : #{target_tag}"){
|
47
|
+
div
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
if $0 == __FILE__
|
54
|
+
require 'qwik/test-common'
|
55
|
+
$test = true
|
56
|
+
end
|
57
|
+
|
58
|
+
if defined?($test) && $test
|
59
|
+
class TestActTag < Test::Unit::TestCase
|
60
|
+
include TestSession
|
61
|
+
|
62
|
+
def test_all
|
63
|
+
t_add_user
|
64
|
+
|
65
|
+
# test_plg_show_tags
|
66
|
+
page = @site.create_new
|
67
|
+
page.store("* [t1][t2] t
|
68
|
+
{{show_tags}}")
|
69
|
+
res = session('/test/1.html')
|
70
|
+
ok_title 't'
|
71
|
+
ok_xp([:div, {:class=>'tags'},
|
72
|
+
[:a, {:href=>'t1.tag'}, 't1'],
|
73
|
+
[:a, {:href=>'t2.tag'}, 't2']], "//div[@class='tags']")
|
74
|
+
|
75
|
+
# Make pages with tag 't1'.
|
76
|
+
page1 = @site['1']
|
77
|
+
page1.store("* [t1] page1
|
78
|
+
body1")
|
79
|
+
page2 = @site.create('2')
|
80
|
+
page2.store("* [t1] page2
|
81
|
+
body2")
|
82
|
+
|
83
|
+
# test_tag_get_pages
|
84
|
+
pages = Qwik::Action.tag_get_pages(@site)
|
85
|
+
ok_eq({'t1'=>['1', '2']}, pages)
|
86
|
+
|
87
|
+
# test_act_tag
|
88
|
+
res = session('/test/nosuch.tag')
|
89
|
+
ok_title 'no such tag'
|
90
|
+
|
91
|
+
res = session('/test/t1.tag')
|
92
|
+
ok_title 'tag : t1'
|
93
|
+
ok_xp([:div, {:class=>'tag_pages'},
|
94
|
+
[:div, {:class=>'day'}, '',
|
95
|
+
[:div, {:class=>'body'},
|
96
|
+
[:div, {:class=>'section'}, [[:p, 'body1']]]]],
|
97
|
+
[:div, {:class=>'day'}, '',
|
98
|
+
[:div, {:class=>'body'},
|
99
|
+
[:div, {:class=>'section'}, [[:p, 'body2']]]]]],
|
100
|
+
"//div[@class='tag_pages']")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
|
7
|
+
module Qwik
|
8
|
+
class Action
|
9
|
+
def plg_text
|
10
|
+
str = yield
|
11
|
+
return c_res(str)
|
12
|
+
end
|
13
|
+
|
14
|
+
def plg_pre_text
|
15
|
+
str = yield
|
16
|
+
return c_pre_text { str }
|
17
|
+
end
|
18
|
+
|
19
|
+
def c_pre_text
|
20
|
+
str = yield
|
21
|
+
tokens = TextTokenizer.tokenize(str, true)
|
22
|
+
tree = TextParser.make_tree(tokens)
|
23
|
+
w = Resolver.resolve(@site, self, tree)
|
24
|
+
return w
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if $0 == __FILE__
|
30
|
+
require 'qwik/test-common'
|
31
|
+
$test = true
|
32
|
+
end
|
33
|
+
|
34
|
+
if defined?($test) && $test
|
35
|
+
class TestActText < Test::Unit::TestCase
|
36
|
+
include TestSession
|
37
|
+
|
38
|
+
def ok_day(e, w, user=DEFAULT_USER)
|
39
|
+
assert_path(e, w, user, "//div[@class='day']")
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_plg_text
|
43
|
+
ok_day([[:h2, {:id=>'8f03c3a6dbec1d0f1a5af60947b7b052'}, 'あ'],
|
44
|
+
[:div, {:class=>'body'}, [:div, {:class=>'section'}, []]]],
|
45
|
+
"{{text\n* あ\n}}")
|
46
|
+
ok_day([[:h2, {:id=>'7657b04993b557a2ee9b36bf280a3ec4'}, 'い'],
|
47
|
+
[:div, {:class=>'body'}, [:div, {:class=>'section'}, []]]],
|
48
|
+
"{{text\n* い\n}}")
|
49
|
+
ok_wi([:p, '<'], "{{text\n<\n}}")
|
50
|
+
@site['1'].delete
|
51
|
+
@site.erase_all
|
52
|
+
ok_wi([[:dl, [:dt, 'dt1'], [:dd, 'dd1']],
|
53
|
+
[:p, 'p1'], [:dl, [:dd, 'dd2']]],
|
54
|
+
"{{text\n:dt1:dd1\np1\n::dd2\n}}")
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_c_pre_text
|
58
|
+
res = session
|
59
|
+
ok_eq([[:p, 'a']], @action.c_pre_text { 'a' })
|
60
|
+
ok_eq([[:br]], @action.c_pre_text { '{{br}}' })
|
61
|
+
ok_eq([[:div, {:class=>'ref'},
|
62
|
+
[:a, {:href=>'FrontPage.files/a.jpg'},
|
63
|
+
[:img, {:src=>'.theme/i/broken.gif',
|
64
|
+
:class=>'icon', :alt=>'a.jpg'}],
|
65
|
+
[:br],
|
66
|
+
'a.jpg']]],
|
67
|
+
@action.c_pre_text { '{{file(a.jpg)}}' })
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|