diff options
author | Teravus Ovares | 2009-01-03 03:30:03 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-01-03 03:30:03 +0000 |
commit | e9cef70f892bfbf4aad0e4471a958367766d849a (patch) | |
tree | 397e078977b430526a2f04041e0dfb9a5fb99156 /bin/data/updater.js | |
parent | Split agent updates into two messages: full update and position+camera update... (diff) | |
download | opensim-SC_OLD-e9cef70f892bfbf4aad0e4471a958367766d849a.zip opensim-SC_OLD-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.gz opensim-SC_OLD-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.bz2 opensim-SC_OLD-e9cef70f892bfbf4aad0e4471a958367766d849a.tar.xz |
* Updates the sim stats module. Cleans out some of the rot.
* Adds a prototype web stats module which is disabled by default. It's functional with one report right now, however, the database structure may change, so I don't recommend enabling this to keep actual stats right now. I'll let you know when it's safe.
* Adds Prototype for ajaxy web content
* removed a warning or two.
Diffstat (limited to 'bin/data/updater.js')
-rw-r--r-- | bin/data/updater.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/data/updater.js b/bin/data/updater.js new file mode 100644 index 0000000..20201f8 --- /dev/null +++ b/bin/data/updater.js | |||
@@ -0,0 +1,20 @@ | |||
1 | var updater = Class.create({ | ||
2 | initialize: function(divToUpdate, interval, file) { | ||
3 | this.divToUpdate = divToUpdate; | ||
4 | this.interval = interval; | ||
5 | this.file = file; | ||
6 | new PeriodicalExecuter(this.getUpdate.bind(this), this.interval); | ||
7 | }, | ||
8 | |||
9 | getUpdate: function() { | ||
10 | var oOptions = { | ||
11 | method: "POST", | ||
12 | parameters: "intervalPeriod="+this.interval, | ||
13 | asynchronous: true, | ||
14 | onComplete: function (oXHR, Json) { | ||
15 | $(this.divToUpdate).innerHTML = oXHR.responseText; | ||
16 | } | ||
17 | }; | ||
18 | var oRequest = new Ajax.Updater(this.divToUpdate, this.file, oOptions); | ||
19 | } | ||
20 | }); \ No newline at end of file | ||