From 64d6e9696ee0f720d9559371239fa4b5a1641fc4 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Thu, 14 May 2015 13:57:12 -0700 Subject: [PATCH 1/2] full talk name --- base/pub/talk/src/css/main.css | 3 ++- base/pub/talk/src/css/main.styl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/pub/talk/src/css/main.css b/base/pub/talk/src/css/main.css index 5594e515b..04e8b975a 100644 --- a/base/pub/talk/src/css/main.css +++ b/base/pub/talk/src/css/main.css @@ -471,7 +471,7 @@ a { display: block; } .iden > div { - max-width: 10rem; + max-width: 11rem; display: inline-block; } .iden > div, @@ -536,6 +536,7 @@ a { } .writing .iden .ship { margin-right: 0.3rem; + letter-spacing: 0; } #audi { display: inline-block; diff --git a/base/pub/talk/src/css/main.styl b/base/pub/talk/src/css/main.styl index dfe505843..5c9f488e7 100644 --- a/base/pub/talk/src/css/main.styl +++ b/base/pub/talk/src/css/main.styl @@ -421,7 +421,7 @@ a display block .iden > div - max-width 10rem + max-width 11rem display inline-block .iden > div @@ -491,6 +491,7 @@ a .writing .iden .ship margin-right .3rem + letter-spacing 0 #audi display inline-block From 94aa7c7678ab28f14e982ef0094b737d48c6ea23 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 14 May 2015 14:59:45 -0700 Subject: [PATCH 2/2] switching sole --- base/arvo/eyre.hoon | 3 +- base/lib/urb.js | 3 +- base/pub/sole/src/main.coffee | 62 ++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/base/arvo/eyre.hoon b/base/arvo/eyre.hoon index 32e824a8c..741e2ed11 100644 --- a/base/arvo/eyre.hoon +++ b/base/arvo/eyre.hoon @@ -1133,7 +1133,8 @@ :: ++ del-subs :: XX per path? |= [a=dock %json b=wire c=path] ^+ ..ix - (hurl-note [a b] [%g %deal [him -.a] +.a %pull ~]) + =. ..ix (hurl-note [a b] [%g %deal [him -.a] +.a %pull ~]) + (nice-json:pop-duct:(ire-ix ire)) :: XX gall ack :: ++ get-rush |= [a=whir-of b=json] ^+ ..ix diff --git a/base/lib/urb.js b/base/lib/urb.js index bd528dc6f..215d39ef4 100644 --- a/base/lib/urb.js +++ b/base/lib/urb.js @@ -244,12 +244,11 @@ window.urb.unsubscribe = function(params,cb) { if(!params.path) throw new Error("You must specify a path for urb.unsubscribe.") if(!params.appl) throw new Error("You must specify an appl for urb.unsubscribe.") - if(!cb) throw new Error("You must supply a callback to urb.unsubscribe.") url = "/~/is/"+this.gsig(params)+".json" method = "delete" this.req("delete",url,params,true,function(err,res) { - cb(err,res) + if(cb) cb(err,res) }) } diff --git a/base/pub/sole/src/main.coffee b/base/pub/sole/src/main.coffee index a6c160af8..3a153e3fb 100644 --- a/base/pub/sole/src/main.coffee +++ b/base/pub/sole/src/main.coffee @@ -3,8 +3,8 @@ str = JSON.stringify Prompt = recl render: -> - [pro,cur,buf] = [@props.appl+@props.prompt[@props.appl], @props.cursor, @props.input + " "] - pre {}, pro, + [pro,cur,buf] = [@props.prompt[@props.appl] ? "X", @props.cursor, @props.input + " "] + pre {}, @props.appl+pro, span {style: background: 'lightgray'}, buf.slice(0,cur), "\u0332", buf.slice(cur) Matr = recl render: -> @@ -54,17 +54,28 @@ $ -> offset:0 ), term window.matr = matr update = (a) -> matr.setProps a - buffer = new Share "" + buffer = "": new Share "" window.buffer = buffer - choose = (appl)-> urb.appl = appl; update {appl} + choose = (appl)-> + urb.appl = appl + buffer[appl] ?= new Share "" + updPrompt '', null + update {appl, cursor: 0, input: buffer[appl].buf} print = (txt)-> update rows: [matr.props.rows..., txt] - sync = (ted)-> - update input: buffer.buf, cursor: buffer.transpose ted, matr.props.cursor + sync = (ted,app)-> + app ?= matr.props.appl + if app isnt matr.props.appl then return + b = buffer[app] + update input: b.buf, cursor: b.transpose ted, matr.props.cursor updPrompt = (app,pro) -> prompt = $.extend {}, matr.props.prompt if pro? then prompt[app] = pro else delete prompt[app] update {prompt} - + sysStatus = ()-> updPrompt '', ( + [app,pro] = [matr.props.appl, (k for k,v of matr.props.prompt when k isnt '')] + if app is '' then (pro.join ', ')+'# ' else null + ) + peer = (ruh,app) -> app ?= urb.appl if ruh.map then return ruh.map (rul)-> peer rul, app @@ -75,7 +86,7 @@ $ -> when 'pro' then updPrompt app, ruh.pro.cad when 'hop' then update cursor: ruh.hop; bell() # XX buffer.transpose? when 'blk' then console.log "Stub #{str ruh}" - when 'det' then buffer.receive ruh.det; sync ruh.det.ted + when 'det' then buffer[app].receive ruh.det; sync ruh.det.ted, app when 'act' then switch ruh.act when 'clr' then update rows:[] when 'bel' then bell() @@ -93,19 +104,21 @@ $ -> if matr.props.prompt[app]? return print '# already-joined: '+app choose app - updPrompt "", null urb.bind "/sole", {wire:"/"}, (err,d)-> if err then console.log err else if d.data then peer d.data, app cycle = ()-> apps = Object.keys matr.props.prompt - update appl: apps[1 + apps.indexOf matr.props.appl] ? apps[0] + if apps.length < 2 then return + choose apps[1 + apps.indexOf urb.appl] ? apps[0] part = (appl)-> - unless matr.props.prompt[app]? - return print '# not-joined: '+app + mapr = matr.props + unless mapr.prompt[appl]? + return print '# not-joined: '+appl urb.unsubscribe {appl, path: "/sole", wire: "/"} - if appl is matr.props.appl then cycle() + if appl is mapr.appl then cycle() updPrompt appl, null + sysStatus() join urb.appl window.join = join; window.part = part @@ -123,19 +136,19 @@ $ -> # ), 500 sendAction = (data)-> - if urb.appl then urb.send {mark: 'sole-action', data}, (e,res)-> + if matr.props.appl then urb.send {mark: 'sole-action', data}, (e,res)-> if res.status isnt 200 then $('#err')[0].innerText = res.data.mess else if data is 'ret' - app = /^[a-z-]+$/.exec(buffer.buf.slice(1)) - unless app? + app = /^[a-z-]+$/.exec(buffer[""].buf.slice(1)) + unless app? and app[0]? return bell() - else switch buffer.buf[0] - when '+' then join app - when '-' then part app + else switch buffer[""].buf[0] + when '+' then doEdit set: ""; join app[0] + when '-' then doEdit set: ""; part app[0] else bell() doEdit = (ted)-> - det = buffer.transmit ted + det = buffer[matr.props.appl].transmit ted sync ted sendAction {det} @@ -185,12 +198,9 @@ $ -> when 'g' then bell() when 'x' then cycle() when 'v' - if mapr.appl = "" - updPrompt "", null - cycle() - apps = Object.keys mapr.prompt - updPrompt "", (apps.join ", ")+'# ' - choose '' + appl = if mapr.appl isnt '' then '' else urb.appl + update {appl, cursor:0, input:buffer[appl].buf} + sysStatus() when 't' if mapr.cursor is 0 or mapr.input.length < 2 return bell()