Show More
@@ -144,11 +144,11 define([ | |||
|
144 | 144 | }; |
|
145 | 145 | |
|
146 | 146 | SaveWidget.prototype._set_checkpoint_status = function (human_date, iso_date) { |
|
147 | var el = this.element.find('span#checkpoint_status') | |
|
147 | var el = this.element.find('span#checkpoint_status'); | |
|
148 | 148 | if(human_date){ |
|
149 | 149 | el.text("Last Checkpoint: "+human_date).attr('title',iso_date); |
|
150 | 150 | } else { |
|
151 | el.text('').attr('title','no-checkpoint') | |
|
151 | el.text('').attr('title', 'no-checkpoint'); | |
|
152 | 152 | } |
|
153 | 153 | }; |
|
154 | 154 | |
@@ -185,13 +185,11 define([ | |||
|
185 | 185 | } else { |
|
186 | 186 | return h; |
|
187 | 187 | } |
|
188 | ||
|
189 | ||
|
190 | } | |
|
188 | }; | |
|
191 | 189 | |
|
192 | 190 | SaveWidget.prototype._regularly_update_checkpoint_date = function(){ |
|
193 | 191 | if (!this._checkpoint_date) { |
|
194 | this.set_checkpoint_status(null); | |
|
192 | this._set_checkpoint_status(null); | |
|
195 | 193 | console.log('no checkpoint done'); |
|
196 | 194 | return; |
|
197 | 195 | } |
@@ -202,7 +200,10 define([ | |||
|
202 | 200 | var recall = function(t){ |
|
203 | 201 | // recall slightly later (1s) as long timeout in js might be imprecise, |
|
204 | 202 | // and you want to be call **after** the change of formatting should happend. |
|
205 | return setTimeout($.proxy(that._regularly_update_checkpoint_date, that),(t+1000)) | |
|
203 | return setTimeout( | |
|
204 | $.proxy(that._regularly_update_checkpoint_date, that), | |
|
205 | t + 1000 | |
|
206 | ); | |
|
206 | 207 | } |
|
207 | 208 | var tdelta = Math.ceil(new Date()-this._checkpoint_date); |
|
208 | 209 | |
@@ -214,14 +215,17 define([ | |||
|
214 | 215 | // otherwise update every hour and show |
|
215 | 216 | // <Today | yesterday|...> at hh,mm,ss |
|
216 | 217 | } else { |
|
217 | recall(1*3600*1000) | |
|
218 | recall(1*3600*1000); | |
|
218 | 219 |
this._set_checkpoint_status( |
|
219 | 220 | } |
|
220 | ||
|
221 | } | |
|
221 | }; | |
|
222 | 222 | |
|
223 | 223 | SaveWidget.prototype._set_last_checkpoint = function (checkpoint) { |
|
224 | if (checkpoint) { | |
|
224 | 225 | this._checkpoint_date = new Date(checkpoint.last_modified); |
|
226 | } else { | |
|
227 | this._checkpoint_date = null; | |
|
228 | } | |
|
225 | 229 | this._regularly_update_checkpoint_date(); |
|
226 | 230 | |
|
227 | 231 | }; |
General Comments 0
You need to be logged in to leave comments.
Login now