aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/data/updater.js
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 11:43:07 +0100
committerUbitUmarov2015-09-01 11:43:07 +0100
commitfb78b182520fc9bb0f971afd0322029c70278ea6 (patch)
treeb4e30d383938fdeef8c92d1d1c2f44bb61d329bd /bin/data/updater.js
parentlixo (diff)
parentMantis #7713: fixed bug introduced by 1st MOSES patch. (diff)
downloadopensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.zip
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.gz
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.bz2
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.xz
Merge remote-tracking branch 'os/master'
Diffstat (limited to '')
-rw-r--r--bin/data/updater.js20
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 @@
1var 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