wee 0.10.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +127 -0
- data/Rakefile +11 -32
- data/doc/rdoc/classes/Array.html +28 -24
- data/doc/rdoc/classes/Hash.html +28 -24
- data/doc/rdoc/classes/Object.html +37 -84
- data/doc/rdoc/classes/String.html +89 -21
- data/doc/rdoc/classes/Struct.html +32 -82
- data/doc/rdoc/classes/Wee.html +285 -86
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +111 -48
- data/doc/rdoc/classes/Wee/{Context.html → AnswerDecoration/Answer.html} +61 -51
- data/doc/rdoc/classes/Wee/Application.html +161 -322
- data/doc/rdoc/classes/Wee/Application/SessionCache.html +162 -0
- data/doc/rdoc/classes/Wee/Brush.html +147 -62
- data/doc/rdoc/classes/{Enumerable.html → Wee/Brush/ActionInputTag.html} +68 -41
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +150 -100
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +132 -46
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +63 -41
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +184 -78
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +48 -65
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +83 -37
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +334 -310
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +74 -54
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +64 -74
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +109 -86
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +205 -45
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +96 -34
- data/doc/rdoc/classes/Wee/Brush/Page.html +129 -67
- data/doc/rdoc/classes/Wee/{Utils/LRUCache.html → Brush/PasswordInputTag.html} +65 -38
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +132 -78
- data/doc/rdoc/classes/Wee/Brush/{RadioButtonTag/RadioGroup.html → RadioGroup.html} +91 -53
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +301 -127
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +59 -44
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +94 -57
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +181 -121
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +94 -32
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +257 -71
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/CallAnswerMixin.html +289 -0
- data/doc/rdoc/classes/Wee/CallbackMixin.html +233 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +179 -155
- data/doc/rdoc/classes/Wee/Callbacks.html +262 -0
- data/doc/rdoc/classes/Wee/Component.html +228 -779
- data/doc/rdoc/classes/Wee/Decoration.html +144 -159
- data/doc/rdoc/classes/Wee/DecorationMixin.html +340 -0
- data/doc/rdoc/classes/Wee/Delegate.html +119 -76
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +64 -47
- data/doc/rdoc/classes/Wee/ErrorResponse.html +59 -62
- data/doc/rdoc/classes/Wee/FormDecoration.html +51 -37
- data/doc/rdoc/classes/Wee/GenericResponse.html +60 -35
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +1000 -602
- data/doc/rdoc/classes/Wee/HtmlDocument.html +288 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +227 -126
- data/doc/rdoc/classes/Wee/IdGenerator.html +60 -31
- data/doc/rdoc/classes/Wee/IdGenerator/Secure.html +282 -0
- data/doc/rdoc/classes/Wee/{SimpleIdGenerator.html → IdGenerator/Sequential.html} +76 -49
- data/doc/rdoc/classes/Wee/JQuery.html +221 -0
- data/doc/rdoc/classes/Wee/LRUCache.html +514 -0
- data/doc/rdoc/classes/Wee/LRUCache/Item.html +158 -0
- data/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +187 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +88 -59
- data/doc/rdoc/classes/Wee/Presenter.html +124 -704
- data/doc/rdoc/classes/Wee/RedirectResponse.html +64 -33
- data/doc/rdoc/classes/Wee/RefreshResponse.html +59 -44
- data/doc/rdoc/classes/Wee/Renderer.html +234 -54
- data/doc/rdoc/classes/Wee/Request.html +151 -286
- data/doc/rdoc/classes/Wee/Response.html +29 -212
- data/doc/rdoc/classes/Wee/Session.html +585 -360
- data/doc/rdoc/classes/Wee/{StateHolder.html → Session/AbortCallbackProcessing.html} +67 -40
- data/doc/rdoc/classes/Wee/Session/MutexSerializer.html +166 -0
- data/doc/rdoc/classes/{Cache/Strategy/LFU/Item.html → Wee/Session/Page.html} +26 -27
- data/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +219 -0
- data/doc/rdoc/classes/Wee/State.html +307 -0
- data/doc/rdoc/classes/{Cache/Strategy/LRU/Item.html → Wee/State/Snapshot.html} +26 -27
- data/doc/rdoc/classes/{Cache/Strategy/Unbounded/Item.html → Wee/State/SnapshotIVars.html} +26 -27
- data/doc/rdoc/classes/Wee/StructSnapshotMixin.html +183 -0
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +101 -35
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README_rdoc.html +243 -0
- data/doc/rdoc/files/lib/wee/application_rb.html +22 -30
- data/doc/rdoc/files/lib/wee/{page_rb.html → call_answer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/callback_rb.html +12 -29
- data/doc/rdoc/files/lib/wee/component_rb.html +22 -27
- data/doc/rdoc/files/lib/wee/decoration_rb.html +19 -20
- data/doc/rdoc/files/lib/wee/{idgen_rb.html → html_brushes_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/html_canvas_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{abstractsession_rb.html → html_document_rb.html} +17 -25
- data/doc/rdoc/files/lib/wee/html_writer_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{webrick_rb.html → id_generator_rb.html} +19 -25
- data/doc/rdoc/files/lib/wee/{core/page_rb.html → jquery/jquery_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/{state_registry_rb.html → jquery_rb.html} +17 -27
- data/doc/rdoc/files/lib/{cache/cache_rb.html → wee/lru_cache_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/presenter_rb.html +12 -34
- data/doc/rdoc/files/lib/wee/{holder_rb.html → renderer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/request_rb.html +18 -32
- data/doc/rdoc/files/lib/wee/response_rb.html +17 -24
- data/doc/rdoc/files/lib/wee/session_rb.html +21 -23
- data/doc/rdoc/files/lib/wee/state_rb.html +90 -0
- data/doc/rdoc/files/lib/wee_rb.html +48 -40
- data/doc/rdoc/fr_class_index.html +111 -75
- data/doc/rdoc/fr_file_index.html +46 -76
- data/doc/rdoc/fr_method_index.html +473 -480
- data/doc/rdoc/index.html +6 -9
- data/doc/rdoc/rdoc-style.css +210 -119
- data/examples/ObjectSpaceBrowser.rb +33 -23
- data/examples/ajax.rb +71 -0
- data/examples/continuations.rb +28 -0
- data/examples/demo.rb +92 -36
- data/examples/demo/calculator.rb +63 -0
- data/examples/demo/calendar.rb +42 -55
- data/examples/demo/counter.rb +38 -0
- data/{lib/wee/examples → examples/demo}/editable_counter.rb +11 -6
- data/examples/demo/example.rb +28 -24
- data/examples/demo/file_upload.rb +19 -0
- data/{lib/wee/components → examples/demo}/messagebox.rb +3 -3
- data/examples/demo/radio.rb +33 -0
- data/{lib/wee/examples → examples/demo}/window.rb +15 -10
- data/examples/hw.rb +3 -4
- data/{lib/wee/components → examples}/pager.rb +14 -14
- data/lib/wee.rb +48 -25
- data/lib/wee/application.rb +69 -131
- data/lib/wee/call_answer.rb +118 -0
- data/lib/wee/callback.rb +88 -0
- data/lib/wee/component.rb +141 -0
- data/lib/wee/decoration.rb +242 -0
- data/lib/wee/html_brushes.rb +725 -0
- data/lib/wee/html_canvas.rb +241 -0
- data/lib/wee/html_document.rb +45 -0
- data/lib/wee/html_writer.rb +71 -0
- data/lib/wee/id_generator.rb +70 -0
- data/lib/wee/jquery.rb +1 -0
- data/lib/wee/jquery/jquery.rb +17 -0
- data/lib/wee/jquery/public/jquery-1.3.2.min.js +19 -0
- data/lib/wee/jquery/public/wee-jquery.js +19 -0
- data/lib/wee/lru_cache.rb +89 -0
- data/lib/wee/presenter.rb +43 -0
- data/lib/wee/renderer.rb +65 -0
- data/lib/wee/request.rb +37 -113
- data/lib/wee/response.rb +43 -70
- data/lib/wee/session.rb +304 -113
- data/lib/wee/state.rb +85 -0
- data/test/component_spec.rb +17 -0
- data/wee.gemspec +4 -3
- metadata +249 -452
- data/ChangeLog +0 -657
- data/INSTALL +0 -17
- data/README +0 -272
- data/TODO +0 -142
- data/benchmark/Centrino1300/result.2000.counter.action +0 -45
- data/benchmark/Centrino1300/result.2000.counter.render +0 -43
- data/benchmark/Centrino1300/result.2000.filehandler +0 -43
- data/benchmark/Centrino600/result.2000.counter.action +0 -47
- data/benchmark/Centrino600/result.2000.counter.render +0 -45
- data/benchmark/Centrino600/result.2000.filehandler +0 -43
- data/benchmark/Makefile +0 -53
- data/benchmark/counter.rb +0 -77
- data/benchmark/filehandler.rb +0 -6
- data/benchmark/report_req.rb +0 -12
- data/bin/wee +0 -100
- data/doc/rdoc/classes/ActionView.html +0 -107
- data/doc/rdoc/classes/ActionView/Base.html +0 -133
- data/doc/rdoc/classes/Cache.html +0 -126
- data/doc/rdoc/classes/Cache/StorageCache.html +0 -320
- data/doc/rdoc/classes/Cache/Strategy.html +0 -128
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +0 -269
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +0 -225
- data/doc/rdoc/classes/LiteralMethod.html +0 -196
- data/doc/rdoc/classes/Main.html +0 -289
- data/doc/rdoc/classes/OgApplication.html +0 -126
- data/doc/rdoc/classes/OgScaffolder.html +0 -827
- data/doc/rdoc/classes/OgScaffolder/Editor.html +0 -565
- data/doc/rdoc/classes/OgSession.html +0 -172
- data/doc/rdoc/classes/Recipe.html +0 -113
- data/doc/rdoc/classes/Wee/AbstractSession.html +0 -502
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/ActionMixin.html +0 -146
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +0 -154
- data/doc/rdoc/classes/Wee/Brush/AssignMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/CallbackMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +0 -158
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +0 -146
- data/doc/rdoc/classes/Wee/Callback.html +0 -231
- data/doc/rdoc/classes/Wee/CallbackStream.html +0 -227
- data/doc/rdoc/classes/Wee/Canvas.html +0 -235
- data/doc/rdoc/classes/Wee/CanvasMixin.html +0 -225
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +0 -153
- data/doc/rdoc/classes/Wee/ComponentDispatcher.html +0 -289
- data/doc/rdoc/classes/Wee/ComponentRunner.html +0 -321
- data/doc/rdoc/classes/Wee/ErrorPage.html +0 -175
- data/doc/rdoc/classes/Wee/Examples.html +0 -114
- data/doc/rdoc/classes/Wee/Examples/Calculator.html +0 -319
- data/doc/rdoc/classes/Wee/Examples/Counter.html +0 -289
- data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +0 -210
- data/doc/rdoc/classes/Wee/Examples/Window.html +0 -346
- data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +0 -227
- data/doc/rdoc/classes/Wee/Helper.html +0 -148
- data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +0 -1230
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +0 -198
- data/doc/rdoc/classes/Wee/LoginDecoration.html +0 -261
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +0 -181
- data/doc/rdoc/classes/Wee/MessageBox.html +0 -180
- data/doc/rdoc/classes/Wee/MethodCallback.html +0 -193
- data/doc/rdoc/classes/Wee/Nitro.html +0 -114
- data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +0 -345
- data/doc/rdoc/classes/Wee/Nitro/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +0 -178
- data/doc/rdoc/classes/Wee/Page.html +0 -115
- data/doc/rdoc/classes/Wee/PagelessApplication.html +0 -154
- data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +0 -296
- data/doc/rdoc/classes/Wee/PagelessRequest.html +0 -208
- data/doc/rdoc/classes/Wee/PagelessSession.html +0 -359
- data/doc/rdoc/classes/Wee/Pager.html +0 -534
- data/doc/rdoc/classes/Wee/Rails.html +0 -114
- data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +0 -342
- data/doc/rdoc/classes/Wee/Rails/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +0 -177
- data/doc/rdoc/classes/Wee/RenderingContext.html +0 -283
- data/doc/rdoc/classes/Wee/RequestHandler.html +0 -341
- data/doc/rdoc/classes/Wee/Snapshot.html +0 -211
- data/doc/rdoc/classes/Wee/StateRegistry.html +0 -434
- data/doc/rdoc/classes/Wee/StateRegistry/Snapshot.html +0 -320
- data/doc/rdoc/classes/Wee/StateRegistry/WithObject.html +0 -153
- data/doc/rdoc/classes/Wee/Utils.html +0 -300
- data/doc/rdoc/classes/Wee/ValueHolder.html +0 -220
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +0 -368
- data/doc/rdoc/files/INSTALL.html +0 -130
- data/doc/rdoc/files/README.html +0 -471
- data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/component_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/pager_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/continuation_rb.html +0 -116
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/core/component_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/core/componentrunner_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +0 -133
- data/doc/rdoc/files/lib/wee/core/idgen_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +0 -112
- data/doc/rdoc/files/lib/wee/core/renderer_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +0 -113
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core_rb.html +0 -124
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/examples/counter_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/examples/window_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +0 -109
- data/doc/rdoc/files/lib/wee/pageless_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/rendering/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/snapshot_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/stuff_rb.html +0 -144
- data/doc/rdoc/files/lib/wee/template_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils_rb.html +0 -110
- data/examples/ajax/ajax.js +0 -444
- data/examples/ajax/ajax.rb +0 -31
- data/examples/cc.rb +0 -74
- data/examples/dispatcher.rb +0 -37
- data/examples/draw.rb +0 -94
- data/examples/live-update.rb +0 -45
- data/examples/nitro/run.rb +0 -42
- data/examples/og-test.rb +0 -60
- data/examples/radio.rb +0 -44
- data/examples/test.rb +0 -39
- data/install.rb +0 -14
- data/lib/cache/cache.rb +0 -167
- data/lib/wee/abstractsession.rb +0 -96
- data/lib/wee/adaptors/fastcgi.rb +0 -76
- data/lib/wee/adaptors/nitro.rb +0 -155
- data/lib/wee/adaptors/rails.rb +0 -154
- data/lib/wee/adaptors/webrick.rb +0 -89
- data/lib/wee/components.rb +0 -7
- data/lib/wee/components/component_dispatcher.rb +0 -46
- data/lib/wee/components/form_decoration.rb +0 -7
- data/lib/wee/components/login_decoration.rb +0 -35
- data/lib/wee/components/page_decoration.rb +0 -14
- data/lib/wee/components/wrapper_decoration.rb +0 -7
- data/lib/wee/continuation.rb +0 -5
- data/lib/wee/continuation/core/component.rb +0 -56
- data/lib/wee/continuation/session.rb +0 -64
- data/lib/wee/core.rb +0 -16
- data/lib/wee/core/callback.rb +0 -121
- data/lib/wee/core/component.rb +0 -356
- data/lib/wee/core/componentrunner.rb +0 -73
- data/lib/wee/core/context.rb +0 -27
- data/lib/wee/core/decoration.rb +0 -138
- data/lib/wee/core/idgen.rb +0 -5
- data/lib/wee/core/page.rb +0 -1
- data/lib/wee/core/presenter.rb +0 -100
- data/lib/wee/core/renderer.rb +0 -23
- data/lib/wee/core/snapshot.rb +0 -21
- data/lib/wee/core/valueholder.rb +0 -19
- data/lib/wee/core_ext.rb +0 -122
- data/lib/wee/databases/og.rb +0 -4
- data/lib/wee/databases/og/application.rb +0 -3
- data/lib/wee/databases/og/old_scaffolder.rb +0 -98
- data/lib/wee/databases/og/scaffolder.rb +0 -255
- data/lib/wee/databases/og/session.rb +0 -9
- data/lib/wee/examples/calculator.rb +0 -70
- data/lib/wee/examples/counter.rb +0 -33
- data/lib/wee/idgen/md5.rb +0 -21
- data/lib/wee/idgen/sequential.rb +0 -11
- data/lib/wee/pageless.rb +0 -3
- data/lib/wee/pageless/application.rb +0 -13
- data/lib/wee/pageless/request.rb +0 -27
- data/lib/wee/pageless/session.rb +0 -74
- data/lib/wee/renderer/html/brushes.rb +0 -667
- data/lib/wee/renderer/html/canvas.rb +0 -265
- data/lib/wee/renderer/html/writer.rb +0 -80
- data/lib/wee/requesthandler.rb +0 -81
- data/lib/wee/skeleton/og/README +0 -38
- data/lib/wee/skeleton/og/components/main.rb +0 -20
- data/lib/wee/skeleton/og/conf/db.rb +0 -8
- data/lib/wee/skeleton/og/models/recipe.rb +0 -5
- data/lib/wee/skeleton/og/run.rb +0 -23
- data/lib/wee/skeleton/simple/README +0 -32
- data/lib/wee/skeleton/simple/components/main.rb +0 -25
- data/lib/wee/skeleton/simple/run.rb +0 -12
- data/lib/wee/snapshot_ext.rb +0 -41
- data/lib/wee/template.rb +0 -42
- data/lib/wee/utils.rb +0 -5
- data/lib/wee/utils/autoreload.rb +0 -56
- data/lib/wee/utils/cache.rb +0 -7
- data/lib/wee/utils/helper.rb +0 -51
@@ -1,101 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: helper.rb</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>helper.rb</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>lib/wee/utils/helper.rb
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Mon Jul 11 23:54:41 CEST 2005</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
</div>
|
74
|
-
|
75
|
-
|
76
|
-
</div>
|
77
|
-
|
78
|
-
|
79
|
-
<!-- if includes -->
|
80
|
-
|
81
|
-
<div id="section">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
<!-- if method_list -->
|
91
|
-
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
|
96
|
-
<div id="validator-badges">
|
97
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
</body>
|
101
|
-
</html>
|
@@ -1,110 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: utils.rb</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>utils.rb</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>lib/wee/utils.rb
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Mon Jul 11 23:54:42 CEST 2005</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
|
72
|
-
<div id="requires-list">
|
73
|
-
<h3 class="section-bar">Required files</h3>
|
74
|
-
|
75
|
-
<div class="name-list">
|
76
|
-
wee/utils/autoreload
|
77
|
-
wee/utils/cache
|
78
|
-
wee/utils/helper
|
79
|
-
</div>
|
80
|
-
</div>
|
81
|
-
|
82
|
-
</div>
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
|
88
|
-
<!-- if includes -->
|
89
|
-
|
90
|
-
<div id="section">
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<!-- if method_list -->
|
100
|
-
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
|
105
|
-
<div id="validator-badges">
|
106
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
107
|
-
</div>
|
108
|
-
|
109
|
-
</body>
|
110
|
-
</html>
|
data/examples/ajax/ajax.js
DELETED
@@ -1,444 +0,0 @@
|
|
1
|
-
/* Prototype: an object-oriented Javascript library, version 1.1.0
|
2
|
-
* (c) 2005 Sam Stephenson <sam@conio.net>
|
3
|
-
*
|
4
|
-
* Prototype is freely distributable under the terms of an MIT-style license.
|
5
|
-
* For details, see http://prototype.conio.net/
|
6
|
-
*
|
7
|
-
* Changes by Michael Neumann.
|
8
|
-
*/
|
9
|
-
|
10
|
-
var Prototype = {
|
11
|
-
Version: '1.1.0'
|
12
|
-
}
|
13
|
-
|
14
|
-
var Class = {
|
15
|
-
create: function() {
|
16
|
-
return function() {
|
17
|
-
this.initialize.apply(this, arguments);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
var Abstract = new Object();
|
23
|
-
|
24
|
-
Object.prototype.extend = function(object) {
|
25
|
-
for (property in object) {
|
26
|
-
this[property] = object[property];
|
27
|
-
}
|
28
|
-
return this;
|
29
|
-
}
|
30
|
-
|
31
|
-
Function.prototype.bind = function(object) {
|
32
|
-
var method = this;
|
33
|
-
return function() {
|
34
|
-
method.apply(object, arguments);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
Function.prototype.bindAsEventListener = function(object) {
|
39
|
-
var method = this;
|
40
|
-
return function(event) {
|
41
|
-
method.call(object, event || window.event);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
Number.prototype.toColorPart = function() {
|
46
|
-
var digits = this.toString(16);
|
47
|
-
if (this < 16) return '0' + digits;
|
48
|
-
return digits;
|
49
|
-
}
|
50
|
-
|
51
|
-
var Try = {
|
52
|
-
these: function() {
|
53
|
-
var returnValue;
|
54
|
-
|
55
|
-
for (var i = 0; i < arguments.length; i++) {
|
56
|
-
var lambda = arguments[i];
|
57
|
-
try {
|
58
|
-
returnValue = lambda();
|
59
|
-
break;
|
60
|
-
} catch (e) {}
|
61
|
-
}
|
62
|
-
|
63
|
-
return returnValue;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
var Toggle = {
|
68
|
-
display: function() {
|
69
|
-
for (var i = 0; i < arguments.length; i++) {
|
70
|
-
var element = $(arguments[i]);
|
71
|
-
element.style.display =
|
72
|
-
(element.style.display == 'none' ? '' : 'none');
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
/*--------------------------------------------------------------------------*/
|
78
|
-
|
79
|
-
function $() {
|
80
|
-
var elements = new Array();
|
81
|
-
|
82
|
-
for (var i = 0; i < arguments.length; i++) {
|
83
|
-
var element = arguments[i];
|
84
|
-
if (typeof element == 'string')
|
85
|
-
element = document.getElementById(element);
|
86
|
-
|
87
|
-
if (arguments.length == 1)
|
88
|
-
return element;
|
89
|
-
|
90
|
-
elements.push(element);
|
91
|
-
}
|
92
|
-
|
93
|
-
return elements;
|
94
|
-
}
|
95
|
-
|
96
|
-
function getElementsByClassName(className) {
|
97
|
-
var children = document.getElementsByTagName('*') || document.all;
|
98
|
-
var elements = new Array();
|
99
|
-
|
100
|
-
for (var i = 0; i < children.length; i++) {
|
101
|
-
var child = children[i];
|
102
|
-
var classNames = child.className.split(' ');
|
103
|
-
for (var j = 0; j < classNames.length; j++) {
|
104
|
-
if (classNames[j] == className) {
|
105
|
-
elements.push(child);
|
106
|
-
break;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
return elements;
|
112
|
-
}
|
113
|
-
var Ajax = {
|
114
|
-
getTransport: function() {
|
115
|
-
return Try.these(
|
116
|
-
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
117
|
-
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
|
118
|
-
function() {return new XMLHttpRequest()}
|
119
|
-
) || false;
|
120
|
-
},
|
121
|
-
|
122
|
-
emptyFunction: function() {}
|
123
|
-
}
|
124
|
-
|
125
|
-
Ajax.Base = function() {};
|
126
|
-
Ajax.Base.prototype = {
|
127
|
-
setOptions: function(options) {
|
128
|
-
this.options = {
|
129
|
-
method: 'post',
|
130
|
-
asynchronous: true,
|
131
|
-
parameters: ''
|
132
|
-
}.extend(options || {});
|
133
|
-
}
|
134
|
-
}
|
135
|
-
|
136
|
-
Ajax.Request = Class.create();
|
137
|
-
Ajax.Request.Events =
|
138
|
-
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
139
|
-
|
140
|
-
Ajax.Request.prototype = (new Ajax.Base()).extend({
|
141
|
-
initialize: function(url, options) {
|
142
|
-
this.transport = Ajax.getTransport();
|
143
|
-
this.setOptions(options);
|
144
|
-
|
145
|
-
try {
|
146
|
-
/*if (this.options.method == 'get')
|
147
|
-
url += '?' + this.options.parameters; */
|
148
|
-
|
149
|
-
this.transport.open(this.options.method, url, true);
|
150
|
-
|
151
|
-
if (this.options.asynchronous) {
|
152
|
-
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
153
|
-
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
|
154
|
-
}
|
155
|
-
|
156
|
-
if (this.options.method == 'post') {
|
157
|
-
this.transport.setRequestHeader('Connection', 'close');
|
158
|
-
this.transport.setRequestHeader('Content-type',
|
159
|
-
'application/x-www-form-urlencoded');
|
160
|
-
}
|
161
|
-
|
162
|
-
this.transport.send(this.options.method == 'post' ?
|
163
|
-
this.options.parameters : null);
|
164
|
-
|
165
|
-
} catch (e) {
|
166
|
-
}
|
167
|
-
},
|
168
|
-
|
169
|
-
onStateChange: function() {
|
170
|
-
var readyState = this.transport.readyState;
|
171
|
-
if (readyState != 1)
|
172
|
-
this.respondToReadyState(this.transport.readyState);
|
173
|
-
},
|
174
|
-
|
175
|
-
respondToReadyState: function(readyState) {
|
176
|
-
var event = Ajax.Request.Events[readyState];
|
177
|
-
(this.options['on' + event] || Ajax.emptyFunction)(this.transport);
|
178
|
-
}
|
179
|
-
});
|
180
|
-
|
181
|
-
Ajax.Updater = Class.create();
|
182
|
-
Ajax.Updater.prototype = (new Ajax.Base()).extend({
|
183
|
-
initialize: function(container, url, options) {
|
184
|
-
this.container = $(container);
|
185
|
-
this.setOptions(options);
|
186
|
-
|
187
|
-
if (this.options.asynchronous) {
|
188
|
-
this.onComplete = this.options.onComplete;
|
189
|
-
this.options.onComplete = this.updateContent.bind(this);
|
190
|
-
}
|
191
|
-
|
192
|
-
this.request = new Ajax.Request(url, this.options);
|
193
|
-
|
194
|
-
if (!this.options.asynchronous)
|
195
|
-
this.updateContent();
|
196
|
-
},
|
197
|
-
|
198
|
-
updateContent: function() {
|
199
|
-
if (this.options.insertion) {
|
200
|
-
new this.options.insertion(this.container,
|
201
|
-
this.request.transport.responseText);
|
202
|
-
} else {
|
203
|
-
this.container.innerHTML = this.request.transport.responseText;
|
204
|
-
}
|
205
|
-
|
206
|
-
if (this.onComplete) {
|
207
|
-
setTimeout((function() {this.onComplete(this.request)}).bind(this), 10);
|
208
|
-
}
|
209
|
-
}
|
210
|
-
});
|
211
|
-
var Field = {
|
212
|
-
clear: function() {
|
213
|
-
for (var i = 0; i < arguments.length; i++)
|
214
|
-
$(arguments[i]).value = '';
|
215
|
-
},
|
216
|
-
|
217
|
-
focus: function(element) {
|
218
|
-
$(element).focus();
|
219
|
-
},
|
220
|
-
|
221
|
-
present: function() {
|
222
|
-
for (var i = 0; i < arguments.length; i++)
|
223
|
-
if ($(arguments[i]).value == '') return false;
|
224
|
-
return true;
|
225
|
-
}
|
226
|
-
}
|
227
|
-
|
228
|
-
/*--------------------------------------------------------------------------*/
|
229
|
-
|
230
|
-
var Form = {
|
231
|
-
serialize: function(form) {
|
232
|
-
var elements = Form.getElements($(form));
|
233
|
-
var queryComponents = new Array();
|
234
|
-
|
235
|
-
for (var i = 0; i < elements.length; i++) {
|
236
|
-
var queryComponent = Form.Element.serialize(elements[i]);
|
237
|
-
if (queryComponent)
|
238
|
-
queryComponents.push(queryComponent);
|
239
|
-
}
|
240
|
-
|
241
|
-
return queryComponents.join('&');
|
242
|
-
},
|
243
|
-
|
244
|
-
getElements: function(form) {
|
245
|
-
form = $(form);
|
246
|
-
var elements = new Array();
|
247
|
-
|
248
|
-
for (tagName in Form.Element.Serializers) {
|
249
|
-
var tagElements = form.getElementsByTagName(tagName);
|
250
|
-
for (var j = 0; j < tagElements.length; j++)
|
251
|
-
elements.push(tagElements[j]);
|
252
|
-
}
|
253
|
-
return elements;
|
254
|
-
}
|
255
|
-
}
|
256
|
-
|
257
|
-
Form.Element = {
|
258
|
-
serialize: function(element) {
|
259
|
-
element = $(element);
|
260
|
-
var method = element.tagName.toLowerCase();
|
261
|
-
var parameter = Form.Element.Serializers[method](element);
|
262
|
-
|
263
|
-
if (parameter)
|
264
|
-
return encodeURIComponent(parameter[0]) + '=' +
|
265
|
-
encodeURIComponent(parameter[1]);
|
266
|
-
},
|
267
|
-
|
268
|
-
getValue: function(element) {
|
269
|
-
element = $(element);
|
270
|
-
var method = element.tagName.toLowerCase();
|
271
|
-
var parameter = Form.Element.Serializers[method](element);
|
272
|
-
|
273
|
-
if (parameter)
|
274
|
-
return parameter[1];
|
275
|
-
}
|
276
|
-
}
|
277
|
-
|
278
|
-
Form.Element.Serializers = {
|
279
|
-
input: function(element) {
|
280
|
-
switch (element.type.toLowerCase()) {
|
281
|
-
case 'hidden':
|
282
|
-
case 'password':
|
283
|
-
case 'text':
|
284
|
-
return Form.Element.Serializers.textarea(element);
|
285
|
-
case 'checkbox':
|
286
|
-
case 'radio':
|
287
|
-
return Form.Element.Serializers.inputSelector(element);
|
288
|
-
}
|
289
|
-
return false;
|
290
|
-
},
|
291
|
-
|
292
|
-
inputSelector: function(element) {
|
293
|
-
if (element.checked)
|
294
|
-
return [element.name, element.value];
|
295
|
-
},
|
296
|
-
|
297
|
-
textarea: function(element) {
|
298
|
-
return [element.name, element.value];
|
299
|
-
},
|
300
|
-
|
301
|
-
select: function(element) {
|
302
|
-
var index = element.selectedIndex;
|
303
|
-
return [element.name, (index >= 0) ? element.options[index].value : ''];
|
304
|
-
}
|
305
|
-
}
|
306
|
-
|
307
|
-
/*--------------------------------------------------------------------------*/
|
308
|
-
|
309
|
-
Abstract.TimedObserver = function() {}
|
310
|
-
Abstract.TimedObserver.prototype = {
|
311
|
-
initialize: function(element, frequency, callback) {
|
312
|
-
this.frequency = frequency;
|
313
|
-
this.element = $(element);
|
314
|
-
this.callback = callback;
|
315
|
-
|
316
|
-
this.lastValue = this.getValue();
|
317
|
-
this.registerCallback();
|
318
|
-
},
|
319
|
-
|
320
|
-
registerCallback: function() {
|
321
|
-
setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000);
|
322
|
-
},
|
323
|
-
|
324
|
-
onTimerEvent: function() {
|
325
|
-
var value = this.getValue();
|
326
|
-
if (this.lastValue != value) {
|
327
|
-
this.callback(this.element, value);
|
328
|
-
this.lastValue = value;
|
329
|
-
}
|
330
|
-
|
331
|
-
this.registerCallback();
|
332
|
-
}
|
333
|
-
}
|
334
|
-
|
335
|
-
Form.Element.Observer = Class.create();
|
336
|
-
Form.Element.Observer.prototype = (new Abstract.TimedObserver()).extend({
|
337
|
-
getValue: function() {
|
338
|
-
return Form.Element.getValue(this.element);
|
339
|
-
}
|
340
|
-
});
|
341
|
-
|
342
|
-
Form.Observer = Class.create();
|
343
|
-
Form.Observer.prototype = (new Abstract.TimedObserver()).extend({
|
344
|
-
getValue: function() {
|
345
|
-
return Form.serialize(this.element);
|
346
|
-
}
|
347
|
-
});
|
348
|
-
|
349
|
-
Abstract.Insertion = function(adjacency) {
|
350
|
-
this.adjacency = adjacency;
|
351
|
-
}
|
352
|
-
|
353
|
-
Abstract.Insertion.prototype = {
|
354
|
-
initialize: function(element, content) {
|
355
|
-
this.element = $(element);
|
356
|
-
this.content = content;
|
357
|
-
|
358
|
-
if (this.adjacency && this.element.insertAdjacentHTML) {
|
359
|
-
this.element.insertAdjacentHTML(this.adjacency, this.content);
|
360
|
-
} else {
|
361
|
-
this.range = this.element.ownerDocument.createRange();
|
362
|
-
if (this.initializeRange) this.initializeRange();
|
363
|
-
this.fragment = this.range.createContextualFragment(this.content);
|
364
|
-
this.insertContent();
|
365
|
-
}
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
var Insertion = new Object();
|
370
|
-
|
371
|
-
Insertion.Before = Class.create();
|
372
|
-
Insertion.Before.prototype = (new Abstract.Insertion('beforeBegin')).extend({
|
373
|
-
initializeRange: function() {
|
374
|
-
this.range.setStartBefore(this.element);
|
375
|
-
},
|
376
|
-
|
377
|
-
insertContent: function() {
|
378
|
-
this.element.parentNode.insertBefore(this.fragment, this.element);
|
379
|
-
}
|
380
|
-
});
|
381
|
-
|
382
|
-
Insertion.Top = Class.create();
|
383
|
-
Insertion.Top.prototype = (new Abstract.Insertion('afterBegin')).extend({
|
384
|
-
initializeRange: function() {
|
385
|
-
this.range.selectNodeContents(this.element);
|
386
|
-
this.range.collapse(true);
|
387
|
-
},
|
388
|
-
|
389
|
-
insertContent: function() {
|
390
|
-
this.element.insertBefore(this.fragment, this.element.firstChild);
|
391
|
-
}
|
392
|
-
});
|
393
|
-
|
394
|
-
Insertion.Bottom = Class.create();
|
395
|
-
Insertion.Bottom.prototype = (new Abstract.Insertion('beforeEnd')).extend({
|
396
|
-
initializeRange: function() {
|
397
|
-
this.range.selectNodeContents(this.element);
|
398
|
-
this.range.collapse(this.element);
|
399
|
-
},
|
400
|
-
|
401
|
-
insertContent: function() {
|
402
|
-
this.element.appendChild(this.fragment);
|
403
|
-
}
|
404
|
-
});
|
405
|
-
|
406
|
-
Insertion.After = Class.create();
|
407
|
-
Insertion.After.prototype = (new Abstract.Insertion('afterEnd')).extend({
|
408
|
-
initializeRange: function() {
|
409
|
-
this.range.setStartAfter(this.element);
|
410
|
-
},
|
411
|
-
|
412
|
-
insertContent: function() {
|
413
|
-
this.element.parentNode.insertBefore(this.fragment,
|
414
|
-
this.element.nextSibling);
|
415
|
-
}
|
416
|
-
});
|
417
|
-
var Effect = new Object();
|
418
|
-
|
419
|
-
Effect.Highlight = Class.create();
|
420
|
-
Effect.Highlight.prototype = {
|
421
|
-
initialize: function(element) {
|
422
|
-
this.element = $(element);
|
423
|
-
this.start = 153;
|
424
|
-
this.finish = 255;
|
425
|
-
this.current = this.start;
|
426
|
-
this.fade();
|
427
|
-
},
|
428
|
-
|
429
|
-
fade: function() {
|
430
|
-
if (this.isFinished()) return;
|
431
|
-
if (this.timer) clearTimeout(this.timer);
|
432
|
-
this.highlight(this.element, this.current);
|
433
|
-
this.current += 17;
|
434
|
-
this.timer = setTimeout(this.fade.bind(this), 250);
|
435
|
-
},
|
436
|
-
|
437
|
-
isFinished: function() {
|
438
|
-
return this.current > this.finish;
|
439
|
-
},
|
440
|
-
|
441
|
-
highlight: function(element, current) {
|
442
|
-
element.style.backgroundColor = "#ffff" + current.toColorPart();
|
443
|
-
}
|
444
|
-
}
|