//Toast show toast message in browser
7069
func Toast(ws *websocket.Conn, message string, t uint) error {
	js := fmt.Sprintf("Materialize.toast('%s', %d);", message, t)
	err := ws.WriteMessage(websocket.TextMessage, []byte(js))
	if err != nil {
		return err
	}

	return nil
}
1192944
func (c clearSessionMessage) String() string {
	msg := "Session `" + c.SessionID + "`"
	var colorizedMsg string
	switch c.Status {
	case "success":
		colorizedMsg = console.Colorize("ClearSession", msg+" cleared successfully.")
	case "forced":
		colorizedMsg = console.Colorize("ClearSession", msg+" cleared forcefully.")
	}
	return colorizedMsg
}
90458
func (s *grpcAPIService) Broadcast(ctx context.Context, req *BroadcastRequest) (*BroadcastResponse, error) {
	return s.api.Broadcast(ctx, req), nil
}
919356
func (c *UserServiceController) Show(ctx *app.ShowUserServiceContext) error {
	t, err := c.ShowTenant(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK(convert(t))
}
481283
func (l *DebugLogger) Toggle() {
	l.mx.Lock()
	defer l.mx.Unlock()
	if l.debug == false {
		l.debug = true
	} else {
		l.debug = false
	}
	l.updateLogFlags()
}
216721
func (r *RoomService) Message(id string, msgReq *RoomMessageRequest) (*http.Response, error) {
	req, err := r.client.NewRequest("POST", fmt.Sprintf("room/%s/message", id), nil, msgReq)
	if err != nil {
		return nil, err
	}

	return r.client.Do(req, nil)
}
1358093
func PageShow(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "pageshow", Listener: listener}
}
1160404
func (w *Window) message(format string, args ...interface{}) {
	if *acmeDebug {
		q0, q1, _ := w.ReadAddr()
		log.Printf("message; addr=%d,%d", q0, q1)
	}
	if err := w.Addr(".-/\\n?\\n?/"); err != nil && *acmeDebug {
		log.Printf("set addr: %s", err)
	}
	q0, _, _ := w.ReadAddr()
	nl := ""
	if q0 > 0 {
		nl = "\n"
	}
	if *acmeDebug {
		q0, q1, _ := w.ReadAddr()
		log.Printf("inserting; addr=%d,%d", q0, q1)
	}
	w.Fprintf("data", nl+w.time()+format+"\n", args...)
	if *acmeDebug {
		q0, q1, _ := w.ReadAddr()
		log.Printf("wrote; addr=%d,%d", q0, q1)
	}
}
173695
func (g *Group) Rune() *Statement {
	// notest
	s := Rune()
	g.items = append(g.items, s)
	return s
}
1364807
func (remote *RemoteDebugger) CloseBrowser() {
	_, err := remote.SendRequest("Browser.close", nil)
	if err != nil {
		log.Println(err)
	}
}
177128
func (sm StatusMessage) Element() *etree.Element {
	el := etree.NewElement("samlp:StatusMessage")
	el.SetText(sm.Value)
	return el
}
377794
func (client *Client) Broadcast(message string) {
	if client.ctx.Err() != nil {
		return
	}

	client.push <- ("[ " + message)
}
209473
func (e *presentableError) render(c *router.Context) {
	breadcrumps := []string{}
	for _, k := range []string{"ProjectID", "JobName", "InvID"} {
		p := c.Params.ByName(k)
		if p == "" {
			break
		}
		breadcrumps = append(breadcrumps, p)
	}
	c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8")
	c.Writer.WriteHeader(e.Status)
	templates.MustRender(c.Context, c.Writer, "pages/error.html", map[string]interface{}{
		"Breadcrumps":    breadcrumps,
		"LastCrumbIdx":   len(breadcrumps) - 1,
		"Message":        e.Message,
		"ReloginMayHelp": e.ReloginMayHelp,
	})
}
471325
func (u uiErr) Msg(m string, args ...interface{}) uiErr {
	return uiErr{
		msg:    fmt.Sprintf(m, args...),
		detail: u.detail,
		action: u.action,
		help:   u.help,
	}
}
104482
func (e *sessionMessages) SessionMessageChannel(topics ...string) chan SessionMessage {
	e.mutex.Lock()
	defer e.mutex.Unlock()
	channelEntry := &sessionMessageChannelEntry{topics: topics, channel: make(chan SessionMessage, 16+len(e.history))}
	e.channels[channelEntry] = true
	for _, oldEvent := range e.history {
		channelEntry.emitSessionEvent(oldEvent)
	}
	return channelEntry.channel
}
472092
func (m *Message) Render(tmpl *template.Template) ([]byte, error) {
	buf := new(bytes.Buffer)
	err := tmpl.Execute(buf, m)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}
772019
func (service *Service) HomePage(w http.ResponseWriter, request *http.Request) {

	loggedinuser, err := service.GetLoggedInUser(request, w)
	if err != nil {
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	if loggedinuser == "" {
		service.ShowPublicSite(w, request)
		return
	}

	htmlData, err := html.Asset(homepageFileName)
	if err != nil {
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	sessions.Save(request, w)
	w.Write(htmlData)
}