Merge branch 'urbjs-timeout', remote-tracking branches 'joemfb/pedant' and 'galenwp/long-lines'

Add reconnect timeout to urb.js
Spell "successful" correctly
Fix talk line wrapping issue
This commit is contained in:
Raymond Pasco 2016-06-15 17:04:55 -04:00
commit c1ec01af0b
3 changed files with 16 additions and 4 deletions

View File

@ -109,7 +109,7 @@
++ coup-hi
|= {pax/path cop/(unit tang)} =< abet
?> ?=({@t $~} pax)
(emit %flog ~ %text "hi {(trip i.pax)} {?~(cop "" "un")}succesful")
(emit %flog ~ %text "hi {(trip i.pax)} {?~(cop "" "un")}successful")
::
++ poke-reload |=(all/(list term) (poke-reload-desk %home all))
++ poke-reload-desk :: reload vanes

View File

@ -28,6 +28,8 @@ window.urb.req = function(method,url,params,json,cb) {
if(json)
xhr.setRequestHeader("content-type", "text/json")
xhr.timeout = 60000
if(!window.urb.oryx) throw "No CSRF token" // XX fetch auth.json
_data = {oryx: window.urb.oryx}
if(params.xyro) { _data.xyro = params.xyro; }
@ -59,6 +61,12 @@ window.urb.req = function(method,url,params,json,cb) {
cb(err,res)
}
}
xhr.ontimeout = function() {
cb({
status:408,
data:null
})
}
xhr.onerror = function() {
cb({
status:this.status,
@ -165,8 +173,10 @@ window.urb.poll = function(params) {
this.req("get",url,params,true,function(err,res) {
$this.poll.dely = params.dely || $this.poll.dely
if(res){
if(res.data.beat)
if(res.data.beat) {
$this.poll.dely = params.dely || 250
return $this.poll(params)
}
switch(res.data.type){
case "news":
return document.location.reload() // XX check autoreload

View File

@ -64,10 +64,12 @@ div.gram.same:hover div.meta {
position: absolute;
background-color: #fff;
margin-top: -2.5rem;
padding-top: 1rem; }
padding-top: 1rem;
white-space: nowrap; }
.speech {
margin-left: 1.875rem; }
margin-left: 1.875rem;
white-space: nowrap; }
.exp {
font-family: 'scp';