diff options
author | UbitUmarov | 2015-09-01 11:43:07 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-01 11:43:07 +0100 |
commit | fb78b182520fc9bb0f971afd0322029c70278ea6 (patch) | |
tree | b4e30d383938fdeef8c92d1d1c2f44bb61d329bd /bin/data/updater.js | |
parent | lixo (diff) | |
parent | Mantis #7713: fixed bug introduced by 1st MOSES patch. (diff) | |
download | opensim-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.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 | ||