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,34 @@
|
|
1
|
+
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
+
RegExp.prototype.indexOf||(RegExp.indexOf=function(a,b){return a[0].indexOf(a[b])+a.index});RegExp.prototype.escape||(RegExp.escape=function(a){return a.replace(/[\-\[\]{}()*+?.\\\^$|,#\s]/g,"\\$&")});String.prototype.repeat||(String.prototype.repeat=function(a){return Array(a+1).join(this)});Syntax.innerText=function(a){var b;if(!a)return"";if("BR"==a.nodeName)return"\n";a.textContent?b=a.textContent:document.body.innerText&&(b=a.innerText);return b.replace(/\r\n?/g,"\n")};
|
3
|
+
Syntax.extractTextFromSelection=function(a){for(var b="",c=0;c<a.rangeCount;c+=1)var d=a.getRangeAt(c).toString(),b=b+d;return b};Syntax.copyCode=function(a){var b=window.getSelection(),b=Syntax.extractTextFromSelection(b);a.clipboardData.setData("text/plain",b);return!1};
|
4
|
+
Syntax.extractElementMatches=function(a,b){var c=[];b=b||0;(function(a){for(var e=0;a[e];e++){var f=null,g=a[e];3===g.nodeType||4===g.nodeType?b+=g.nodeValue.length:1===g.nodeType&&(f=Syntax.innerText(g),c.push(new Syntax.Match(b,f.length,{klass:g.className,force:!0,element:g,allow:"*"},f)));8!==g.nodeType&&g.children&&arguments.callee(g.childNodes,b)}})(a);c.shift();return c};
|
5
|
+
Syntax.extractMatches=function(){var a=arguments;return function(b,c){for(var d=[],e=0;e<a.length;e+=1){var f=a[e],g=e+1;null!=f&&("undefined"!=typeof f.index&&(g=f.index),f.debug&&console.log("extractMatches",f,g,b[g],b),0<b[g].length&&(f.brush?d.push(Syntax.Brush.buildTree(f,b[g],RegExp.indexOf(b,g))):(f=jQuery.extend({owner:c.owner},f),d.push(new Syntax.Match(RegExp.indexOf(b,g),b[g].length,f,b[g])))))}return d}};
|
6
|
+
Syntax.lib.webLinkProcess=function(a,b){b&&(a="http://www.google.com/search?btnI=I&q="+encodeURIComponent(a+" "));return function(b,d,e){if(!1===e.linkify)return b;d=document.createElement("a");d.href=a+encodeURIComponent(Syntax.innerText(b));for(d.className=b.className;0<b.childNodes.length;)d.appendChild(b.childNodes[0]);return d}};Syntax.register=function(a,b){var c=Syntax.brushes[a]=new Syntax.Brush;c.klass=a;b(c)};Syntax.lib.cStyleComment={pattern:/\/\*[\s\S]*?\*\//gm,klass:"comment",allow:["href"]};
|
7
|
+
Syntax.lib.cppStyleComment={pattern:/\/\/.*$/gm,klass:"comment",allow:["href"]};Syntax.lib.perlStyleComment={pattern:/#.*$/gm,klass:"comment",allow:["href"]};Syntax.lib.perlStyleRegularExpression={pattern:/\B\/([^\\\/]|\\.)*\/[a-z]*(?=\s*($|[^\w\s'"\(]))/gm,klass:"constant",incremental:!0};Syntax.lib.rubyStyleRegularExpression={pattern:/\B\/([^\\\/]|\\.)*\/[a-z]*(?=\s*($|[^\w\s'"\(]|do))/gm,klass:"constant",incremental:!0};Syntax.lib.cStyleFunction={pattern:/([a-z_][a-z0-9_]*)\s*\(/gi,matches:Syntax.extractMatches({klass:"function"})};
|
8
|
+
Syntax.lib.camelCaseType={pattern:/\b_*[A-Z][\w]*\b/g,klass:"type"};Syntax.lib.cStyleType={pattern:/\b[_a-z][_\w]*_t\b/gi,klass:"type"};Syntax.lib.xmlComment={pattern:/(<|<)!--[\s\S]*?--(>|>)/gm,klass:"comment"};Syntax.lib.webLink={pattern:/\w+:\/\/[\w\-.\/?%&=@:;#]*/g,klass:"href"};Syntax.lib.hexNumber={pattern:/\b0x[0-9a-fA-F]+/g,klass:"constant"};Syntax.lib.decimalNumber={pattern:/\b[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/g,klass:"constant"};
|
9
|
+
Syntax.lib.doubleQuotedString={pattern:/"([^\\"\n]|\\.)*"/g,klass:"string"};Syntax.lib.singleQuotedString={pattern:/'([^\\'\n]|\\.)*'/g,klass:"string"};Syntax.lib.multiLineDoubleQuotedString={pattern:/"([^\\"]|\\.)*"/g,klass:"string"};Syntax.lib.multiLineSingleQuotedString={pattern:/'([^\\']|\\.)*'/g,klass:"string"};Syntax.lib.stringEscape={pattern:/\\./g,klass:"escape",only:["string"]};
|
10
|
+
Syntax.Match=function(a,b,c,d){this.offset=a;this.endOffset=a+b;this.length=b;this.expression=c;this.value=d;this.children=[];this.next=this.parent=null};Syntax.Match.prototype.shift=function(a,b){this.adjust(a,null,b);for(var c=0;c<this.children.length;c++)this.children[c].shift(a,b)};Syntax.Match.prototype.adjust=function(a,b,c){this.offset+=a;this.endOffset+=a;b&&(this.length=b,this.endOffset=this.offset+b);c&&(this.value=c.substr(this.offset,this.length))};
|
11
|
+
Syntax.Match.sort=function(a,b){return a.offset-b.offset||b.length-a.length};Syntax.Match.prototype.contains=function(a){return a.offset>=this.offset&&a.endOffset<=this.endOffset};Syntax.Match.defaultReduceCallback=function(a,b){"string"===typeof a&&(a=document.createTextNode(a));b.appendChild(a)};
|
12
|
+
Syntax.Match.prototype.reduce=function(a,b){var c=this.offset,d=document.createElement("span");a=a||Syntax.Match.defaultReduceCallback;this.expression&&this.expression.klass&&(0<d.className.length&&(d.className+=" "),d.className+=this.expression.klass);this.className&&(d.className+=" ",d.className+=this.className);for(var e=0;e<this.children.length;e+=1){var f=this.children[e],g=f.offset;f.offset<this.offset&&console.log("Syntax Warning: Offset of child",f,"is before offset of parent",this);c=this.value.substr(c-
|
13
|
+
this.offset,g-c);a(c,d);a(f.reduce(a,b),d);c=f.endOffset}c===this.offset?a(this.value,d):c<this.endOffset?a(this.value.substr(c-this.offset,this.endOffset-c),d):c>this.endOffset&&console.log("Syntax Warning: Start position "+c+" exceeds end of value "+this.endOffset);b&&(d=b(d,this));return d};
|
14
|
+
Syntax.Match.prototype.canContain=function(a){return a.expression.force?!0:this.complete?!1:a.expression.only?!0:"undefined"===typeof this.expression.allow||jQuery.isArray(this.expression.disallow)&&-1!==jQuery.inArray(a.expression.klass,this.expression.disallow)?!1:"*"===this.expression.allow||jQuery.isArray(this.expression.allow)&&-1!==jQuery.inArray(a.expression.klass,this.expression.allow)?!0:!1};
|
15
|
+
Syntax.Match.prototype.canHaveChild=function(a){if(a=a.expression.only){for(var b=this;null!==b;){if(-1!==jQuery.inArray(b.expression.klass,a))return!0;if((b=b.parent)&&b.complete)break}return!1}return!0};Syntax.Match.prototype._splice=function(a,b){return this.canHaveChild(b)?(this.children.splice(a,0,b),b.parent=this,b.expression.owner||(b.expression.owner=this.expression.owner),this):null};
|
16
|
+
Syntax.Match.prototype.insert=function(a,b){if(!this.contains(a))return null;if(b){for(var c=this,d=0;d<c.children.length;)c.children[d].contains(a)?(c=c.children[d],d=0):d+=1;return c._insertWhole(a)}return this._insert(a)};
|
17
|
+
Syntax.Match.prototype._insertWhole=function(a){var b=this.bisectAtOffsets([a.offset,a.endOffset]);this.children=[];b[0]&&(this.children=this.children.concat(b[0].children));if(b[1]){a.children=[];this.expression&&this.expression.owner&&(a.expression=this.expression.owner.getRuleForKlass(a.expression.klass)||a.expression);for(var c=0;c<b[1].children.length;c+=1){var d=b[1].children[c];a.canContain(d)&&a.children.push(d)}this.children.push(a)}b[2]&&(this.children=this.children.concat(b[2].children));
|
18
|
+
return this};Syntax.Match.prototype.insertAtEnd=function(a){if(!this.contains(a))return console.log("Syntax Error: Child is not contained in parent node!"),null;if(!this.canContain(a))return null;if(0<this.children.length){var b=this.children.length-1,c=this.children[b];return a.offset<c.offset?a.force?this._insert(a):null:a.offset<c.endOffset?a.endOffset<=c.endOffset?c.insertAtEnd(a):a.force?this._insert(a):null:this._splice(b+1,a)}return this._splice(0,a)};
|
19
|
+
Syntax.Match.prototype._insert=function(a){if(0==this.children.length)return this._splice(0,a);for(var b=0;b<this.children.length;b+=1){var c=this.children[b];if(a.endOffset<=c.offset)return this._splice(b,a);if(!(a.offset>=c.endOffset)){if(c.contains(a))return c._insert(a);a=a.bisectAtOffsets([c.offset,c.endOffset]);a[0]&&this._splice(b,a[0]);a[1]&&c.insert(a[1]);if(a[2])a=a[2];else return this}}this._splice(this.children.length,a)};
|
20
|
+
Syntax.Match.prototype.bisectAtOffsets=function(a){var b=[],c=this.offset,d=null,e=jQuery.merge([],this.children);a=a.slice(0);a.push(this.endOffset);a.sort(function(a,b){return a-b});for(var f=0;f<a.length;f+=1){var g=a[f];if(g>this.endOffset)break;g<this.offset||0==g-c?(b.push(null),c=g):(c<this.offset&&(c=this.offset),g=new Syntax.Match(c,g-c,this.expression),g.value=this.value.substr(c-this.offset,g.length),d&&(d.next=g),d=g,c=g.endOffset,b.push(g))}a.length=b.length;for(f=0;f<b.length;f+=1)if(null!=
|
21
|
+
b[f]){for(g=a[0];0<e.length;)if(e[0].endOffset<=b[f].endOffset)b[f].children.push(e.shift());else break;if(e.length&&e[0].offset<b[f].endOffset){c=e.shift().bisectAtOffsets(a);for(d=0;d<c.length;d+=1)null!=c[d]&&b[f+d].children.push(c[d]);f+=c.length-2;a.splice(0,c.length-2)}a.shift()}e.length&&console.log("Syntax Error: Children nodes not consumed",e.length," remaining!");return b};
|
22
|
+
Syntax.Match.prototype.split=function(a){for(var b=[];null!==a.exec(this.value);)b.push(a.lastIndex);a=this.bisectAtOffsets(b);return jQuery.grep(a,function(a,b){return a})};
|
23
|
+
Syntax.Match.prototype.splitLines=function(){for(var a=this.split(/\n/g),b=0;b<a.length;b+=1){var c=a[b],d=c.value.search(/\S/),e=new Syntax.Match(c.offset,c.length,c.expression,c.value);0<d?(c=c.bisectAtOffsets([c.offset+d]),e.children=c,c[0].expression={klass:"indent"},c[1].expression={klass:"text"}):(c.expression={klass:"text"},e.children=[c]);a[b]=e}return a};Syntax.Brush=function(){this.klass=null;this.rules=[];this.parents=[];this.processes={}};
|
24
|
+
Syntax.Brush.prototype.derives=function(a){this.parents.push(a);this.rules.push({apply:function(b,c){return Syntax.brushes[a].getMatches(b)}})};Syntax.Brush.prototype.allKlasses=function(){for(var a=[this.klass],b=0;b<this.parents.length;b+=1)a=a.concat(Syntax.brushes[this.parents[b]].allKlasses());return a};Syntax.Brush.convertStringToTokenPattern=function(a,b){var c="\\b",d="\\b";a.match(/^\w/)?a.match(/\w$/)||(d="\\B"):c=a.match(/\w$/)?"\\B":d="";b&&(a=RegExp.escape(a));return c+a+d};
|
25
|
+
Syntax.Brush.MatchPattern=function(a,b){if(!b.pattern)return[];var c=[],d=RegExp();for(d.compile(b.pattern);null!==(match=d.exec(a));)b.matches?c=c.concat(b.matches(match,b)):b.brush?c.push(Syntax.Brush.buildTree(b,match[0],match.index)):c.push(new Syntax.Match(match.index,match[0].length,b,match[0])),b.incremental&&(d.lastIndex=match.index+1);return c};
|
26
|
+
Syntax.Brush.prototype.push=function(a,b){if(jQuery.isArray(a)){for(var c=b,d="(",e=0;e<a.length;e+=1){0<e&&(d+="|");var f=a[e],d=f instanceof RegExp?d+f.source:d+Syntax.Brush.convertStringToTokenPattern(f,!0)}this.push(jQuery.extend({pattern:RegExp(d+")",c.options||"g")},c))}else c=a,"string"===typeof c.pattern&&(c.string=c.pattern,c.pattern=RegExp(Syntax.Brush.convertStringToTokenPattern(c.string,!0),c.options||"g")),"undefined"!==typeof XRegExp&&(c.pattern=new XRegExp(c.pattern)),c.apply=c.apply||
|
27
|
+
Syntax.Brush.MatchPattern,c.pattern&&c.pattern.global||"undefined"==typeof c.pattern?this.rules.push(jQuery.extend({owner:this},c)):console.log("Syntax Error: Malformed rule: ",c)};Syntax.Brush.prototype.getMatchesForRule=function(a,b){var c=[];"undefined"!=typeof b.apply&&(c=b.apply(a,b));b.debug&&console.log("Syntax matches:",b,a,c);return c};Syntax.Brush.prototype.getRuleForKlass=function(a){for(var b=0;b<this.rules.length;b+=1)if(this.rules[b].klass==a)return this.rules[b];return null};
|
28
|
+
Syntax.Brush.prototype.getMatches=function(a){for(var b=[],c=0;c<this.rules.length;c+=1)b=b.concat(this.getMatchesForRule(a,this.rules[c]));return b};Syntax.Brush.buildTree=function(a,b,c,d){b=Syntax.brushes[a.brush].buildTree(b,c,d);jQuery.extend(b.expression,a);return b};
|
29
|
+
Syntax.Brush.prototype.buildTree=function(a,b,c){b=b||0;a=a.replace(/\r/g,"");var d=this.getMatches(a);if(b&&0<b)for(var e=0;e<d.length;e+=1)d[e].shift(b);a=new Syntax.Match(b,a.length,{klass:this.allKlasses().join(" "),allow:"*",owner:this},a);d.sort(Syntax.Match.sort);for(e=0;e<d.length;e+=1)a.insertAtEnd(d[e]);if(c)for(e=0;e<c.length;e+=1)a.insert(c[e],!0);a.complete=!0;return a};
|
30
|
+
Syntax.Brush.prototype.process=function(a,b,c){a=this.buildTree(a,0,b).splitLines();b=document.createElement("code");b.className="syntax highlighted";for(var d=0;d<a.length;d+=1){var e=a[d].reduce(null,function(a,b){if(b.expression&&(b.expression.process&&(a=b.expression.process(a,b,c)),b.expression.owner)){var d=b.expression.owner.processes[b.expression.klass];d&&(a=d(a,b,c))}return a});b.appendChild(e)}return b};
|
31
|
+
Syntax.highlightText=function(a,b,c,d,e){b=(b||"plain").toLowerCase();b=Syntax.aliases[b]||b;Syntax.brushes.get(b,function(b){var g=b.process(a,c,d);d.linkify&&jQuery("span.href",g).each(function(){jQuery(this).replaceWith(jQuery("<a>").attr("href",this.innerHTML).text(this.innerHTML))});e(g,b,a,d)})};
|
32
|
+
Syntax.extractBrushName=function(a){a=a.toLowerCase();var b=a.match(/(brush|language)-([\S]+)/);if(b)return b[2];a=a.split(/ /);if(-1!==jQuery.inArray("syntax",a))for(b=0;b<a.length;b+=1){var c=Syntax.aliases[a[b]];if(c)return c}return null};
|
33
|
+
Syntax.highlight=function(a,b,c){a.each(function(){var a=jQuery(this),e=b.brush||Syntax.extractBrushName(this.className),f=Syntax.innerText(this),g=Syntax.extractElementMatches(a);b.matches&&Array.prototype.push(g,b.matches);Syntax.highlightText(f,e,g,b,function(e,f){e.oncopy=Syntax.copyCode;e=jQuery(e);if(b.theme){for(var g=Syntax.themes[b.theme],h=0;h<g.length;h+=1)e.addClass("syntax-theme-"+g[h]);e.addClass("syntax-theme-"+b.theme)}f.postprocess&&(e=f.postprocess(b,e,a));c&&(e=c(b,e,a));e&&!0===
|
34
|
+
b.replace&&a.replaceWith(e)})})};Syntax.loader.core=!0;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
+
Syntax.Editor=function(a,c){this.container=a;this.current=this.getLines()};Syntax.Editor.prototype.getLines=function(){for(var a=this.container.childNodes,c=[],b=[],d="",f=0,g=0;g<a.length;g+=1){var h=Syntax.innerText([a[g]]).split("\n");if(1<h.length){h[0]=d+h[0];for(var d=h.pop(),e=0;e<h.length;e+=1)b.push(f-c.length),c.push(h[e]);f=g+1}else d+=h[0]}""!=d?(b.push(f-c.length),c.push(d)):f-=1;b.push(f);console.log("getLines",b,c,a);return{lines:c,offsets:b}};
|
3
|
+
Syntax.Editor.prototype.updateChangedLines=function(){for(var a={},c=this.getLines(),b=0,d=0;b<this.current.lines.length&&d<c.lines.length;)if(this.current.lines[b]==c.lines[d])b+=1,d+=1;else break;a.start=d;b=this.current.lines.length;for(d=c.lines.length;b>a.start&&d>a.start;)if(this.current.lines[b-1]==c.lines[d-1])b-=1,d-=1;else break;a.end=d;a.originalEnd=b;for(a.difference=c.lines.length-this.current.lines.length;0<a.start&&c.offsets[a.start]!=c.offsets[a.start-1];)a.start-=1;if(0<a.difference)for(;a.end<
|
4
|
+
c.lines.length-1&&c.offsets[a.end-1]!=c.offsets[a.end];)a.end+=1,a.originalEnd+=1;this.current=c;return this.changed=a};Syntax.Editor.prototype.textForLines=function(a,c){return this.current.lines.slice(a,c).join("\n")+"\n"};
|
5
|
+
Syntax.Editor.prototype.updateLines=function(a,c){if(a.start!=a.end){var b=a.start,d=a.end,b=b+this.current.offsets[b],d=d+this.current.offsets[d],b=Array.prototype.slice.call(this.container.childNodes,b,d);$(b).replaceWith(c)}else 0==a.start?$(this.container).prepend(c):(b=a.start,b+=this.current.offsets[b],$(this.container.childNodes[b]).after(c))};
|
6
|
+
Syntax.Editor.getCharacterOffset=function(a){var c=0;if("undefined"!=typeof window.getSelection){var c=window.getSelection().getRangeAt(0),b=c.cloneRange();b.selectNodeContents(a);b.setEnd(c.endContainer,c.endOffset);c=b.toString().length}else"undefined"!=typeof document.selection&&"Control"!=document.selection.type&&(c=document.selection.createRange(),b=document.body.createTextRange(),b.moveToElementText(a),b.setEndPoint("EndToEnd",c),c=b.text.length);return c};
|
7
|
+
Syntax.Editor.getNodesForCharacterOffsets=function(a,c){for(var b=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,function(a){return NodeFilter.FILTER_ACCEPT},!1),d=[],f=0,g=0;g<a.length&&b.nextNode();){for(var h=f+b.currentNode.length;g<a.length&&a[g]<h;)d.push([b.currentNode,f,h]),g+=1;f=h}return d};
|
8
|
+
Syntax.Editor.prototype.getClientState=function(){var a={},c=window.getSelection();0<c.rangeCount&&(a.range=c.getRangeAt(0));a.range&&(a.startOffset=Syntax.Editor.getCharacterOffset(this.container));return a};
|
9
|
+
Syntax.Editor.prototype.setClientState=function(a){if(a.startOffset){var c=Syntax.Editor.getNodesForCharacterOffsets([a.startOffset],this.container),b=document.createRange();b.setStart(c[0][0],a.startOffset-c[0][1]);b.setEnd(c[0][0],a.startOffset-c[0][1]);a=window.getSelection();a.removeAllRanges();a.addRange(b)}};
|
10
|
+
Syntax.layouts.editor=function(a,c){var b=jQuery('<div class="editor syntax highlighted" contentEditable="true">');b.append(c.children());var d=new Syntax.Editor(b.get(0)),f=function(b){var c=d.getClientState(),e=d.updateChangedLines();0>e.difference&&0<e.start&&(e.start-=1);b=d.textForLines(e.start,e.end);e.start==e.end?d.updateLines(e,[]):Syntax.highlightText(b,a,function(a){d.updateLines(e,a.children().get());d.setClientState(c)})};b.bind("keyup",function(){f()});b.bind("paste",function(a){f()});
|
11
|
+
b.bind("keydown",function(a){9==a.keyCode?(a.preventDefault(),document.execCommand("insertHTML",!1," ")):13==a.keyCode&&(a.preventDefault(),document.execCommand("insertHTML",!1,"\n"))});return jQuery('<div class="syntax-container">').append(b)};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
+
Function.prototype.bind||(Function.prototype.bind=function(a){var b=Array.prototype.slice.call(arguments,1),c=this;return function(){return c.apply(a,b)}});function ResourceLoader(a){this.dependencies={};this.loading={};this.loader=a}ResourceLoader.prototype._finish=function(a){var b=this.dependencies[a];if(b){a=this._loaded.bind(this,a);for(var c=0;c<b.length;c+=1)a=this.get.bind(this,b[c],a);a()}else this._loaded(a)};
|
3
|
+
ResourceLoader.prototype._loaded=function(a){var b=this[a],c=this.loading[a];this.loading[a]=null;if(b)for(a=0;a<c.length;a+=1)c[a](b);else alert("ResourceLoader: Could not load resource named "+a)};ResourceLoader.prototype.dependency=function(a,b){if(!this[b]||this.loading[name])this.dependencies[a]?this.dependencies[a].push(b):this.dependencies[a]=[b]};
|
4
|
+
ResourceLoader.prototype.get=function(a,b){void 0==a?b():this.loading[a]?this.loading[a].push(b):this[a]?b(this[a]):(this.loading[a]=[b],this.loader(a,this._finish.bind(this,a)))};
|
5
|
+
var Syntax={root:null,aliases:{},styles:{},themes:{},lib:{},cacheScripts:!0,cacheStyleSheets:!0,codeSelector:"code:not(.highlighted)",defaultOptions:{theme:"base",replace:!0,linkify:!0},brushes:new ResourceLoader(function(a,b){a=Syntax.aliases[a]||a;Syntax.getResource("jquery.syntax.brush",a,b)}),loader:new ResourceLoader(function(a,b){Syntax.getResource("jquery.syntax",a,b)}),getStyles:function(a){var b=jQuery("<link>");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet",
|
6
|
+
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){if(this.onload&&("loaded"==this.readyState||"complete"==this.readyState))this.onload(),this.onload=null};c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d<b.length;d+=1)this.getStyles(this.root+
|
7
|
+
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);if(a&&(a=a.src.match(/.*\//)))Syntax.root=
|
8
|
+
a[0]}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
+
Function.prototype.bind||(Function.prototype.bind=function(a){var b=Array.prototype.slice.call(arguments,1),c=this;return function(){return c.apply(a,b)}});function ResourceLoader(a){this.dependencies={};this.loading={};this.loader=a}ResourceLoader.prototype._finish=function(a){var b=this.dependencies[a];if(b){a=this._loaded.bind(this,a);for(var c=0;c<b.length;c+=1)a=this.get.bind(this,b[c],a);a()}else this._loaded(a)};
|
3
|
+
ResourceLoader.prototype._loaded=function(a){var b=this[a],c=this.loading[a];this.loading[a]=null;if(b)for(a=0;a<c.length;a+=1)c[a](b);else alert("ResourceLoader: Could not load resource named "+a)};ResourceLoader.prototype.dependency=function(a,b){if(!this[b]||this.loading[name])this.dependencies[a]?this.dependencies[a].push(b):this.dependencies[a]=[b]};
|
4
|
+
ResourceLoader.prototype.get=function(a,b){void 0==a?b():this.loading[a]?this.loading[a].push(b):this[a]?b(this[a]):(this.loading[a]=[b],this.loader(a,this._finish.bind(this,a)))};
|
5
|
+
var Syntax={root:null,aliases:{},styles:{},themes:{},lib:{},cacheScripts:!0,cacheStyleSheets:!0,codeSelector:"code:not(.highlighted)",defaultOptions:{theme:"base",replace:!0,linkify:!0},brushes:new ResourceLoader(function(a,b){a=Syntax.aliases[a]||a;Syntax.getResource("jquery.syntax.brush",a,b)}),loader:new ResourceLoader(function(a,b){Syntax.getResource("jquery.syntax",a,b)}),getStyles:function(a){var b=jQuery("<link>");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet",
|
6
|
+
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){if(this.onload&&("loaded"==this.readyState||"complete"==this.readyState))this.onload(),this.onload=null};c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d<b.length;d+=1)this.getStyles(this.root+
|
7
|
+
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);if(a&&(a=a.src.match(/.*\//)))Syntax.root=
|
8
|
+
a[0]}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};Syntax.alias("apache",[]);Syntax.alias("applescript",[]);Syntax.alias("assembly",["asm"]);Syntax.alias("bash-script",[]);Syntax.alias("bash",[]);Syntax.alias("basic",["vb"]);Syntax.alias("clang",["cpp","c++","c","objective-c"]);
|
9
|
+
Syntax.alias("csharp",["c-sharp","c#"]);Syntax.alias("css",[]);Syntax.alias("diff",["patch"]);Syntax.alias("go",[]);Syntax.alias("haskell",[]);Syntax.alias("html",[]);Syntax.alias("io",[]);Syntax.alias("java",[]);Syntax.alias("javascript",["js","actionscript"]);Syntax.alias("kai",[]);Syntax.alias("lisp",["scheme","clojure"]);Syntax.alias("lua",[]);Syntax.alias("nginx",[]);Syntax.alias("ocaml",["ml","sml","fsharp"]);Syntax.alias("ooc",[]);Syntax.alias("pascal",["delphi"]);Syntax.alias("perl5",[]);
|
10
|
+
Syntax.alias("php-script",[]);Syntax.alias("php",[]);Syntax.alias("plain",["text"]);Syntax.alias("protobuf",[]);Syntax.alias("python",[]);Syntax.alias("ruby",[]);Syntax.alias("scala",[]);Syntax.alias("smalltalk",[]);Syntax.alias("sql",[]);Syntax.alias("super-collider",["sc"]);Syntax.alias("swift",[]);Syntax.alias("html",[]);Syntax.alias("xml",[]);Syntax.alias("yaml",[]);Syntax.styles["jquery.syntax.brush.apache"]=["base/jquery.syntax.brush.apache.css"];
|
11
|
+
Syntax.styles["jquery.syntax.brush.applescript"]=["base/jquery.syntax.brush.applescript.css"];Syntax.styles["jquery.syntax.brush.assembly"]=["base/jquery.syntax.brush.assembly.css"];Syntax.styles["jquery.syntax.brush.bash-script"]=["base/jquery.syntax.brush.bash-script.css"];Syntax.styles["jquery.syntax.brush.bash"]=["base/jquery.syntax.brush.bash.css"];Syntax.styles["jquery.syntax.brush.clang"]=["base/jquery.syntax.brush.clang.css"];Syntax.styles["jquery.syntax.brush.css"]=["base/jquery.syntax.brush.css.css"];
|
12
|
+
Syntax.styles["jquery.syntax.brush.diff"]=["base/jquery.syntax.brush.diff.css"];Syntax.styles["jquery.syntax.brush.html"]=["base/jquery.syntax.brush.html.css"];Syntax.styles["jquery.syntax.brush.ocaml"]=["base/jquery.syntax.brush.ocaml.css"];Syntax.styles["jquery.syntax.brush.protobuf"]=["base/jquery.syntax.brush.protobuf.css"];Syntax.styles["jquery.syntax.brush.python"]=["base/jquery.syntax.brush.python.css"];Syntax.styles["jquery.syntax.brush.ruby"]=["base/jquery.syntax.brush.ruby.css"];
|
13
|
+
Syntax.styles["jquery.syntax.brush.xml"]=["base/jquery.syntax.brush.xml.css"];Syntax.styles["jquery.syntax.core"]=["base/jquery.syntax.core.css","bright/jquery.syntax.core.css","paper/jquery.syntax.core.css"];Syntax.styles["jquery.syntax.editor"]=["base/jquery.syntax.editor.css"];Syntax.themes.base=[];Syntax.themes.bright=["base"];Syntax.themes.paper=["base"];
|
@@ -0,0 +1,31 @@
|
|
1
|
+
code.syntax-theme-paper {
|
2
|
+
font-family: "Bitstream Vera Sans Mono", "Courier", monospace;
|
3
|
+
line-height: 1.5em; }
|
4
|
+
code.syntax-theme-paper .function {
|
5
|
+
color: #33f; }
|
6
|
+
code.syntax-theme-paper .keyword {
|
7
|
+
color: #cb4b16; }
|
8
|
+
code.syntax-theme-paper .access {
|
9
|
+
color: #ffb600;
|
10
|
+
font-weight: bold; }
|
11
|
+
code.syntax-theme-paper .type {
|
12
|
+
color: #268bd2; }
|
13
|
+
code.syntax-theme-paper .comment {
|
14
|
+
color: #998;
|
15
|
+
font-style: italic; }
|
16
|
+
code.syntax-theme-paper .string {
|
17
|
+
color: #2aa198; }
|
18
|
+
code.syntax-theme-paper .string .escape {
|
19
|
+
color: #2ab1a8; }
|
20
|
+
code.syntax-theme-paper .operator {
|
21
|
+
color: #268bd2; }
|
22
|
+
code.syntax-theme-paper .href {
|
23
|
+
color: #00f;
|
24
|
+
text-decoration: underline; }
|
25
|
+
code.syntax-theme-paper .variable {
|
26
|
+
color: #b58900; }
|
27
|
+
code.syntax-theme-paper .constant {
|
28
|
+
color: #099; }
|
29
|
+
|
30
|
+
pre code.syntax-theme-paper > span:nth-child(odd) {
|
31
|
+
background-color: rgba(0, 0, 0, 0.05); }
|
@@ -0,0 +1 @@
|
|
1
|
+
Syntax.themes["paper"] = ["base"]
|
@@ -0,0 +1,120 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel="stylesheet" href="index.css" type="text/css" media="screen" />
|
5
|
+
|
6
|
+
<script src="jquery-1.6.min.js" type="text/javascript"></script>
|
7
|
+
<script src="../dist/jquery.syntax.js" type="text/javascript"></script>
|
8
|
+
<script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
jQuery(function($) {
|
12
|
+
$.syntax();
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Syntax: AppleScript</h1>
|
19
|
+
|
20
|
+
<h2>Hello World & Mode-line Support</h2>
|
21
|
+
|
22
|
+
<pre><code class="syntax applescript">(*
|
23
|
+
Copyright (C) 2009 Orion Transfer Ltd. All Rights Reserved. See http://www.oriontransfer.co.nz/ for more information.
|
24
|
+
Drop files on top of this application to produce a zip archive on the desktop containing compressed JPEGs at a maximum size of 800px.
|
25
|
+
*)
|
26
|
+
|
27
|
+
on open some_items
|
28
|
+
-- If we drop a single folder onto the icon, we pull the name from the folder name
|
29
|
+
set target_name to "Images"
|
30
|
+
|
31
|
+
if (count of some_items) = 1 then
|
32
|
+
set first_item to get item 1 of some_items
|
33
|
+
|
34
|
+
tell application "System Events"
|
35
|
+
set target_item to disk item (first_item as string)
|
36
|
+
|
37
|
+
if class of target_item is folder then
|
38
|
+
set target_name to name of first_item
|
39
|
+
end if
|
40
|
+
end tell
|
41
|
+
end if
|
42
|
+
|
43
|
+
display dialog "Name of Archive" default answer target_name buttons {"OK"} default button 1
|
44
|
+
set target_name to text returned of the result
|
45
|
+
|
46
|
+
tell application "Finder"
|
47
|
+
set desktop_path to folder "Desktop" of home
|
48
|
+
|
49
|
+
make new folder at desktop_path with properties {name:target_name}
|
50
|
+
|
51
|
+
set destination to (folder target_name of desktop_path) as alias
|
52
|
+
set archive_path to (POSIX path of (desktop_path as text)) & target_name & ".zip"
|
53
|
+
end tell
|
54
|
+
|
55
|
+
repeat with this_item in some_items
|
56
|
+
tell application "System Events"
|
57
|
+
set source_item to disk item (this_item as string)
|
58
|
+
end tell
|
59
|
+
|
60
|
+
process_path(source_item, destination)
|
61
|
+
end repeat
|
62
|
+
|
63
|
+
set archive_command to "/usr/bin/ditto -c -k -rsrc " & quoted form of (POSIX path of destination) & " " & quoted form of archive_path
|
64
|
+
|
65
|
+
do shell script archive_command
|
66
|
+
|
67
|
+
tell application "Finder"
|
68
|
+
activate
|
69
|
+
|
70
|
+
delete folder target_name of desktop_path
|
71
|
+
|
72
|
+
reveal file (target_name & ".zip") of desktop_path
|
73
|
+
end tell
|
74
|
+
end open
|
75
|
+
|
76
|
+
to process_path(source, destination)
|
77
|
+
-- Figure out if it is a file or folder, and recurse appropriately
|
78
|
+
tell application "System Events"
|
79
|
+
set is_folder to class of source is folder
|
80
|
+
if is_folder then
|
81
|
+
set sub_items to items in source
|
82
|
+
end if
|
83
|
+
end tell
|
84
|
+
|
85
|
+
if is_folder then
|
86
|
+
repeat with this_item in sub_items
|
87
|
+
process_path(this_item, destination)
|
88
|
+
end repeat
|
89
|
+
else
|
90
|
+
tell application "System Events"
|
91
|
+
set source_alias to (path of source) as alias
|
92
|
+
end tell
|
93
|
+
|
94
|
+
resize_and_save(source_alias, destination)
|
95
|
+
end if
|
96
|
+
end process_path
|
97
|
+
|
98
|
+
to resize_and_save(image_alias, destination_alias)
|
99
|
+
tell application "Image Events"
|
100
|
+
launch
|
101
|
+
|
102
|
+
set opened_image to open image_alias
|
103
|
+
|
104
|
+
if class of opened_image is image and not dimensions of opened_image = {} then
|
105
|
+
set dim to dimensions of opened_image
|
106
|
+
|
107
|
+
-- We only resize if the dimension is bigger than 800
|
108
|
+
if (first item of dim > 800 or second item of dim > 800) then
|
109
|
+
scale opened_image to size 800
|
110
|
+
end if
|
111
|
+
|
112
|
+
save opened_image in destination_alias as JPEG with compression level medium
|
113
|
+
|
114
|
+
close opened_image
|
115
|
+
end if
|
116
|
+
end tell
|
117
|
+
end resize_and_save
|
118
|
+
</code></pre>
|
119
|
+
</body>
|
120
|
+
</html>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel="stylesheet" href="index.css" type="text/css" media="screen" />
|
5
|
+
|
6
|
+
<script src="jquery-1.6.min.js" type="text/javascript"></script>
|
7
|
+
<script src="../dist/jquery.syntax.js" type="text/javascript"></script>
|
8
|
+
<script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
jQuery(function($) {
|
12
|
+
$.syntax();
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Syntax: Assembler</h1>
|
19
|
+
|
20
|
+
<pre style="tab-size: 4"><code class="syntax language-asm">
|
21
|
+
.text
|
22
|
+
.global _start
|
23
|
+
|
24
|
+
_start:
|
25
|
+
# ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count)
|
26
|
+
movl $len, %edx # size_t count
|
27
|
+
movl $msg, %ecx # const char __user * buf
|
28
|
+
movl $1, %ebx # unsigned int fd
|
29
|
+
movl $4, %eax # system call number (sys_write)
|
30
|
+
int $0x80 # call kernel
|
31
|
+
|
32
|
+
# void _exit(int status);
|
33
|
+
movl $0, %ebx # int status
|
34
|
+
movl $1, %eax # system call number (sys_exit)
|
35
|
+
int $0x80 # call kernel
|
36
|
+
|
37
|
+
.data
|
38
|
+
|
39
|
+
msg:
|
40
|
+
.ascii "Hello, world!\n"
|
41
|
+
len = . - msg</code></pre>
|
42
|
+
</body>
|
43
|
+
</html>
|
@@ -0,0 +1,139 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel="stylesheet" href="index.css" type="text/css" media="screen" />
|
5
|
+
|
6
|
+
<script src="jquery-1.6.min.js" type="text/javascript"></script>
|
7
|
+
<script src="../dist/jquery.syntax.js" type="text/javascript"></script>
|
8
|
+
<script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
jQuery(function($) {
|
12
|
+
$.syntax();
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Syntax: Bash</h1>
|
19
|
+
|
20
|
+
<p>Bash is context-sensitive - a script could mean different things depending on what is defined in the environment. Thus, to present Bash code clearly, you will need to use inline markup, such as the last example on this page.</p>
|
21
|
+
|
22
|
+
<pre><code class="syntax language-bash-script">#!/bin/bash
|
23
|
+
# Counting to 11 in 10 different ways.
|
24
|
+
|
25
|
+
n=1; echo -n "$n "
|
26
|
+
|
27
|
+
let "n = $n + 1" # let "n = n + 1" also works.
|
28
|
+
echo -n "$n "
|
29
|
+
|
30
|
+
|
31
|
+
: $((n = $n + 1))
|
32
|
+
# ":" necessary because otherwise Bash attempts
|
33
|
+
#+ to interpret "$((n = $n + 1))" as a command.
|
34
|
+
echo -n "$n "
|
35
|
+
|
36
|
+
(( n = n + 1 ))
|
37
|
+
# A simpler alternative to the method above.
|
38
|
+
# Thanks, David Lombard, for pointing this out.
|
39
|
+
echo -n "$n "
|
40
|
+
|
41
|
+
n=$(($n + 1))
|
42
|
+
echo -n "$n "
|
43
|
+
|
44
|
+
: $[ n = $n + 1 ]
|
45
|
+
# ":" necessary because otherwise Bash attempts
|
46
|
+
#+ to interpret "$[ n = $n + 1 ]" as a command.
|
47
|
+
# Works even if "n" was initialized as a string.
|
48
|
+
echo -n "$n "
|
49
|
+
|
50
|
+
n=$[ $n + 1 ]
|
51
|
+
# Works even if "n" was initialized as a string.
|
52
|
+
#* Avoid this type of construct, since it is obsolete and nonportable.
|
53
|
+
# Thanks, Stephane Chazelas.
|
54
|
+
echo -n "$n "
|
55
|
+
|
56
|
+
# Now for C-style increment operators.
|
57
|
+
# Thanks, Frank Wang, for pointing this out.
|
58
|
+
|
59
|
+
let "n++" # let "++n" also works.
|
60
|
+
echo -n "$n "
|
61
|
+
|
62
|
+
(( n++ )) # (( ++n ) also works.
|
63
|
+
echo -n "$n "
|
64
|
+
|
65
|
+
: $(( n++ )) # : $(( ++n )) also works.
|
66
|
+
echo -n "$n "
|
67
|
+
|
68
|
+
: $[ n++ ] # : $[ ++n ]] also works
|
69
|
+
echo -n "$n "
|
70
|
+
|
71
|
+
echo
|
72
|
+
|
73
|
+
exit 0</code></pre>
|
74
|
+
|
75
|
+
<p>
|
76
|
+
|
77
|
+
<pre><code class="syntax bash-script">#!/bin/bash
|
78
|
+
|
79
|
+
svc_cluster_ip=10.0.0.10
|
80
|
+
svc_priv_dsa=~/.ssh/id_dsa
|
81
|
+
|
82
|
+
if [ ! -f $svc_priv_dsa ] ; then
|
83
|
+
echo " ${0##*/} is missing the SSH DSA private key"
|
84
|
+
echo " needed to access the SAN Volume controller."
|
85
|
+
echo " Please specify the correct path!"
|
86
|
+
fi
|
87
|
+
|
88
|
+
if [ -z $1 ] ; then
|
89
|
+
echo
|
90
|
+
echo " ${0##*/} [ WWPN ]"
|
91
|
+
echo
|
92
|
+
echo " WWPN - WWPN, or part of WWPN that is being searched."
|
93
|
+
echo " Should be entered in continous format (ie. no dash (-) or colon (:))!"
|
94
|
+
echo
|
95
|
+
exit 1;
|
96
|
+
fi
|
97
|
+
|
98
|
+
WWPN=$1
|
99
|
+
|
100
|
+
list_wwpn_by_host() {
|
101
|
+
local _host=$1
|
102
|
+
|
103
|
+
if [ ! -z $_host ] ; then
|
104
|
+
ssh -i $svc_priv_dsa admin@$svc_cluster_ip svcinfo lshost \
|
105
|
+
-delim : $_host | grep ^WWPN | sed "s,WWPN:,,"
|
106
|
+
fi
|
107
|
+
}
|
108
|
+
|
109
|
+
#set -x
|
110
|
+
|
111
|
+
HOST_LIST="$( ssh -i $svc_priv_dsa admin@$svc_cluster_ip svcinfo lshost -delim : -nohdr | cut -d: -f2 )"
|
112
|
+
|
113
|
+
for HOST in $HOST_LIST; do
|
114
|
+
echo -n "$HOST: "
|
115
|
+
echo `list_wwpn_by_host $HOST`
|
116
|
+
done | grep $WWPN
|
117
|
+
|
118
|
+
#set +x
|
119
|
+
</code></pre>
|
120
|
+
|
121
|
+
<p>This next example uses inline HTML to markup and highlight <code class="syntax bash-script">rd-resolve-test bob</code>.</p>
|
122
|
+
|
123
|
+
<pre id="ex2"><code class="syntax brush-bash">samuel@ayako:~$ which git
|
124
|
+
/usr/bin/git
|
125
|
+
samuel@ayako:~$ ls -lah
|
126
|
+
getconf getent getopt getopts gettext gettext.sh gettextize
|
127
|
+
samuel@ayako:~# sudo <span class="highlight"><span class="function">rd-resolve-test</span> bob</span>
|
128
|
+
/home/samuel</code></pre>
|
129
|
+
|
130
|
+
<p>Here is the HTML of the above <code class="syntax html"><pre></code>:</p>
|
131
|
+
|
132
|
+
<pre id="ex2_html" class="syntax html"></pre>
|
133
|
+
|
134
|
+
<script type="text/javascript">
|
135
|
+
$('#ex2_html').text($('<div>').append($('#ex2').clone()).html());
|
136
|
+
</script>
|
137
|
+
|
138
|
+
</body>
|
139
|
+
</html>
|
@@ -0,0 +1,337 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel="stylesheet" href="index.css" type="text/css" media="screen" />
|
5
|
+
|
6
|
+
<script src="jquery-1.6.min.js" type="text/javascript"></script>
|
7
|
+
<script src="../dist/jquery.syntax.js" type="text/javascript"></script>
|
8
|
+
<script src="../dist/jquery.syntax.cache.js" type="text/javascript"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
jQuery(function($) {
|
12
|
+
$.syntax();
|
13
|
+
});
|
14
|
+
</script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Syntax: C, C++, Objective-C</h1>
|
19
|
+
|
20
|
+
<h2>C++</h2>
|
21
|
+
|
22
|
+
<pre><code class="syntax brush-clang">#include <iostream>
|
23
|
+
|
24
|
+
// If we increase row by 1, the offset will increase by sz (number of elements per row i.e. number of columns)
|
25
|
+
// If we increase col by 1, the offset will increase by 1
|
26
|
+
unsigned rowMajorOffset(unsigned row, unsigned col, unsigned sz)
|
27
|
+
{
|
28
|
+
return col + row * sz;
|
29
|
+
}
|
30
|
+
|
31
|
+
// If we increase col by 1, the offset will increase by sz (number of elements per column i.e. number of rows)
|
32
|
+
// If we increase row by 1, the offset will increase by 1
|
33
|
+
unsigned columnMajorOffset(unsigned row, unsigned col, unsigned sz)
|
34
|
+
{
|
35
|
+
return row + col * sz;
|
36
|
+
}
|
37
|
+
|
38
|
+
template <typename _ValueT, unsigned _R, unsigned _C, bool _ColumnMajor>
|
39
|
+
class Matrix {
|
40
|
+
protected:
|
41
|
+
enum { ColumnMajor = _ColumnMajor };
|
42
|
+
enum { R = _R };
|
43
|
+
enum { C = _C };
|
44
|
+
|
45
|
+
typedef _ValueT ValueT;
|
46
|
+
|
47
|
+
ValueT m_values[C*R];
|
48
|
+
|
49
|
+
public:
|
50
|
+
const ValueT & at (unsigned r, unsigned c) const
|
51
|
+
{
|
52
|
+
if (ColumnMajor)
|
53
|
+
return m_values[columnMajorOffset(r, c, R)];
|
54
|
+
else
|
55
|
+
return m_values[rowMajorOffset(r, c, C)];
|
56
|
+
}
|
57
|
+
|
58
|
+
ValueT & at (unsigned r, unsigned c)
|
59
|
+
{
|
60
|
+
if (ColumnMajor)
|
61
|
+
return m_values[columnMajorOffset(r, c, R)];
|
62
|
+
else
|
63
|
+
return m_values[rowMajorOffset(r, c, C)];
|
64
|
+
}
|
65
|
+
|
66
|
+
void loadTestPattern ()
|
67
|
+
{
|
68
|
+
for (unsigned r = 0; r < R; r += 1)
|
69
|
+
for (unsigned c = 0; c < C; c += 1)
|
70
|
+
at(r, c) = (r+1) * 1000 + (c+1);
|
71
|
+
}
|
72
|
+
|
73
|
+
void debug ()
|
74
|
+
{
|
75
|
+
using namespace std;
|
76
|
+
|
77
|
+
if (ColumnMajor)
|
78
|
+
cout << "Column-Major Matrix " << "(" << R << "," << C << ")" << " @ " << this << endl;
|
79
|
+
else
|
80
|
+
cout << "Row-Major Matrix " << "(" << R << "," << C << ")" << " @ " << this << endl;
|
81
|
+
|
82
|
+
cout << "Memory Offset: ";
|
83
|
+
for (unsigned i = 0; i < (R*C); i += 1)
|
84
|
+
cout << i << " ";
|
85
|
+
cout << endl;
|
86
|
+
|
87
|
+
cout << " Values: ";
|
88
|
+
for (unsigned i = 0; i < (R*C); i += 1)
|
89
|
+
cout << m_values[i] << " ";
|
90
|
+
cout << endl;
|
91
|
+
|
92
|
+
cout << "Standard Mathematical Notation:" << endl;
|
93
|
+
cout << " ";
|
94
|
+
for (unsigned c = 0; c < C; c += 1)
|
95
|
+
cout << "Col " << c << " ";
|
96
|
+
cout << endl;
|
97
|
+
|
98
|
+
for (unsigned r = 0; r < R; r += 1) {
|
99
|
+
cout << "Row " << r << " ";
|
100
|
+
for (unsigned c = 0; c < C; c += 1)
|
101
|
+
cout << at(r, c) << " ";
|
102
|
+
cout << endl;
|
103
|
+
}
|
104
|
+
cout << endl;
|
105
|
+
}
|
106
|
+
|
107
|
+
Matrix<ValueT, R, C, !ColumnMajor> transposeStorage () const
|
108
|
+
{
|
109
|
+
Matrix<ValueT, R, C, !ColumnMajor> result;
|
110
|
+
|
111
|
+
for (unsigned r = 0; r < R; r += 1)
|
112
|
+
for (unsigned c = 0; c < C; c += 1)
|
113
|
+
result.at(r, c) = at(r, c);
|
114
|
+
|
115
|
+
return result;
|
116
|
+
}
|
117
|
+
|
118
|
+
Matrix<ValueT, C, R, !ColumnMajor> transposeMatrix () const
|
119
|
+
{
|
120
|
+
Matrix<ValueT, C, R, !ColumnMajor> result;
|
121
|
+
|
122
|
+
memcpy(&result.at(0,0), m_values, sizeof(m_values));
|
123
|
+
|
124
|
+
return result;
|
125
|
+
}
|
126
|
+
};
|
127
|
+
|
128
|
+
int main (int argc, char * const argv[]) {
|
129
|
+
Matrix<float, 4, 2, false> rowMajorMatrix;
|
130
|
+
Matrix<float, 4, 2, true> columnMajorMatrix;
|
131
|
+
|
132
|
+
rowMajorMatrix.loadTestPattern();
|
133
|
+
rowMajorMatrix.debug();
|
134
|
+
|
135
|
+
columnMajorMatrix.loadTestPattern();
|
136
|
+
columnMajorMatrix.debug();
|
137
|
+
|
138
|
+
rowMajorMatrix = columnMajorMatrix.transposeStorage();
|
139
|
+
rowMajorMatrix.debug();
|
140
|
+
|
141
|
+
Matrix<float, 2, 4, false> transposedMatrix = columnMajorMatrix.transposeMatrix();
|
142
|
+
transposedMatrix.debug();
|
143
|
+
|
144
|
+
return 0;
|
145
|
+
}</code></pre>
|
146
|
+
|
147
|
+
<h2>Objective-C Header</h2>
|
148
|
+
|
149
|
+
<pre><code class="syntax brush-clang">//
|
150
|
+
// GHInventoryEditor.h
|
151
|
+
// Goblin Hacker
|
152
|
+
//
|
153
|
+
// Created by Samuel Williams on 19/12/07.
|
154
|
+
// Copyright 2007 Samuel Williams, Orion Transfer Ltd. All rights reserved.
|
155
|
+
|
156
|
+
// This software was originally produced by Orion Transfer Ltd.
|
157
|
+
// Please see http://www.oriontransfer.org for more details.
|
158
|
+
//
|
159
|
+
|
160
|
+
/*
|
161
|
+
This program is free software: you can redistribute it and/or modify
|
162
|
+
it under the terms of the GNU General Public License as published by
|
163
|
+
the Free Software Foundation, either version 3 of the License, or
|
164
|
+
(at your option) any later version.
|
165
|
+
|
166
|
+
This program is distributed in the hope that it will be useful,
|
167
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
168
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
169
|
+
GNU General Public License for more details.
|
170
|
+
|
171
|
+
You should have received a copy of the GNU General Public License
|
172
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
173
|
+
*/
|
174
|
+
|
175
|
+
|
176
|
+
#import <Cocoa/Cocoa.h>
|
177
|
+
|
178
|
+
#import "GHEditorController.h"
|
179
|
+
#import "GHSavedGameDocument+Slots.h"
|
180
|
+
|
181
|
+
@interface GHInventoryEditor : GHEditorController {
|
182
|
+
NSInteger armorType, weaponType, potionQuality;
|
183
|
+
}
|
184
|
+
|
185
|
+
+ (NSArray*) items;
|
186
|
+
|
187
|
+
@property NSInteger armorType;
|
188
|
+
@property NSInteger weaponType;
|
189
|
+
@property NSInteger potionQuality;
|
190
|
+
|
191
|
+
- (IBAction)healingPotions: (id)sender;
|
192
|
+
- (IBAction)manaPotions: (id)sender;
|
193
|
+
- (IBAction)cureDiseasePotions: (id)sender;
|
194
|
+
- (IBAction)catsEyePotions: (id)sender;
|
195
|
+
- (IBAction)predatorSightPotions:(id)sender;
|
196
|
+
- (IBAction)leatherSkinPotions: (id)sender;
|
197
|
+
- (IBAction)hastePotions: (id)sender;
|
198
|
+
- (IBAction)invisibilityPotions: (id)sender;
|
199
|
+
|
200
|
+
- (IBAction)basicWeapon: (id)sender;
|
201
|
+
- (IBAction)goodWeapon: (id)sender;
|
202
|
+
- (IBAction)superbWeapon: (id)sender;
|
203
|
+
- (IBAction)avatarWeapon: (id)sender;
|
204
|
+
|
205
|
+
- (IBAction)basicArmor: (id)sender;
|
206
|
+
- (IBAction)goodArmor: (id)sender;
|
207
|
+
- (IBAction)superbArmor: (id)sender;
|
208
|
+
- (IBAction)avatarArmor: (id)sender;
|
209
|
+
|
210
|
+
- (IBAction)alchemyBooks: (id)sender;
|
211
|
+
- (IBAction)amulets: (id)sender;
|
212
|
+
- (IBAction)lockpicks: (id)sender;
|
213
|
+
- (IBAction)reagents: (id)sender;
|
214
|
+
- (IBAction)reactants: (id)sender;
|
215
|
+
- (IBAction)rings: (id)sender;
|
216
|
+
- (IBAction)torches: (id)sender;
|
217
|
+
|
218
|
+
- (IBAction)avatarJewelry: (id)sender;
|
219
|
+
|
220
|
+
@end</code></pre>
|
221
|
+
|
222
|
+
<h2>Objective-C Implementation</h2>
|
223
|
+
|
224
|
+
<pre><code class="syntax brush-clang">//
|
225
|
+
// GPointSet.m
|
226
|
+
// Gocoa
|
227
|
+
//
|
228
|
+
// Created by Samuel Williams on 9/05/05.
|
229
|
+
// Copyright 2005 Orion Transfer Ltd. All rights reserved.
|
230
|
+
//
|
231
|
+
|
232
|
+
#import "GPointSet.h"
|
233
|
+
|
234
|
+
void adjacentPoints (NSPoint p, NSPoint pts[4]) { //pts must have four elements
|
235
|
+
pts[3] = NSMakePoint (p.x - 1, p.y);
|
236
|
+
pts[0] = NSMakePoint (p.x, p.y + 1);
|
237
|
+
pts[1] = NSMakePoint (p.x + 1, p.y);
|
238
|
+
pts[2] = NSMakePoint (p.x, p.y - 1);
|
239
|
+
}
|
240
|
+
|
241
|
+
@implementation GPointSet
|
242
|
+
+ (NSPoint) pointForIndex:(unsigned int)index withSize:(NSSize)s {
|
243
|
+
int x = index % (int)(s.width);
|
244
|
+
return NSMakePoint (x, (int)((index - x) / s.width));
|
245
|
+
}
|
246
|
+
|
247
|
+
+ (unsigned int) indexForPoint:(NSPoint)point withSize:(NSSize)s {
|
248
|
+
return point.x + (point.y * s.width);
|
249
|
+
}
|
250
|
+
|
251
|
+
- (id) init {
|
252
|
+
NSLog(@"%s does not have default constructor", __FUNCTION__);
|
253
|
+
return nil;
|
254
|
+
}
|
255
|
+
|
256
|
+
- (id) initWithSize:(NSSize)newSize {
|
257
|
+
if (self = [super init]) {
|
258
|
+
size = newSize;
|
259
|
+
indexSet = [[NSMutableIndexSet alloc] init];
|
260
|
+
}
|
261
|
+
|
262
|
+
return self;
|
263
|
+
}
|
264
|
+
|
265
|
+
- (void) dealloc {
|
266
|
+
[super dealloc];
|
267
|
+
[indexSet release];
|
268
|
+
}
|
269
|
+
|
270
|
+
- (NSMutableIndexSet*) indexSet {
|
271
|
+
return [[indexSet retain] autorelease];
|
272
|
+
}
|
273
|
+
|
274
|
+
- (void) addPoint:(NSPoint)point {
|
275
|
+
[indexSet addIndex:[GPointSet indexForPoint:point withSize:size]];
|
276
|
+
}
|
277
|
+
|
278
|
+
- (void) removePoint:(NSPoint)point {
|
279
|
+
[indexSet removeIndex:[GPointSet indexForPoint:point withSize:size]];
|
280
|
+
}
|
281
|
+
|
282
|
+
- (BOOL) containsPoint:(NSPoint)point {
|
283
|
+
return [indexSet containsIndex:[GPointSet indexForPoint:point withSize:size]];
|
284
|
+
}
|
285
|
+
|
286
|
+
- (NSPoint) pointForIndex:(unsigned int)index {
|
287
|
+
return [GPointSet pointForIndex:index withSize:size];
|
288
|
+
}
|
289
|
+
|
290
|
+
- (unsigned int) indexForPoint:(NSPoint)point {
|
291
|
+
return [GPointSet indexForPoint:point withSize:size];
|
292
|
+
}
|
293
|
+
|
294
|
+
- (NSString*)description {
|
295
|
+
NSMutableString *result = [NSMutableString new];
|
296
|
+
[result appendFormat:@"<GPointSet %h", self];
|
297
|
+
|
298
|
+
unsigned index = [indexSet firstIndex];
|
299
|
+
|
300
|
+
while (index != NSNotFound) {
|
301
|
+
[result appendFormat:@"%@ ", NSStringFromPoint([self pointForIndex:index])];
|
302
|
+
|
303
|
+
index = [indexSet indexGreaterThanIndex:index];
|
304
|
+
}
|
305
|
+
|
306
|
+
[result appendString:@">"];
|
307
|
+
return result;
|
308
|
+
}
|
309
|
+
|
310
|
+
@end</code></pre>
|
311
|
+
|
312
|
+
<h2>Strings with embedded escapes</h2>
|
313
|
+
|
314
|
+
<pre><code class="syntax brush-clang">
|
315
|
+
const char * text = "The elephant\n was in the room.";
|
316
|
+
</code></pre>
|
317
|
+
|
318
|
+
<h2>Types and Functions</h2>
|
319
|
+
|
320
|
+
<pre><code class="syntax c++">
|
321
|
+
int pthread_setcancelstate(int, int *);
|
322
|
+
int pthread_setcanceltype(int, int *);
|
323
|
+
int pthread_setconcurrency(int);
|
324
|
+
int pthread_setschedparam(pthread_t, int ,
|
325
|
+
const struct sched_param *);
|
326
|
+
int pthread_setspecific(pthread_key_t, const void *);
|
327
|
+
void pthread_testcancel(void);
|
328
|
+
|
329
|
+
namespace Bob {
|
330
|
+
namespace moo {
|
331
|
+
|
332
|
+
}
|
333
|
+
}
|
334
|
+
</code></pre>
|
335
|
+
|
336
|
+
</body>
|
337
|
+
</html>
|