rsence 2.0.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +295 -0
- data/LICENSE +622 -0
- data/README.rdoc +24 -0
- data/VERSION +1 -0
- data/bin/build_client.rb +254 -0
- data/bin/help +6 -0
- data/bin/launch.rb +120 -0
- data/bin/rdoc.sh +2 -0
- data/bin/restart +6 -0
- data/bin/rsence +120 -0
- data/bin/run +6 -0
- data/bin/run.rb +6 -0
- data/bin/save +6 -0
- data/bin/start +6 -0
- data/bin/status +6 -0
- data/bin/stop +6 -0
- data/conf/config.ru +5 -0
- data/conf/default_conf.yaml +337 -0
- data/conf/default_strings.yaml +77 -0
- data/conf/local_conf.yaml +14 -0
- data/conf/unicorn.conf +78 -0
- data/js/comm/comm/autosync/autosync.js +18 -0
- data/js/comm/comm/autosync/js.inc +0 -0
- data/js/comm/comm/comm.js +195 -0
- data/js/comm/comm/js.inc +0 -0
- data/js/comm/comm/queue/js.inc +0 -0
- data/js/comm/comm/queue/queue.js +183 -0
- data/js/comm/comm/session/js.inc +0 -0
- data/js/comm/comm/session/session.js +51 -0
- data/js/comm/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/comm/sessionwatcher/sessionwatcher.js +43 -0
- data/js/comm/comm/transporter/js.inc +0 -0
- data/js/comm/comm/transporter/transporter.js +257 -0
- data/js/comm/comm/urlresponder/js.inc +0 -0
- data/js/comm/comm/urlresponder/urlresponder.js +148 -0
- data/js/comm/comm/values/js.inc +0 -0
- data/js/comm/comm/values/values.js +432 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/jsloader/jsloader.js +114 -0
- data/js/comm/reloadapp/js.inc +0 -0
- data/js/comm/reloadapp/reloadapp.js +150 -0
- data/js/comm/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
- data/js/comm/reloadapp/themes/default/reloadapp_warning.png +0 -0
- data/js/comm/sha/js.inc +0 -0
- data/js/comm/sha/sha.js +432 -0
- data/js/comm/values/value/js.inc +0 -0
- data/js/comm/values/value/value.js +182 -0
- data/js/comm/values/valuematrix/js.inc +0 -0
- data/js/comm/values/valuematrix/valuematrix.js +138 -0
- data/js/controls/button/button.js +57 -0
- data/js/controls/button/js.inc +0 -0
- data/js/controls/button/themes/bright/button.css +89 -0
- data/js/controls/button/themes/bright/button.html +7 -0
- data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
- data/js/controls/button/themes/bright/button_parts1.png +0 -0
- data/js/controls/button/themes/default/button.css +89 -0
- data/js/controls/button/themes/default/button.html +7 -0
- data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
- data/js/controls/button/themes/default/button_parts1.png +0 -0
- data/js/controls/checkbox/checkbox.js +47 -0
- data/js/controls/checkbox/js.inc +0 -0
- data/js/controls/checkbox/themes/default/checkbox.css +69 -0
- data/js/controls/checkbox/themes/default/checkbox.html +5 -0
- data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
- data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
- data/js/controls/datetime/calendar/calendar.js +197 -0
- data/js/controls/datetime/calendar/js.inc +0 -0
- data/js/controls/datetime/calendar/themes/default/calendar.css +108 -0
- data/js/controls/datetime/calendar/themes/default/calendar.html +9 -0
- data/js/controls/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
- data/js/controls/datetime/calendar/themes/default/calendar_arrows.png +0 -0
- data/js/controls/datetime/datetimevalue/datetimevalue.js +246 -0
- data/js/controls/datetime/datetimevalue/js.inc +0 -0
- data/js/controls/datetime/timesheet/js.inc +0 -0
- data/js/controls/datetime/timesheet/themes/default/timesheet.css +30 -0
- data/js/controls/datetime/timesheet/themes/default/timesheet.html +2 -0
- data/js/controls/datetime/timesheet/timesheet.js +182 -0
- data/js/controls/datetime/timesheet_item/js.inc +0 -0
- data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
- data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
- data/js/controls/datetime/timesheet_item/timesheet_item.js +247 -0
- data/js/controls/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
- data/js/controls/dialogs/alert_sheet/alert_sheet.js +62 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +36 -0
- data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/sheet.js +83 -0
- data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
- data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
- data/js/controls/imageview/imageview.js +108 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/imageview/themes/default/blank.gif +0 -0
- data/js/controls/lists/checkboxlist/checkboxlist.js +170 -0
- data/js/controls/lists/checkboxlist/js.inc +0 -0
- data/js/controls/lists/listitems/js.inc +0 -0
- data/js/controls/lists/listitems/listitems.js +65 -0
- data/js/controls/lists/radiobuttonlist/js.inc +0 -0
- data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +126 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/passwordcontrol/passwordcontrol.js +22 -0
- data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
- data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
- data/js/controls/progress/progressbar/js.inc +0 -0
- data/js/controls/progress/progressbar/progressbar.js +36 -0
- data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
- data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
- data/js/controls/progress/progressindicator/js.inc +0 -0
- data/js/controls/progress/progressindicator/progressindicator.js +43 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/radiobutton/radiobutton.js +41 -0
- data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
- data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
- data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
- data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
- data/js/controls/sliders/slider/js.inc +0 -0
- data/js/controls/sliders/slider/slider.js +356 -0
- data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
- data/js/controls/sliders/slider/themes/default/slider.css +108 -0
- data/js/controls/sliders/slider/themes/default/slider.html +5 -0
- data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
- data/js/controls/sliders/vslider/js.inc +0 -0
- data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
- data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
- data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
- data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
- data/js/controls/sliders/vslider/vslider.js +40 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stepper/stepper.js +212 -0
- data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
- data/js/controls/stepper/themes/default/stepper.css +14 -0
- data/js/controls/stepper/themes/default/stepper.html +2 -0
- data/js/controls/stepper/themes/default/stepper.png +0 -0
- data/js/controls/stringview/js.inc +0 -0
- data/js/controls/stringview/stringview.js +49 -0
- data/js/controls/stringview/themes/default/stringview.css +8 -0
- data/js/controls/stringview/themes/default/stringview.html +1 -0
- data/js/controls/tab/js.inc +0 -0
- data/js/controls/tab/tab.js +276 -0
- data/js/controls/tab/themes/bright/tab.css +76 -0
- data/js/controls/tab/themes/bright/tab.html +6 -0
- data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
- data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
- data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
- data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
- data/js/controls/tab/themes/default/tab.css +77 -0
- data/js/controls/tab/themes/default/tab.html +6 -0
- data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
- data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
- data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_parts1.png +0 -0
- data/js/controls/textarea/js.inc +0 -0
- data/js/controls/textarea/textarea.js +23 -0
- data/js/controls/textarea/themes/default/textarea.css +21 -0
- data/js/controls/textarea/themes/default/textarea.html +18 -0
- data/js/controls/textcontrol/js.inc +0 -0
- data/js/controls/textcontrol/textcontrol.js +372 -0
- data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
- data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
- data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
- data/js/controls/uploader/js.inc +0 -0
- data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
- data/js/controls/uploader/themes/default/uploader.css +108 -0
- data/js/controls/uploader/themes/default/uploader.html +27 -0
- data/js/controls/uploader/uploader.js +153 -0
- data/js/controls/validatorview/js.inc +0 -0
- data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
- data/js/controls/validatorview/themes/default/validator.png +0 -0
- data/js/controls/validatorview/themes/default/validatorview.css +0 -0
- data/js/controls/validatorview/themes/default/validatorview.html +0 -0
- data/js/controls/validatorview/validatorview.js +55 -0
- data/js/controls/window/js.inc +0 -0
- data/js/controls/window/themes/default/window.css +219 -0
- data/js/controls/window/themes/default/window.html +17 -0
- data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_bg_active.png +0 -0
- data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
- data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_buttons.png +0 -0
- data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts1.png +0 -0
- data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts2.png +0 -0
- data/js/controls/window/window.js +284 -0
- data/js/core/class/class.js +317 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +1376 -0
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/event.js +1021 -0
- data/js/core/event/js.inc +0 -0
- data/js/core/iefix/ie_css_element.htc +5 -0
- data/js/core/iefix/ie_css_style.htc +5 -0
- data/js/core/iefix/iefix.js +359 -0
- data/js/core/iefix/js.inc +0 -0
- data/js/debugg/debugg.js +43 -0
- data/js/debugg/js.inc +0 -0
- data/js/foundation/application/application.js +209 -0
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/control.js +342 -0
- data/js/foundation/control/controldefaults/controldefaults.js +59 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/dummyvalue.js +50 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/dyncontrol.js +494 -0
- data/js/foundation/control/dyncontrol/js.inc +0 -0
- data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
- data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
- data/js/foundation/control/eventresponder/eventresponder.js +713 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/control/valueresponder/valueresponder.js +77 -0
- data/js/foundation/geom/point/js.inc +0 -0
- data/js/foundation/geom/point/point.js +202 -0
- data/js/foundation/geom/rect/js.inc +0 -0
- data/js/foundation/geom/rect/rect.js +610 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/json_renderer/json_renderer.js +231 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/system/system.js +369 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/thememanager/thememanager.js +387 -0
- data/js/foundation/view/js.inc +0 -0
- data/js/foundation/view/markupview/js.inc +0 -0
- data/js/foundation/view/markupview/markupview.js +113 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/morphanimation/morphanimation.js +236 -0
- data/js/foundation/view/view.js +1804 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/foundation/view/viewdefaults/viewdefaults.js +25 -0
- data/js/views/centerview/centerview.js +45 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/inlineview.js +14 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/js/views/scrollview/scrollview.js +39 -0
- data/lib/conf/default.rb +220 -0
- data/lib/conf/wizard.rb +303 -0
- data/lib/daemon/daemon.rb +293 -0
- data/lib/http/broker.rb +102 -0
- data/lib/http/rackup.rb +88 -0
- data/lib/http/request.rb +69 -0
- data/lib/http/response.rb +63 -0
- data/lib/plugins/gui_plugin.rb +129 -0
- data/lib/plugins/guiparser.rb +114 -0
- data/lib/plugins/plugin.rb +652 -0
- data/lib/plugins/plugin_plugins.rb +47 -0
- data/lib/plugins/plugin_sqlite_db.rb +72 -0
- data/lib/plugins/plugin_util.rb +96 -0
- data/lib/plugins/pluginmanager.rb +517 -0
- data/lib/plugins/servlet.rb +69 -0
- data/lib/session/msg.rb +291 -0
- data/lib/session/sessionmanager.rb +491 -0
- data/lib/session/sessionstorage.rb +314 -0
- data/lib/transporter/transporter.rb +254 -0
- data/lib/util/gzstring.rb +5 -0
- data/lib/values/hvalue.rb +323 -0
- data/lib/values/valuemanager.rb +152 -0
- data/plugins/client_pkg/client_pkg.rb +186 -0
- data/plugins/client_pkg/info.yaml +25 -0
- data/plugins/client_pkg/lib/client_pkg_build.rb +569 -0
- data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
- data/plugins/client_pkg/lib/client_pkg_serve.rb +210 -0
- data/plugins/client_pkg/log/build_log +0 -0
- data/plugins/index_html/img/loading.gif +0 -0
- data/plugins/index_html/img/riassence.gif +0 -0
- data/plugins/index_html/index_html.rb +150 -0
- data/plugins/index_html/tmpl/index.html +22 -0
- data/plugins/index_html/tmpl/startup_index.html +29 -0
- data/plugins/legacy/disabled +0 -0
- data/plugins/legacy/disabled- +0 -0
- data/plugins/legacy/info.yaml +22 -0
- data/plugins/legacy/legacy.rb +15 -0
- data/plugins/main/js/riassence_ns.js +87 -0
- data/plugins/main/main.rb +234 -0
- data/plugins/main/values.yaml +8 -0
- data/plugins/ticketservices/lib/common.rb +300 -0
- data/plugins/ticketservices/lib/favicon.rb +38 -0
- data/plugins/ticketservices/lib/file.rb +58 -0
- data/plugins/ticketservices/lib/img.rb +50 -0
- data/plugins/ticketservices/lib/objblob.rb +66 -0
- data/plugins/ticketservices/lib/rsrc.rb +34 -0
- data/plugins/ticketservices/lib/upload.rb +206 -0
- data/plugins/ticketservices/ticketservices.rb +268 -0
- data/var/db/.git_include +0 -0
- data/var/log/.git_include +0 -0
- data/var/run/.git_include +0 -0
- metadata +390 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
:plugin_paths:
|
3
|
+
- demos
|
4
|
+
:http_server:
|
5
|
+
:latency: 0
|
6
|
+
:rack_handler:
|
7
|
+
:rack_require: mongrel
|
8
|
+
:bind_address: 0.0.0.0
|
9
|
+
:port: 8001
|
10
|
+
:database:
|
11
|
+
:ses_db: sqlite://var/db/rsence_ses.db
|
12
|
+
:client_pkg:
|
13
|
+
:no_obfuscation: true
|
14
|
+
:no_whitespace_removal: true
|
data/conf/unicorn.conf
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Sample configuration file for Unicorn (not Rack)
|
2
|
+
#
|
3
|
+
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
|
4
|
+
# documentation.
|
5
|
+
|
6
|
+
# Use at least one worker per core if you're on a dedicated server,
|
7
|
+
# more will usually help for _short_ waits on databases/caches.
|
8
|
+
worker_processes 1
|
9
|
+
|
10
|
+
# Help ensure your application will always spawn in the symlinked
|
11
|
+
# "current" directory that Capistrano sets up.
|
12
|
+
# working_directory "/path/to/app/current" # available in 0.94.0+
|
13
|
+
|
14
|
+
# listen on both a Unix domain socket and a TCP port,
|
15
|
+
# we use a shorter backlog for quicker failover when busy
|
16
|
+
# listen "/tmp/.sock", :backlog => 64
|
17
|
+
# listen 8080, :tcp_nopush => true
|
18
|
+
|
19
|
+
# nuke workers after 30 seconds instead of 60 seconds (the default)
|
20
|
+
timeout 9999
|
21
|
+
|
22
|
+
# feel free to point this anywhere accessible on the filesystem
|
23
|
+
#pid "/path/to/app/shared/pids/unicorn.pid"
|
24
|
+
|
25
|
+
# some applications/frameworks log to stderr or stdout, so prevent
|
26
|
+
# them from going to /dev/null when daemonized here:
|
27
|
+
#stderr_path "/path/to/app/shared/log/unicorn.stderr.log"
|
28
|
+
#stdout_path "/path/to/app/shared/log/unicorn.stdout.log"
|
29
|
+
|
30
|
+
# combine REE with "preload_app true" for memory savings
|
31
|
+
# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
|
32
|
+
preload_app true
|
33
|
+
GC.respond_to?(:copy_on_write_friendly=) and
|
34
|
+
GC.copy_on_write_friendly = true
|
35
|
+
|
36
|
+
# before_fork do |server, worker|
|
37
|
+
# # the following is highly recomended for Rails + "preload_app true"
|
38
|
+
# # as there's no need for the master process to hold a connection
|
39
|
+
# defined?(ActiveRecord::Base) and
|
40
|
+
# ActiveRecord::Base.connection.disconnect!
|
41
|
+
#
|
42
|
+
# # The following is only recommended for memory/DB-constrained
|
43
|
+
# # installations. It is not needed if your system can house
|
44
|
+
# # twice as many worker_processes as you have configured.
|
45
|
+
# #
|
46
|
+
# # # This allows a new master process to incrementally
|
47
|
+
# # # phase out the old master process with SIGTTOU to avoid a
|
48
|
+
# # # thundering herd (especially in the "preload_app false" case)
|
49
|
+
# # # when doing a transparent upgrade. The last worker spawned
|
50
|
+
# # # will then kill off the old master process with a SIGQUIT.
|
51
|
+
# # old_pid = "#{server.config[:pid]}.oldbin"
|
52
|
+
# # if old_pid != server.pid
|
53
|
+
# # begin
|
54
|
+
# # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
|
55
|
+
# # Process.kill(sig, File.read(old_pid).to_i)
|
56
|
+
# # rescue Errno::ENOENT, Errno::ESRCH
|
57
|
+
# # end
|
58
|
+
# # end
|
59
|
+
# #
|
60
|
+
# # # *optionally* throttle the master from forking too quickly by sleeping
|
61
|
+
# # sleep 1
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# after_fork do |server, worker|
|
65
|
+
# # per-process listener ports for debugging/admin/migrations
|
66
|
+
# # addr = "127.0.0.1:#{9293 + worker.nr}"
|
67
|
+
# # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
|
68
|
+
#
|
69
|
+
# # the following is *required* for Rails + "preload_app true",
|
70
|
+
# defined?(ActiveRecord::Base) and
|
71
|
+
# ActiveRecord::Base.establish_connection
|
72
|
+
#
|
73
|
+
# # if preload_app is true, then you may also want to check and
|
74
|
+
# # restart any other shared sockets/descriptors such as Memcached,
|
75
|
+
# # and Redis. TokyoCabinet file handles are safe to reuse
|
76
|
+
# # between any number of forked children (assuming your kernel
|
77
|
+
# # correctly implements pread()/pwrite() system calls)
|
78
|
+
# end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/* Riassence Framework
|
2
|
+
* Copyright 2009 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
// Starts the synchronization upon page load.
|
10
|
+
LOAD(
|
11
|
+
function(){
|
12
|
+
COMM.urlResponder=COMM.URLResponder.nu();
|
13
|
+
urlResponder=COMM.urlResponder; // backwards compatibility
|
14
|
+
COMM.Transporter.url=HCLIENT_HELLO;
|
15
|
+
COMM.Transporter.stop=false;
|
16
|
+
COMM.Transporter.sync();
|
17
|
+
}
|
18
|
+
);
|
File without changes
|
@@ -0,0 +1,195 @@
|
|
1
|
+
/* Riassence Framework
|
2
|
+
* Copyright 2009 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
|
10
|
+
/*** = Description
|
11
|
+
** XMLHttpRequest abstractor, and handler and utilities.
|
12
|
+
** The only public method is +request+
|
13
|
+
** The namespace also holds the following services:
|
14
|
+
**
|
15
|
+
** Service Name:: Service Description
|
16
|
+
** +COMM.Queue+:: Singleton, used for queuing tasks
|
17
|
+
** awaiting asynchronous requests to complete.
|
18
|
+
** +COMM.Session+:: Session key secure hashing service.
|
19
|
+
** +COMM.SessionWatcher+:: Polls server at regular intervals by reporting
|
20
|
+
** the client's local time.
|
21
|
+
** +COMM.Transporter+:: Automated synchronization service, pulls server
|
22
|
+
** data, tasks etc. The main server interface.
|
23
|
+
** +COMM.Values+:: Data value manager, handles synchronized data in
|
24
|
+
** both directions (server-client-server).
|
25
|
+
** +COMM.JSLoader+:: Loads Javascript libraries asynchronously.
|
26
|
+
** +COMM.JSONRenderer+:: Constructs nodes from JSON structures as GUI
|
27
|
+
** tree structures. Lowers the learning curve of GUI
|
28
|
+
** development, because Javascript knowledge is not
|
29
|
+
** required to define user interfaces.
|
30
|
+
** The main purpose is to ease the development of
|
31
|
+
** user interfaces by defining them as data on the
|
32
|
+
** server, converting the data to JSON GUI trees and
|
33
|
+
** letting the client handle the rest. The end result
|
34
|
+
** is the same as defining the structures in
|
35
|
+
** JavaScript code.
|
36
|
+
**
|
37
|
+
***/
|
38
|
+
COMM = {
|
39
|
+
|
40
|
+
/** Displays an error alert, if the browser doesn't support XMLHttpRequests
|
41
|
+
**/
|
42
|
+
_FakeHttpRequest: function(){
|
43
|
+
alert("'ERROR: This web browser doesn't support XMLHttpRequest. Please upgrade; unable to continue.");
|
44
|
+
},
|
45
|
+
|
46
|
+
/** = Description
|
47
|
+
* Finds and calls the state responder method upon a readyState change to 4.
|
48
|
+
* - On readyStates other than 4 does nothing.
|
49
|
+
* - The default responder for a successful response code (between 200 to 299) is onSuccess.
|
50
|
+
* - The default responder for unsuccessful response codes is onFailure.
|
51
|
+
* - The responders are called with the request object as the parameter.
|
52
|
+
* - Custom response code handling is implemented as 'on' + status code,
|
53
|
+
* eg. 'on404' for a 404 not found error.
|
54
|
+
**/
|
55
|
+
_stateChange: function(_this){
|
56
|
+
if(_this.X.readyState === 4){
|
57
|
+
var _status = _this.X.status,
|
58
|
+
_responderName = 'on'+_status,
|
59
|
+
_success = ((_status >= 200 && _status < 300) || (_status === 0));
|
60
|
+
_this[_responderName]?_this[_responderName](_this):_success?_this.onSuccess(_this):_this.onFailure(_this);
|
61
|
+
}
|
62
|
+
},
|
63
|
+
|
64
|
+
/** = Description
|
65
|
+
* Converts arrays to valid query strings.
|
66
|
+
*
|
67
|
+
* = Usage
|
68
|
+
* Returns 'productId=100&customerName=J-J%20Heinonen'
|
69
|
+
* COMM._arrayToQueryString(['productId',100,'customerName','J-J Heinonen'])
|
70
|
+
*
|
71
|
+
**/
|
72
|
+
_arrayToQueryString: function(_params){
|
73
|
+
var i = 0,
|
74
|
+
_length = _params.length,
|
75
|
+
_queryString = '';
|
76
|
+
for(;i<_length;i++){
|
77
|
+
_queryString += encodeURIComponent(_params[i]);
|
78
|
+
_queryString += (i===_length-1)?'':(i%2===0)?'=':'&';
|
79
|
+
}
|
80
|
+
return _queryString;
|
81
|
+
},
|
82
|
+
|
83
|
+
/** = Description
|
84
|
+
* The main Request-handling object. Provides a general and fairly easy to use
|
85
|
+
* interface for making "Ajax" requests.
|
86
|
+
*
|
87
|
+
* = Parameters
|
88
|
+
* +_url+:: Full or relative url of the response handler
|
89
|
+
* +_options+:: An +Object+, see below for content:
|
90
|
+
*
|
91
|
+
*
|
92
|
+
* == Required properties for +_options+:
|
93
|
+
* +onSuccess+:: A function that is called on a successful response.
|
94
|
+
* Must accept one parameter: the request object.
|
95
|
+
* +onFailure+:: A function that is called on an unsuccessful response.
|
96
|
+
* Must accept one parameter: the request object.
|
97
|
+
*
|
98
|
+
* == Optional properties for +_options+:
|
99
|
+
* +method+:: The HTTP Request Method, usually 'POST' or 'GET', but will handle
|
100
|
+
* DAV and other extensions if the server supports them.
|
101
|
+
* Defaults to 'POST'.
|
102
|
+
* +async+:: Boolean; Uses asyncronous requests when true.
|
103
|
+
* Defaults to true.
|
104
|
+
* +params+:: Extra parameters to send, format: Array, see COMM._arrayToQueryString()
|
105
|
+
* +headers+:: Extra HTTP headers to send for POST requests, format: Hash.
|
106
|
+
* +body+:: The HTTP POST Body
|
107
|
+
* +username+:: Username for basic authentication
|
108
|
+
* +password+:: Password for basic authentication
|
109
|
+
* +contentType+:: The 'content-type' -header to send.
|
110
|
+
* Defaults to 'application/x-www-form-urlencoded'.
|
111
|
+
* +charset+:: The charset type to use. Defaults to 'UTF-8'.
|
112
|
+
*
|
113
|
+
* = Returns
|
114
|
+
* An +Object+ extended from the +_options+ given in the input.
|
115
|
+
*
|
116
|
+
**/
|
117
|
+
request: function(_url,_options){
|
118
|
+
var _comm = COMM,
|
119
|
+
|
120
|
+
_this = _options?_options:{},
|
121
|
+
|
122
|
+
_method = _options.method?_options.method.toUpperCase():'GET',
|
123
|
+
_async = (_options.async===undefined)?true:_options.async,
|
124
|
+
_params = _options.params?_options.params:[],
|
125
|
+
_headers = _options.headers?_options.headers:{},
|
126
|
+
_contentType = _options.contentType?_options.contentType:'application/x-www-form-urlencoded',
|
127
|
+
_charset = _options.charset?_options.charset:'UTF-8',
|
128
|
+
_username = _options.username?_options.username:null,
|
129
|
+
_password = _options.username?_options.password:null;
|
130
|
+
if(!_options.onFailure){
|
131
|
+
_this.onFailure = function(resp){console.log('No failure handler specified, response: ',resp);};
|
132
|
+
}
|
133
|
+
if(!_options.onSuccess){
|
134
|
+
_this.onSuccess = function(resp){console.log('No success handler specified, response: ',resp);};
|
135
|
+
}
|
136
|
+
_this.url = _url;
|
137
|
+
_this.options = _options;
|
138
|
+
_this.X = _comm._XMLHttpRequest();
|
139
|
+
if(_method === 'GET' && _params.length !== 0){
|
140
|
+
_url += ((_url.indexOf('?')!==-1)?'&':'?')+_comm._arrayToQueryString(_params);
|
141
|
+
}
|
142
|
+
if(!_async){
|
143
|
+
console.log("WARNING: Synchronous "+_method+" request to "+_url+", these will fail on the Symbian web browser.");
|
144
|
+
}
|
145
|
+
_this.X.open(
|
146
|
+
_method,
|
147
|
+
_url,
|
148
|
+
_async,
|
149
|
+
_username,
|
150
|
+
_password
|
151
|
+
);
|
152
|
+
_this.X.onreadystatechange = function(){
|
153
|
+
_comm._stateChange(_this);
|
154
|
+
};
|
155
|
+
if(_method === 'POST'){
|
156
|
+
_headers['Content-Type'] = _contentType + '; charset=' + _charset;
|
157
|
+
var _body = _options.body?_options.body:'';
|
158
|
+
for(var _header in _headers){
|
159
|
+
_this.X.setRequestHeader(_header,_headers[_header]);
|
160
|
+
}
|
161
|
+
_this.X.send(_body);
|
162
|
+
}
|
163
|
+
else if(_method === 'GET'){
|
164
|
+
_this.X.send(null);
|
165
|
+
}
|
166
|
+
if(!_async){
|
167
|
+
_comm._stateChange(_this);
|
168
|
+
}
|
169
|
+
return _this;
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
/** = Description
|
174
|
+
* Creates a new instance of the XMLHttpRequest
|
175
|
+
* object supported by the browser. Evaluated only once,
|
176
|
+
* after that does its things without any extra statements
|
177
|
+
*
|
178
|
+
**/
|
179
|
+
if(window['XMLHttpRequest']!==undefined){
|
180
|
+
COMM._XMLHttpRequest = function(){
|
181
|
+
return new XMLHttpRequest();
|
182
|
+
};
|
183
|
+
}
|
184
|
+
else if(BROWSER_TYPE.ie){
|
185
|
+
COMM._XMLHttpRequest = function(){
|
186
|
+
return new ActiveXObject("Msxml2.XMLHTTP");
|
187
|
+
};
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
COMM._XMLHttpRequest = function(){
|
191
|
+
console.log("No XMLHttpRequest object types known. Can't Communicate.");
|
192
|
+
return new COMM._FakeHttpRequst();
|
193
|
+
};
|
194
|
+
}
|
195
|
+
|
data/js/comm/comm/js.inc
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,183 @@
|
|
1
|
+
/* Riassence Framework
|
2
|
+
* Copyright 2009 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
/*** = Description
|
10
|
+
** COMM.Queue executes javascript blocks in a managed queue.
|
11
|
+
**
|
12
|
+
** COMM.Queue is used by COMM.Transporter and JSLoader to continue
|
13
|
+
** javascript command execution after a XMLHttpRequest finishes.
|
14
|
+
**
|
15
|
+
** COMM.Queue runs as a single instance, dan't try to reconstruct it.
|
16
|
+
***/
|
17
|
+
COMM.Queue = HApplication.extend({
|
18
|
+
|
19
|
+
/** The constructor takes no arguments and starts queue flushing automatically.
|
20
|
+
**/
|
21
|
+
constructor: function(){
|
22
|
+
|
23
|
+
// The queue itself, is packed with anonymous functions
|
24
|
+
this.commandQueue = [];
|
25
|
+
|
26
|
+
// Flag to signal the pause and resume status.
|
27
|
+
this.paused = false;
|
28
|
+
|
29
|
+
// Run with priority 10; not too demanding but not too sluggish either
|
30
|
+
this.base(10);
|
31
|
+
},
|
32
|
+
|
33
|
+
/** Checks periodically, if the queue needs flushing.
|
34
|
+
**/
|
35
|
+
onIdle: function(){
|
36
|
+
// Runs the flush operation, if the queue is not
|
37
|
+
// empty and the state is not resumed:
|
38
|
+
!this.paused && this.commandQueue.length !== 0 && this.flush();
|
39
|
+
},
|
40
|
+
|
41
|
+
/** = Description
|
42
|
+
* Pauses the queue.
|
43
|
+
*
|
44
|
+
* Use to stop execution, if some data or code needs to be loaded that the
|
45
|
+
* rest of the queue depends on.
|
46
|
+
* Typically called before an +XMLHttpRequest+ with the +onSuccess+
|
47
|
+
* event defined to call +resume+ when the request is done.
|
48
|
+
*
|
49
|
+
**/
|
50
|
+
pause: function(){
|
51
|
+
this.paused = true;
|
52
|
+
},
|
53
|
+
|
54
|
+
/** = Description
|
55
|
+
* Resumes queue flushing.
|
56
|
+
*
|
57
|
+
* Use to resume execuption, when some depending code for the rest
|
58
|
+
* of the queue has been loaded.
|
59
|
+
* Typically on an +XMLHttpRequest+ +onSuccess+ event.
|
60
|
+
*
|
61
|
+
**/
|
62
|
+
resume: function(){
|
63
|
+
this.paused = false;
|
64
|
+
this.flush();
|
65
|
+
},
|
66
|
+
|
67
|
+
/** A Group of localizable strings; errors and warnings.
|
68
|
+
**/
|
69
|
+
STRINGS: {
|
70
|
+
ERR: 'COMM.Queue Error: ',
|
71
|
+
JS_EXEC_FAIL: 'Failed to execute the Javascript function: ',
|
72
|
+
REASON: ' Reason:'
|
73
|
+
},
|
74
|
+
|
75
|
+
/** = Description
|
76
|
+
* Flushes the queue until stopped.
|
77
|
+
*
|
78
|
+
* Iterates through the +commandQueue+ and calls each function.
|
79
|
+
* Removes items from the queue after execution.
|
80
|
+
*
|
81
|
+
**/
|
82
|
+
flush: function(){
|
83
|
+
var i = 0, // current index in the for-loop.
|
84
|
+
_item, // the current item to execute
|
85
|
+
_function, // the function to run
|
86
|
+
_arguments, // the arguments of the function
|
87
|
+
_len = this.commandQueue.length; // the length of the queue
|
88
|
+
|
89
|
+
// Iterates through the items.
|
90
|
+
for(;i<_len;i++){
|
91
|
+
|
92
|
+
// Checks that the queue hasn't been paused.
|
93
|
+
if(this.paused){
|
94
|
+
break; // stops flushing, if paused.
|
95
|
+
}
|
96
|
+
|
97
|
+
// The first item in the queue is removed from the queue.
|
98
|
+
_item = this.commandQueue.shift();
|
99
|
+
|
100
|
+
// Execute the item, with arugments if the item
|
101
|
+
try{
|
102
|
+
if(typeof _item === 'function'){
|
103
|
+
_item.call();
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
_function = _item[0];
|
107
|
+
_arguments = _item[1];
|
108
|
+
_function.apply(this,_arguments);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// Displays an error message in the Javascript console, if failure.
|
113
|
+
catch(e){
|
114
|
+
var _strs = this.STRINGS;
|
115
|
+
console.log([
|
116
|
+
_strs.ERR_PREFIX,
|
117
|
+
_strs.JS_EXEC_FAIL,
|
118
|
+
_item,
|
119
|
+
_strs.REASON,
|
120
|
+
e.description
|
121
|
+
].join(''));
|
122
|
+
}
|
123
|
+
}
|
124
|
+
},
|
125
|
+
|
126
|
+
/** = Description
|
127
|
+
* Adds an item to the beginning of the queue.
|
128
|
+
*
|
129
|
+
* Use to make the given +_function+ with its
|
130
|
+
* optional +_arguments+ the next item to flush.
|
131
|
+
*
|
132
|
+
* = Parameters:
|
133
|
+
* +_function+:: An anonymous function. Contains the code to execute.
|
134
|
+
*
|
135
|
+
* +_arguments+:: _Optional_ arguments to pass on to the +_function+
|
136
|
+
**/
|
137
|
+
unshift: function(_function,_arguments){
|
138
|
+
if(_arguments!==undefined){
|
139
|
+
this.commandQueue.unshift([_function,_arguments]);
|
140
|
+
}
|
141
|
+
else {
|
142
|
+
this.commandQueue.unshift(_function);
|
143
|
+
}
|
144
|
+
},
|
145
|
+
|
146
|
+
/** = Description
|
147
|
+
* Adds an item to the end of the queue.
|
148
|
+
*
|
149
|
+
* Use to make the given +_function+ with its
|
150
|
+
* optional +_arguments+ the last item to flush.
|
151
|
+
*
|
152
|
+
* = Parameters:
|
153
|
+
* +_function+:: An anonymous function. Contains the code to execute.
|
154
|
+
*
|
155
|
+
* +_arguments+:: _Optional_ arguments to pass on to the +_function+
|
156
|
+
**/
|
157
|
+
push: function(_function,_arguments){
|
158
|
+
if(_arguments!==undefined){
|
159
|
+
this.commandQueue.push([_function,_arguments]);
|
160
|
+
}
|
161
|
+
else {
|
162
|
+
this.commandQueue.push(_function);
|
163
|
+
}
|
164
|
+
},
|
165
|
+
|
166
|
+
/** Like +unshift+, but uses the code block as a string to be
|
167
|
+
* passed on as an evaluated anonymous function.
|
168
|
+
**/
|
169
|
+
unshiftEval: function(_evalStr,_arguments){
|
170
|
+
var _function;
|
171
|
+
eval('_function = function(){'+_evalStr+'}');
|
172
|
+
this.unshift(_function);
|
173
|
+
},
|
174
|
+
|
175
|
+
/** Like +push+, but uses the code block as a string to be
|
176
|
+
* passed on as an evaluated anonymous function.
|
177
|
+
**/
|
178
|
+
pushEval: function(_evalStr){
|
179
|
+
var _function;
|
180
|
+
eval('_function = function(){'+_evalStr+'}');
|
181
|
+
this.push(_function);
|
182
|
+
}
|
183
|
+
}).nu();
|