utopia-wiki 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/development.yml +62 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.yarnrc +1 -0
- data/Gemfile +4 -0
- data/README.md +46 -0
- data/bake/utopia/wiki.rb +13 -0
- data/lib/components/.yarn-integrity +19 -0
- data/lib/components/jquery-litebox/README.md +66 -0
- data/lib/components/jquery-litebox/bower.json +27 -0
- data/lib/components/jquery-litebox/dist/jquery.litebox.css +23 -0
- data/lib/components/jquery-litebox/dist/jquery.litebox.gallery.css +48 -0
- data/lib/components/jquery-litebox/dist/jquery.litebox.js +30 -0
- data/lib/components/jquery-litebox/example/index.html +69 -0
- data/lib/components/jquery-litebox/example/jquery.min.js +4 -0
- data/lib/components/jquery-litebox/example/sample_images/large/IMG_3340.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/large/IMG_3341.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/large/IMG_3344.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/large/IMG_3351.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3340.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3341.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3344.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/medium/IMG_3351.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/small/IMG_3340.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/small/IMG_3341.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/small/IMG_3344.jpg +0 -0
- data/lib/components/jquery-litebox/example/sample_images/small/IMG_3351.jpg +0 -0
- data/lib/components/jquery-litebox/package.json +29 -0
- data/lib/components/jquery-syntax/Gemfile +5 -0
- data/lib/components/jquery-syntax/LICENSE.txt +19 -0
- data/lib/components/jquery-syntax/NOTES.txt +20 -0
- data/lib/components/jquery-syntax/README.md +95 -0
- data/lib/components/jquery-syntax/Rakefile +211 -0
- data/lib/components/jquery-syntax/bower.json +25 -0
- data/lib/components/jquery-syntax/config.ru +4 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.apache.css +12 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.applescript.css +5 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.assembly.css +8 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.bash-script.css +6 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.bash.css +4 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.clang.css +6 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.css.css +14 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.diff.css +16 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.html.css +5 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.ocaml.css +3 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.protobuf.css +2 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.python.css +6 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.ruby.css +2 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.brush.xml.css +18 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.core.css +58 -0
- data/lib/components/jquery-syntax/dist/base/jquery.syntax.editor.css +6 -0
- data/lib/components/jquery-syntax/dist/base/theme.js +1 -0
- data/lib/components/jquery-syntax/dist/bright/jquery.syntax.core.css +27 -0
- data/lib/components/jquery-syntax/dist/bright/theme.js +1 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.apache.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.applescript.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.assembly.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.bash-script.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.bash.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.basic.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.clang.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.csharp.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.css.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.diff.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.go.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.haskell.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.html.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.io.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.java.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.javascript.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.kai.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.lisp.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.lua.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.nginx.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ocaml.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ooc.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.pascal.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.perl5.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.php-script.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.php.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.plain.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.protobuf.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.python.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.ruby.js +5 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.scala.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.smalltalk.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.sql.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.super-collider.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.swift.js +3 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.trenni.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.xml.js +4 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.brush.yaml.js +2 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.cache.js +7 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.core.js +34 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.editor.js +11 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.js +8 -0
- data/lib/components/jquery-syntax/dist/jquery.syntax.min.js +13 -0
- data/lib/components/jquery-syntax/dist/paper/jquery.syntax.core.css +31 -0
- data/lib/components/jquery-syntax/dist/paper/theme.js +1 -0
- data/lib/components/jquery-syntax/examples/ex.applescript.html +120 -0
- data/lib/components/jquery-syntax/examples/ex.asm.html +43 -0
- data/lib/components/jquery-syntax/examples/ex.bash.html +139 -0
- data/lib/components/jquery-syntax/examples/ex.clang.html +337 -0
- data/lib/components/jquery-syntax/examples/ex.css.html +48 -0
- data/lib/components/jquery-syntax/examples/ex.diff.html +1226 -0
- data/lib/components/jquery-syntax/examples/ex.editor.html +28 -0
- data/lib/components/jquery-syntax/examples/ex.html.html +134 -0
- data/lib/components/jquery-syntax/examples/ex.javascript.html +330 -0
- data/lib/components/jquery-syntax/examples/ex.ooc.html +119 -0
- data/lib/components/jquery-syntax/examples/ex.php.html +54 -0
- data/lib/components/jquery-syntax/examples/ex.python.html +1510 -0
- data/lib/components/jquery-syntax/examples/ex.ruby.html +358 -0
- data/lib/components/jquery-syntax/examples/ex.swift.html +90 -0
- data/lib/components/jquery-syntax/examples/index.css +18 -0
- data/lib/components/jquery-syntax/examples/jquery-1.6.min.js +16 -0
- data/lib/components/jquery-syntax/examples/tests.html +71 -0
- data/lib/components/jquery-syntax/examples/wrapping-flex.html +71 -0
- data/lib/components/jquery-syntax/examples/wrapping.html +181 -0
- data/lib/components/jquery-syntax/ext/closure/COPYING +202 -0
- data/lib/components/jquery-syntax/ext/closure/README +292 -0
- data/lib/components/jquery-syntax/ext/closure/compiler.jar +0 -0
- data/lib/components/jquery-syntax/ext/theme.rb +85 -0
- data/lib/components/jquery-syntax/install.yaml +9 -0
- data/lib/components/jquery-syntax/jQuery.Syntax.artx/Preview/preview.png +0 -0
- data/lib/components/jquery-syntax/jQuery.Syntax.artx/doc.thread +0 -0
- data/lib/components/jquery-syntax/package.json +31 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.apache.js +41 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.applescript.js +57 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.assembly.js +37 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.bash-script.js +67 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.bash.js +33 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.basic.js +51 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.clang.js +89 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.csharp.js +47 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.css.js +80 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.diff.js +24 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.go.js +47 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.haskell.js +45 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.html.js +66 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.io.js +45 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.java.js +45 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.javascript.js +42 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.kai.js +29 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.lisp.js +34 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.lua.js +44 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.nginx.js +30 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.ocaml.js +73 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.ooc.js +46 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.pascal.js +51 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.perl5.js +52 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.php-script.js +48 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.php.js +15 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.plain.js +10 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.protobuf.js +43 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.python.js +44 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.ruby.js +77 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.scala.js +44 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.smalltalk.js +29 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.sql.js +31 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.super-collider.js +57 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.swift.js +55 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.trenni.js +35 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.xml.js +50 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.brush.yaml.js +29 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.core.js +1114 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.editor.js +291 -0
- data/lib/components/jquery-syntax/source/jquery.syntax.js +258 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.apache.sass +23 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.applescript.sass +11 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.assembly.sass +16 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.bash-script.sass +14 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.bash.sass +11 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.clang.sass +12 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.css.sass +25 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.diff.sass +25 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.html.sass +12 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.ocaml.sass +8 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.protobuf.sass +7 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.python.sass +12 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.ruby.sass +9 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.brush.xml.sass +30 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.core.sass +86 -0
- data/lib/components/jquery-syntax/themes/base/jquery.syntax.editor.sass +12 -0
- data/lib/components/jquery-syntax/themes/bright/_config.yaml +2 -0
- data/lib/components/jquery-syntax/themes/bright/jquery.syntax.core.sass +42 -0
- data/lib/components/jquery-syntax/themes/paper/_config.yaml +2 -0
- data/lib/components/jquery-syntax/themes/paper/jquery.syntax.core.sass +47 -0
- data/lib/components/jquery/AUTHORS.txt +327 -0
- data/lib/components/jquery/LICENSE.txt +20 -0
- data/lib/components/jquery/README.md +62 -0
- data/lib/components/jquery/bower.json +14 -0
- data/lib/components/jquery/dist/jquery.js +10872 -0
- data/lib/components/jquery/dist/jquery.min.js +2 -0
- data/lib/components/jquery/dist/jquery.min.map +1 -0
- data/lib/components/jquery/dist/jquery.slim.js +8777 -0
- data/lib/components/jquery/dist/jquery.slim.min.js +2 -0
- data/lib/components/jquery/dist/jquery.slim.min.map +1 -0
- data/lib/components/jquery/external/sizzle/LICENSE.txt +36 -0
- data/lib/components/jquery/external/sizzle/dist/sizzle.js +2478 -0
- data/lib/components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/lib/components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/lib/components/jquery/package.json +117 -0
- data/lib/components/jquery/src/ajax.js +873 -0
- data/lib/components/jquery/src/ajax/jsonp.js +103 -0
- data/lib/components/jquery/src/ajax/load.js +77 -0
- data/lib/components/jquery/src/ajax/script.js +74 -0
- data/lib/components/jquery/src/ajax/var/location.js +5 -0
- data/lib/components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/components/jquery/src/ajax/var/rquery.js +5 -0
- data/lib/components/jquery/src/ajax/xhr.js +170 -0
- data/lib/components/jquery/src/attributes.js +13 -0
- data/lib/components/jquery/src/attributes/attr.js +141 -0
- data/lib/components/jquery/src/attributes/classes.js +186 -0
- data/lib/components/jquery/src/attributes/prop.js +143 -0
- data/lib/components/jquery/src/attributes/support.js +33 -0
- data/lib/components/jquery/src/attributes/val.js +191 -0
- data/lib/components/jquery/src/callbacks.js +236 -0
- data/lib/components/jquery/src/core.js +400 -0
- data/lib/components/jquery/src/core/DOMEval.js +43 -0
- data/lib/components/jquery/src/core/access.js +72 -0
- data/lib/components/jquery/src/core/camelCase.js +23 -0
- data/lib/components/jquery/src/core/init.js +129 -0
- data/lib/components/jquery/src/core/isAttached.js +26 -0
- data/lib/components/jquery/src/core/nodeName.js +13 -0
- data/lib/components/jquery/src/core/parseHTML.js +65 -0
- data/lib/components/jquery/src/core/parseXML.js +30 -0
- data/lib/components/jquery/src/core/ready-no-deferred.js +97 -0
- data/lib/components/jquery/src/core/ready.js +86 -0
- data/lib/components/jquery/src/core/readyException.js +13 -0
- data/lib/components/jquery/src/core/stripAndCollapse.js +14 -0
- data/lib/components/jquery/src/core/support.js +20 -0
- data/lib/components/jquery/src/core/toType.js +20 -0
- data/lib/components/jquery/src/core/var/rsingleTag.js +7 -0
- data/lib/components/jquery/src/css.js +494 -0
- data/lib/components/jquery/src/css/addGetHookIf.js +26 -0
- data/lib/components/jquery/src/css/adjustCSS.js +74 -0
- data/lib/components/jquery/src/css/curCSS.js +65 -0
- data/lib/components/jquery/src/css/finalPropName.js +42 -0
- data/lib/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/lib/components/jquery/src/css/showHide.js +105 -0
- data/lib/components/jquery/src/css/support.js +133 -0
- data/lib/components/jquery/src/css/var/cssExpand.js +5 -0
- data/lib/components/jquery/src/css/var/getStyles.js +17 -0
- data/lib/components/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/lib/components/jquery/src/css/var/rboxStyle.js +7 -0
- data/lib/components/jquery/src/css/var/rnumnonpx.js +7 -0
- data/lib/components/jquery/src/css/var/swap.js +26 -0
- data/lib/components/jquery/src/data.js +180 -0
- data/lib/components/jquery/src/data/Data.js +162 -0
- data/lib/components/jquery/src/data/var/acceptData.js +19 -0
- data/lib/components/jquery/src/data/var/dataPriv.js +7 -0
- data/lib/components/jquery/src/data/var/dataUser.js +7 -0
- data/lib/components/jquery/src/deferred.js +399 -0
- data/lib/components/jquery/src/deferred/exceptionHook.js +21 -0
- data/lib/components/jquery/src/deprecated.js +87 -0
- data/lib/components/jquery/src/deprecated/ajax-event-alias.js +22 -0
- data/lib/components/jquery/src/deprecated/event.js +48 -0
- data/lib/components/jquery/src/dimensions.js +57 -0
- data/lib/components/jquery/src/effects.js +701 -0
- data/lib/components/jquery/src/effects/Tween.js +125 -0
- data/lib/components/jquery/src/effects/animatedSelector.js +15 -0
- data/lib/components/jquery/src/event.js +892 -0
- data/lib/components/jquery/src/event/focusin.js +58 -0
- data/lib/components/jquery/src/event/support.js +11 -0
- data/lib/components/jquery/src/event/trigger.js +201 -0
- data/lib/components/jquery/src/exports/amd.js +26 -0
- data/lib/components/jquery/src/exports/global.js +34 -0
- data/lib/components/jquery/src/jquery.js +41 -0
- data/lib/components/jquery/src/manipulation.js +480 -0
- data/lib/components/jquery/src/manipulation/_evalUrl.js +32 -0
- data/lib/components/jquery/src/manipulation/buildFragment.js +106 -0
- data/lib/components/jquery/src/manipulation/getAll.js +32 -0
- data/lib/components/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/lib/components/jquery/src/manipulation/support.js +41 -0
- data/lib/components/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/lib/components/jquery/src/manipulation/var/rtagName.js +8 -0
- data/lib/components/jquery/src/manipulation/wrapMap.js +30 -0
- data/lib/components/jquery/src/offset.js +238 -0
- data/lib/components/jquery/src/queue.js +145 -0
- data/lib/components/jquery/src/queue/delay.js +24 -0
- data/lib/components/jquery/src/selector-native.js +241 -0
- data/lib/components/jquery/src/selector-sizzle.js +19 -0
- data/lib/components/jquery/src/selector.js +3 -0
- data/lib/components/jquery/src/serialize.js +136 -0
- data/lib/components/jquery/src/traversing.js +198 -0
- data/lib/components/jquery/src/traversing/findFilter.js +97 -0
- data/lib/components/jquery/src/traversing/var/dir.js +22 -0
- data/lib/components/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/lib/components/jquery/src/traversing/var/siblings.js +17 -0
- data/lib/components/jquery/src/var/ObjectFunctionString.js +7 -0
- data/lib/components/jquery/src/var/arr.js +5 -0
- data/lib/components/jquery/src/var/class2type.js +6 -0
- data/lib/components/jquery/src/var/document.js +5 -0
- data/lib/components/jquery/src/var/documentElement.js +7 -0
- data/lib/components/jquery/src/var/flat.js +16 -0
- data/lib/components/jquery/src/var/fnToString.js +7 -0
- data/lib/components/jquery/src/var/getProto.js +5 -0
- data/lib/components/jquery/src/var/hasOwn.js +7 -0
- data/lib/components/jquery/src/var/indexOf.js +7 -0
- data/lib/components/jquery/src/var/isFunction.js +13 -0
- data/lib/components/jquery/src/var/isWindow.js +8 -0
- data/lib/components/jquery/src/var/pnum.js +5 -0
- data/lib/components/jquery/src/var/push.js +7 -0
- data/lib/components/jquery/src/var/rcheckableType.js +5 -0
- data/lib/components/jquery/src/var/rcssNum.js +9 -0
- data/lib/components/jquery/src/var/rnothtmlwhite.js +8 -0
- data/lib/components/jquery/src/var/slice.js +7 -0
- data/lib/components/jquery/src/var/support.js +6 -0
- data/lib/components/jquery/src/var/toString.js +7 -0
- data/lib/components/jquery/src/wrap.js +78 -0
- data/lib/utopia/wiki.rb +80 -0
- data/lib/utopia/wiki/version.rb +27 -0
- data/package.json +6 -0
- data/pages/_editor.xnode +21 -0
- data/pages/_heading.xnode +2 -0
- data/pages/_listing.xnode +23 -0
- data/pages/_navigation.xnode +33 -0
- data/pages/_page.xnode +32 -0
- data/pages/_thumbnail.xnode +8 -0
- data/pages/controller.rb +77 -0
- data/pages/create.xnode +15 -0
- data/pages/edit.xnode +10 -0
- data/pages/errors/exception.xnode +5 -0
- data/pages/errors/file-not-found.xnode +5 -0
- data/pages/links.yaml +2 -0
- data/pages/show.xnode +15 -0
- data/public/.nojekyll +0 -0
- data/public/_components/jquery-litebox/jquery.litebox.css +23 -0
- data/public/_components/jquery-litebox/jquery.litebox.gallery.css +48 -0
- data/public/_components/jquery-litebox/jquery.litebox.js +30 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.apache.css +12 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.applescript.css +5 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.assembly.css +8 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash-script.css +6 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash.css +4 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.clang.css +6 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.css.css +14 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.diff.css +16 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.html.css +5 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.ocaml.css +3 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.protobuf.css +2 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.python.css +6 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.ruby.css +2 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.xml.css +18 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.core.css +58 -0
- data/public/_components/jquery-syntax/base/jquery.syntax.editor.css +6 -0
- data/public/_components/jquery-syntax/base/theme.js +1 -0
- data/public/_components/jquery-syntax/bright/jquery.syntax.core.css +27 -0
- data/public/_components/jquery-syntax/bright/theme.js +1 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.apache.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.applescript.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.assembly.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.bash-script.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.bash.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.basic.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.clang.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.csharp.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.css.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.diff.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.go.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.haskell.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.html.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.io.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.java.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.javascript.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.kai.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.lisp.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.lua.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.nginx.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.ocaml.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.ooc.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.pascal.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.perl5.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.php-script.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.php.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.plain.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.protobuf.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.python.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.ruby.js +5 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.scala.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.smalltalk.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.sql.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.super-collider.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.swift.js +3 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.trenni.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.xml.js +4 -0
- data/public/_components/jquery-syntax/jquery.syntax.brush.yaml.js +2 -0
- data/public/_components/jquery-syntax/jquery.syntax.cache.js +7 -0
- data/public/_components/jquery-syntax/jquery.syntax.core.js +34 -0
- data/public/_components/jquery-syntax/jquery.syntax.editor.js +11 -0
- data/public/_components/jquery-syntax/jquery.syntax.js +8 -0
- data/public/_components/jquery-syntax/jquery.syntax.min.js +13 -0
- data/public/_components/jquery-syntax/paper/jquery.syntax.core.css +31 -0
- data/public/_components/jquery-syntax/paper/theme.js +1 -0
- data/public/_components/jquery/jquery.js +10872 -0
- data/public/_components/jquery/jquery.min.js +2 -0
- data/public/_components/jquery/jquery.min.map +1 -0
- data/public/_components/jquery/jquery.slim.js +8777 -0
- data/public/_components/jquery/jquery.slim.min.js +2 -0
- data/public/_components/jquery/jquery.slim.min.map +1 -0
- data/public/_static/icon.png +0 -0
- data/public/_static/site.css +191 -0
- data/utopia-wiki.gemspec +39 -0
- data/wiki/Gemfile +10 -0
- data/wiki/config.ru +7 -0
- data/wiki/pages/_logos/Async.png +0 -0
- data/wiki/pages/_logos/Falcon.png +0 -0
- data/wiki/pages/_logos/Utopia.png +0 -0
- data/wiki/pages/index.en.md +62 -0
- data/wiki/pages/index.md +57 -0
- data/wiki/pages/links.yaml +2 -0
- data/wiki/pages/usage/merging/index.md +3 -0
- data/yarn.lock +22 -0
- metadata +675 -0
@@ -0,0 +1,78 @@
|
|
1
|
+
define( [
|
2
|
+
"./core",
|
3
|
+
"./var/isFunction",
|
4
|
+
"./core/init",
|
5
|
+
"./manipulation", // clone
|
6
|
+
"./traversing" // parent, contents
|
7
|
+
], function( jQuery, isFunction ) {
|
8
|
+
|
9
|
+
"use strict";
|
10
|
+
|
11
|
+
jQuery.fn.extend( {
|
12
|
+
wrapAll: function( html ) {
|
13
|
+
var wrap;
|
14
|
+
|
15
|
+
if ( this[ 0 ] ) {
|
16
|
+
if ( isFunction( html ) ) {
|
17
|
+
html = html.call( this[ 0 ] );
|
18
|
+
}
|
19
|
+
|
20
|
+
// The elements to wrap the target around
|
21
|
+
wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
|
22
|
+
|
23
|
+
if ( this[ 0 ].parentNode ) {
|
24
|
+
wrap.insertBefore( this[ 0 ] );
|
25
|
+
}
|
26
|
+
|
27
|
+
wrap.map( function() {
|
28
|
+
var elem = this;
|
29
|
+
|
30
|
+
while ( elem.firstElementChild ) {
|
31
|
+
elem = elem.firstElementChild;
|
32
|
+
}
|
33
|
+
|
34
|
+
return elem;
|
35
|
+
} ).append( this );
|
36
|
+
}
|
37
|
+
|
38
|
+
return this;
|
39
|
+
},
|
40
|
+
|
41
|
+
wrapInner: function( html ) {
|
42
|
+
if ( isFunction( html ) ) {
|
43
|
+
return this.each( function( i ) {
|
44
|
+
jQuery( this ).wrapInner( html.call( this, i ) );
|
45
|
+
} );
|
46
|
+
}
|
47
|
+
|
48
|
+
return this.each( function() {
|
49
|
+
var self = jQuery( this ),
|
50
|
+
contents = self.contents();
|
51
|
+
|
52
|
+
if ( contents.length ) {
|
53
|
+
contents.wrapAll( html );
|
54
|
+
|
55
|
+
} else {
|
56
|
+
self.append( html );
|
57
|
+
}
|
58
|
+
} );
|
59
|
+
},
|
60
|
+
|
61
|
+
wrap: function( html ) {
|
62
|
+
var htmlIsFunction = isFunction( html );
|
63
|
+
|
64
|
+
return this.each( function( i ) {
|
65
|
+
jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
|
66
|
+
} );
|
67
|
+
},
|
68
|
+
|
69
|
+
unwrap: function( selector ) {
|
70
|
+
this.parent( selector ).not( "body" ).each( function() {
|
71
|
+
jQuery( this ).replaceWith( this.childNodes );
|
72
|
+
} );
|
73
|
+
return this;
|
74
|
+
}
|
75
|
+
} );
|
76
|
+
|
77
|
+
return jQuery;
|
78
|
+
} );
|
data/lib/utopia/wiki.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require "utopia/wiki/version"
|
24
|
+
|
25
|
+
require 'variant'
|
26
|
+
|
27
|
+
require 'kramdown'
|
28
|
+
|
29
|
+
require 'utopia/localization'
|
30
|
+
require 'utopia/gallery'
|
31
|
+
|
32
|
+
module Utopia
|
33
|
+
module Wiki
|
34
|
+
SITE_ROOT = File.expand_path("../..", __dir__)
|
35
|
+
PAGES_ROOT = File.expand_path("pages", SITE_ROOT)
|
36
|
+
PUBLIC_ROOT = File.expand_path("public", SITE_ROOT)
|
37
|
+
|
38
|
+
def self.call(builder, root = Dir.pwd, locales: nil)
|
39
|
+
if UTOPIA.production?
|
40
|
+
# Handle exceptions in production with a error page and send an email notification:
|
41
|
+
builder.use Utopia::Exceptions::Handler
|
42
|
+
builder.use Utopia::Exceptions::Mailer
|
43
|
+
else
|
44
|
+
# We want to propate exceptions up when running tests:
|
45
|
+
builder.use Rack::ShowExceptions unless UTOPIA.testing?
|
46
|
+
end
|
47
|
+
|
48
|
+
public_root = File.expand_path("public", root)
|
49
|
+
builder.use Utopia::Static, root: public_root
|
50
|
+
|
51
|
+
builder.use Utopia::Static, root: PUBLIC_ROOT
|
52
|
+
|
53
|
+
builder.use Utopia::Redirection::Rewrite, {
|
54
|
+
'/' => '/index'
|
55
|
+
}
|
56
|
+
|
57
|
+
builder.use Utopia::Redirection::DirectoryIndex
|
58
|
+
|
59
|
+
builder.use Utopia::Redirection::Errors, {
|
60
|
+
404 => '/errors/file-not-found'
|
61
|
+
}
|
62
|
+
|
63
|
+
if locales
|
64
|
+
builder.use Utopia::Localization,
|
65
|
+
default_locale: locales.first,
|
66
|
+
locales: locales
|
67
|
+
end
|
68
|
+
|
69
|
+
builder.use Utopia::Controller, root: PAGES_ROOT
|
70
|
+
|
71
|
+
cache_root = File.expand_path("_gallery", root)
|
72
|
+
|
73
|
+
builder.use Utopia::Content, root: PAGES_ROOT, namespaces: {
|
74
|
+
'gallery' => Utopia::Gallery::Tags.new
|
75
|
+
}
|
76
|
+
|
77
|
+
builder.run lambda { |env| [404, {}, []] }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
module Utopia
|
24
|
+
module Wiki
|
25
|
+
VERSION = "0.2.0"
|
26
|
+
end
|
27
|
+
end
|
data/package.json
ADDED
data/pages/_editor.xnode
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<?r response.do_not_cache! ?>
|
5
|
+
|
6
|
+
<?r if title = self[:title] ?>
|
7
|
+
<title>Editing #{title.gsub(/<.*?>/, "")}</title>
|
8
|
+
<?r else ?>
|
9
|
+
<title>Utopia</title>
|
10
|
+
<?r end ?>
|
11
|
+
|
12
|
+
<link rel="icon" type="image/png" href="/_static/icon.png" />
|
13
|
+
<link rel="stylesheet" href="/_static/site.css" type="text/css" media="screen" />
|
14
|
+
|
15
|
+
<script src="/_components/jquery/jquery.min.js"></script>
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body class="editor">
|
19
|
+
<utopia:content/>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<?r
|
2
|
+
|
3
|
+
# Listing src will be relative to the path of the wiki page:
|
4
|
+
base_path = controller[:page_root]
|
5
|
+
|
6
|
+
if attributes[:src]
|
7
|
+
path = File.join(base_path, attributes[:src])
|
8
|
+
code = File.read(path)
|
9
|
+
else
|
10
|
+
code = content
|
11
|
+
end
|
12
|
+
|
13
|
+
escaped_code = MarkupString.new(code)
|
14
|
+
|
15
|
+
escaped_code = escaped_code.gsub(/%%([a-z]+)\{(.*?)\}/) do |match|
|
16
|
+
"<span class=\"#{$1}\">#{$2}</span>"
|
17
|
+
end
|
18
|
+
|
19
|
+
if lang = (attributes[:lang] || attributes[:brush]) ?>
|
20
|
+
<pre><code class="syntax brush-#{lang}">#{escaped_code}</code></pre>
|
21
|
+
<?r else ?>
|
22
|
+
<pre>#{escaped_code}</pre>
|
23
|
+
<?r end ?>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<nav><?r
|
2
|
+
root = controller[:root]
|
3
|
+
content_links = controller[:links]
|
4
|
+
page_path = Utopia::Path[attributes[:path]]
|
5
|
+
|
6
|
+
Utopia::Path[page_path.dirname].descend do |path|
|
7
|
+
index_path = path + "index"
|
8
|
+
|
9
|
+
if link = content_links.for(index_path, localization.current_locale)
|
10
|
+
if link.href?
|
11
|
+
?> › <a href="#{link.path}">#{link.title}</a><?r
|
12
|
+
else
|
13
|
+
?> › <span>#{link.title}</span><?r
|
14
|
+
end
|
15
|
+
elsif link = links(path.dirname, name: path.last, locale: localization.current_locale, display: nil).first
|
16
|
+
?> › <span>#{link.title}</span><?r
|
17
|
+
else
|
18
|
+
?> › <span>#{path.last}</span><?r
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
if localization.localized?
|
23
|
+
?> (<?r
|
24
|
+
localization.all_locales.each.with_index do |locale, index|
|
25
|
+
?>#{index.zero? ? '' : ' '}<a href="#{localization.localized_path(page_path, locale)}">#{locale}</a><?r
|
26
|
+
end
|
27
|
+
?>)<?r
|
28
|
+
end
|
29
|
+
|
30
|
+
if Variant.for(:wiki) != :static
|
31
|
+
?> • <a href="edit">Edit Page</a><?r
|
32
|
+
end
|
33
|
+
?></nav>
|
data/pages/_page.xnode
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<?r response.cache! ?>
|
5
|
+
|
6
|
+
<?r if title = self[:title] ?>
|
7
|
+
<title>#{title.gsub(/<.*?>/, "")}</title>
|
8
|
+
<?r else ?>
|
9
|
+
<title>Utopia Wiki</title>
|
10
|
+
<?r end ?>
|
11
|
+
|
12
|
+
<meta charset="UTF-8" />
|
13
|
+
|
14
|
+
<link rel="icon" type="image/png" href="/_static/icon.png" />
|
15
|
+
<link rel="stylesheet" href="/_static/site.css" type="text/css" media="screen" />
|
16
|
+
|
17
|
+
<script src="/_components/jquery/jquery.min.js"></script>
|
18
|
+
<script src="/_components/jquery-syntax/jquery.syntax.min.js"></script>
|
19
|
+
|
20
|
+
<script type="text/javascript">
|
21
|
+
//<![CDATA[
|
22
|
+
jQuery(function($) {
|
23
|
+
$.syntax();
|
24
|
+
});
|
25
|
+
//]]>
|
26
|
+
</script>
|
27
|
+
</head>
|
28
|
+
|
29
|
+
<body class="#{attributes[:class]}">
|
30
|
+
<utopia:content/>
|
31
|
+
</body>
|
32
|
+
</html>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<figure class="photo">
|
2
|
+
<a href="#{attributes[:src].large}" title="#{attributes[:alt]}">
|
3
|
+
<img src="#{attributes[:src].small}" alt="#{attributes[:alt]}"/>
|
4
|
+
</a>
|
5
|
+
<?r if caption = attributes[:alt].caption ?>
|
6
|
+
<figcaption>#{caption}</figcaption>
|
7
|
+
<?r end ?>
|
8
|
+
</figure>
|
data/pages/controller.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
prepend Actions
|
4
|
+
|
5
|
+
ROOT = File.expand_path("pages")
|
6
|
+
LINKS = Utopia::Content::Links.new(ROOT, extension: ".md")
|
7
|
+
|
8
|
+
def index_path(locale)
|
9
|
+
if locale
|
10
|
+
"index.#{locale}.md"
|
11
|
+
else
|
12
|
+
"index.md"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
on '**' do |request, path|
|
17
|
+
@full_path = URI_PATH + path
|
18
|
+
@page_path = path.components[0..-2]
|
19
|
+
|
20
|
+
@root = ROOT
|
21
|
+
@links = LINKS
|
22
|
+
@page_root = File.join(@root, @page_path)
|
23
|
+
|
24
|
+
@localization = Utopia::Localization[request]
|
25
|
+
@relative_page_file = File.join(@page_path, index_path(@localization.current_locale))
|
26
|
+
@page_file = File.join(@root, @relative_page_file)
|
27
|
+
|
28
|
+
if last_path_component = @page_path.last
|
29
|
+
@title = Trenni::Strings.to_title(last_path_component)
|
30
|
+
else
|
31
|
+
@title = "Wiki"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def exists?(locale: @localization.current_locale)
|
36
|
+
relative_page_file = File.join(@page_path, index_path(locale))
|
37
|
+
page_file = File.join(@root, relative_page_file)
|
38
|
+
|
39
|
+
if File.exist?(page_file)
|
40
|
+
return page_file
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def read_contents
|
45
|
+
if path = (exists? || exists?(locale: nil))
|
46
|
+
File.read(path)
|
47
|
+
else
|
48
|
+
"\# #{@title}\n\n" +
|
49
|
+
"This page is empty."
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
on '**/edit' do |request, path|
|
54
|
+
if request.post?
|
55
|
+
FileUtils.mkdir_p File.dirname(@page_file)
|
56
|
+
|
57
|
+
# Get the content and normalize newlines:
|
58
|
+
content = request.params['content'].gsub /\r\n?/, "\n"
|
59
|
+
File.write(@page_file, content)
|
60
|
+
|
61
|
+
# Redirect relative to controller.
|
62
|
+
goto! Utopia::Path[@page_path] + "index"
|
63
|
+
else
|
64
|
+
@content = read_contents
|
65
|
+
end
|
66
|
+
|
67
|
+
path.components = ["edit"]
|
68
|
+
end
|
69
|
+
|
70
|
+
on '**/index' do |request, path|
|
71
|
+
if exists?
|
72
|
+
@content = read_contents
|
73
|
+
path.components = ["show"]
|
74
|
+
else
|
75
|
+
path.components = ["create"]
|
76
|
+
end
|
77
|
+
end
|