mdbe 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/app.rb +182 -0
- data/bin/mdbe +5 -0
- data/config.ru +2 -0
- data/environment.rb +8 -0
- data/lib/mdbe.rb +39 -0
- data/lib/mdbe/action_controller_debug_patch.rb +12 -0
- data/lib/mdbe/code_evaluation.rb +46 -0
- data/lib/mdbe/database_views.rb +24 -0
- data/lib/mdbe/database_views/abstract_dictionary.rb +69 -0
- data/lib/mdbe/database_views/abstract_exception.rb +25 -0
- data/lib/mdbe/database_views/array.rb +28 -0
- data/lib/mdbe/database_views/boolean.rb +12 -0
- data/lib/mdbe/database_views/class.rb +46 -0
- data/lib/mdbe/database_views/exception.rb +3 -0
- data/lib/mdbe/database_views/execblock.rb +5 -0
- data/lib/mdbe/database_views/fixnum.rb +5 -0
- data/lib/mdbe/database_views/float.rb +5 -0
- data/lib/mdbe/database_views/globals.rb +2 -0
- data/lib/mdbe/database_views/gsnmethod.rb +29 -0
- data/lib/mdbe/database_views/hash.rb +5 -0
- data/lib/mdbe/database_views/maglev_record.rb +42 -0
- data/lib/mdbe/database_views/module.rb +103 -0
- data/lib/mdbe/database_views/nilclass.rb +5 -0
- data/lib/mdbe/database_views/object.rb +80 -0
- data/lib/mdbe/database_views/proc.rb +3 -0
- data/lib/mdbe/database_views/repository.rb +3 -0
- data/lib/mdbe/database_views/ruby_workspace.rb +5 -0
- data/lib/mdbe/database_views/smalltalk_classes.rb +34 -0
- data/lib/mdbe/database_views/smalltalk_classes.st +60 -0
- data/lib/mdbe/database_views/string.rb +31 -0
- data/lib/mdbe/database_views/symbol.rb +32 -0
- data/lib/mdbe/database_views/system.rb +61 -0
- data/lib/mdbe/database_views/thread.rb +101 -0
- data/lib/mdbe/debug_server.rb +22 -0
- data/lib/mdbe/halt.rb +42 -0
- data/lib/mdbe/ruby_workspace.rb +29 -0
- data/lib/mdbe/version.rb +3 -0
- data/lib/tasks/maglev-database-explorer_tasks.rake +4 -0
- data/public/LICENSE +35 -0
- data/public/amber/CHANGELOG +65 -0
- data/public/amber/LICENSE +22 -0
- data/public/amber/Makefile +53 -0
- data/public/amber/README.md +30 -0
- data/public/amber/bin/amber +3 -0
- data/public/amber/bin/amberc +352 -0
- data/public/amber/bin/nodecompile.js +33 -0
- data/public/amber/bin/server +3 -0
- data/public/amber/bin/server.bat +3 -0
- data/public/amber/css/amber-normalize.css +468 -0
- data/public/amber/css/amber-normalize.less +501 -0
- data/public/amber/css/amber.css +539 -0
- data/public/amber/css/documentation.css +84 -0
- data/public/amber/css/profstef.css +75 -0
- data/public/amber/css/style.css +313 -0
- data/public/amber/documentation.html +37 -0
- data/public/amber/examples/Makefile +23 -0
- data/public/amber/examples/README +4 -0
- data/public/amber/examples/android/helloamber/AndroidManifest.xml +19 -0
- data/public/amber/examples/android/helloamber/HelloAmber.st +13 -0
- data/public/amber/examples/android/helloamber/Makefile +56 -0
- data/public/amber/examples/android/helloamber/README.md +80 -0
- data/public/amber/examples/android/helloamber/ant.properties +17 -0
- data/public/amber/examples/android/helloamber/assets/index.html +15 -0
- data/public/amber/examples/android/helloamber/assets/jquery-1.7.2.min.js +4 -0
- data/public/amber/examples/android/helloamber/build.xml +83 -0
- data/public/amber/examples/android/helloamber/local.properties +10 -0
- data/public/amber/examples/android/helloamber/proguard-project.txt +20 -0
- data/public/amber/examples/android/helloamber/project.properties +14 -0
- data/public/amber/examples/android/helloamber/res/layout/main.xml +6 -0
- data/public/amber/examples/android/helloamber/res/values/strings.xml +4 -0
- data/public/amber/examples/android/helloamber/src/org/amberlang/android/helloamber/HelloAmber.java +59 -0
- data/public/amber/examples/myproject/index.html +16 -0
- data/public/amber/examples/nodejs/README +9 -0
- data/public/amber/examples/nodejs/benchfib/Benchfib.st +124 -0
- data/public/amber/examples/nodejs/benchfib/Makefile +8 -0
- data/public/amber/examples/nodejs/benchfib/benchfib +1 -0
- data/public/amber/examples/nodejs/hello/Hello.st +9 -0
- data/public/amber/examples/nodejs/hello/Makefile +8 -0
- data/public/amber/examples/nodejs/hello/README +13 -0
- data/public/amber/examples/nodejs/hello/hello +1 -0
- data/public/amber/examples/nodejs/meta/Makefile +8 -0
- data/public/amber/examples/nodejs/meta/MyScript.st +27 -0
- data/public/amber/examples/nodejs/meta/meta +1 -0
- data/public/amber/examples/nodejs/pystone/Makefile +8 -0
- data/public/amber/examples/nodejs/pystone/Pystone.st +306 -0
- data/public/amber/examples/nodejs/pystone/pystone +1 -0
- data/public/amber/examples/nodejs/trivialserver/Makefile +8 -0
- data/public/amber/examples/nodejs/trivialserver/TrivialServer.st +51 -0
- data/public/amber/examples/nodejs/trivialserver/trivial +1 -0
- data/public/amber/examples/presentation/esug2011/images/asterix.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_box.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/background_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/balloon_header.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/devices.jpg +0 -0
- data/public/amber/examples/presentation/esug2011/images/enyo.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/ide_star_wars.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/terminal.png +0 -0
- data/public/amber/examples/presentation/esug2011/images/webos.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/amber.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/ambrhino.jpg +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/nodejs.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/pharo.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/php.gif +0 -0
- data/public/amber/examples/presentation/fosdem2012/images/rails.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-next.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-prev.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/closedhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/openhand.cur +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-back.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-forward.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow.png +0 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.css +100 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.js +1232 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js +13 -0
- data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.easing.1.3.js +38 -0
- data/public/amber/examples/presentation/index.html +17 -0
- data/public/amber/examples/presentation/js/Presentation.deploy.js +1922 -0
- data/public/amber/examples/presentation/js/Presentation.js +2712 -0
- data/public/amber/examples/presentation/st/Presentation.st +1996 -0
- data/public/amber/examples/trysmalltalk/index.html +18 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.deploy.js +837 -0
- data/public/amber/examples/trysmalltalk/js/TrySmalltalk.js +1206 -0
- data/public/amber/examples/trysmalltalk/st/TrySmalltalk.st +964 -0
- data/public/amber/examples/twitterwall/css/twitterwall.css +19 -0
- data/public/amber/examples/twitterwall/index.html +35 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.deploy.js +116 -0
- data/public/amber/examples/twitterwall/js/TwitterWall.js +146 -0
- data/public/amber/examples/twitterwall/st/TwitterWall.st +91 -0
- data/public/amber/examples/webos/README +11 -0
- data/public/amber/examples/webos/eris/DuckQwaq.wav +0 -0
- data/public/amber/examples/webos/eris/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/eris/Eris.css +0 -0
- data/public/amber/examples/webos/eris/Eris.st +86 -0
- data/public/amber/examples/webos/eris/Makefile +37 -0
- data/public/amber/examples/webos/eris/README +3 -0
- data/public/amber/examples/webos/eris/appinfo.json +10 -0
- data/public/amber/examples/webos/eris/index.html +12 -0
- data/public/amber/examples/webos/helloamber/EnyoAmber.st +36 -0
- data/public/amber/examples/webos/helloamber/HelloAmber.st +86 -0
- data/public/amber/examples/webos/helloamber/Makefile +38 -0
- data/public/amber/examples/webos/helloamber/README +5 -0
- data/public/amber/examples/webos/helloamber/appinfo.json +10 -0
- data/public/amber/examples/webos/helloamber/index.html +12 -0
- data/public/amber/favicon.ico +0 -0
- data/public/amber/images/amber.png +0 -0
- data/public/amber/images/amber.svg +706 -0
- data/public/amber/images/amber_small.png +0 -0
- data/public/amber/images/off.amber.png +0 -0
- data/public/amber/images/off.png +0 -0
- data/public/amber/images/offHover.amber.png +0 -0
- data/public/amber/images/offHover.png +0 -0
- data/public/amber/images/presentation.png +0 -0
- data/public/amber/images/profstef.png +0 -0
- data/public/amber/images/sprite.amber.png +0 -0
- data/public/amber/images/sprite.png +0 -0
- data/public/amber/images/tinylogo.amber.png +0 -0
- data/public/amber/images/tinylogo.png +0 -0
- data/public/amber/images/twitterwall.png +0 -0
- data/public/amber/index.html +55 -0
- data/public/amber/js/Additional-Examples.deploy.js +15 -0
- data/public/amber/js/Additional-Examples.js +21 -0
- data/public/amber/js/Benchfib.deploy.js +132 -0
- data/public/amber/js/Benchfib.js +167 -0
- data/public/amber/js/Canvas.deploy.js +2446 -0
- data/public/amber/js/Canvas.js +3547 -0
- data/public/amber/js/Compiler-Tests.deploy.js +97 -0
- data/public/amber/js/Compiler-Tests.js +137 -0
- data/public/amber/js/Compiler.deploy.js +1877 -0
- data/public/amber/js/Compiler.js +2622 -0
- data/public/amber/js/Documentation.deploy.js +961 -0
- data/public/amber/js/Documentation.js +1376 -0
- data/public/amber/js/Examples.deploy.js +53 -0
- data/public/amber/js/Examples.js +73 -0
- data/public/amber/js/IDE.deploy.js +3557 -0
- data/public/amber/js/IDE.js +5002 -0
- data/public/amber/js/Kernel-Announcements.deploy.js +107 -0
- data/public/amber/js/Kernel-Announcements.js +152 -0
- data/public/amber/js/Kernel-Classes.deploy.js +774 -0
- data/public/amber/js/Kernel-Classes.js +1095 -0
- data/public/amber/js/Kernel-Collections.deploy.js +3121 -0
- data/public/amber/js/Kernel-Collections.js +4427 -0
- data/public/amber/js/Kernel-Exceptions.deploy.js +244 -0
- data/public/amber/js/Kernel-Exceptions.js +349 -0
- data/public/amber/js/Kernel-Methods.deploy.js +573 -0
- data/public/amber/js/Kernel-Methods.js +807 -0
- data/public/amber/js/Kernel-Objects.deploy.js +2877 -0
- data/public/amber/js/Kernel-Objects.js +4107 -0
- data/public/amber/js/Kernel-Tests.deploy.js +1513 -0
- data/public/amber/js/Kernel-Tests.js +2053 -0
- data/public/amber/js/Kernel-Transcript.deploy.js +142 -0
- data/public/amber/js/Kernel-Transcript.js +202 -0
- data/public/amber/js/Maglev-Core.deploy.js +2996 -0
- data/public/amber/js/Maglev-Core.js +4246 -0
- data/public/amber/js/Maglev-Database-Explorer.deploy.js +4476 -0
- data/public/amber/js/Maglev-Database-Explorer.js +6232 -0
- data/public/amber/js/Maglev-Vendor.deploy.js +350 -0
- data/public/amber/js/Maglev-Vendor.js +465 -0
- data/public/amber/js/README.md +5 -0
- data/public/amber/js/SUnit.deploy.js +351 -0
- data/public/amber/js/SUnit.js +501 -0
- data/public/amber/js/amber.js +273 -0
- data/public/amber/js/boot.js +602 -0
- data/public/amber/js/compat.js +22 -0
- data/public/amber/js/init.js +9 -0
- data/public/amber/js/lib/CodeMirror/LICENSE +19 -0
- data/public/amber/js/lib/CodeMirror/active-line.js +39 -0
- data/public/amber/js/lib/CodeMirror/amber.css +21 -0
- data/public/amber/js/lib/CodeMirror/codemirror.css +67 -0
- data/public/amber/js/lib/CodeMirror/codemirror.js +2144 -0
- data/public/amber/js/lib/CodeMirror/smalltalk.js +134 -0
- data/public/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
- data/public/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
- data/public/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
- data/public/amber/js/lib/jQuery/jquery.textarea.js +267 -0
- data/public/amber/js/lib/peg-0.6.2.min.js +2 -0
- data/public/amber/js/lib/showdown.js +419 -0
- data/public/amber/js/parser.js +4222 -0
- data/public/amber/js/parser.pegjs +223 -0
- data/public/amber/learn.html +40 -0
- data/public/amber/repl/Makefile +8 -0
- data/public/amber/repl/REPL.js +124 -0
- data/public/amber/repl/REPL.st +56 -0
- data/public/amber/repl/amber.js +18085 -0
- data/public/amber/server/FileServer.st +576 -0
- data/public/amber/server/Makefile +8 -0
- data/public/amber/server/server.js +13049 -0
- data/public/amber/st/Benchfib.js +297 -0
- data/public/amber/st/Benchfib.st +124 -0
- data/public/amber/st/Canvas.st +968 -0
- data/public/amber/st/Compiler-Tests.st +471 -0
- data/public/amber/st/Compiler.st +1445 -0
- data/public/amber/st/Documentation.st +758 -0
- data/public/amber/st/Examples.js +100 -0
- data/public/amber/st/Examples.st +38 -0
- data/public/amber/st/IDE.st +2404 -0
- data/public/amber/st/Kernel-Announcements.st +61 -0
- data/public/amber/st/Kernel-Classes.st +462 -0
- data/public/amber/st/Kernel-Collections.st +1611 -0
- data/public/amber/st/Kernel-Exceptions.st +124 -0
- data/public/amber/st/Kernel-Methods.st +291 -0
- data/public/amber/st/Kernel-Objects.st +1587 -0
- data/public/amber/st/Kernel-Tests.st +953 -0
- data/public/amber/st/Kernel-Transcript.st +70 -0
- data/public/amber/st/Maglev-Core.st +1694 -0
- data/public/amber/st/Maglev-Database-Explorer.st +3148 -0
- data/public/amber/st/Maglev-Vendor.st +151 -0
- data/public/amber/st/Makefile +104 -0
- data/public/amber/st/README.md +4 -0
- data/public/amber/st/SUnit.st +172 -0
- data/public/css/bootstrap-combined.no-icons.min.css +731 -0
- data/public/css/bootstrap.css +6811 -0
- data/public/css/images/animated-overlay.gif +0 -0
- data/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/css/images/ui-icons_222222_256x240.png +0 -0
- data/public/css/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/css/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/css/jquery-ui.min.css +5 -0
- data/public/css/smalltalk_code.css +42 -0
- data/public/css/style.css +210 -0
- data/public/images/bg_tile.png +0 -0
- data/public/images/maglev-logo.gif +0 -0
- data/public/images/mchammer.gif +0 -0
- data/public/images/rails_tiny.png +0 -0
- data/public/images/ruby.png +0 -0
- data/public/images/ruby_smalltalk_bridge.png +0 -0
- data/public/images/smalltalk.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/index.html +118 -0
- data/public/libs/bootstrap.min.js +7 -0
- data/public/libs/codemirror/CONTRIBUTING.md +72 -0
- data/public/libs/codemirror/LICENSE +23 -0
- data/public/libs/codemirror/README.md +11 -0
- data/public/libs/codemirror/addon/dialog/dialog.css +32 -0
- data/public/libs/codemirror/addon/dialog/dialog.js +80 -0
- data/public/libs/codemirror/addon/display/placeholder.js +54 -0
- data/public/libs/codemirror/addon/edit/closebrackets.js +54 -0
- data/public/libs/codemirror/addon/edit/closetag.js +86 -0
- data/public/libs/codemirror/addon/edit/continuecomment.js +44 -0
- data/public/libs/codemirror/addon/edit/continuelist.js +25 -0
- data/public/libs/codemirror/addon/edit/matchbrackets.js +82 -0
- data/public/libs/codemirror/addon/fold/brace-fold.js +31 -0
- data/public/libs/codemirror/addon/fold/foldcode.js +32 -0
- data/public/libs/codemirror/addon/fold/indent-fold.js +11 -0
- data/public/libs/codemirror/addon/fold/xml-fold.js +64 -0
- data/public/libs/codemirror/addon/hint/html-hint.js +582 -0
- data/public/libs/codemirror/addon/hint/javascript-hint.js +142 -0
- data/public/libs/codemirror/addon/hint/pig-hint.js +117 -0
- data/public/libs/codemirror/addon/hint/python-hint.js +93 -0
- data/public/libs/codemirror/addon/hint/show-hint.css +38 -0
- data/public/libs/codemirror/addon/hint/show-hint.js +180 -0
- data/public/libs/codemirror/addon/hint/xml-hint.js +118 -0
- data/public/libs/codemirror/addon/lint/javascript-lint.js +127 -0
- data/public/libs/codemirror/addon/lint/json-lint.js +14 -0
- data/public/libs/codemirror/addon/lint/lint.css +96 -0
- data/public/libs/codemirror/addon/lint/lint.js +197 -0
- data/public/libs/codemirror/addon/mode/loadmode.js +51 -0
- data/public/libs/codemirror/addon/mode/multiplex.js +95 -0
- data/public/libs/codemirror/addon/mode/overlay.js +59 -0
- data/public/libs/codemirror/addon/runmode/colorize.js +29 -0
- data/public/libs/codemirror/addon/runmode/runmode-standalone.js +130 -0
- data/public/libs/codemirror/addon/runmode/runmode.js +52 -0
- data/public/libs/codemirror/addon/runmode/runmode.node.js +89 -0
- data/public/libs/codemirror/addon/search/match-highlighter.js +60 -0
- data/public/libs/codemirror/addon/search/search.js +131 -0
- data/public/libs/codemirror/addon/search/searchcursor.js +133 -0
- data/public/libs/codemirror/addon/selection/active-line.js +39 -0
- data/public/libs/codemirror/addon/selection/mark-selection.js +34 -0
- data/public/libs/codemirror/bin/compress +91 -0
- data/public/libs/codemirror/bin/lint +11 -0
- data/public/libs/codemirror/demo/activeline.html +70 -0
- data/public/libs/codemirror/demo/bidi.html +61 -0
- data/public/libs/codemirror/demo/btree.html +87 -0
- data/public/libs/codemirror/demo/buffers.html +98 -0
- data/public/libs/codemirror/demo/changemode.html +50 -0
- data/public/libs/codemirror/demo/closebrackets.html +63 -0
- data/public/libs/codemirror/demo/closetag.html +37 -0
- data/public/libs/codemirror/demo/complete.html +70 -0
- data/public/libs/codemirror/demo/emacs.html +60 -0
- data/public/libs/codemirror/demo/folding.html +69 -0
- data/public/libs/codemirror/demo/fullscreen.html +147 -0
- data/public/libs/codemirror/demo/html5complete.html +92 -0
- data/public/libs/codemirror/demo/indentwrap.html +49 -0
- data/public/libs/codemirror/demo/lint.html +90 -0
- data/public/libs/codemirror/demo/loadmode.html +40 -0
- data/public/libs/codemirror/demo/marker.html +59 -0
- data/public/libs/codemirror/demo/markselection.html +36 -0
- data/public/libs/codemirror/demo/matchhighlighter.html +38 -0
- data/public/libs/codemirror/demo/multiplex.html +60 -0
- data/public/libs/codemirror/demo/mustache.html +59 -0
- data/public/libs/codemirror/demo/placeholder.html +36 -0
- data/public/libs/codemirror/demo/preview.html +76 -0
- data/public/libs/codemirror/demo/resize.html +49 -0
- data/public/libs/codemirror/demo/runmode.html +50 -0
- data/public/libs/codemirror/demo/search.html +85 -0
- data/public/libs/codemirror/demo/spanaffectswrapping_shim.html +73 -0
- data/public/libs/codemirror/demo/theme.html +89 -0
- data/public/libs/codemirror/demo/variableheight.html +52 -0
- data/public/libs/codemirror/demo/vim.html +65 -0
- data/public/libs/codemirror/demo/visibletabs.html +53 -0
- data/public/libs/codemirror/demo/widget.html +74 -0
- data/public/libs/codemirror/demo/xmlcomplete.html +81 -0
- data/public/libs/codemirror/index.html +487 -0
- data/public/libs/codemirror/keymap/emacs.js +30 -0
- data/public/libs/codemirror/keymap/vim.js +3044 -0
- data/public/libs/codemirror/lib/codemirror.css +253 -0
- data/public/libs/codemirror/lib/codemirror.js +5585 -0
- data/public/libs/codemirror/mode/apl/apl.js +160 -0
- data/public/libs/codemirror/mode/apl/index.html +61 -0
- data/public/libs/codemirror/mode/asterisk/asterisk.js +183 -0
- data/public/libs/codemirror/mode/asterisk/index.html +142 -0
- data/public/libs/codemirror/mode/clike/clike.js +302 -0
- data/public/libs/codemirror/mode/clike/index.html +103 -0
- data/public/libs/codemirror/mode/clike/scala.html +767 -0
- data/public/libs/codemirror/mode/clojure/clojure.js +222 -0
- data/public/libs/codemirror/mode/clojure/index.html +76 -0
- data/public/libs/codemirror/mode/coffeescript/LICENSE +22 -0
- data/public/libs/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/public/libs/codemirror/mode/coffeescript/index.html +728 -0
- data/public/libs/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/public/libs/codemirror/mode/commonlisp/index.html +165 -0
- data/public/libs/codemirror/mode/css/css.js +567 -0
- data/public/libs/codemirror/mode/css/index.html +58 -0
- data/public/libs/codemirror/mode/css/scss.html +145 -0
- data/public/libs/codemirror/mode/css/scss_test.js +80 -0
- data/public/libs/codemirror/mode/css/test.js +113 -0
- data/public/libs/codemirror/mode/d/d.js +205 -0
- data/public/libs/codemirror/mode/d/index.html +262 -0
- data/public/libs/codemirror/mode/diff/diff.js +32 -0
- data/public/libs/codemirror/mode/diff/index.html +105 -0
- data/public/libs/codemirror/mode/ecl/ecl.js +192 -0
- data/public/libs/codemirror/mode/ecl/index.html +39 -0
- data/public/libs/codemirror/mode/erlang/erlang.js +463 -0
- data/public/libs/codemirror/mode/erlang/index.html +64 -0
- data/public/libs/codemirror/mode/gas/gas.js +326 -0
- data/public/libs/codemirror/mode/gas/index.html +57 -0
- data/public/libs/codemirror/mode/gfm/gfm.js +96 -0
- data/public/libs/codemirror/mode/gfm/index.html +74 -0
- data/public/libs/codemirror/mode/gfm/test.js +112 -0
- data/public/libs/codemirror/mode/go/go.js +165 -0
- data/public/libs/codemirror/mode/go/index.html +74 -0
- data/public/libs/codemirror/mode/groovy/groovy.js +210 -0
- data/public/libs/codemirror/mode/groovy/index.html +73 -0
- data/public/libs/codemirror/mode/haskell/haskell.js +242 -0
- data/public/libs/codemirror/mode/haskell/index.html +62 -0
- data/public/libs/codemirror/mode/haxe/haxe.js +429 -0
- data/public/libs/codemirror/mode/haxe/index.html +90 -0
- data/public/libs/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/public/libs/codemirror/mode/htmlembedded/index.html +49 -0
- data/public/libs/codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/public/libs/codemirror/mode/htmlmixed/index.html +73 -0
- data/public/libs/codemirror/mode/http/http.js +98 -0
- data/public/libs/codemirror/mode/http/index.html +32 -0
- data/public/libs/codemirror/mode/javascript/index.html +92 -0
- data/public/libs/codemirror/mode/javascript/javascript.js +467 -0
- data/public/libs/codemirror/mode/javascript/typescript.html +48 -0
- data/public/libs/codemirror/mode/jinja2/index.html +38 -0
- data/public/libs/codemirror/mode/jinja2/jinja2.js +42 -0
- data/public/libs/codemirror/mode/less/index.html +741 -0
- data/public/libs/codemirror/mode/less/less.js +266 -0
- data/public/libs/codemirror/mode/livescript/LICENSE +23 -0
- data/public/libs/codemirror/mode/livescript/index.html +446 -0
- data/public/libs/codemirror/mode/livescript/livescript.js +267 -0
- data/public/libs/codemirror/mode/livescript/livescript.ls +266 -0
- data/public/libs/codemirror/mode/lua/index.html +74 -0
- data/public/libs/codemirror/mode/lua/lua.js +140 -0
- data/public/libs/codemirror/mode/markdown/index.html +344 -0
- data/public/libs/codemirror/mode/markdown/markdown.js +526 -0
- data/public/libs/codemirror/mode/markdown/test.js +636 -0
- data/public/libs/codemirror/mode/meta.js +75 -0
- data/public/libs/codemirror/mode/mirc/index.html +149 -0
- data/public/libs/codemirror/mode/mirc/mirc.js +177 -0
- data/public/libs/codemirror/mode/ntriples/index.html +33 -0
- data/public/libs/codemirror/mode/ntriples/ntriples.js +170 -0
- data/public/libs/codemirror/mode/ocaml/index.html +131 -0
- data/public/libs/codemirror/mode/ocaml/ocaml.js +113 -0
- data/public/libs/codemirror/mode/pascal/LICENSE +7 -0
- data/public/libs/codemirror/mode/pascal/index.html +48 -0
- data/public/libs/codemirror/mode/pascal/pascal.js +94 -0
- data/public/libs/codemirror/mode/perl/LICENSE +19 -0
- data/public/libs/codemirror/mode/perl/index.html +62 -0
- data/public/libs/codemirror/mode/perl/perl.js +816 -0
- data/public/libs/codemirror/mode/php/index.html +51 -0
- data/public/libs/codemirror/mode/php/php.js +129 -0
- data/public/libs/codemirror/mode/pig/index.html +42 -0
- data/public/libs/codemirror/mode/pig/pig.js +171 -0
- data/public/libs/codemirror/mode/properties/index.html +41 -0
- data/public/libs/codemirror/mode/properties/properties.js +63 -0
- data/public/libs/codemirror/mode/python/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/python/index.html +135 -0
- data/public/libs/codemirror/mode/python/python.js +340 -0
- data/public/libs/codemirror/mode/q/index.html +131 -0
- data/public/libs/codemirror/mode/q/q.js +124 -0
- data/public/libs/codemirror/mode/r/LICENSE +24 -0
- data/public/libs/codemirror/mode/r/index.html +74 -0
- data/public/libs/codemirror/mode/r/r.js +141 -0
- data/public/libs/codemirror/mode/rpm/changes/changes.js +19 -0
- data/public/libs/codemirror/mode/rpm/changes/index.html +53 -0
- data/public/libs/codemirror/mode/rpm/spec/index.html +99 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.css +5 -0
- data/public/libs/codemirror/mode/rpm/spec/spec.js +66 -0
- data/public/libs/codemirror/mode/rst/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/rst/index.html +524 -0
- data/public/libs/codemirror/mode/rst/rst.js +550 -0
- data/public/libs/codemirror/mode/ruby/LICENSE +24 -0
- data/public/libs/codemirror/mode/ruby/index.html +173 -0
- data/public/libs/codemirror/mode/ruby/ruby.js +197 -0
- data/public/libs/codemirror/mode/rust/index.html +48 -0
- data/public/libs/codemirror/mode/rust/rust.js +432 -0
- data/public/libs/codemirror/mode/sass/index.html +54 -0
- data/public/libs/codemirror/mode/sass/sass.js +349 -0
- data/public/libs/codemirror/mode/scheme/index.html +65 -0
- data/public/libs/codemirror/mode/scheme/scheme.js +230 -0
- data/public/libs/codemirror/mode/shell/index.html +51 -0
- data/public/libs/codemirror/mode/shell/shell.js +118 -0
- data/public/libs/codemirror/mode/sieve/LICENSE +19 -0
- data/public/libs/codemirror/mode/sieve/index.html +81 -0
- data/public/libs/codemirror/mode/sieve/sieve.js +183 -0
- data/public/libs/codemirror/mode/smalltalk/index.html +57 -0
- data/public/libs/codemirror/mode/smalltalk/smalltalk.js +141 -0
- data/public/libs/codemirror/mode/smarty/index.html +83 -0
- data/public/libs/codemirror/mode/smarty/smarty.js +148 -0
- data/public/libs/codemirror/mode/sparql/index.html +42 -0
- data/public/libs/codemirror/mode/sparql/sparql.js +143 -0
- data/public/libs/codemirror/mode/sql/index.html +68 -0
- data/public/libs/codemirror/mode/sql/sql.js +268 -0
- data/public/libs/codemirror/mode/stex/index.html +98 -0
- data/public/libs/codemirror/mode/stex/stex.js +246 -0
- data/public/libs/codemirror/mode/stex/test.js +117 -0
- data/public/libs/codemirror/mode/tcl/index.html +129 -0
- data/public/libs/codemirror/mode/tcl/tcl.js +131 -0
- data/public/libs/codemirror/mode/tiddlywiki/index.html +142 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/public/libs/codemirror/mode/tiki/index.html +81 -0
- data/public/libs/codemirror/mode/tiki/tiki.css +26 -0
- data/public/libs/codemirror/mode/tiki/tiki.js +308 -0
- data/public/libs/codemirror/mode/turtle/index.html +39 -0
- data/public/libs/codemirror/mode/turtle/turtle.js +145 -0
- data/public/libs/codemirror/mode/vb/LICENSE.txt +21 -0
- data/public/libs/codemirror/mode/vb/index.html +88 -0
- data/public/libs/codemirror/mode/vb/vb.js +259 -0
- data/public/libs/codemirror/mode/vbscript/index.html +42 -0
- data/public/libs/codemirror/mode/vbscript/vbscript.js +26 -0
- data/public/libs/codemirror/mode/velocity/index.html +103 -0
- data/public/libs/codemirror/mode/velocity/velocity.js +144 -0
- data/public/libs/codemirror/mode/verilog/index.html +121 -0
- data/public/libs/codemirror/mode/verilog/verilog.js +182 -0
- data/public/libs/codemirror/mode/xml/index.html +45 -0
- data/public/libs/codemirror/mode/xml/xml.js +328 -0
- data/public/libs/codemirror/mode/xquery/LICENSE +20 -0
- data/public/libs/codemirror/mode/xquery/index.html +221 -0
- data/public/libs/codemirror/mode/xquery/test.js +64 -0
- data/public/libs/codemirror/mode/xquery/xquery.js +450 -0
- data/public/libs/codemirror/mode/yaml/index.html +68 -0
- data/public/libs/codemirror/mode/yaml/yaml.js +95 -0
- data/public/libs/codemirror/mode/z80/index.html +39 -0
- data/public/libs/codemirror/mode/z80/z80.js +85 -0
- data/public/libs/codemirror/package.json +21 -0
- data/public/libs/codemirror/test/doc_test.js +329 -0
- data/public/libs/codemirror/test/driver.js +138 -0
- data/public/libs/codemirror/test/index.html +182 -0
- data/public/libs/codemirror/test/lint/acorn.js +1593 -0
- data/public/libs/codemirror/test/lint/lint.js +112 -0
- data/public/libs/codemirror/test/lint/parse-js.js +1372 -0
- data/public/libs/codemirror/test/lint/walk.js +216 -0
- data/public/libs/codemirror/test/mode_test.css +10 -0
- data/public/libs/codemirror/test/mode_test.js +192 -0
- data/public/libs/codemirror/test/phantom_driver.js +31 -0
- data/public/libs/codemirror/test/run.js +33 -0
- data/public/libs/codemirror/test/test.js +1400 -0
- data/public/libs/codemirror/test/vim_test.js +1688 -0
- data/public/libs/codemirror/theme/ambiance-mobile.css +5 -0
- data/public/libs/codemirror/theme/ambiance.css +75 -0
- data/public/libs/codemirror/theme/blackboard.css +25 -0
- data/public/libs/codemirror/theme/cobalt.css +18 -0
- data/public/libs/codemirror/theme/eclipse.css +25 -0
- data/public/libs/codemirror/theme/elegant.css +10 -0
- data/public/libs/codemirror/theme/erlang-dark.css +21 -0
- data/public/libs/codemirror/theme/lesser-dark.css +44 -0
- data/public/libs/codemirror/theme/midnight.css +52 -0
- data/public/libs/codemirror/theme/monokai.css +28 -0
- data/public/libs/codemirror/theme/neat.css +9 -0
- data/public/libs/codemirror/theme/night.css +21 -0
- data/public/libs/codemirror/theme/rubyblue.css +21 -0
- data/public/libs/codemirror/theme/solarized.css +207 -0
- data/public/libs/codemirror/theme/twilight.css +26 -0
- data/public/libs/codemirror/theme/vibrant-ink.css +27 -0
- data/public/libs/codemirror/theme/xq-dark.css +46 -0
- data/public/libs/codemirror/theme/xq-light.css +43 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.css +983 -0
- data/public/libs/font-awesome/css/font-awesome-ie7.min.css +24 -0
- data/public/libs/font-awesome/css/font-awesome.css +1268 -0
- data/public/libs/font-awesome/css/font-awesome.min.css +24 -0
- data/public/libs/font-awesome/font/FontAwesome.otf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.eot +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.svg +339 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.ttf +0 -0
- data/public/libs/font-awesome/font/fontawesome-webfont.woff +0 -0
- data/public/libs/font-awesome/less/bootstrap.less +78 -0
- data/public/libs/font-awesome/less/core.less +132 -0
- data/public/libs/font-awesome/less/extras.less +79 -0
- data/public/libs/font-awesome/less/font-awesome-ie7.less +413 -0
- data/public/libs/font-awesome/less/font-awesome.less +32 -0
- data/public/libs/font-awesome/less/icons.less +330 -0
- data/public/libs/font-awesome/less/mixins.less +34 -0
- data/public/libs/font-awesome/less/path.less +15 -0
- data/public/libs/font-awesome/less/variables.less +9 -0
- data/public/libs/jquery-1.10.0.min.js +6 -0
- data/public/libs/jquery-ui.min.js +12 -0
- data/public/libs/jquery.jsPlumb-1.4.0-all.js +9571 -0
- data/public/libs/jquery.livequery.js +226 -0
- data/public/libs/jsPlumbInitializer.js +72 -0
- data/public/libs/jstree/README.txt +10 -0
- data/public/libs/jstree/_demo/_dump.sql +20 -0
- data/public/libs/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/libs/jstree/_demo/_inc/class._database.php +146 -0
- data/public/libs/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/libs/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/libs/jstree/_demo/_install.txt +6 -0
- data/public/libs/jstree/_demo/config.php +14 -0
- data/public/libs/jstree/_demo/file.png +0 -0
- data/public/libs/jstree/_demo/folder.png +0 -0
- data/public/libs/jstree/_demo/index.html +461 -0
- data/public/libs/jstree/_demo/root.png +0 -0
- data/public/libs/jstree/_demo/server.php +69 -0
- data/public/libs/jstree/_docs/!style.css +48 -0
- data/public/libs/jstree/_docs/_drive.png +0 -0
- data/public/libs/jstree/_docs/_html_data.html +2 -0
- data/public/libs/jstree/_docs/_json_data.json +4 -0
- data/public/libs/jstree/_docs/_search_data.json +6 -0
- data/public/libs/jstree/_docs/_search_result.json +1 -0
- data/public/libs/jstree/_docs/_xml_flat.xml +12 -0
- data/public/libs/jstree/_docs/_xml_nest.xml +18 -0
- data/public/libs/jstree/_docs/checkbox.html +171 -0
- data/public/libs/jstree/_docs/contextmenu.html +121 -0
- data/public/libs/jstree/_docs/cookies.html +97 -0
- data/public/libs/jstree/_docs/core.html +689 -0
- data/public/libs/jstree/_docs/crrm.html +316 -0
- data/public/libs/jstree/_docs/dnd.html +199 -0
- data/public/libs/jstree/_docs/hotkeys.html +82 -0
- data/public/libs/jstree/_docs/html_data.html +175 -0
- data/public/libs/jstree/_docs/index.html +86 -0
- data/public/libs/jstree/_docs/json_data.html +249 -0
- data/public/libs/jstree/_docs/languages.html +152 -0
- data/public/libs/jstree/_docs/logo.png +0 -0
- data/public/libs/jstree/_docs/search.html +153 -0
- data/public/libs/jstree/_docs/sort.html +85 -0
- data/public/libs/jstree/_docs/syntax/!script.js +2232 -0
- data/public/libs/jstree/_docs/syntax/!style.css +511 -0
- data/public/libs/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/libs/jstree/_docs/syntax/help.png +0 -0
- data/public/libs/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/libs/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/libs/jstree/_docs/syntax/printer.png +0 -0
- data/public/libs/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/libs/jstree/_docs/themeroller.html +107 -0
- data/public/libs/jstree/_docs/themes.html +127 -0
- data/public/libs/jstree/_docs/types.html +178 -0
- data/public/libs/jstree/_docs/ui.html +197 -0
- data/public/libs/jstree/_docs/unique.html +85 -0
- data/public/libs/jstree/_docs/xml_data.html +218 -0
- data/public/libs/jstree/_lib/jquery.cookie.js +96 -0
- data/public/libs/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/libs/jstree/_lib/jquery.js +5 -0
- data/public/libs/jstree/jquery.jstree.js +4564 -0
- data/public/libs/jstree/themes/apple/bg.jpg +0 -0
- data/public/libs/jstree/themes/apple/d.png +0 -0
- data/public/libs/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/apple/style.css +61 -0
- data/public/libs/jstree/themes/apple/throbber.gif +0 -0
- data/public/libs/jstree/themes/classic/d.gif +0 -0
- data/public/libs/jstree/themes/classic/d.png +0 -0
- data/public/libs/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/libs/jstree/themes/classic/style.css +77 -0
- data/public/libs/jstree/themes/classic/throbber.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/d.png +0 -0
- data/public/libs/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/libs/jstree/themes/default-rtl/style.css +84 -0
- data/public/libs/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/libs/jstree/themes/default/d.gif +0 -0
- data/public/libs/jstree/themes/default/d.png +0 -0
- data/public/libs/jstree/themes/default/style.css +74 -0
- data/public/libs/jstree/themes/default/throbber.gif +0 -0
- data/public/themes/geo-bootstrap/README.md +25 -0
- data/public/themes/geo-bootstrap/img/flames.gif +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/public/themes/geo-bootstrap/img/glyphicons-halflings.png +0 -0
- data/public/themes/geo-bootstrap/img/microfab.gif +0 -0
- data/public/themes/geo-bootstrap/img/progress.gif +0 -0
- data/public/themes/geo-bootstrap/img/rainbow.gif +0 -0
- data/public/themes/geo-bootstrap/img/stars.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/7upspot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/americanflag.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/community.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer-01.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/computer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/construction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/counter2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider1.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider3.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/divider4.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/drudgesiren.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/emailme.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/funky.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/geocities.jpg +0 -0
- data/public/themes/geo-bootstrap/img/test/hacker.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/heart.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/hot.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ie_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mailkitten.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/mchammer.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/new2.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/noframes.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/notepad.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/ns_logo.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/sign-in.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/spinningearth.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/underconstruction.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/wabwalk.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/webtrips.gif +0 -0
- data/public/themes/geo-bootstrap/img/test/yahooweek.gif +0 -0
- data/public/themes/geo-bootstrap/package.json +21 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.css +1109 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap-responsive.min.css +9 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.css +6462 -0
- data/public/themes/geo-bootstrap/swatch/bootstrap.min.css +9 -0
- metadata +791 -0
@@ -0,0 +1 @@
|
|
1
|
+
node Program.js $@
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Object subclass: #TrivialServer
|
2
|
+
instanceVariableNames: 'counter'
|
3
|
+
category: 'TrivialServer'!
|
4
|
+
|
5
|
+
!TrivialServer methodsFor: 'initializing'!
|
6
|
+
initialize
|
7
|
+
counter := 0
|
8
|
+
! !
|
9
|
+
|
10
|
+
!TrivialServer methodsFor: 'processing'!
|
11
|
+
process: aRequest
|
12
|
+
| hostname httpVersion stream |
|
13
|
+
counter := counter + 1.
|
14
|
+
|
15
|
+
"Calling a method in a js module"
|
16
|
+
hostname := os hostname.
|
17
|
+
|
18
|
+
"Accessing a property of js HTTP request object"
|
19
|
+
httpVersion := aRequest httpVersion.
|
20
|
+
|
21
|
+
stream := String new writeStream.
|
22
|
+
stream
|
23
|
+
nextPutAll: '<html><p>Request HTTP version: ', httpVersion, '</p>';
|
24
|
+
nextPutAll: '<p>OS hostname: ', hostname, '</p>';
|
25
|
+
nextPutAll: '<p>Number of requests: ', counter asString, '</p></html>'.
|
26
|
+
^stream contents
|
27
|
+
!
|
28
|
+
|
29
|
+
start
|
30
|
+
| block obj |
|
31
|
+
block := [:req :res || headers |
|
32
|
+
headers := Dictionary with: 'content-type' -> 'text/html'.
|
33
|
+
res writeHead: (Array with: 200 with: headers).
|
34
|
+
res end: (self process: req)].
|
35
|
+
|
36
|
+
(http createServer: block)
|
37
|
+
listen: 1337 host: '127.0.0.1'.
|
38
|
+
console log: 'TrivialServer running at http://127.0.0.1:1337/'
|
39
|
+
! !
|
40
|
+
|
41
|
+
|
42
|
+
!TrivialServer class methodsFor: 'initialization'!
|
43
|
+
initialize
|
44
|
+
"We require these Node modules."
|
45
|
+
os := require value: 'os'.
|
46
|
+
http := require value: 'http'.
|
47
|
+
!
|
48
|
+
|
49
|
+
main
|
50
|
+
self new start
|
51
|
+
! !
|
@@ -0,0 +1 @@
|
|
1
|
+
node Program.js $@
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/* @Booklet
|
2
|
+
----------------------------------------*/
|
3
|
+
.booklet {width:800px; height:600px; position:relative; /*background:#fff;*/ margin:0 auto 10px; overflow:visible !important;}
|
4
|
+
.booklet .b-page {left:0; top:0; position:absolute; overflow:hidden; padding:0;}
|
5
|
+
|
6
|
+
.booklet .b-pN {}
|
7
|
+
.booklet .b-p0 {}
|
8
|
+
.booklet .b-p1 {}
|
9
|
+
.booklet .b-p2 {}
|
10
|
+
.booklet .b-p3 {}
|
11
|
+
.booklet .b-p4 {}
|
12
|
+
|
13
|
+
.booklet .b-load {}
|
14
|
+
|
15
|
+
/* Page Wrappers */
|
16
|
+
.booklet .b-wrap {top:0; position:absolute;}
|
17
|
+
.booklet .b-wrap-left {background:#fff;}
|
18
|
+
.booklet .b-wrap-right {background:#efefef;}
|
19
|
+
|
20
|
+
.booklet .b-pN .b-wrap,
|
21
|
+
.booklet .b-p1 .b-wrap,
|
22
|
+
.booklet .b-p2 .b-wrap,
|
23
|
+
.booklet .b-p3 .b-wrap,
|
24
|
+
.booklet .b-p4 .b-wrap {left:0;}
|
25
|
+
.booklet .b-p0 .b-wrap {right:0;}
|
26
|
+
|
27
|
+
/* Custom Page Types */
|
28
|
+
.booklet .b-page-blank {padding:0; width:100%; height:100%;}
|
29
|
+
.booklet .b-page-cover {padding:0; width:100%; height:100%; background:#925C0E;}
|
30
|
+
.booklet .b-page-cover h3 {color:#fff; text-shadow:0px 1px 3px #222;}
|
31
|
+
|
32
|
+
/* Page Numbers */
|
33
|
+
.booklet .b-counter {bottom:10px; position:absolute; display:block; width:25px; height:20px; background:#ccc; color:#444; text-align:center; font-family:Georgia, "Times New Roman", Times, serif; font-size:10px; padding:5px 0 0;}
|
34
|
+
.booklet .b-wrap-left .b-counter {left:10px;}
|
35
|
+
.booklet .b-wrap-right .b-counter {right:10px;}
|
36
|
+
|
37
|
+
/* Page Shadows */
|
38
|
+
.booklet .b-shadow-f {right:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-forward.png"); background-repeat:repeat-y; background-position:100% 0;}
|
39
|
+
.booklet .b-shadow-b {left:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-back.png"); background-repeat:repeat-y; background-position:0 0;}
|
40
|
+
|
41
|
+
.booklet .b-p0 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:100% 10px;}
|
42
|
+
.booklet .b-p3 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:0 10px;}
|
43
|
+
|
44
|
+
/* Overlay Controls */
|
45
|
+
.booklet .b-grab {cursor: url(images/openhand.cur), default;}
|
46
|
+
.booklet .b-grabbing {cursor: url(images/closedhand.cur), default;}
|
47
|
+
|
48
|
+
/* Overlay Controls */
|
49
|
+
.booklet .b-overlay {top:0; position:absolute; height:100%; width:50%;}
|
50
|
+
.booklet .b-overlay-prev {left:0;}
|
51
|
+
.booklet .b-overlay-next {right:0;}
|
52
|
+
|
53
|
+
/* Tab Controls */
|
54
|
+
.booklet .b-tab {background:#000; height:40px; width:100%; padding:10px 0 0; text-align:center; color:#ccc; position:absolute; font-size:11px;}
|
55
|
+
.booklet .b-tab-prev {left:0;}
|
56
|
+
.booklet .b-tab-next {right:0;}
|
57
|
+
.booklet .b-tab:hover {background:#aaa; color:#000;}
|
58
|
+
|
59
|
+
/* Arrow Controls */
|
60
|
+
.booklet .b-arrow {display:block; position:absolute; text-indent:-9999px; top:0; height:100%; width:74px;}
|
61
|
+
.booklet .b-arrow div {display:none; text-indent:-9999px; height:170px; width:74px; position:absolute; left:0; top:25%;}
|
62
|
+
.booklet .b-arrow-next {right:-80px;}
|
63
|
+
.booklet .b-arrow-prev {left:-80px;}
|
64
|
+
.booklet .b-arrow-next div {background:url("images/arrow-next.png") no-repeat left top;}
|
65
|
+
.booklet .b-arrow-prev div {background:url("images/arrow-prev.png") no-repeat left top;}
|
66
|
+
|
67
|
+
/* @z-index fix (needed for older IE browsers)
|
68
|
+
----------------------------------------*/
|
69
|
+
body {z-index:0;}
|
70
|
+
.b-menu {z-index:100;}
|
71
|
+
.b-selector {z-index:100;}
|
72
|
+
.booklet {z-index:10;}
|
73
|
+
.b-pN {z-index:10;}
|
74
|
+
.b-p0 {z-index:10;}
|
75
|
+
.b-p1 {z-index:10;}
|
76
|
+
.b-p2 {z-index:10;}
|
77
|
+
.b-p3 {z-index:10;}
|
78
|
+
.b-p4 {z-index:10;}
|
79
|
+
.b-prev {z-index:40;}
|
80
|
+
.b-next {z-index:40;}
|
81
|
+
.b-counter {z-index:40;}
|
82
|
+
|
83
|
+
/* @Menu Items
|
84
|
+
----------------------------------------*/
|
85
|
+
.b-menu {height:40px; padding:0 0 10px;}
|
86
|
+
|
87
|
+
.b-selector {height:40px; position:relative; float:right; border:none; color:#cecece; cursor:pointer;}
|
88
|
+
.b-selector .b-current {padding:8px 15px 12px; line-height:20px; min-width:18px; height:20px; display:block; background:#000; text-align:center;}
|
89
|
+
.b-selector-page {width:auto; margin-left:15px;}
|
90
|
+
.b-selector-chapter {width:auto;}
|
91
|
+
|
92
|
+
.b-selector:hover {color:#fff; background-position:left 0px;}
|
93
|
+
.b-selector:hover .b-current {background-position:right 0px;}
|
94
|
+
.b-selector ul {overflow:hidden; margin:0; list-style:none !important; position:absolute; top:40px; right:0; padding:0 0 10px; background:#000; width:240px; font:normal 12px "Myriad Pro", Myriad, "DejaVu Sans Condensed","Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;}
|
95
|
+
.b-selector li {border:none;}
|
96
|
+
.b-selector a {color:#cecece; height:14px; text-decoration:none; display:block; padding:5px 10px;}
|
97
|
+
.b-selector a .b-text {float:left; clear:none;}
|
98
|
+
.b-selector a .b-num {float:right; clear:none;}
|
99
|
+
.b-selector a:hover {color:#fff;}
|
100
|
+
|
@@ -0,0 +1,1232 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Booklet Plugin
|
3
|
+
* Copyright (c) 2010 W. Grauvogel (http://builtbywill.com/)
|
4
|
+
*
|
5
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
7
|
+
*
|
8
|
+
* Version : 1.2.0
|
9
|
+
*
|
10
|
+
* Originally based on the work of:
|
11
|
+
* 1) Charles Mangin (http://clickheredammit.com/pageflip/)
|
12
|
+
*/
|
13
|
+
;(function($) {
|
14
|
+
|
15
|
+
$.fn.booklet = function(options){
|
16
|
+
|
17
|
+
var o = $.extend({}, $.fn.booklet.defaults, options);
|
18
|
+
|
19
|
+
return $(this).each(function()
|
20
|
+
{
|
21
|
+
var command, config, obj, id, i, target;
|
22
|
+
|
23
|
+
//option type string - api call
|
24
|
+
if(typeof options == 'string')
|
25
|
+
{
|
26
|
+
//check if booklet has been initialized
|
27
|
+
if($(this).data('booklet')){
|
28
|
+
command = options.toLowerCase();
|
29
|
+
obj = $.fn.booklet.interfaces[$(this).data('id')];
|
30
|
+
|
31
|
+
if(command == 'next'){ obj.next() }
|
32
|
+
else if(command == 'prev'){ obj.prev() }
|
33
|
+
|
34
|
+
}
|
35
|
+
}
|
36
|
+
//option type number - api call
|
37
|
+
else if(typeof options == 'number')
|
38
|
+
{
|
39
|
+
//check if booklet has been initialized
|
40
|
+
if($(this).data('booklet')){
|
41
|
+
target = options;
|
42
|
+
obj = $.fn.booklet.interfaces[$(this).data('id')];
|
43
|
+
|
44
|
+
if(target % 2 != 0) {
|
45
|
+
target-= 1;
|
46
|
+
}
|
47
|
+
|
48
|
+
obj.gotoPage(target);
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
52
|
+
//else build new booklet
|
53
|
+
else
|
54
|
+
{
|
55
|
+
config = $.extend(true, {}, o);
|
56
|
+
|
57
|
+
// Determine ID (Reuse array slots if possible)
|
58
|
+
id = $.fn.booklet.interfaces.length;
|
59
|
+
for(i = 0; i < id; i++)
|
60
|
+
{
|
61
|
+
if(typeof $.fn.booklet.interfaces[i] == 'undefined'){ id = i; break; }
|
62
|
+
}
|
63
|
+
|
64
|
+
// Instantiate the booklet
|
65
|
+
obj = new booklet($(this), config, id);
|
66
|
+
|
67
|
+
// Add API references
|
68
|
+
$.fn.booklet.interfaces[id] = obj;
|
69
|
+
}
|
70
|
+
});
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
function booklet(target, options, id){
|
75
|
+
|
76
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
77
|
+
//VARS + STRUCTURE
|
78
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
79
|
+
|
80
|
+
var self, opts, b, src,
|
81
|
+
hash, i, j, p, diff, busy, init, rhover, lhover, h, a, playing,
|
82
|
+
titles = new Array(), chapters = new Array(),
|
83
|
+
pN, p0, p1, p2, p3, p4, pNwrap, p0wrap, p1wrap, p2wrap, p3wrap, p4wrap, wraps, sF, sB,
|
84
|
+
p3drag, p0drag, temp, relativeX,
|
85
|
+
overlaysB, overlayN, overlayP, tabs, tabN, tabP, arrows, arrowN, arrowP, next, prev, ctrlsN, ctrlsP,
|
86
|
+
menu, chapter, dd, ddUL, ddH, ddLI, ddA, ddT, ddC, ddCUL, ddCH, ddCLI, ddCA, ddCT,
|
87
|
+
empty = '<div class="b-page-empty" title="" rel=""></div>', blank = '<div class="b-page-blank" title="" rel=""></div>'
|
88
|
+
;
|
89
|
+
|
90
|
+
busy = false;
|
91
|
+
playing = false;
|
92
|
+
init = false;
|
93
|
+
rhover = lhover = false;
|
94
|
+
self = this;
|
95
|
+
self.options = options;
|
96
|
+
self.id = id;
|
97
|
+
self.hash = '';
|
98
|
+
opts = self.options;
|
99
|
+
b = target.addClass('booklet');
|
100
|
+
src = b.children('.b-load');
|
101
|
+
|
102
|
+
//save page titles and chapter names, add page numbers
|
103
|
+
initPages();
|
104
|
+
|
105
|
+
//store data for api calls
|
106
|
+
b.data('booklet',true);
|
107
|
+
b.data('id', id);
|
108
|
+
b.data('total', src.children().length);
|
109
|
+
|
110
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
111
|
+
// SETUP OPTIONS
|
112
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
113
|
+
|
114
|
+
//set width + height
|
115
|
+
if(!opts.width){
|
116
|
+
opts.width = b.width();
|
117
|
+
}else if(typeof opts.width == 'string' && opts.width.indexOf("%") != -1){
|
118
|
+
opts.wPercent = true;
|
119
|
+
opts.wOrig = opts.width;
|
120
|
+
opts.width = (opts.width.replace('%','')/100) * parseFloat(b.parent().css('width'));
|
121
|
+
}
|
122
|
+
if(!opts.height){
|
123
|
+
opts.height = b.height();
|
124
|
+
}else if(typeof opts.height == 'string' && opts.height.indexOf("%") != -1){
|
125
|
+
opts.hPercent = true;
|
126
|
+
opts.hOrig = opts.height;
|
127
|
+
opts.height = (opts.height.replace('%','')/100) * parseFloat(b.parent().css('height'));
|
128
|
+
}
|
129
|
+
b.width(opts.width);
|
130
|
+
b.height(opts.height);
|
131
|
+
|
132
|
+
//save page sizes and other vars
|
133
|
+
opts.pWidth = opts.width/2;
|
134
|
+
opts.pWidthN = '-'+(opts.pWidth)+'px';
|
135
|
+
opts.pWidthH = opts.pWidth/2;
|
136
|
+
opts.pHeight = opts.height;
|
137
|
+
|
138
|
+
opts.pTotal = src.children().length;
|
139
|
+
opts.speedH = opts.speed/2;
|
140
|
+
|
141
|
+
//set startingPage
|
142
|
+
if(opts.direction == 'LTR'){
|
143
|
+
opts.curr = 0;
|
144
|
+
}else if(opts.direction == 'RTL'){
|
145
|
+
opts.curr = opts.pTotal-2;
|
146
|
+
}
|
147
|
+
if(!isNaN(opts.startingPage) && opts.startingPage <= opts.pTotal && opts.startingPage > 0){
|
148
|
+
if((opts.startingPage % 2) != 0){opts.startingPage--};
|
149
|
+
opts.curr = opts.startingPage;
|
150
|
+
}
|
151
|
+
|
152
|
+
//set position
|
153
|
+
if(opts.closed && opts.autoCenter){
|
154
|
+
if(opts.curr == 0){
|
155
|
+
b.width(opts.pWidth);
|
156
|
+
}else if(opts.curr >= opts.pTotal-2){
|
157
|
+
b.width(opts.pWidth);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
//set booklet opts.name
|
162
|
+
if(opts.name){
|
163
|
+
document.title = opts.name;
|
164
|
+
}else{
|
165
|
+
opts.name = document.title;
|
166
|
+
}
|
167
|
+
|
168
|
+
//save shadow widths for anim
|
169
|
+
if(opts.shadows){
|
170
|
+
opts.shadowTopFwdWidth = '-'+opts.shadowTopFwdWidth+'px';
|
171
|
+
opts.shadowTopBackWidth = '-'+opts.shadowTopBackWidth+'px';
|
172
|
+
}
|
173
|
+
|
174
|
+
//setup menu
|
175
|
+
if(opts.menu){
|
176
|
+
menu = $(opts.menu).addClass('b-menu');
|
177
|
+
p = opts.curr;
|
178
|
+
//setup page selctor
|
179
|
+
if(opts.pageSelector){
|
180
|
+
//add selector
|
181
|
+
dd = $('<div class="b-selector b-selector-page"><span class="b-current">'+ (p+1) +' - '+ (p+2) +'</span></div>').appendTo(menu);
|
182
|
+
ddUL = $('<ul></ul>').appendTo(dd).empty().css('height','auto');
|
183
|
+
|
184
|
+
//loop through all pages
|
185
|
+
for(i=0; i < opts.pTotal; i+=2){
|
186
|
+
j = i;
|
187
|
+
//nums for normal view
|
188
|
+
nums = (j+1) +'-'+ (j+2);
|
189
|
+
if(opts.closed){
|
190
|
+
//nums for closed book
|
191
|
+
j--;
|
192
|
+
if(i==0){nums='1'}
|
193
|
+
else if(i==opts.pTotal-2){nums=opts.pTotal-2}
|
194
|
+
else {nums = (j+1) +'-'+ (j+2);}
|
195
|
+
//nums for closed book with covers
|
196
|
+
if(opts.covers){
|
197
|
+
j--;
|
198
|
+
if(i==0){nums=''}
|
199
|
+
else if(i==opts.pTotal-2){nums=''}
|
200
|
+
else {nums = (j+1) +'-'+ (j+2);}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
//nums for RTL direction
|
204
|
+
if(opts.direction == 'RTL'){
|
205
|
+
nums = (Math.abs(j - opts.pTotal)-1) +' - '+ ((Math.abs(j - opts.pTotal)));
|
206
|
+
if(opts.closed){
|
207
|
+
if(i==opts.pTotal-2){nums='1'}
|
208
|
+
else if(i==0){nums=opts.pTotal-2}
|
209
|
+
else{nums = (Math.abs(j - opts.pTotal)-3) +' - '+ ((Math.abs(j - opts.pTotal)-2));}
|
210
|
+
|
211
|
+
if(opts.covers){
|
212
|
+
if(i==opts.pTotal-2){nums=''}
|
213
|
+
else if(i==0){nums=''}
|
214
|
+
else{nums = (Math.abs(j - opts.pTotal)-5) +' - '+ ((Math.abs(j - opts.pTotal)-4));}
|
215
|
+
}
|
216
|
+
}
|
217
|
+
dd.find('.b-current').text(nums);
|
218
|
+
ddLI = $('<li><a href="#/page/'+ (i+1) +'" id="selector-page-'+i+'"><span class="b-text">'+ titles[i+1] +'</span><span class="b-num">'+ nums +'</span></a></li>').prependTo(ddUL);
|
219
|
+
}else{
|
220
|
+
if(i==0){dd.find('.b-current').text(nums);}
|
221
|
+
ddLI = $('<li><a href="#/page/'+ (i+1) +'" id="selector-page-'+i+'"><span class="b-text">'+ titles[i] +'</span><span class="b-num">'+ nums +'</span></a></li>').appendTo(ddUL);
|
222
|
+
}
|
223
|
+
|
224
|
+
ddA = ddLI.find('a');
|
225
|
+
if(!opts.hash){
|
226
|
+
ddA.click(function(){
|
227
|
+
if(opts.direction == 'RTL'){dd.find('.b-current').text($(this).find('.b-num').text());}
|
228
|
+
ddT = parseInt($(this).attr('id').replace('selector-page-',''));
|
229
|
+
self.gotoPage(ddT);
|
230
|
+
return false;
|
231
|
+
});
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
//set height
|
236
|
+
ddH = ddUL.height();
|
237
|
+
ddUL.css({'height':0, 'padding-bottom':0});
|
238
|
+
|
239
|
+
//add hover effects
|
240
|
+
dd.unbind('hover').hover(function(){
|
241
|
+
ddUL.stop().animate({height:ddH, paddingBottom:10}, 500);
|
242
|
+
},function(){
|
243
|
+
ddUL.stop().animate({height:0, paddingBottom:0}, 500);
|
244
|
+
});
|
245
|
+
}
|
246
|
+
|
247
|
+
//setup chapter selctor
|
248
|
+
if(opts.chapterSelector){
|
249
|
+
|
250
|
+
chapter = chapters[opts.curr];
|
251
|
+
if(chapter == ""){ chapter = chapters[opts.curr+1]; }
|
252
|
+
|
253
|
+
ddC = $('<div class="b-selector b-selector-chapter"><span class="b-current">'+chapter+'</span></div>').appendTo(menu);
|
254
|
+
ddCUL = $('<ul></ul>').appendTo(ddC).empty().css('height','auto');
|
255
|
+
|
256
|
+
for(i=0; i < opts.pTotal; i+=1){
|
257
|
+
if(chapters[i] != "" && typeof chapters[i] != "undefined"){
|
258
|
+
if(opts.direction == 'RTL'){
|
259
|
+
j = i;
|
260
|
+
if(j % 2 != 0){j--;}
|
261
|
+
ddC.find('.b-current').text(chapters[i]);
|
262
|
+
ddCLI = $('<li><a href="#/page/'+ (j+1) +'" id="selector-page-'+(j)+'"><span class="b-text">'+ chapters[i] +'</span></a></li>').prependTo(ddCUL);
|
263
|
+
}else{
|
264
|
+
ddCLI = $('<li><a href="#/page/'+ (i+1) +'" id="selector-page-'+i+'"><span class="b-text">'+ chapters[i] +'</span></a></li>').appendTo(ddCUL);
|
265
|
+
}
|
266
|
+
ddCA = ddCLI.find('a');
|
267
|
+
if(!opts.hash){
|
268
|
+
ddCA.click(function(){
|
269
|
+
if(opts.direction == 'RTL'){ddC.find('.b-current').text($(this).find('.b-text').text());}
|
270
|
+
ddCT = parseInt($(this).attr('id').replace('selector-page-',''));
|
271
|
+
self.gotoPage(ddCT);
|
272
|
+
return false;
|
273
|
+
});
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
ddCH = ddCUL.height();
|
279
|
+
ddCUL.css({'height':0, 'padding-bottom':0});
|
280
|
+
|
281
|
+
ddC.unbind('hover').hover(function(){
|
282
|
+
ddCUL.stop().animate({height:ddCH, paddingBottom:10}, 500);
|
283
|
+
},function(){
|
284
|
+
ddCUL.stop().animate({height:0, paddingBottom:0}, 500);
|
285
|
+
});
|
286
|
+
}
|
287
|
+
}
|
288
|
+
|
289
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
290
|
+
// API METHODS
|
291
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
292
|
+
|
293
|
+
$.extend(self,
|
294
|
+
{
|
295
|
+
next : function(){
|
296
|
+
if(!busy){
|
297
|
+
self.gotoPage(opts.curr+2);
|
298
|
+
}
|
299
|
+
},
|
300
|
+
prev : function(){
|
301
|
+
if(!busy){
|
302
|
+
self.gotoPage(opts.curr-2);
|
303
|
+
}
|
304
|
+
},
|
305
|
+
gotoPage : function(num){
|
306
|
+
//moving forward (increasing number)
|
307
|
+
if(num > opts.curr && num < opts.pTotal && num >= 0 && !busy){
|
308
|
+
busy = true;
|
309
|
+
diff = num - opts.curr;
|
310
|
+
opts.curr = num;
|
311
|
+
opts.before.call(self, opts);
|
312
|
+
updatePager();
|
313
|
+
updateCtrls();
|
314
|
+
updateHash(opts.curr+1, opts);
|
315
|
+
initAnim(diff, true, sF);
|
316
|
+
|
317
|
+
//hide p2 as p3 moves across it
|
318
|
+
if(opts.closed && opts.autoCenter && num-diff == 0){
|
319
|
+
p2.stop().animate({width:0, left:opts.pWidth}, opts.speed, opts.easing);
|
320
|
+
p4.stop().animate({left:opts.pWidth}, opts.speed, opts.easing);
|
321
|
+
}else{
|
322
|
+
p2.stop().animate({width:0}, opts.speedH, opts.easeIn);
|
323
|
+
}
|
324
|
+
|
325
|
+
//animate p3 from right to left (left: movement, width: reveal slide, paddingLeft: shadow underneath)
|
326
|
+
//call setuppages at end of animation to reset pages
|
327
|
+
|
328
|
+
//animation if dragging forward
|
329
|
+
if(p3drag){
|
330
|
+
p3.stop().animate({left:opts.pWidth/4, width:opts.pWidth*.75, paddingLeft: opts.shadowBtmWidth}, opts.speedH, opts.easeIn)
|
331
|
+
.animate({left:0, width:opts.pWidth, paddingLeft:0}, opts.speedH);
|
332
|
+
}else{
|
333
|
+
p3.stop().animate({left:opts.pWidthH, width:opts.pWidthH, paddingLeft: opts.shadowBtmWidth}, opts.speedH, opts.easeIn)
|
334
|
+
.animate({left:0, width:opts.pWidth, paddingLeft:0}, opts.speedH);
|
335
|
+
}
|
336
|
+
p3wrap.animate({left:opts.shadowBtmWidth}, opts.speedH, opts.easeIn)
|
337
|
+
.animate({left:0}, opts.speedH, opts.easeOut, function(){updateAfter()});
|
338
|
+
|
339
|
+
//moving backward (decreasing number)
|
340
|
+
}else if(num < opts.curr && num < opts.pTotal && num >= 0 && !busy){
|
341
|
+
busy = true;
|
342
|
+
diff = opts.curr - num;
|
343
|
+
opts.curr = num;
|
344
|
+
opts.before.call(self, opts);
|
345
|
+
updatePager();
|
346
|
+
updateCtrls();
|
347
|
+
updateHash(opts.curr+1, opts);
|
348
|
+
initAnim(diff, false, sB);
|
349
|
+
|
350
|
+
//animation if dragging backwards
|
351
|
+
if(p0drag){
|
352
|
+
//hide p1 as p0 moves across it
|
353
|
+
p1.animate({left:opts.pWidth, width:0}, opts.speed, opts.easing);
|
354
|
+
p1wrap.animate({left:opts.pWidthN}, opts.speed, opts.easing);
|
355
|
+
|
356
|
+
//animate p0 from left to right (right: movement, width: reveal slide, paddingLeft: shadow underneath)
|
357
|
+
if(opts.closed && opts.autoCenter && opts.curr == 0){
|
358
|
+
p0.animate({left:opts.pWidthH, width:opts.pWidthH}, opts.speedH, opts.easeIn)
|
359
|
+
.animate({left:0, width:opts.pWidth}, opts.speedH, opts.easeOut);
|
360
|
+
p2.stop().animate({left:0}, opts.speed, opts.easing);
|
361
|
+
}else{
|
362
|
+
p0.animate({left:opts.pWidth, width:opts.pWidth}, opts.speed, opts.easing);
|
363
|
+
}
|
364
|
+
//animate .wrapper content with p0 to keep content right aligned throughout
|
365
|
+
//call setuppages at end of animation to reset pages
|
366
|
+
p0wrap.animate({right:0}, opts.speed, opts.easing, function(){updateAfter()});
|
367
|
+
}else{
|
368
|
+
//hide p1 as p0 moves across it
|
369
|
+
p1.animate({left:opts.pWidth, width:0}, opts.speed, opts.easing);
|
370
|
+
p1wrap.animate({left:opts.pWidthN}, opts.speed, opts.easing);
|
371
|
+
|
372
|
+
//animate p0 from left to right (right: movement, width: reveal slide, paddingLeft: shadow underneath)
|
373
|
+
if(opts.closed && opts.autoCenter && opts.curr == 0){
|
374
|
+
p0.animate({left:opts.pWidthH, width:opts.pWidthH}, opts.speedH, opts.easeIn)
|
375
|
+
.animate({left:0, width:opts.pWidth}, opts.speedH, opts.easeOut);
|
376
|
+
p2.stop().animate({left:0}, opts.speed, opts.easing);
|
377
|
+
}else{
|
378
|
+
p0.animate({left:opts.pWidthH, width:opts.pWidthH}, opts.speedH, opts.easeIn)
|
379
|
+
.animate({left:opts.pWidth, width:opts.pWidth}, opts.speedH, opts.easeOut);
|
380
|
+
}
|
381
|
+
//animate .wrapper content with p0 to keep content right aligned throughout
|
382
|
+
//call setuppages at end of animation to reset pages
|
383
|
+
p0wrap.animate({right:opts.shadowBtmWidth}, opts.speedH,opts. easeIn)
|
384
|
+
.animate({right:0}, opts.speedH, opts.easeOut, function(){updateAfter()});
|
385
|
+
}
|
386
|
+
}
|
387
|
+
}
|
388
|
+
});
|
389
|
+
|
390
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
391
|
+
// SETUP CONTROLS
|
392
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
393
|
+
|
394
|
+
if(opts.manual && $.ui){
|
395
|
+
opts.overlays = false;
|
396
|
+
}
|
397
|
+
|
398
|
+
//add prev next user defined controls
|
399
|
+
if(opts.next){
|
400
|
+
next = $(opts.next);
|
401
|
+
next.click(function(e){e.preventDefault(); self.next();});
|
402
|
+
}
|
403
|
+
if(opts.prev){
|
404
|
+
prev = $(opts.prev);
|
405
|
+
prev.click(function(e){e.preventDefault(); self.prev();});
|
406
|
+
}
|
407
|
+
|
408
|
+
//add overlays
|
409
|
+
if(opts.overlays){
|
410
|
+
overlayP = $('<div class="b-overlay b-overlay-prev b-prev" title="Previous Page"></div>').appendTo(b);
|
411
|
+
overlayN = $('<div class="b-overlay b-overlay-next b-next" title="Next Page"></div>').appendTo(b);
|
412
|
+
overlaysB = b.find('.b-overlay');
|
413
|
+
|
414
|
+
if ($.browser.msie) {
|
415
|
+
overlaysB.css({'background':'#fff','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0) !important'});
|
416
|
+
}
|
417
|
+
}
|
418
|
+
|
419
|
+
//add tabs
|
420
|
+
if(opts.tabs){
|
421
|
+
tabP = $('<div class="b-tab b-tab-prev b-prev" title="Previous Page">Previous</div>').appendTo(b);
|
422
|
+
tabN = $('<div class="b-tab b-tab-next b-next" title="Next Page">Next</div>').appendTo(b);
|
423
|
+
tabs = b.find('.b-tab');
|
424
|
+
|
425
|
+
if(opts.tabWidth){
|
426
|
+
tabs.width(opts.tabWidth);
|
427
|
+
}
|
428
|
+
if(opts.tabHeight){
|
429
|
+
tabs.height(opts.tabHeight);
|
430
|
+
}
|
431
|
+
|
432
|
+
tabs.css({'top': '-'+tabN.outerHeight()+'px'});
|
433
|
+
b.css({'marginTop': tabN.outerHeight()});
|
434
|
+
|
435
|
+
//update ctrls for RTL direction
|
436
|
+
if(opts.direction == 'RTL'){
|
437
|
+
tabN.html('Previous').attr('title','Previous Page');
|
438
|
+
tabP.html('Next').attr('title','Next Page');
|
439
|
+
}
|
440
|
+
}else{
|
441
|
+
b.css({'marginTop': 0});
|
442
|
+
}
|
443
|
+
|
444
|
+
//add arrows
|
445
|
+
if(opts.arrows){
|
446
|
+
arrowP = $('<div class="b-arrow b-arrow-prev b-prev" title="Previous Page"><div>Previous</div></div>').appendTo(b);
|
447
|
+
arrowN = $('<div class="b-arrow b-arrow-next b-next" title="Next Page"><div>Next</div></div>').appendTo(b);
|
448
|
+
arrows = b.find('.b-arrow');
|
449
|
+
|
450
|
+
//update ctrls for RTL direction
|
451
|
+
if(opts.direction == 'RTL'){
|
452
|
+
arrowN.html('<div>Previous</div>').attr('title','Previous Page');
|
453
|
+
arrowP.html('<div>Next</div>').attr('title','Next Page');
|
454
|
+
}
|
455
|
+
}
|
456
|
+
|
457
|
+
//save all "b-prev" and "b-next" controls
|
458
|
+
ctrlsN = b.find('.b-next');
|
459
|
+
ctrlsP = b.find('.b-prev');
|
460
|
+
|
461
|
+
//add click actions
|
462
|
+
ctrlsN.click(function(e){e.preventDefault(); self.next();});
|
463
|
+
ctrlsP.click(function(e){e.preventDefault(); self.prev();});
|
464
|
+
|
465
|
+
//add page hover animations
|
466
|
+
if(opts.overlays && opts.hovers){
|
467
|
+
//hovers to start draggable forward
|
468
|
+
ctrlsN.unbind("mouseover mouseout").bind("mouseover",function(){
|
469
|
+
hoverAnimStart(true);
|
470
|
+
})
|
471
|
+
.bind("mouseout",function(){
|
472
|
+
hoverAnimEnd(true);
|
473
|
+
});
|
474
|
+
|
475
|
+
//hovers to start draggable backwards
|
476
|
+
ctrlsP.unbind("mouseover mouseout").bind("mouseover",function(){
|
477
|
+
hoverAnimStart(false);
|
478
|
+
})
|
479
|
+
.bind("mouseout",function(){
|
480
|
+
hoverAnimEnd(false);
|
481
|
+
});
|
482
|
+
}
|
483
|
+
|
484
|
+
//arrow animations
|
485
|
+
if(opts.arrows){
|
486
|
+
if(opts.arrowsHide){
|
487
|
+
if($.support.opacity){
|
488
|
+
ctrlsN.hover(
|
489
|
+
function(){arrowN.find('div').stop().fadeTo('fast', 1);},
|
490
|
+
function(){arrowN.find('div').stop().fadeTo('fast', 0);
|
491
|
+
});
|
492
|
+
ctrlsP.hover(
|
493
|
+
function(){arrowP.find('div').stop().fadeTo('fast', 1);},
|
494
|
+
function(){arrowP.find('div').stop().fadeTo('fast', 0);
|
495
|
+
});
|
496
|
+
}else{
|
497
|
+
ctrlsN.hover(
|
498
|
+
function(){arrowN.find('div').show();},
|
499
|
+
function(){arrowN.find('div').hide();
|
500
|
+
});
|
501
|
+
ctrlsP.hover(
|
502
|
+
function(){arrowP.find('div').show();},
|
503
|
+
function(){arrowP.find('div').hide();
|
504
|
+
});
|
505
|
+
}
|
506
|
+
}else{
|
507
|
+
arrowN.find('div').show();
|
508
|
+
arrowP.find('div').show();
|
509
|
+
}
|
510
|
+
}
|
511
|
+
|
512
|
+
//keyboard ctrls
|
513
|
+
if(opts.keyboard){
|
514
|
+
//keyboard ctrls
|
515
|
+
$(document).keyup(function(event){
|
516
|
+
if(event.keyCode == 37){self.prev();}
|
517
|
+
else if(event.keyCode == 39){self.next();}
|
518
|
+
});
|
519
|
+
}
|
520
|
+
|
521
|
+
//hash ctrls
|
522
|
+
if(opts.hash){
|
523
|
+
setupHash();
|
524
|
+
clearInterval(h);
|
525
|
+
h = setInterval(function(){pollHash()}, 250);
|
526
|
+
}
|
527
|
+
|
528
|
+
//percentage resizing
|
529
|
+
if(opts.wPercent || opts.hPercent){
|
530
|
+
$(window).resize(function() {
|
531
|
+
resetSize();
|
532
|
+
});
|
533
|
+
}
|
534
|
+
|
535
|
+
//auto flip book controls
|
536
|
+
if(opts.auto && opts.delay){
|
537
|
+
clearTimeout(a);
|
538
|
+
a = setTimeout(function(){self.next();},opts.delay);
|
539
|
+
playing = true;
|
540
|
+
|
541
|
+
if(opts.pause){
|
542
|
+
pause = $(opts.pause);
|
543
|
+
pause.click(function(e){
|
544
|
+
e.preventDefault();
|
545
|
+
if(playing){
|
546
|
+
clearTimeout(a);
|
547
|
+
playing = false;
|
548
|
+
}
|
549
|
+
});
|
550
|
+
}
|
551
|
+
if(opts.play){
|
552
|
+
play = $(opts.play);
|
553
|
+
play.click(function(e){
|
554
|
+
e.preventDefault();
|
555
|
+
if(!playing){
|
556
|
+
clearTimeout(a);
|
557
|
+
a = setTimeout(function(){self.next();},opts.delay);
|
558
|
+
playing = true;
|
559
|
+
}
|
560
|
+
});
|
561
|
+
}
|
562
|
+
}
|
563
|
+
|
564
|
+
//first time setup
|
565
|
+
resetPages();
|
566
|
+
updateCtrls();
|
567
|
+
updatePager();
|
568
|
+
|
569
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
570
|
+
//General Functions
|
571
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
572
|
+
|
573
|
+
function initPages(){
|
574
|
+
//fix for odd number of pages
|
575
|
+
if((src.children().length % 2) != 0){
|
576
|
+
//if book is closed and using covers, add page before back cover, else after last page
|
577
|
+
if(opts.closed && opts.covers){
|
578
|
+
src.children().last().before(blank);
|
579
|
+
}else{
|
580
|
+
src.children().last().after(blank);
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
//if closed book, add empty pages to start and end
|
585
|
+
if(opts.closed){
|
586
|
+
$(empty).attr({'title':opts.closedFrontTitle || "Beginning", 'rel':opts.closedFrontChapter || "Beginning of Book"}).prependTo(src);
|
587
|
+
src.children().last().attr({'title':opts.closedBackTitle || "End", 'rel':opts.closedBackChapter || "End of Book"});
|
588
|
+
src.append(empty);
|
589
|
+
}
|
590
|
+
|
591
|
+
if(opts.direction == 'LTR'){
|
592
|
+
j = 0;
|
593
|
+
}else{
|
594
|
+
j = src.children().length;
|
595
|
+
if(opts.closed){j-=2;}
|
596
|
+
if(opts.covers){j-=2;}
|
597
|
+
$(src.children().get().reverse()).each(function(){
|
598
|
+
$(this).appendTo(src);
|
599
|
+
});
|
600
|
+
}
|
601
|
+
|
602
|
+
//save titles and chapters
|
603
|
+
src.children().each(function(i){
|
604
|
+
//save chapter title
|
605
|
+
if($(this).attr('rel')){
|
606
|
+
chapters[i] = $(this).attr('rel');
|
607
|
+
}else{
|
608
|
+
chapters[i] = "";
|
609
|
+
}
|
610
|
+
//save page title
|
611
|
+
titles[i] = $(this).attr('title');
|
612
|
+
|
613
|
+
//give content the correct wrapper and page wrapper
|
614
|
+
if($(this).hasClass('b-page-empty')){
|
615
|
+
$(this).wrap('<div class="b-page"><div class="b-wrap"></div></div>');
|
616
|
+
}else if(opts.closed && opts.covers && (i == 1 || i == src.children().length-2)){
|
617
|
+
$(this).wrap('<div class="b-page"><div class="b-wrap b-page-cover"></div></div>');
|
618
|
+
}else if(i % 2 != 0){
|
619
|
+
$(this).wrap('<div class="b-page"><div class="b-wrap b-wrap-right"></div></div>');
|
620
|
+
}else{
|
621
|
+
|
622
|
+
$(this).wrap('<div class="b-page"><div class="b-wrap b-wrap-left"></div></div>');
|
623
|
+
}
|
624
|
+
|
625
|
+
$(this).parents('.b-page').addClass('b-page-'+i).data('page',i);
|
626
|
+
|
627
|
+
//add page numbers
|
628
|
+
if(opts.pageNumbers && !$(this).hasClass('b-page-empty') && (!opts.closed || (opts.closed && !opts.covers) || (opts.closed && opts.covers && i != 1 && i != src.children().length-2))){
|
629
|
+
if(opts.direction == 'LTR'){j++;}
|
630
|
+
$(this).parent().append('<div class="b-counter">'+(j)+'</div>');
|
631
|
+
if(opts.direction == 'RTL'){j--;}
|
632
|
+
}
|
633
|
+
});
|
634
|
+
}
|
635
|
+
|
636
|
+
function resetSize(){
|
637
|
+
//recalculate size for percentage values
|
638
|
+
if(opts.wPercent){
|
639
|
+
opts.width = (opts.wOrig.replace('%','')/100) * parseFloat(b.parent().css('width'));
|
640
|
+
b.width(opts.width);
|
641
|
+
opts.pWidth = opts.width/2;
|
642
|
+
opts.pWidthN = '-'+(opts.pWidth)+'px';
|
643
|
+
opts.pWidthH = opts.pWidth/2;
|
644
|
+
}
|
645
|
+
if(opts.hPercent){
|
646
|
+
opts.height = (opts.hOrig.replace('%','')/100) * parseFloat(b.parent().css('height'));
|
647
|
+
b.height(opts.height);
|
648
|
+
opts.pHeight = opts.height;
|
649
|
+
}
|
650
|
+
resetCSS();
|
651
|
+
}
|
652
|
+
|
653
|
+
function resetCSS(){
|
654
|
+
//update css
|
655
|
+
b.find('.b-shadow-f, .b-shadow-b, .b-p0, .b-p3').css({'filter':'','zoom':''});
|
656
|
+
if(opts.manual && $.ui){
|
657
|
+
b.find('.b-page').draggable('destroy').removeClass('b-grab b-grabbing');
|
658
|
+
}
|
659
|
+
wraps.attr('style','');
|
660
|
+
wraps.css({'left':0,'width':opts.pWidth-(opts.pagePadding*2), 'height':opts.pHeight-(opts.pagePadding*2), 'padding': opts.pagePadding});
|
661
|
+
p0wrap.css({'right':0,'left':'auto'});
|
662
|
+
p1.css({'left':0,'width':opts.pWidth, 'height':opts.pHeight});
|
663
|
+
p2.css({'left':opts.pWidth, 'width':opts.pWidth, 'opacity':1, 'height':opts.pHeight});
|
664
|
+
pN.css({'left':0, 'width':opts.pWidth, 'height':opts.pHeight});
|
665
|
+
p0.css({'left':0, 'width':0, 'height':opts.pHeight});
|
666
|
+
p3.stop().css({'left':opts.pWidth*2, 'width':0, 'height':opts.pHeight, paddingLeft:0});
|
667
|
+
p4.css({'left':opts.pWidth, 'width':opts.pWidth, 'height':opts.pHeight});
|
668
|
+
|
669
|
+
if(opts.closed && opts.autoCenter && opts.curr == 0){
|
670
|
+
pN.css({'left':0});
|
671
|
+
p1.css({'left':opts.pWidthN});
|
672
|
+
p2.css({'left':0});
|
673
|
+
p3.css({'left':opts.pWidth});
|
674
|
+
p4.css({'left':0});
|
675
|
+
}
|
676
|
+
|
677
|
+
if(opts.closed && opts.autoCenter && (opts.curr == 0 || opts.curr >= opts.pTotal-2)){
|
678
|
+
if(opts.overlays){overlaysB.width('100%');}
|
679
|
+
b.width(opts.pWidth);
|
680
|
+
}else{
|
681
|
+
if(opts.overlays){overlaysB.width('50%');}
|
682
|
+
b.width(opts.width);
|
683
|
+
}
|
684
|
+
|
685
|
+
}
|
686
|
+
|
687
|
+
function resetPages(){
|
688
|
+
//reset page order
|
689
|
+
if(init){
|
690
|
+
if(p1.data('page')-1 < 0){
|
691
|
+
src.prepend(p2.detach());
|
692
|
+
src.prepend(p1.detach());
|
693
|
+
}else{
|
694
|
+
b.find('.b-page-'+(p1.data('page')-1)).after(p1.detach());
|
695
|
+
b.find('.b-page-'+(p2.data('page')-1)).after(p2.detach());
|
696
|
+
}
|
697
|
+
if(p3.data('page')-1 <= opts.pTotal){
|
698
|
+
b.find('.b-page-'+(p3.data('page')-1)).after(p3.detach());
|
699
|
+
b.find('.b-page-'+(p4.data('page')-1)).after(p4.detach());
|
700
|
+
}
|
701
|
+
if(pN.data('page')-1 >= 0){
|
702
|
+
b.find('.b-page-'+(pN.data('page')-1)).after(pN.detach());
|
703
|
+
b.find('.b-page-'+(p0.data('page')-1)).after(p0.detach());
|
704
|
+
}else{
|
705
|
+
src.prepend(pN.detach());
|
706
|
+
pN.after(p0.detach());
|
707
|
+
}
|
708
|
+
}
|
709
|
+
//reset all content
|
710
|
+
b.find('.b-page').removeClass('b-pN b-p0 b-p1 b-p2 b-p3 b-p4').hide();
|
711
|
+
|
712
|
+
//add page classes
|
713
|
+
if(opts.curr-2 >= 0){
|
714
|
+
b.find('.b-page-'+(opts.curr-2)).addClass('b-pN').show();
|
715
|
+
b.find('.b-page-'+(opts.curr-1)).addClass('b-p0').show();
|
716
|
+
}
|
717
|
+
b.find('.b-page-'+(opts.curr)).addClass('b-p1').show();
|
718
|
+
b.find('.b-page-'+(opts.curr+1)).addClass('b-p2').show();
|
719
|
+
if(opts.curr+3 <= opts.pTotal){
|
720
|
+
b.find('.b-page-'+(opts.curr+2)).addClass('b-p3').show();
|
721
|
+
b.find('.b-page-'+(opts.curr+3)).addClass('b-p4').show();
|
722
|
+
}
|
723
|
+
|
724
|
+
//save structure elems to vars
|
725
|
+
pN = b.find('.b-pN');
|
726
|
+
p0 = b.find('.b-p0');
|
727
|
+
p1 = b.find('.b-p1');
|
728
|
+
p2 = b.find('.b-p2');
|
729
|
+
p3 = b.find('.b-p3');
|
730
|
+
p4 = b.find('.b-p4');
|
731
|
+
pNwrap = b.find('.b-pN .b-wrap');
|
732
|
+
p0wrap = b.find('.b-p0 .b-wrap');
|
733
|
+
p1wrap = b.find('.b-p1 .b-wrap');
|
734
|
+
p2wrap = b.find('.b-p2 .b-wrap');
|
735
|
+
p3wrap = b.find('.b-p3 .b-wrap');
|
736
|
+
p4wrap = b.find('.b-p4 .b-wrap');
|
737
|
+
wraps = b.find('.b-wrap');
|
738
|
+
|
739
|
+
resetCSS();
|
740
|
+
|
741
|
+
//update page order for animations
|
742
|
+
if(opts.curr+3 <= opts.pTotal){
|
743
|
+
p3.after(p0.detach());
|
744
|
+
p1.after(p4.detach());
|
745
|
+
}else{
|
746
|
+
p0.detach().appendTo(src);
|
747
|
+
}
|
748
|
+
init = true;
|
749
|
+
|
750
|
+
if(opts.shadows){
|
751
|
+
b.find('.b-shadow-f, .b-shadow-b').remove();
|
752
|
+
sF = $('<div class="b-shadow-f"></div>').css({'right':0,'width':opts.pWidth, 'height':opts.pHeight}).appendTo(p3);
|
753
|
+
sB = $('<div class="b-shadow-b"></div>').appendTo(p0).css({'left':0,'width':opts.pWidth, 'height':opts.pHeight});
|
754
|
+
}
|
755
|
+
|
756
|
+
//reset vars
|
757
|
+
rhover = lhover = p3drag = p0drag = false;
|
758
|
+
|
759
|
+
//manual page turning, check if jQuery UI is loaded
|
760
|
+
if(opts.manual && $.ui){
|
761
|
+
|
762
|
+
//implement draggable forward
|
763
|
+
p3.draggable({
|
764
|
+
axis: "x",
|
765
|
+
containment: [p2.offset().left-opts.pWidthH,0,p2.offset().left+opts.pWidth-50,opts.pHeight],
|
766
|
+
drag: function(event, ui) {
|
767
|
+
p3drag = true;
|
768
|
+
temp = ui.originalPosition.left - ui.position.left;
|
769
|
+
p3.removeClass('b-grab').addClass('b-grabbing');
|
770
|
+
p3.width(40+(temp/2));
|
771
|
+
p3wrap.css({'left':10+(temp/8)});
|
772
|
+
p2.width(opts.pWidth-p3.width()+10);
|
773
|
+
if(opts.shadows){
|
774
|
+
sF.css({'right':'-'+(20+temp/4)+'px'});
|
775
|
+
if($.support.opacity){
|
776
|
+
sF.css({'opacity':0.5*(temp/opts.pWidthH)});
|
777
|
+
}else{
|
778
|
+
sF.css({'right':'auto','left':0.1*p3.width()});
|
779
|
+
}
|
780
|
+
}
|
781
|
+
},
|
782
|
+
stop: function(event, ui) {
|
783
|
+
hoverAnimEnd(false);
|
784
|
+
var temp = ui.originalPosition.left - ui.position.left;
|
785
|
+
if(temp>opts.pWidthH/4){
|
786
|
+
if(opts.shadows && !$.support.opacity){
|
787
|
+
sF.css({'left':'auto'});
|
788
|
+
}
|
789
|
+
self.next();
|
790
|
+
p3.removeClass('b-grab b-grabbing');
|
791
|
+
}else{
|
792
|
+
p3drag = false;
|
793
|
+
p3.removeClass('b-grabbing').addClass('b-grab');
|
794
|
+
}
|
795
|
+
}
|
796
|
+
});
|
797
|
+
|
798
|
+
//implement draggable backwards
|
799
|
+
p0.draggable({
|
800
|
+
axis: "x",
|
801
|
+
containment: [p1.offset().left+10,0,p1.offset().left+opts.pWidth*.75,opts.pHeight],
|
802
|
+
drag: function(event, ui) {
|
803
|
+
p0drag = true;
|
804
|
+
temp = ui.position.left - ui.originalPosition.left;
|
805
|
+
p0.removeClass('b-grab').addClass('b-grabbing');
|
806
|
+
p0.css({left:40+(temp)/1.5, width:40+(temp)});
|
807
|
+
p0wrap.css({right:10+temp/4});
|
808
|
+
p1.css({left:ui.position.left+20, width:opts.pWidth-ui.position.left-10});
|
809
|
+
p1wrap.css({left:-1*(temp+30)});
|
810
|
+
if(opts.shadows){
|
811
|
+
if($.support.opacity){
|
812
|
+
sB.css({'opacity':0.5*(temp/opts.pWidthH)});
|
813
|
+
}else{
|
814
|
+
sB.css({'left':-0.38*opts.pWidth});
|
815
|
+
}
|
816
|
+
}
|
817
|
+
},
|
818
|
+
stop: function(event, ui) {
|
819
|
+
hoverAnimEnd(true);
|
820
|
+
temp = ui.position.left - ui.originalPosition.left;
|
821
|
+
if(temp>opts.pWidthH/4){
|
822
|
+
self.prev();
|
823
|
+
p0.removeClass('b-grab b-grabbing');
|
824
|
+
}else{
|
825
|
+
p0drag = false;
|
826
|
+
p0.removeClass('b-grabbing').addClass('b-grab');
|
827
|
+
}
|
828
|
+
}
|
829
|
+
});
|
830
|
+
|
831
|
+
//mousetracking for page movement
|
832
|
+
$(b).unbind('mousemove mouseout').bind('mousemove',function(e){
|
833
|
+
relativeX = e.pageX - b.offset().left;
|
834
|
+
if(relativeX < 50){
|
835
|
+
hoverAnimStart(false);
|
836
|
+
}else if(relativeX > opts.pWidth-50 && opts.curr == 0 && opts.autoCenter && opts.closed){
|
837
|
+
hoverAnimStart(true);
|
838
|
+
}else if(relativeX > 50 && relativeX < opts.width-50){
|
839
|
+
hoverAnimEnd(false);
|
840
|
+
hoverAnimEnd(true);
|
841
|
+
}else if(relativeX > opts.width-50){
|
842
|
+
hoverAnimStart(true);
|
843
|
+
}
|
844
|
+
}).bind('mouseout',function(){
|
845
|
+
hoverAnimEnd(false);
|
846
|
+
hoverAnimEnd(true);
|
847
|
+
});
|
848
|
+
|
849
|
+
}
|
850
|
+
}
|
851
|
+
|
852
|
+
function hoverAnimStart(inc){
|
853
|
+
if(inc){
|
854
|
+
if(!busy && !rhover &&!lhover && !p3drag && opts.curr+2 <= opts.pTotal-2){
|
855
|
+
//animate
|
856
|
+
p2.stop().animate({'width':opts.pWidth-40}, 500, opts.easing);
|
857
|
+
p3.addClass('b-grab');
|
858
|
+
if(opts.closed && opts.autoCenter && opts.curr == 0){
|
859
|
+
p3.stop().animate({'left':opts.pWidth-50, 'width':40}, 500, opts.easing);
|
860
|
+
}else{
|
861
|
+
p3.stop().animate({'left':opts.width-50, 'width':40}, 500, opts.easing);
|
862
|
+
}
|
863
|
+
p3wrap.stop().animate({'left':10}, 500, opts.easing);
|
864
|
+
if(opts.shadows && !$.support.opacity){
|
865
|
+
sF.css({'right':'auto','left':'-40%'});
|
866
|
+
}
|
867
|
+
rhover = true;
|
868
|
+
}
|
869
|
+
}else{
|
870
|
+
if(!busy && !lhover && !rhover && !p0drag && opts.curr-2 >= 0){
|
871
|
+
//animate
|
872
|
+
p1.stop().animate({left:10, width:opts.pWidth-10}, 400, opts.easing);
|
873
|
+
p0.addClass('b-grab');
|
874
|
+
p1wrap.stop().animate({left:"-10px"}, 400, opts.easing);
|
875
|
+
p0.stop().animate({left:10, width:40}, 400, opts.easing);
|
876
|
+
p0wrap.stop().animate({right:10}, 400, opts.easing);
|
877
|
+
if(opts.shadows && !$.support.opacity){
|
878
|
+
sB.css({'left':-0.38*opts.pWidth});
|
879
|
+
}
|
880
|
+
lhover = true;
|
881
|
+
}
|
882
|
+
}
|
883
|
+
}
|
884
|
+
|
885
|
+
function hoverAnimEnd(inc){
|
886
|
+
if(inc){
|
887
|
+
if(!busy && rhover && !p3drag && opts.curr+2 <= opts.pTotal-2){
|
888
|
+
p2.stop().animate({'width':opts.pWidth}, 500, opts.easing);
|
889
|
+
if(opts.closed && opts.autoCenter && opts.curr == 0){
|
890
|
+
p3.stop().animate({'left':opts.pWidth, 'width':0}, 500, opts.easing);
|
891
|
+
}else{
|
892
|
+
p3.stop().animate({'left':opts.width, 'width':0}, 500, opts.easing);
|
893
|
+
}
|
894
|
+
p3wrap.stop().animate({'left':0}, 500, opts.easing);
|
895
|
+
if(opts.shadows && !$.support.opacity){
|
896
|
+
sF.css({'left':'auto'});
|
897
|
+
}
|
898
|
+
rhover = false;
|
899
|
+
}
|
900
|
+
}else{
|
901
|
+
if(!busy && lhover && !p0drag && opts.curr-2 >= 0){
|
902
|
+
p1.stop().animate({left:0, width:opts.pWidth}, 400, opts.easing);
|
903
|
+
p1wrap.stop().animate({left:0}, 400, opts.easing);
|
904
|
+
p0.stop().animate({left:0, width:0}, 400, opts.easing);
|
905
|
+
p0wrap.stop().animate({right:0}, 400, opts.easing);
|
906
|
+
lhover = false;
|
907
|
+
}
|
908
|
+
}
|
909
|
+
}
|
910
|
+
|
911
|
+
function initAnim(diff, inc, shadow){
|
912
|
+
|
913
|
+
//setup content
|
914
|
+
if(inc && diff > 2){
|
915
|
+
b.find('.b-page-'+(p3.data('page')-1)).after(p3.detach());
|
916
|
+
b.find('.b-page-'+(p4.data('page')-1)).after(p4.detach());
|
917
|
+
|
918
|
+
b.find('.b-p3, .b-p4').removeClass('b-p3 b-p4').hide();
|
919
|
+
b.find('.b-page-'+opts.curr).addClass('b-p3').show().stop().css({'left':opts.pWidth*2, 'width':0, 'height':opts.pHeight, paddingLeft:0});
|
920
|
+
b.find('.b-page-'+(opts.curr+1)).addClass('b-p4').show().css({'left':opts.pWidth, 'width':opts.pWidth, 'height':opts.pHeight});
|
921
|
+
b.find('.b-page-'+opts.curr+' .b-wrap').show().css({'width':opts.pWidth-(opts.pagePadding*2), 'height':opts.pHeight-(opts.pagePadding*2), 'padding': opts.pagePadding});
|
922
|
+
b.find('.b-page-'+(opts.curr+1)+' .b-wrap').show().css({'width':opts.pWidth-(opts.pagePadding*2), 'height':opts.pHeight-(opts.pagePadding*2), 'padding': opts.pagePadding});
|
923
|
+
|
924
|
+
p3 = b.find('.b-p3');
|
925
|
+
p4 = b.find('.b-p4');
|
926
|
+
p3wrap = b.find('.b-p3 .b-wrap');
|
927
|
+
p4wrap = b.find('.b-p4 .b-wrap');
|
928
|
+
|
929
|
+
if(rhover){
|
930
|
+
p3.css({'left':opts.width-40, 'width':20, 'padding-left': 10});
|
931
|
+
}
|
932
|
+
|
933
|
+
p1.after(p4.detach());
|
934
|
+
p2.after(p3.detach());
|
935
|
+
|
936
|
+
if (opts.shadows) {
|
937
|
+
b.find('.b-shadow-f').remove();
|
938
|
+
sF = $('<div class="b-shadow-f"></div>').css({
|
939
|
+
'right': 0,
|
940
|
+
'width': opts.pWidth,
|
941
|
+
'height': opts.pHeight
|
942
|
+
}).appendTo(p3);
|
943
|
+
shadow = sF;
|
944
|
+
}
|
945
|
+
|
946
|
+
}else if(!inc && diff > 2){
|
947
|
+
|
948
|
+
b.find('.b-page-'+(pN.data('page')-1)).after(pN.detach());
|
949
|
+
b.find('.b-page-'+(p0.data('page')-1)).after(p0.detach());
|
950
|
+
|
951
|
+
b.find('.b-pN, .b-p0').removeClass('b-pN b-p0').hide();
|
952
|
+
b.find('.b-page-'+opts.curr).addClass('b-pN').show().css({'left':0, 'width':opts.pWidth, 'height':opts.pHeight});
|
953
|
+
b.find('.b-page-'+(opts.curr+1)).addClass('b-p0').show().css({'left':0, 'width':0, 'height':opts.pHeight});
|
954
|
+
b.find('.b-page-'+opts.curr+' .b-wrap').show().css({'width':opts.pWidth-(opts.pagePadding*2), 'height':opts.pHeight-(opts.pagePadding*2), 'padding': opts.pagePadding});
|
955
|
+
b.find('.b-page-'+(opts.curr+1)+' .b-wrap').show().css({'width':opts.pWidth-(opts.pagePadding*2), 'height':opts.pHeight-(opts.pagePadding*2), 'padding': opts.pagePadding});
|
956
|
+
|
957
|
+
pN = b.find('.b-pN');
|
958
|
+
p0 = b.find('.b-p0');
|
959
|
+
pNwrap = b.find('.b-pN .b-wrap');
|
960
|
+
p0wrap = b.find('.b-p0 .b-wrap');
|
961
|
+
|
962
|
+
if(lhover){
|
963
|
+
p0.css({left:10, width:40});
|
964
|
+
p0wrap.css({right:10});
|
965
|
+
}
|
966
|
+
|
967
|
+
p0.detach().appendTo(src);
|
968
|
+
|
969
|
+
if (opts.shadows) {
|
970
|
+
b.find('.b-shadow-b, .b-shadow-f').remove();
|
971
|
+
sB = $('<div class="b-shadow-b"></div>').appendTo(p0).css({
|
972
|
+
'left': 0,
|
973
|
+
'width': opts.pWidth,
|
974
|
+
'height': opts.pHeight
|
975
|
+
});
|
976
|
+
shadow = sB;
|
977
|
+
}
|
978
|
+
}
|
979
|
+
|
980
|
+
//update page visibility
|
981
|
+
//if moving to start and end of book
|
982
|
+
if(opts.closed){
|
983
|
+
if(!inc && opts.curr == 0){
|
984
|
+
pN.hide();
|
985
|
+
}else if(!inc){
|
986
|
+
pN.show();
|
987
|
+
}
|
988
|
+
if(inc && opts.curr >= opts.pTotal-2){
|
989
|
+
p4.hide();
|
990
|
+
}else if(inc){
|
991
|
+
p4.show();
|
992
|
+
}
|
993
|
+
}
|
994
|
+
|
995
|
+
//init shadows
|
996
|
+
if(opts.shadows){
|
997
|
+
//check for opacity support -> animate shadow overlay on moving slide
|
998
|
+
if($.support.opacity){
|
999
|
+
shadow.animate({opacity:1}, opts.speedH, opts.easeIn)
|
1000
|
+
.animate({opacity:0}, opts.speedH, opts.easeOut);
|
1001
|
+
}else{
|
1002
|
+
if(inc){
|
1003
|
+
shadow.animate({right:opts.shadowTopFwdWidth}, opts.speed, opts.easeIn);
|
1004
|
+
}else{
|
1005
|
+
shadow.animate({left:opts.shadowTopBackWidth}, opts.speed, opts.easeIn);
|
1006
|
+
}
|
1007
|
+
}
|
1008
|
+
}
|
1009
|
+
|
1010
|
+
//init position anim
|
1011
|
+
if(opts.closed && opts.autoCenter){
|
1012
|
+
if(opts.curr == 0){
|
1013
|
+
p3.hide();
|
1014
|
+
p4.hide();
|
1015
|
+
b.animate({width:opts.pWidth}, opts.speed, opts.easing);
|
1016
|
+
}else if(opts.curr >= opts.pTotal-2){
|
1017
|
+
p0.hide();
|
1018
|
+
pN.hide();
|
1019
|
+
b.animate({width:opts.pWidth}, opts.speed, opts.easing);
|
1020
|
+
}else{
|
1021
|
+
b.animate({width:opts.width}, opts.speed, opts.easing);
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
function updateAfter(){
|
1027
|
+
resetPages();
|
1028
|
+
updatePager();
|
1029
|
+
updateCtrls();
|
1030
|
+
opts.after.call(self, opts);
|
1031
|
+
busy = false;
|
1032
|
+
|
1033
|
+
//update auto play timer
|
1034
|
+
if(opts.auto && opts.delay){
|
1035
|
+
if(playing && opts.curr < opts.pTotal-2){
|
1036
|
+
clearTimeout(a);
|
1037
|
+
a = setTimeout(function(){self.next();},opts.delay);
|
1038
|
+
console.log("continue...");
|
1039
|
+
}
|
1040
|
+
if(opts.curr >= opts.pTotal-2){
|
1041
|
+
playing = false;
|
1042
|
+
}
|
1043
|
+
}
|
1044
|
+
}
|
1045
|
+
|
1046
|
+
function updateCtrls(){
|
1047
|
+
//update ctrls, cursors and visibility
|
1048
|
+
if(opts.overlays || opts.tabs || opts.arrows){
|
1049
|
+
if($.support.opacity){
|
1050
|
+
if(opts.curr < opts.pTotal-2){
|
1051
|
+
ctrlsN.fadeIn('fast').css('cursor',opts.cursor);
|
1052
|
+
}else{
|
1053
|
+
ctrlsN.fadeOut('fast').css('cursor','default');
|
1054
|
+
}
|
1055
|
+
if(opts.curr >= 2 && opts.curr != 0){
|
1056
|
+
ctrlsP.fadeIn('fast').css('cursor',opts.cursor);
|
1057
|
+
}else{
|
1058
|
+
ctrlsP.fadeOut('fast').css('cursor','default');
|
1059
|
+
}
|
1060
|
+
}else{
|
1061
|
+
if(opts.curr < opts.pTotal-2){
|
1062
|
+
ctrlsN.show().css('cursor',opts.cursor);
|
1063
|
+
}else{
|
1064
|
+
ctrlsN.hide().css('cursor','default');
|
1065
|
+
}
|
1066
|
+
if(opts.curr >= 2 && opts.curr != 0){
|
1067
|
+
ctrlsP.show().css('cursor',opts.cursor);
|
1068
|
+
}else{
|
1069
|
+
ctrlsP.hide().css('cursor','default');
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
function updatePager(){
|
1076
|
+
if(opts.pageSelector){
|
1077
|
+
if(opts.direction == 'RTL'){
|
1078
|
+
nums = (Math.abs(opts.curr - opts.pTotal)-1) +' - '+ ((Math.abs(opts.curr - opts.pTotal)));
|
1079
|
+
if(opts.closed){
|
1080
|
+
if(opts.curr==opts.pTotal-2){nums='1'}
|
1081
|
+
else if(opts.curr==0){nums=opts.pTotal-2}
|
1082
|
+
else{nums = (Math.abs(opts.curr - opts.pTotal)-2) +' - '+ ((Math.abs(opts.curr - opts.pTotal)-1));}
|
1083
|
+
|
1084
|
+
if(opts.covers){
|
1085
|
+
if(opts.curr==opts.pTotal-2){nums=''}
|
1086
|
+
else if(opts.curr==0){nums=''}
|
1087
|
+
else{nums = (Math.abs(opts.curr - opts.pTotal)-3) +' - '+ ((Math.abs(opts.curr - opts.pTotal)-2));}
|
1088
|
+
}
|
1089
|
+
}
|
1090
|
+
$(opts.menu+' .b-selector-page .b-current').text(nums);
|
1091
|
+
}else{
|
1092
|
+
nums = (opts.curr+1) +' - '+ (opts.curr+2);
|
1093
|
+
if(opts.closed){
|
1094
|
+
if(opts.curr==0){nums='1'}
|
1095
|
+
else if(opts.curr==opts.pTotal-2){nums=opts.pTotal-2}
|
1096
|
+
else {nums = (opts.curr) +'-'+ (opts.curr+1);}
|
1097
|
+
|
1098
|
+
if(opts.covers){
|
1099
|
+
if(opts.curr==0){nums=''}
|
1100
|
+
else if(opts.curr==opts.pTotal-2){nums=''}
|
1101
|
+
else {nums = (opts.curr-1) +'-'+ (opts.curr);}
|
1102
|
+
}
|
1103
|
+
}
|
1104
|
+
$(opts.menu+' .b-selector-page .b-current').text(nums);
|
1105
|
+
}
|
1106
|
+
}
|
1107
|
+
if(opts.chapterSelector){
|
1108
|
+
if(chapters[opts.curr]!=""){
|
1109
|
+
$(opts.menu+' .b-selector-chapter .b-current').text(chapters[opts.curr]);
|
1110
|
+
}else if(chapters[opts.curr+1]!=""){
|
1111
|
+
$(opts.menu+' .b-selector-chapter .b-current').text(chapters[opts.curr+1]);
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
if(opts.direction == 'RTL' && chapters[opts.curr+1]!=""){
|
1115
|
+
$(opts.menu+' .b-selector-chapter .b-current').text(chapters[opts.curr+1]);
|
1116
|
+
}else if(chapters[opts.curr]!=""){
|
1117
|
+
$(opts.menu+' .b-selector-chapter .b-current').text(chapters[opts.curr]);
|
1118
|
+
}
|
1119
|
+
}
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
function setupHash(){
|
1123
|
+
hash = getHashNum();
|
1124
|
+
|
1125
|
+
if(!isNaN(hash) && hash <= opts.pTotal-1 && hash >= 0 && hash != ''){
|
1126
|
+
if((hash % 2) != 0){
|
1127
|
+
hash--;
|
1128
|
+
}
|
1129
|
+
opts.curr = hash;
|
1130
|
+
}else{
|
1131
|
+
updateHash(opts.curr+1, opts);
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
self.hash = hash;
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
function pollHash(){
|
1138
|
+
hash = getHashNum();
|
1139
|
+
//check page num
|
1140
|
+
if(!isNaN(hash) && hash <= opts.pTotal-1 && hash >= 0){
|
1141
|
+
if(hash != opts.curr && hash.toString()!=self.hash){
|
1142
|
+
if((hash % 2) != 0){hash--};
|
1143
|
+
|
1144
|
+
document.title = opts.name + " - Page "+ (hash+1);
|
1145
|
+
|
1146
|
+
if(!busy){
|
1147
|
+
self.gotoPage(hash);
|
1148
|
+
self.hash = hash;
|
1149
|
+
}
|
1150
|
+
}
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
//get page number from hash tag, last element
|
1155
|
+
function getHashNum(){
|
1156
|
+
var hash = window.location.hash.split('/');
|
1157
|
+
if(hash.length > 1){
|
1158
|
+
return parseInt(hash[2])-1;
|
1159
|
+
}else{
|
1160
|
+
return '';
|
1161
|
+
}
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
//set the hash
|
1165
|
+
function updateHash(hash, opts){
|
1166
|
+
if(opts.hash){
|
1167
|
+
window.location.hash = "/page/" + hash;
|
1168
|
+
}
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
}
|
1172
|
+
|
1173
|
+
//define empty array to hold API references
|
1174
|
+
$.fn.booklet.interfaces = [];
|
1175
|
+
|
1176
|
+
//define default options
|
1177
|
+
$.fn.booklet.defaults = {
|
1178
|
+
name: null, // name of the booklet to display in the document title bar
|
1179
|
+
width: 600, // container width
|
1180
|
+
height: 400, // container height
|
1181
|
+
speed: 1000, // speed of the transition between pages
|
1182
|
+
direction: 'LTR', // direction of the overall content organization, default LTR, left to right, can be RTL for languages which read right to left
|
1183
|
+
startingPage: 0, // index of the first page to be displayed
|
1184
|
+
easing: 'easeInOutQuad', // easing method for complete transition
|
1185
|
+
easeIn: 'easeInQuad', // easing method for first half of transition
|
1186
|
+
easeOut: 'easeOutQuad', // easing method for second half of transition
|
1187
|
+
|
1188
|
+
closed: false, // start with the book "closed", will add empty pages to beginning and end of book
|
1189
|
+
closedFrontTitle: null, // used with "closed", "menu" and "pageSelector", determines title of blank starting page
|
1190
|
+
closedFrontChapter: null, // used with "closed", "menu" and "chapterSelector", determines chapter name of blank starting page
|
1191
|
+
closedBackTitle: null, // used with "closed", "menu" and "pageSelector", determines chapter name of blank ending page
|
1192
|
+
closedBackChapter: null, // used with "closed", "menu" and "chapterSelector", determines chapter name of blank ending page
|
1193
|
+
covers: false, // used with "closed", makes first and last pages into covers, without page numbers (if enabled)
|
1194
|
+
autoCenter: false, // used with "closed", makes book position in center of container when closed
|
1195
|
+
|
1196
|
+
pagePadding: 10, // padding for each page wrapper
|
1197
|
+
pageNumbers: true, // display page numbers on each page
|
1198
|
+
|
1199
|
+
manual: true, // enables manual page turning, requires jQuery UI to function
|
1200
|
+
|
1201
|
+
hovers: true, // enables preview pageturn hover animation, shows a small preview of previous or next page on hover
|
1202
|
+
overlays: true, // enables navigation using a page sized overlay, when enabled links inside the content will not be clickable
|
1203
|
+
tabs: false, // adds tabs along the top of the pages
|
1204
|
+
tabWidth: 60, // set the width of the tabs
|
1205
|
+
tabHeight: 20, // set the height of the tabs
|
1206
|
+
arrows: false, // adds arrows overlayed over the book edges
|
1207
|
+
arrowsHide: false, // auto hides arrows when controls are not hovered
|
1208
|
+
cursor: 'pointer', // cursor css setting for side bar areas
|
1209
|
+
|
1210
|
+
hash: false, // enables navigation using a hash string, ex: #/page/1 for page 1, will affect all booklets with 'hash' enabled
|
1211
|
+
keyboard: true, // enables navigation with arrow keys (left: previous, right: next)
|
1212
|
+
next: null, // selector for element to use as click trigger for next page
|
1213
|
+
prev: null, // selector for element to use as click trigger for previous page
|
1214
|
+
auto: false, // enables automatic navigation, requires "delay"
|
1215
|
+
delay: 5000, // amount of time between automatic page flipping
|
1216
|
+
pause: null, // selector for element to use as click trigger for pausing auto page flipping
|
1217
|
+
play: null, // selector for element to use as click trigger for restarting auto page flipping
|
1218
|
+
|
1219
|
+
menu: null, // selector for element to use as the menu area, required for 'pageSelector'
|
1220
|
+
pageSelector: false, // enables navigation with a dropdown menu of pages, requires 'menu'
|
1221
|
+
chapterSelector: false, // enables navigation with a dropdown menu of chapters, determined by the "rel" attribute, requires 'menu'
|
1222
|
+
|
1223
|
+
shadows: true, // display shadows on page animations
|
1224
|
+
shadowTopFwdWidth: 166, // shadow width for top forward anim
|
1225
|
+
shadowTopBackWidth: 166, // shadow width for top back anim
|
1226
|
+
shadowBtmWidth: 50, // shadow width for bottom shadow
|
1227
|
+
|
1228
|
+
before: function(){}, // callback invoked before each page turn animation
|
1229
|
+
after: function(){} // callback invoked after each page turn animation
|
1230
|
+
}
|
1231
|
+
|
1232
|
+
})(jQuery);
|