milksteak 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -14
- data/.rspec +2 -0
- data/Gemfile +1 -1
- data/Guardfile +8 -0
- data/Rakefile +0 -1
- data/Readme.md +37 -0
- data/lib/helpers.rb +0 -0
- data/lib/milksteak/cms.rb +17 -0
- data/lib/milksteak/version.rb +1 -1
- data/lib/milksteak.rb +52 -1
- data/lib/models/page.rb +73 -0
- data/lib/models/user.rb +5 -0
- data/lib/public/milksteak/codemirror2/keymap/emacs.js +29 -0
- data/lib/public/milksteak/codemirror2/keymap/vim.js +347 -0
- data/lib/public/milksteak/codemirror2/lib/codemirror.css +110 -0
- data/lib/public/milksteak/codemirror2/lib/codemirror.js +2887 -0
- data/lib/public/milksteak/codemirror2/lib/util/dialog.css +23 -0
- data/lib/public/milksteak/codemirror2/lib/util/dialog.js +63 -0
- data/lib/public/milksteak/codemirror2/lib/util/foldcode.js +186 -0
- data/lib/public/milksteak/codemirror2/lib/util/formatting.js +294 -0
- data/lib/public/milksteak/codemirror2/lib/util/javascript-hint.js +132 -0
- data/lib/public/milksteak/codemirror2/lib/util/match-highlighter.js +44 -0
- data/lib/public/milksteak/codemirror2/lib/util/overlay.js +51 -0
- data/lib/public/milksteak/codemirror2/lib/util/runmode.js +49 -0
- data/lib/public/milksteak/codemirror2/lib/util/search.js +114 -0
- data/lib/public/milksteak/codemirror2/lib/util/searchcursor.js +117 -0
- data/lib/public/milksteak/codemirror2/lib/util/simple-hint.css +16 -0
- data/lib/public/milksteak/codemirror2/lib/util/simple-hint.js +66 -0
- data/lib/public/milksteak/codemirror2/mode/clike/clike.js +234 -0
- data/lib/public/milksteak/codemirror2/mode/clike/index.html +101 -0
- data/lib/public/milksteak/codemirror2/mode/clojure/clojure.js +207 -0
- data/lib/public/milksteak/codemirror2/mode/clojure/index.html +66 -0
- data/lib/public/milksteak/codemirror2/mode/coffeescript/LICENSE +22 -0
- data/lib/public/milksteak/codemirror2/mode/coffeescript/coffeescript.js +341 -0
- data/lib/public/milksteak/codemirror2/mode/coffeescript/index.html +721 -0
- data/lib/public/milksteak/codemirror2/mode/css/css.js +124 -0
- data/lib/public/milksteak/codemirror2/mode/css/index.html +55 -0
- data/lib/public/milksteak/codemirror2/mode/diff/diff.css +3 -0
- data/lib/public/milksteak/codemirror2/mode/diff/diff.js +13 -0
- data/lib/public/milksteak/codemirror2/mode/diff/index.html +99 -0
- data/lib/public/milksteak/codemirror2/mode/ecl/ecl.js +203 -0
- data/lib/public/milksteak/codemirror2/mode/ecl/index.html +42 -0
- data/lib/public/milksteak/codemirror2/mode/gfm/gfm.js +108 -0
- data/lib/public/milksteak/codemirror2/mode/gfm/index.html +47 -0
- data/lib/public/milksteak/codemirror2/mode/go/go.js +170 -0
- data/lib/public/milksteak/codemirror2/mode/go/index.html +72 -0
- data/lib/public/milksteak/codemirror2/mode/groovy/groovy.js +210 -0
- data/lib/public/milksteak/codemirror2/mode/groovy/index.html +71 -0
- data/lib/public/milksteak/codemirror2/mode/haskell/haskell.js +242 -0
- data/lib/public/milksteak/codemirror2/mode/haskell/index.html +60 -0
- data/lib/public/milksteak/codemirror2/mode/htmlembedded/htmlembedded.js +68 -0
- data/lib/public/milksteak/codemirror2/mode/htmlembedded/index.html +49 -0
- data/lib/public/milksteak/codemirror2/mode/htmlmixed/htmlmixed.js +83 -0
- data/lib/public/milksteak/codemirror2/mode/htmlmixed/index.html +51 -0
- data/lib/public/milksteak/codemirror2/mode/javascript/index.html +77 -0
- data/lib/public/milksteak/codemirror2/mode/javascript/javascript.js +360 -0
- data/lib/public/milksteak/codemirror2/mode/jinja2/index.html +37 -0
- data/lib/public/milksteak/codemirror2/mode/jinja2/jinja2.js +42 -0
- data/lib/public/milksteak/codemirror2/mode/less/index.html +577 -0
- data/lib/public/milksteak/codemirror2/mode/less/less.js +186 -0
- data/lib/public/milksteak/codemirror2/mode/lua/index.html +72 -0
- data/lib/public/milksteak/codemirror2/mode/lua/lua.js +140 -0
- data/lib/public/milksteak/codemirror2/mode/markdown/index.html +339 -0
- data/lib/public/milksteak/codemirror2/mode/markdown/markdown.js +276 -0
- data/lib/public/milksteak/codemirror2/mode/mysql/index.html +41 -0
- data/lib/public/milksteak/codemirror2/mode/mysql/mysql.js +188 -0
- data/lib/public/milksteak/codemirror2/mode/ntriples/index.html +32 -0
- data/lib/public/milksteak/codemirror2/mode/ntriples/ntriples.js +172 -0
- data/lib/public/milksteak/codemirror2/mode/pascal/LICENSE +7 -0
- data/lib/public/milksteak/codemirror2/mode/pascal/index.html +48 -0
- data/lib/public/milksteak/codemirror2/mode/pascal/pascal.js +94 -0
- data/lib/public/milksteak/codemirror2/mode/perl/LICENSE +19 -0
- data/lib/public/milksteak/codemirror2/mode/perl/index.html +62 -0
- data/lib/public/milksteak/codemirror2/mode/perl/perl.js +816 -0
- data/lib/public/milksteak/codemirror2/mode/php/index.html +48 -0
- data/lib/public/milksteak/codemirror2/mode/php/php.js +150 -0
- data/lib/public/milksteak/codemirror2/mode/plsql/index.html +62 -0
- data/lib/public/milksteak/codemirror2/mode/plsql/plsql.js +217 -0
- data/lib/public/milksteak/codemirror2/mode/properties/index.html +40 -0
- data/lib/public/milksteak/codemirror2/mode/properties/properties.css +3 -0
- data/lib/public/milksteak/codemirror2/mode/properties/properties.js +57 -0
- data/lib/public/milksteak/codemirror2/mode/python/LICENSE.txt +21 -0
- data/lib/public/milksteak/codemirror2/mode/python/index.html +122 -0
- data/lib/public/milksteak/codemirror2/mode/python/python.js +340 -0
- data/lib/public/milksteak/codemirror2/mode/r/LICENSE +24 -0
- data/lib/public/milksteak/codemirror2/mode/r/index.html +73 -0
- data/lib/public/milksteak/codemirror2/mode/r/r.js +141 -0
- data/lib/public/milksteak/codemirror2/mode/rpm/changes/changes.js +19 -0
- data/lib/public/milksteak/codemirror2/mode/rpm/changes/index.html +53 -0
- data/lib/public/milksteak/codemirror2/mode/rpm/spec/index.html +99 -0
- data/lib/public/milksteak/codemirror2/mode/rpm/spec/spec.css +5 -0
- data/lib/public/milksteak/codemirror2/mode/rpm/spec/spec.js +66 -0
- data/lib/public/milksteak/codemirror2/mode/rst/index.html +525 -0
- data/lib/public/milksteak/codemirror2/mode/rst/rst.js +326 -0
- data/lib/public/milksteak/codemirror2/mode/ruby/LICENSE +24 -0
- data/lib/public/milksteak/codemirror2/mode/ruby/index.html +171 -0
- data/lib/public/milksteak/codemirror2/mode/ruby/ruby.js +200 -0
- data/lib/public/milksteak/codemirror2/mode/rust/index.html +48 -0
- data/lib/public/milksteak/codemirror2/mode/rust/rust.js +432 -0
- data/lib/public/milksteak/codemirror2/mode/scheme/index.html +64 -0
- data/lib/public/milksteak/codemirror2/mode/scheme/scheme.js +202 -0
- data/lib/public/milksteak/codemirror2/mode/smalltalk/index.html +55 -0
- data/lib/public/milksteak/codemirror2/mode/smalltalk/smalltalk.js +139 -0
- data/lib/public/milksteak/codemirror2/mode/sparql/index.html +40 -0
- data/lib/public/milksteak/codemirror2/mode/sparql/sparql.js +143 -0
- data/lib/public/milksteak/codemirror2/mode/stex/index.html +95 -0
- data/lib/public/milksteak/codemirror2/mode/stex/stex.js +167 -0
- data/lib/public/milksteak/codemirror2/mode/tiddlywiki/index.html +183 -0
- data/lib/public/milksteak/codemirror2/mode/tiddlywiki/tiddlywiki.css +21 -0
- data/lib/public/milksteak/codemirror2/mode/tiddlywiki/tiddlywiki.js +374 -0
- data/lib/public/milksteak/codemirror2/mode/velocity/index.html +103 -0
- data/lib/public/milksteak/codemirror2/mode/velocity/velocity.js +146 -0
- data/lib/public/milksteak/codemirror2/mode/verilog/index.html +210 -0
- data/lib/public/milksteak/codemirror2/mode/verilog/verilog.js +194 -0
- data/lib/public/milksteak/codemirror2/mode/xml/index.html +45 -0
- data/lib/public/milksteak/codemirror2/mode/xml/xml.js +267 -0
- data/lib/public/milksteak/codemirror2/mode/xmlpure/index.html +59 -0
- data/lib/public/milksteak/codemirror2/mode/xmlpure/xmlpure.js +490 -0
- data/lib/public/milksteak/codemirror2/mode/yaml/index.html +67 -0
- data/lib/public/milksteak/codemirror2/mode/yaml/yaml.js +95 -0
- data/lib/public/milksteak/codemirror2/theme/cobalt.css +18 -0
- data/lib/public/milksteak/codemirror2/theme/eclipse.css +25 -0
- data/lib/public/milksteak/codemirror2/theme/elegant.css +10 -0
- data/lib/public/milksteak/codemirror2/theme/monokai.css +28 -0
- data/lib/public/milksteak/codemirror2/theme/neat.css +9 -0
- data/lib/public/milksteak/codemirror2/theme/night.css +21 -0
- data/lib/public/milksteak/codemirror2/theme/rubyblue.css +21 -0
- data/lib/public/milksteak/css/bootstrap-responsive.css +567 -0
- data/lib/public/milksteak/css/bootstrap-responsive.min.css +3 -0
- data/lib/public/milksteak/css/bootstrap.css +3365 -0
- data/lib/public/milksteak/css/bootstrap.min.css +610 -0
- data/lib/public/milksteak/css/calendrical.css +69 -0
- data/lib/public/milksteak/css/prettify.css +52 -0
- data/lib/public/milksteak/css/style.css +8 -0
- data/lib/public/milksteak/img/glyphicons-halflings-white.png +0 -0
- data/lib/public/milksteak/img/glyphicons-halflings.png +0 -0
- data/lib/public/milksteak/img/spinner.gif +0 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.asp +44 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.aspx +31 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.cf +19 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.jsp +49 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.php +43 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.pl +102 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.py +25 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree.rb +61 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree_huck.lasso +36 -0
- data/lib/public/milksteak/jqueryFileTree/connectors/jqueryFileTree_sabourdin.lasso +48 -0
- data/lib/public/milksteak/jqueryFileTree/images/application.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/code.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/css.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/db.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/directory.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/doc.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/file.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/film.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/flash.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/folder_open.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/html.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/java.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/linux.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/music.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/pdf.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/php.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/picture.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/ppt.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/psd.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/ruby.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/script.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/spinner.gif +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/txt.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/xls.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/images/zip.png +0 -0
- data/lib/public/milksteak/jqueryFileTree/jqueryFileTree.css +91 -0
- data/lib/public/milksteak/jqueryFileTree/jqueryFileTree.js +95 -0
- data/lib/public/milksteak/js/app.js +0 -0
- data/lib/public/milksteak/js/backbone.js +1290 -0
- data/lib/public/milksteak/js/bootstrap-alert.js +91 -0
- data/lib/public/milksteak/js/bootstrap-button.js +98 -0
- data/lib/public/milksteak/js/bootstrap-carousel.js +154 -0
- data/lib/public/milksteak/js/bootstrap-collapse.js +136 -0
- data/lib/public/milksteak/js/bootstrap-dropdown.js +92 -0
- data/lib/public/milksteak/js/bootstrap-modal.js +209 -0
- data/lib/public/milksteak/js/bootstrap-popover.js +95 -0
- data/lib/public/milksteak/js/bootstrap-scrollspy.js +125 -0
- data/lib/public/milksteak/js/bootstrap-tab.js +130 -0
- data/lib/public/milksteak/js/bootstrap-tooltip.js +270 -0
- data/lib/public/milksteak/js/bootstrap-transition.js +51 -0
- data/lib/public/milksteak/js/bootstrap-typeahead.js +271 -0
- data/lib/public/milksteak/js/bootstrap.js +1722 -0
- data/lib/public/milksteak/js/bootstrap.min.js +1 -0
- data/lib/public/milksteak/js/jquery-ui.min.js +15 -0
- data/lib/public/milksteak/js/jquery.calendrical.js +490 -0
- data/lib/public/milksteak/js/jquery.easing.js +146 -0
- data/lib/public/milksteak/js/jquery.js +9252 -0
- data/lib/public/milksteak/js/mustache.js +536 -0
- data/lib/public/milksteak/js/prettify.js +28 -0
- data/lib/public/milksteak/js/underscore.js +999 -0
- data/lib/public/milksteak/markitup/.DS_Store +0 -0
- data/lib/public/milksteak/markitup/jquery.markitup.js +593 -0
- data/lib/public/milksteak/markitup/sets/default/images/bold.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/clean.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/image.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/italic.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/link.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/list-bullet.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/list-numeric.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/picture.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/preview.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/images/stroke.png +0 -0
- data/lib/public/milksteak/markitup/sets/default/set.js +30 -0
- data/lib/public/milksteak/markitup/sets/default/style.css +34 -0
- data/lib/public/milksteak/markitup/sets/textile/images/bold.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/code.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h1.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h2.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h3.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h4.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h5.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/h6.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/italic.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/link.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/list-bullet.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/list-numeric.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/paragraph.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/picture.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/preview.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/quotes.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/images/stroke.png +0 -0
- data/lib/public/milksteak/markitup/sets/textile/set.js +33 -0
- data/lib/public/milksteak/markitup/sets/textile/style.css +60 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-container.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/handle.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/menu.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/images/submenu.png +0 -0
- data/lib/public/milksteak/markitup/skins/markitup/style.css +147 -0
- data/lib/public/milksteak/markitup/skins/simple/images/handle.png +0 -0
- data/lib/public/milksteak/markitup/skins/simple/images/menu.png +0 -0
- data/lib/public/milksteak/markitup/skins/simple/images/submenu.png +0 -0
- data/lib/public/milksteak/markitup/skins/simple/style.css +118 -0
- data/lib/public/milksteak/markitup/templates/preview.css +5 -0
- data/lib/public/milksteak/markitup/templates/preview.html +11 -0
- data/lib/public/milksteak/uploadify-v2.1.4/cancel.png +0 -0
- data/lib/public/milksteak/uploadify-v2.1.4/check.php +35 -0
- data/lib/public/milksteak/uploadify-v2.1.4/expressInstall.swf +0 -0
- data/lib/public/milksteak/uploadify-v2.1.4/jquery-1.4.2.min.js +154 -0
- data/lib/public/milksteak/uploadify-v2.1.4/jquery.uploadify.v2.1.4.js +296 -0
- data/lib/public/milksteak/uploadify-v2.1.4/jquery.uploadify.v2.1.4.min.js +26 -0
- data/lib/public/milksteak/uploadify-v2.1.4/swfobject.js +4 -0
- data/lib/public/milksteak/uploadify-v2.1.4/uploadify.allglyphs.swf +0 -0
- data/lib/public/milksteak/uploadify-v2.1.4/uploadify.css +53 -0
- data/lib/public/milksteak/uploadify-v2.1.4/uploadify.fla +0 -0
- data/lib/public/milksteak/uploadify-v2.1.4/uploadify.php +46 -0
- data/lib/public/milksteak/uploadify-v2.1.4/uploadify.swf +0 -0
- data/lib/public/milksteak/wmd/Markdown.Converter.js +1332 -0
- data/lib/public/milksteak/wmd/Markdown.Editor.js +2160 -0
- data/lib/public/milksteak/wmd/Markdown.Sanitizer.js +108 -0
- data/lib/public/milksteak/wmd/wmd-buttons.png +0 -0
- data/lib/public/milksteak/wmd/wmd.css +103 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-blockquote.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h1.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h2.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h3.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h4.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h5.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-h6.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-p.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/lbl-pre.png +0 -0
- data/lib/public/milksteak/wymeditor/iframe/default/wymiframe.css +90 -0
- data/lib/public/milksteak/wymeditor/iframe/default/wymiframe.html +26 -0
- data/lib/public/milksteak/wymeditor/jquery.wymeditor.js +4688 -0
- data/lib/public/milksteak/wymeditor/jquery.wymeditor.min.js +1 -0
- data/lib/public/milksteak/wymeditor/jquery.wymeditor.pack.js +1 -0
- data/lib/public/milksteak/wymeditor/lang/bg.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/ca.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/cs.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/cy.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/de.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/en.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/es.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/fa.js +46 -0
- data/lib/public/milksteak/wymeditor/lang/fi.js +44 -0
- data/lib/public/milksteak/wymeditor/lang/fr.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/gl.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/he.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/hr.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/hu.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/it.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/nb.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/nl.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/nn.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/pl.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/pt-br.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/pt.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/ru.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/sv.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/tr.js +45 -0
- data/lib/public/milksteak/wymeditor/lang/zh_cn.js +47 -0
- data/lib/public/milksteak/wymeditor/plugins/embed/jquery.wymeditor.embed.js +52 -0
- data/lib/public/milksteak/wymeditor/plugins/fullscreen/icon_fullscreen.gif +0 -0
- data/lib/public/milksteak/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js +127 -0
- data/lib/public/milksteak/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js +57 -0
- data/lib/public/milksteak/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +91 -0
- data/lib/public/milksteak/wymeditor/plugins/resizable/readme.txt +124 -0
- data/lib/public/milksteak/wymeditor/plugins/tidy/README +19 -0
- data/lib/public/milksteak/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +82 -0
- data/lib/public/milksteak/wymeditor/plugins/tidy/tidy.php +36 -0
- data/lib/public/milksteak/wymeditor/plugins/tidy/wand.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/compact/icons.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/compact/skin.css +134 -0
- data/lib/public/milksteak/wymeditor/skins/compact/skin.js +35 -0
- data/lib/public/milksteak/wymeditor/skins/default/icons.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/default/skin.css +133 -0
- data/lib/public/milksteak/wymeditor/skins/default/skin.js +40 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.header.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.selector.silver.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/images/bg.wymeditor.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/images/icons.silver.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/skin.css +131 -0
- data/lib/public/milksteak/wymeditor/skins/minimal/skin.js +30 -0
- data/lib/public/milksteak/wymeditor/skins/silver/COPYING +674 -0
- data/lib/public/milksteak/wymeditor/skins/silver/README +27 -0
- data/lib/public/milksteak/wymeditor/skins/silver/images/bg.header.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/silver/images/bg.selector.silver.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/silver/images/bg.wymeditor.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/silver/images/icons.silver.gif +0 -0
- data/lib/public/milksteak/wymeditor/skins/silver/skin.css +297 -0
- data/lib/public/milksteak/wymeditor/skins/silver/skin.js +61 -0
- data/lib/public/milksteak/wymeditor/skins/twopanels/icons.png +0 -0
- data/lib/public/milksteak/wymeditor/skins/twopanels/skin.css +134 -0
- data/lib/public/milksteak/wymeditor/skins/twopanels/skin.js +39 -0
- data/lib/public/milksteak/wymeditor/skins/wymeditor_icon.png +0 -0
- data/lib/views/layouts/admin.erb +8 -0
- data/lib/views/login.erb +1 -0
- data/milksteak.gemspec +30 -13
- data/spec/fixtures/pages/sample_page.yml +5 -0
- data/spec/lib/milksteak/cms_spec.rb +12 -0
- data/spec/models/page_spec.rb +58 -0
- data/spec/spec_helper.rb +19 -0
- metadata +429 -10
- data/LICENSE +0 -22
- data/README.md +0 -29
@@ -0,0 +1,188 @@
|
|
1
|
+
/*
|
2
|
+
* MySQL Mode for CodeMirror 2 by MySQL-Tools
|
3
|
+
* @author James Thorne (partydroid)
|
4
|
+
* @link http://github.com/partydroid/MySQL-Tools
|
5
|
+
* @link http://mysqltools.org
|
6
|
+
* @version 02/Jan/2012
|
7
|
+
*/
|
8
|
+
CodeMirror.defineMode("mysql", function(config) {
|
9
|
+
var indentUnit = config.indentUnit;
|
10
|
+
var curPunc;
|
11
|
+
|
12
|
+
function wordRegexp(words) {
|
13
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
14
|
+
}
|
15
|
+
var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",
|
16
|
+
"isblank", "isliteral", "union", "a"]);
|
17
|
+
var keywords = wordRegexp([
|
18
|
+
('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'),
|
19
|
+
('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'),
|
20
|
+
('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'),
|
21
|
+
('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'),
|
22
|
+
('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'),
|
23
|
+
('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'),
|
24
|
+
('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'),
|
25
|
+
('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'),
|
26
|
+
('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'),
|
27
|
+
('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'),
|
28
|
+
('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'),
|
29
|
+
('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'),
|
30
|
+
('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'),
|
31
|
+
('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'),
|
32
|
+
('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT')
|
33
|
+
]);
|
34
|
+
var operatorChars = /[*+\-<>=&|]/;
|
35
|
+
|
36
|
+
function tokenBase(stream, state) {
|
37
|
+
var ch = stream.next();
|
38
|
+
curPunc = null;
|
39
|
+
if (ch == "$" || ch == "?") {
|
40
|
+
stream.match(/^[\w\d]*/);
|
41
|
+
return "variable-2";
|
42
|
+
}
|
43
|
+
else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) {
|
44
|
+
stream.match(/^[^\s\u00a0>]*>?/);
|
45
|
+
return "atom";
|
46
|
+
}
|
47
|
+
else if (ch == "\"" || ch == "'") {
|
48
|
+
state.tokenize = tokenLiteral(ch);
|
49
|
+
return state.tokenize(stream, state);
|
50
|
+
}
|
51
|
+
else if (ch == "`") {
|
52
|
+
state.tokenize = tokenOpLiteral(ch);
|
53
|
+
return state.tokenize(stream, state);
|
54
|
+
}
|
55
|
+
else if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
56
|
+
curPunc = ch;
|
57
|
+
return null;
|
58
|
+
}
|
59
|
+
else if (ch == "-") {
|
60
|
+
ch2 = stream.next();
|
61
|
+
if(ch2=="-")
|
62
|
+
{
|
63
|
+
stream.skipToEnd();
|
64
|
+
return "comment";
|
65
|
+
}
|
66
|
+
|
67
|
+
}
|
68
|
+
else if (operatorChars.test(ch)) {
|
69
|
+
stream.eatWhile(operatorChars);
|
70
|
+
return null;
|
71
|
+
}
|
72
|
+
else if (ch == ":") {
|
73
|
+
stream.eatWhile(/[\w\d\._\-]/);
|
74
|
+
return "atom";
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
stream.eatWhile(/[_\w\d]/);
|
78
|
+
if (stream.eat(":")) {
|
79
|
+
stream.eatWhile(/[\w\d_\-]/);
|
80
|
+
return "atom";
|
81
|
+
}
|
82
|
+
var word = stream.current(), type;
|
83
|
+
if (ops.test(word))
|
84
|
+
return null;
|
85
|
+
else if (keywords.test(word))
|
86
|
+
return "keyword";
|
87
|
+
else
|
88
|
+
return "variable";
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
function tokenLiteral(quote) {
|
93
|
+
return function(stream, state) {
|
94
|
+
var escaped = false, ch;
|
95
|
+
while ((ch = stream.next()) != null) {
|
96
|
+
if (ch == quote && !escaped) {
|
97
|
+
state.tokenize = tokenBase;
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
escaped = !escaped && ch == "\\";
|
101
|
+
}
|
102
|
+
return "string";
|
103
|
+
};
|
104
|
+
}
|
105
|
+
|
106
|
+
function tokenOpLiteral(quote) {
|
107
|
+
return function(stream, state) {
|
108
|
+
var escaped = false, ch;
|
109
|
+
while ((ch = stream.next()) != null) {
|
110
|
+
if (ch == quote && !escaped) {
|
111
|
+
state.tokenize = tokenBase;
|
112
|
+
break;
|
113
|
+
}
|
114
|
+
escaped = !escaped && ch == "\\";
|
115
|
+
}
|
116
|
+
return "variable-2";
|
117
|
+
};
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
function pushContext(state, type, col) {
|
122
|
+
state.context = {prev: state.context, indent: state.indent, col: col, type: type};
|
123
|
+
}
|
124
|
+
function popContext(state) {
|
125
|
+
state.indent = state.context.indent;
|
126
|
+
state.context = state.context.prev;
|
127
|
+
}
|
128
|
+
|
129
|
+
return {
|
130
|
+
startState: function(base) {
|
131
|
+
return {tokenize: tokenBase,
|
132
|
+
context: null,
|
133
|
+
indent: 0,
|
134
|
+
col: 0};
|
135
|
+
},
|
136
|
+
|
137
|
+
token: function(stream, state) {
|
138
|
+
if (stream.sol()) {
|
139
|
+
if (state.context && state.context.align == null) state.context.align = false;
|
140
|
+
state.indent = stream.indentation();
|
141
|
+
}
|
142
|
+
if (stream.eatSpace()) return null;
|
143
|
+
var style = state.tokenize(stream, state);
|
144
|
+
|
145
|
+
if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") {
|
146
|
+
state.context.align = true;
|
147
|
+
}
|
148
|
+
|
149
|
+
if (curPunc == "(") pushContext(state, ")", stream.column());
|
150
|
+
else if (curPunc == "[") pushContext(state, "]", stream.column());
|
151
|
+
else if (curPunc == "{") pushContext(state, "}", stream.column());
|
152
|
+
else if (/[\]\}\)]/.test(curPunc)) {
|
153
|
+
while (state.context && state.context.type == "pattern") popContext(state);
|
154
|
+
if (state.context && curPunc == state.context.type) popContext(state);
|
155
|
+
}
|
156
|
+
else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
|
157
|
+
else if (/atom|string|variable/.test(style) && state.context) {
|
158
|
+
if (/[\}\]]/.test(state.context.type))
|
159
|
+
pushContext(state, "pattern", stream.column());
|
160
|
+
else if (state.context.type == "pattern" && !state.context.align) {
|
161
|
+
state.context.align = true;
|
162
|
+
state.context.col = stream.column();
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
return style;
|
167
|
+
},
|
168
|
+
|
169
|
+
indent: function(state, textAfter) {
|
170
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
171
|
+
var context = state.context;
|
172
|
+
if (/[\]\}]/.test(firstChar))
|
173
|
+
while (context && context.type == "pattern") context = context.prev;
|
174
|
+
|
175
|
+
var closing = context && firstChar == context.type;
|
176
|
+
if (!context)
|
177
|
+
return 0;
|
178
|
+
else if (context.type == "pattern")
|
179
|
+
return context.col;
|
180
|
+
else if (context.align)
|
181
|
+
return context.col + (closing ? 0 : 1);
|
182
|
+
else
|
183
|
+
return context.indent + (closing ? 0 : indentUnit);
|
184
|
+
}
|
185
|
+
};
|
186
|
+
});
|
187
|
+
|
188
|
+
CodeMirror.defineMIME("text/x-mysql", "mysql");
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>CodeMirror: NTriples mode</title>
|
5
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
|
+
<script src="../../lib/codemirror.js"></script>
|
7
|
+
<script src="ntriples.js"></script>
|
8
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
9
|
+
<style type="text/css">
|
10
|
+
.CodeMirror {
|
11
|
+
border: 1px solid #eee;
|
12
|
+
}
|
13
|
+
</style>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<h1>CodeMirror: NTriples mode</h1>
|
17
|
+
<form>
|
18
|
+
<textarea id="ntriples" name="ntriples">
|
19
|
+
<http://Sub1> <http://pred1> <http://obj> .
|
20
|
+
<http://Sub2> <http://pred2#an2> "literal 1" .
|
21
|
+
<http://Sub3#an3> <http://pred3> _:bnode3 .
|
22
|
+
_:bnode4 <http://pred4> "literal 2"@lang .
|
23
|
+
_:bnode5 <http://pred5> "literal 3"^^<http://type> .
|
24
|
+
</textarea>
|
25
|
+
</form>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
|
29
|
+
</script>
|
30
|
+
<p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
|
31
|
+
</body>
|
32
|
+
</html>
|
@@ -0,0 +1,172 @@
|
|
1
|
+
/**********************************************************
|
2
|
+
* This script provides syntax highlighting support for
|
3
|
+
* the Ntriples format.
|
4
|
+
* Ntriples format specification:
|
5
|
+
* http://www.w3.org/TR/rdf-testcases/#ntriples
|
6
|
+
***********************************************************/
|
7
|
+
|
8
|
+
/*
|
9
|
+
The following expression defines the defined ASF grammar transitions.
|
10
|
+
|
11
|
+
pre_subject ->
|
12
|
+
{
|
13
|
+
( writing_subject_uri | writing_bnode_uri )
|
14
|
+
-> pre_predicate
|
15
|
+
-> writing_predicate_uri
|
16
|
+
-> pre_object
|
17
|
+
-> writing_object_uri | writing_object_bnode |
|
18
|
+
(
|
19
|
+
writing_object_literal
|
20
|
+
-> writing_literal_lang | writing_literal_type
|
21
|
+
)
|
22
|
+
-> post_object
|
23
|
+
-> BEGIN
|
24
|
+
} otherwise {
|
25
|
+
-> ERROR
|
26
|
+
}
|
27
|
+
*/
|
28
|
+
CodeMirror.defineMode("ntriples", function() {
|
29
|
+
|
30
|
+
Location = {
|
31
|
+
PRE_SUBJECT : 0,
|
32
|
+
WRITING_SUB_URI : 1,
|
33
|
+
WRITING_BNODE_URI : 2,
|
34
|
+
PRE_PRED : 3,
|
35
|
+
WRITING_PRED_URI : 4,
|
36
|
+
PRE_OBJ : 5,
|
37
|
+
WRITING_OBJ_URI : 6,
|
38
|
+
WRITING_OBJ_BNODE : 7,
|
39
|
+
WRITING_OBJ_LITERAL : 8,
|
40
|
+
WRITING_LIT_LANG : 9,
|
41
|
+
WRITING_LIT_TYPE : 10,
|
42
|
+
POST_OBJ : 11,
|
43
|
+
ERROR : 12
|
44
|
+
};
|
45
|
+
function transitState(currState, c) {
|
46
|
+
var currLocation = currState.location;
|
47
|
+
var ret;
|
48
|
+
|
49
|
+
// Opening.
|
50
|
+
if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;
|
51
|
+
else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;
|
52
|
+
else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;
|
53
|
+
else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;
|
54
|
+
else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;
|
55
|
+
else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL;
|
56
|
+
|
57
|
+
// Closing.
|
58
|
+
else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;
|
59
|
+
else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;
|
60
|
+
else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;
|
61
|
+
else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;
|
62
|
+
else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;
|
63
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ;
|
64
|
+
else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;
|
65
|
+
else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;
|
66
|
+
|
67
|
+
// Closing typed and language literal.
|
68
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;
|
69
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;
|
70
|
+
|
71
|
+
// Spaces.
|
72
|
+
else if( c == ' ' &&
|
73
|
+
(
|
74
|
+
currLocation == Location.PRE_SUBJECT ||
|
75
|
+
currLocation == Location.PRE_PRED ||
|
76
|
+
currLocation == Location.PRE_OBJ ||
|
77
|
+
currLocation == Location.POST_OBJ
|
78
|
+
)
|
79
|
+
) ret = currLocation;
|
80
|
+
|
81
|
+
// Reset.
|
82
|
+
else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;
|
83
|
+
|
84
|
+
// Error
|
85
|
+
else ret = Location.ERROR;
|
86
|
+
|
87
|
+
currState.location=ret;
|
88
|
+
}
|
89
|
+
|
90
|
+
untilSpace = function(c) { return c != ' '; };
|
91
|
+
untilEndURI = function(c) { return c != '>'; };
|
92
|
+
return {
|
93
|
+
startState: function() {
|
94
|
+
return {
|
95
|
+
location : Location.PRE_SUBJECT,
|
96
|
+
uris : [],
|
97
|
+
anchors : [],
|
98
|
+
bnodes : [],
|
99
|
+
langs : [],
|
100
|
+
types : []
|
101
|
+
};
|
102
|
+
},
|
103
|
+
token: function(stream, state) {
|
104
|
+
var ch = stream.next();
|
105
|
+
if(ch == '<') {
|
106
|
+
transitState(state, ch);
|
107
|
+
var parsedURI = '';
|
108
|
+
stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );
|
109
|
+
state.uris.push(parsedURI);
|
110
|
+
if( stream.match('#', false) ) return 'variable';
|
111
|
+
stream.next();
|
112
|
+
transitState(state, '>');
|
113
|
+
return 'variable';
|
114
|
+
}
|
115
|
+
if(ch == '#') {
|
116
|
+
var parsedAnchor = '';
|
117
|
+
stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false});
|
118
|
+
state.anchors.push(parsedAnchor);
|
119
|
+
return 'variable-2';
|
120
|
+
}
|
121
|
+
if(ch == '>') {
|
122
|
+
transitState(state, '>');
|
123
|
+
return 'variable';
|
124
|
+
}
|
125
|
+
if(ch == '_') {
|
126
|
+
transitState(state, ch);
|
127
|
+
var parsedBNode = '';
|
128
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});
|
129
|
+
state.bnodes.push(parsedBNode);
|
130
|
+
stream.next();
|
131
|
+
transitState(state, ' ');
|
132
|
+
return 'builtin';
|
133
|
+
}
|
134
|
+
if(ch == '"') {
|
135
|
+
transitState(state, ch);
|
136
|
+
stream.eatWhile( function(c) { return c != '"'; } );
|
137
|
+
stream.next();
|
138
|
+
if( stream.peek() != '@' && stream.peek() != '^' ) {
|
139
|
+
transitState(state, '"');
|
140
|
+
}
|
141
|
+
return 'string';
|
142
|
+
}
|
143
|
+
if( ch == '@' ) {
|
144
|
+
transitState(state, '@');
|
145
|
+
var parsedLang = '';
|
146
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});
|
147
|
+
state.langs.push(parsedLang);
|
148
|
+
stream.next();
|
149
|
+
transitState(state, ' ');
|
150
|
+
return 'string-2';
|
151
|
+
}
|
152
|
+
if( ch == '^' ) {
|
153
|
+
stream.next();
|
154
|
+
transitState(state, '^');
|
155
|
+
var parsedType = '';
|
156
|
+
stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );
|
157
|
+
state.types.push(parsedType);
|
158
|
+
stream.next();
|
159
|
+
transitState(state, '>');
|
160
|
+
return 'variable';
|
161
|
+
}
|
162
|
+
if( ch == ' ' ) {
|
163
|
+
transitState(state, ch);
|
164
|
+
}
|
165
|
+
if( ch == '.' ) {
|
166
|
+
transitState(state, ch);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
};
|
170
|
+
});
|
171
|
+
|
172
|
+
CodeMirror.defineMIME("text/n-triples", "ntriples");
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2011 souceLair <support@sourcelair.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>CodeMirror: Pascal mode</title>
|
5
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
|
+
<script src="../../lib/codemirror.js"></script>
|
7
|
+
<script src="pascal.js"></script>
|
8
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
9
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<h1>CodeMirror: Pascal mode</h1>
|
13
|
+
|
14
|
+
<div><textarea id="code" name="code">
|
15
|
+
(* Example Pascal code *)
|
16
|
+
|
17
|
+
while a <> b do writeln('Waiting');
|
18
|
+
|
19
|
+
if a > b then
|
20
|
+
writeln('Condition met')
|
21
|
+
else
|
22
|
+
writeln('Condition not met');
|
23
|
+
|
24
|
+
for i := 1 to 10 do
|
25
|
+
writeln('Iteration: ', i:1);
|
26
|
+
|
27
|
+
repeat
|
28
|
+
a := a + 1
|
29
|
+
until a = 10;
|
30
|
+
|
31
|
+
case i of
|
32
|
+
0: write('zero');
|
33
|
+
1: write('one');
|
34
|
+
2: write('two')
|
35
|
+
end;
|
36
|
+
</textarea></div>
|
37
|
+
|
38
|
+
<script>
|
39
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
40
|
+
lineNumbers: true,
|
41
|
+
matchBrackets: true,
|
42
|
+
mode: "text/x-pascal"
|
43
|
+
});
|
44
|
+
</script>
|
45
|
+
|
46
|
+
<p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
CodeMirror.defineMode("pascal", function(config) {
|
2
|
+
function words(str) {
|
3
|
+
var obj = {}, words = str.split(" ");
|
4
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
5
|
+
return obj;
|
6
|
+
}
|
7
|
+
var keywords = words("and array begin case const div do downto else end file for forward integer " +
|
8
|
+
"boolean char function goto if in label mod nil not of or packed procedure " +
|
9
|
+
"program record repeat set string then to type until var while with");
|
10
|
+
var atoms = {"null": true};
|
11
|
+
|
12
|
+
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
13
|
+
|
14
|
+
function tokenBase(stream, state) {
|
15
|
+
var ch = stream.next();
|
16
|
+
if (ch == "#" && state.startOfLine) {
|
17
|
+
stream.skipToEnd();
|
18
|
+
return "meta";
|
19
|
+
}
|
20
|
+
if (ch == '"' || ch == "'") {
|
21
|
+
state.tokenize = tokenString(ch);
|
22
|
+
return state.tokenize(stream, state);
|
23
|
+
}
|
24
|
+
if (ch == "(" && stream.eat("*")) {
|
25
|
+
state.tokenize = tokenComment;
|
26
|
+
return tokenComment(stream, state);
|
27
|
+
}
|
28
|
+
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
29
|
+
return null
|
30
|
+
}
|
31
|
+
if (/\d/.test(ch)) {
|
32
|
+
stream.eatWhile(/[\w\.]/);
|
33
|
+
return "number";
|
34
|
+
}
|
35
|
+
if (ch == "/") {
|
36
|
+
if (stream.eat("/")) {
|
37
|
+
stream.skipToEnd();
|
38
|
+
return "comment";
|
39
|
+
}
|
40
|
+
}
|
41
|
+
if (isOperatorChar.test(ch)) {
|
42
|
+
stream.eatWhile(isOperatorChar);
|
43
|
+
return "operator";
|
44
|
+
}
|
45
|
+
stream.eatWhile(/[\w\$_]/);
|
46
|
+
var cur = stream.current();
|
47
|
+
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
48
|
+
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
49
|
+
return "word";
|
50
|
+
}
|
51
|
+
|
52
|
+
function tokenString(quote) {
|
53
|
+
return function(stream, state) {
|
54
|
+
var escaped = false, next, end = false;
|
55
|
+
while ((next = stream.next()) != null) {
|
56
|
+
if (next == quote && !escaped) {end = true; break;}
|
57
|
+
escaped = !escaped && next == "\\";
|
58
|
+
}
|
59
|
+
if (end || !escaped) state.tokenize = null;
|
60
|
+
return "string";
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
function tokenComment(stream, state) {
|
65
|
+
var maybeEnd = false, ch;
|
66
|
+
while (ch = stream.next()) {
|
67
|
+
if (ch == ")" && maybeEnd) {
|
68
|
+
state.tokenize = null;
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
maybeEnd = (ch == "*");
|
72
|
+
}
|
73
|
+
return "comment";
|
74
|
+
}
|
75
|
+
|
76
|
+
// Interface
|
77
|
+
|
78
|
+
return {
|
79
|
+
startState: function(basecolumn) {
|
80
|
+
return {tokenize: null};
|
81
|
+
},
|
82
|
+
|
83
|
+
token: function(stream, state) {
|
84
|
+
if (stream.eatSpace()) return null;
|
85
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
86
|
+
if (style == "comment" || style == "meta") return style;
|
87
|
+
return style;
|
88
|
+
},
|
89
|
+
|
90
|
+
electricChars: "{}"
|
91
|
+
};
|
92
|
+
});
|
93
|
+
|
94
|
+
CodeMirror.defineMIME("text/x-pascal", "pascal");
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (C) 2011 by Sabaca <mail@sabaca.com> under the MIT license.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>CodeMirror: Perl mode</title>
|
5
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
6
|
+
<script src="../../lib/codemirror.js"></script>
|
7
|
+
<script src="perl.js"></script>
|
8
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
9
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<h1>CodeMirror: Perl mode</h1>
|
13
|
+
|
14
|
+
<div><textarea id="code" name="code">
|
15
|
+
#!/usr/bin/perl
|
16
|
+
|
17
|
+
use Something qw(func1 func2);
|
18
|
+
|
19
|
+
# strings
|
20
|
+
my $s1 = qq'single line';
|
21
|
+
our $s2 = q(multi-
|
22
|
+
line);
|
23
|
+
|
24
|
+
=item Something
|
25
|
+
Example.
|
26
|
+
=cut
|
27
|
+
|
28
|
+
my $html=<<'HTML'
|
29
|
+
<html>
|
30
|
+
<title>hi!</title>
|
31
|
+
</html>
|
32
|
+
HTML
|
33
|
+
|
34
|
+
print "first,".join(',', 'second', qq~third~);
|
35
|
+
|
36
|
+
if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
|
37
|
+
$h->{$1}=$$.' predefined variables';
|
38
|
+
$s2 =~ s/\-line//ox;
|
39
|
+
$s1 =~ s[
|
40
|
+
line ]
|
41
|
+
[
|
42
|
+
block
|
43
|
+
]ox;
|
44
|
+
}
|
45
|
+
|
46
|
+
1; # numbers and comments
|
47
|
+
|
48
|
+
__END__
|
49
|
+
something...
|
50
|
+
|
51
|
+
</textarea></div>
|
52
|
+
|
53
|
+
<script>
|
54
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
55
|
+
lineNumbers: true,
|
56
|
+
matchBrackets: true
|
57
|
+
});
|
58
|
+
</script>
|
59
|
+
|
60
|
+
<p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
|
61
|
+
</body>
|
62
|
+
</html>
|