Socket
Socket
Sign inDemoInstall

nobj-app-channel

Package Overview
Dependencies
0
Maintainers
1
Versions
180
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.36 to 0.4.37

14

lib.js

@@ -35,9 +35,9 @@ /*

"clearChildren",{configurable:!0,enumerable:!1,value:function(){for(;q.firstChild;)q.removeChild(q.lastChild)}})});O(l,function(G,u,L){V(G,{id:"channel",title:"Create your channel",error:"There is a problem ...",actions:["create"],params:{name:{defaultValue:"",caption:"Channel Name",hint:"type a name",help:"This name will be displayed to your friends.",required:"Please type in a name for your channel.",className:"isfull"},tos:{type:"check",defaultValue:"",caption:"Terms of service",hint:"I agree to be bound by Quarantune Terms of service",
help:"Creating your channel means accepting our terms of service.",required:"You need to accept the TOS to create your channel.",className:"isfull"}}})});O(p,function(G,u,L){var q=u("mithril"),A=u("nobj.auth"),w=u("nobj.fire"),B=u(R),y=u(Q).setRoute,t={},M=null,I={config:function(x){M=x},oninit:function(x){var a=x.attrs;x=x.state;try{var h=w.validate(a.channel)}catch(k){h=null}x.inited&&x.inited===h?y(a.requestedPath,x):(V(x,{loading:!1,user:null,requestedPath:a.requestedPath,requestedChannel:h}),
A.config(Object.assign({},M,h&&{channel:h})))},view:function(x){x=x.attrs;return t.user?q(".h-100.flexcol.flexcenter",[q(".flexcol",[t.user.image?[q("img",{src:t.user.image})]:[],q("h1",t.user.name||t.user.id)].concat(ea.arrayFromIterable(t.error?[q(".errormessage",t.error.message)]:[])))]):q(B,Object.assign({},{config:M,requestedChannel:t.requestedChannel,requestedPath:t.requestedPath},x))},onmatch:function(x,a,h,k,z){console.log("[AutoLoginWidget]","OnMatch: routeParams",x,"repaths",a,h,"routeOptions",
k);if(a===z.routeSelf&&t.inited)y(z.routeChannel,t);else if(h=A.session?A.session():null,h=!h||!h.user().id(),!h&&x.channel&&t.inited&&x.channel!==t.inited)history.pushState(null,null,"#!"+a),window.location.reload();else if(h)return console.log("[AutoLoginWidget]","unauth - failed, launch login"),{view:function(H){return q(I,Object.assign({},z||{},k||{},H.attrs,{requestedPath:a}))}};return null}};L.exports=I});O(r,function(G,u,L){function q(x,a){console.warn("accept",x);B.channel().create(x).then(a.runAuthenticated).catch(function(h){t("Error",
h.message)})}function A(){console.warn("cancel")}var w=u("mithril"),B=u(J);G=u("app.widgets");var y=G.Dialog,t=G.Alert,M=u("nobj.auth"),I=u(l);L.exports={oninit:function(x){return B.channel().init()},view:function(x){var a=x.attrs;x=M.session().user().info();return B.channel().exists()?w(".widget.flexcol.flexcenter.shadow",[w("h1",x.name),w("h2","id "+x.id)]):w(".flexrow",[w(".flexcol.flex-al-center.marg-4",[w("img.avatar",{src:x.image}),w("h1",x.name),w("h6.idchannel",x.id)]),w(y,{meta:[I],onAction:function(h){return q(h,
a)},onCancel:A})])}}});O(n,function(G,u,L){var q=u("nobj.auth"),A=u("mithril");L.exports={view:function(w){w=w.state;try{w.user=q.session().user().info()}catch(B){}try{w.channel=q.session().channel().info()}catch(B){}return w.channel&&w.user?A(".flexrow.loggedinwidget.font-75",[A(".flexcol.flexcenter.al-right",[A(".channelname",w.channel.name),A(".username",w.user.name)]),w.user.image?[A("img",{src:w.user.image})]:[]]):A(".nologin.loggedinwidget")}}});O(R,function(G,u,L){var q=u("mithril"),A=u("nobj.auth"),
w=u("nobj.fire"),B=u("rt.channel"),y=u("app.widgets").Dialog,t=u(C),M=u(Q).setRoute,I=u(J),x=u(r),a={};L.exports=function(h){function k(E){a.loading=E;q.redraw()}function z(E,D){M(!E||E.startsWith(W.routeSelf)?g:E,a)}function H(){a.inited=S.id();delete a.create;k(!1);z(ca||g,{channel:a.inited})}function K(E,D){if(D)a.error=D,k(!1);else try{k(!0),N.hasRealtime()?w.init().then(function(){var F=new B(w.current(),Object.assign({},X,{redraw:function(){return q.redraw()}}));I.input(F);F.init(X).then(H).catch(function(T){console.error(T);
k(!1);S.isOwner()?(V(a,{inited:S.id(),create:!0}),q.redraw()):z(aa)})}).catch(function(F){delete a.inited;delete a.create;a.error=F;k(!1)}):H()}catch(F){a.error=F,k(!1)}}function c(E,D){var F=X.profiles[D];return new U(function(T,ha){a.error=null;a.loading=!0;q.redraw();A.login(F.profile,E,F.flow).then(function(){K(!0,null);T()}).catch(function(fa){K(!1,fa);ha(fa)})})}function b(E){a.loading=!0;a.error=null;A.recover({channel:E,refresh:!!X.refresh}).then(function(){return K(!0)}).catch(function(D){return K(!1,
required:"You need to accept the TOS to create your channel.",className:"isfull"}}})});O(p,function(G,u,L){var q=u("mithril"),A=u("nobj.auth"),w=u("nobj.fire"),B=u(R),y=u(Q).setRoute,t={},M=null,I={config:function(x){M=x},oninit:function(x){var a=x.attrs;x=x.state;try{var h=w.validate(a.channel)}catch(k){h=null}x.inited&&x.inited===h?y(a.requestedPath,x):(V(x,{loading:!1,user:null,requestedPath:a.requestedPath,requestedChannel:h}),A.config(Object.assign({},M,h&&{channel:h})))},view:function(x){x=
x.attrs;return t.user?q(".h-100.flexcol.flexcenter",[q(".flexcol",[t.user.image?[q("img",{src:t.user.image})]:[],q("h1",t.user.name||t.user.id)].concat(ea.arrayFromIterable(t.error?[q(".errormessage",t.error.message)]:[])))]):q(B,Object.assign({},{config:M,requestedChannel:t.requestedChannel,requestedPath:t.requestedPath},x))},onmatch:function(x,a,h,k,z){console.log("[AutoLoginWidget]","OnMatch: routeParams",x,"repaths",a,h,"routeOptions",k);if(a===z.routeSelf&&t.inited)y(z.routeChannel,t);else if(h=
A.session?A.session():null,h=!h||!h.user().id(),!h&&x.channel&&t.inited&&x.channel!==t.inited)history.pushState(null,null,"#!"+a),window.location.reload();else if(h)return console.log("[AutoLoginWidget]","unauth - failed, launch login"),{view:function(H){return q(I,Object.assign({},z||{},k||{},H.attrs,{requestedPath:a}))}};return null}};L.exports=I});O(r,function(G,u,L){function q(x,a){console.warn("accept",x);B.channel().create(x).then(a.runAuthenticated).catch(function(h){t("Error",h.message)})}
function A(){console.warn("cancel")}var w=u("mithril"),B=u(J);G=u("app.widgets");var y=G.Dialog,t=G.Alert,M=u("nobj.auth"),I=u(l);L.exports={oninit:function(x){return B.channel().init()},view:function(x){var a=x.attrs;x=M.session().user().info();return B.channel().exists()?w(".widget.flexcol.flexcenter.shadow",[w("h1",x.name),w("h2","id "+x.id)]):w(".flexrow.flexaround",[w(".flexcol.flex-al-center.marg-4",[w("img.avatar",{src:x.image}),w("h1",x.name),w("h6.idchannel",x.id)]),w(y,{className:"bg-accent-light",
meta:[I],onAction:function(h){return q(h,a)},onCancel:A})])}}});O(n,function(G,u,L){var q=u("nobj.auth"),A=u("mithril");L.exports={view:function(w){w=w.state;try{w.user=q.session().user().info()}catch(B){}try{w.channel=q.session().channel().info()}catch(B){}return w.channel&&w.user?A(".flexrow.loggedinwidget.font-75",[A(".flexcol.flexcenter.al-right",[A(".channelname",w.channel.name),A(".username",w.user.name)]),w.user.image?[A("img",{src:w.user.image})]:[]]):A(".nologin.loggedinwidget")}}});O(R,
function(G,u,L){var q=u("mithril"),A=u("nobj.auth"),w=u("nobj.fire"),B=u("rt.channel"),y=u("app.widgets").Dialog,t=u(C),M=u(Q).setRoute,I=u(J),x=u(r),a={};L.exports=function(h){function k(E){a.loading=E;q.redraw()}function z(E,D){M(!E||E.startsWith(W.routeSelf)?g:E,a)}function H(){a.inited=S.id();delete a.create;k(!1);z(ca||g,{channel:a.inited})}function K(E,D){if(D)a.error=D,k(!1);else try{k(!0),N.hasRealtime()?w.init().then(function(){var F=new B(w.current(),Object.assign({},X,{redraw:function(){return q.redraw()}}));
I.input(F);F.init(X).then(H).catch(function(T){console.error(T);k(!1);S.isOwner()?(V(a,{inited:S.id(),create:!0}),q.redraw()):z(aa)})}).catch(function(F){delete a.inited;delete a.create;a.error=F;k(!1)}):H()}catch(F){a.error=F,k(!1)}}function c(E,D){var F=X.profiles[D];return new U(function(T,ha){a.error=null;a.loading=!0;q.redraw();A.login(F.profile,E,F.flow).then(function(){K(!0,null);T()}).catch(function(fa){K(!1,fa);ha(fa)})})}function b(E){a.loading=!0;a.error=null;A.recover({channel:E,refresh:!!X.refresh}).then(function(){return K(!0)}).catch(function(D){return K(!1,
D)})}var W=h.attrs;h=W;var X=h.config,d=h.profile,e=h.backgroundUrl,g=h.routeChannel,aa=h.routeNotFound,ba=h.requestedChannel,ca=h.requestedPath,da=d&&"string"===typeof d?[d]:d&&d.length?d:[null],N=A.session(),P=N.user(),S=N.channel();return{oninit:function(E){E=E.attrs;try{if(a.inited){if(E.channel&&a.inited!==E.channel)throw Error("already inited for channel "+a.inited);}else if(X.remember)return b(ba)}catch(D){console.log("[LoginWidget]",D.message),z(aa)}},view:function(){try{P.info()}catch(D){}var E=

@@ -44,0 +44,0 @@ W.channel?t.map(W.channel,"login/visitor.jpg"):e;return q(".fullheight.fullwidth.flexcol.loginwidget.flexcenter"+(a.loading?".loading":""),{style:Object.assign({},E&&{backgroundImage:"url("+E+")"})},a.loading?[q(".throbber",[q(".line"),q(".subline.inc"),q(".subline.dec")])]:a.create?[q(x,{runAuthenticated:H})]:[].concat(ea.arrayFromIterable(a.error?[q(".errormessage.marg-2.pad-2.bg-accent.shadow",a.error.message||"")]:[]),[q(".flexcol.fullheight.flexcenter.logincard",q(".card",da.map(function(D){var F=

{
"name": "nobj-app-channel",
"version": "0.4.36",
"version": "0.4.37",
"description": "Realtime channel skeleton for nobj-app",

@@ -5,0 +5,0 @@ "main": "lib.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc