// =========== TEXT AREA
// TextAreaField creates a default textarea input field based on the provided name and dimensions.
962571
func TextAreaField(name string, rows, cols int) *Field {
	ret := FieldWithType(name, formcommon.TEXTAREA)
	ret.SetParam("rows", fmt.Sprintf("%d", rows))
	ret.SetParam("cols", fmt.Sprintf("%d", cols))
	return ret
}
939204
func ConvertAreaSimple(request *http.Request, id interface{}) (*app.GenericData, *app.GenericLinks) {
	t := area.APIStringTypeAreas
	i := fmt.Sprint(id)
	data := &app.GenericData{
		Type: &t,
		ID:   &i,
	}
	relatedURL := rest.AbsoluteURL(request, app.AreaHref(i))
	links := &app.GenericLinks{
		Self:    &relatedURL,
		Related: &relatedURL,
	}
	return data, links
}
868787
func (g *LinearRing) Area() float64 {
	return doubleArea1(g.flatCoords, 0, len(g.flatCoords), g.stride) / 2
}
1243920
public function textarea($name = null, $value = null, $attr = null)
    {
        return $this->createInput('textarea', $name, $value, $attr);
    }
528746
func (g *MultiPolygon) Area() float64 {
	return doubleArea3(g.flatCoords, 0, g.endss, g.stride) / 2
}
73571
func (f *Field) Field(name string) *Field {
	field, ok := f.FieldOk(name)
	if !ok {
		panic("field not found")
	}

	return field
}
501862
func (c *AreaController) CreateChild(ctx *app.CreateChildAreaContext) error {
	currentUser, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))
	}
	parentID, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	var a *area.Area
	err = application.Transactional(c.db, func(appl application.Application) error {
		parent, err := appl.Areas().Load(ctx, parentID)
		if err != nil {
			return err
		}
		s, err := appl.Spaces().Load(ctx, parent.SpaceID)
		if err != nil {
			return err
		}
		if !uuid.Equal(*currentUser, s.OwnerID) {
			log.Warn(ctx, map[string]interface{}{
				"space_id":     s.ID,
				"space_owner":  s.OwnerID,
				"current_user": *currentUser,
			}, "user is not the space owner")
			return errors.NewForbiddenError("user is not the space owner")
		}

		reqArea := ctx.Payload.Data
		if reqArea.Attributes.Name == nil {
			return errors.NewBadParameterError("data.attributes.name", nil).Expected("not nil")
		}

		a = &area.Area{
			SpaceID: parent.SpaceID,
			Name:    *reqArea.Attributes.Name,
		}
		a.MakeChildOf(*parent)
		return appl.Areas().Create(ctx, a)
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	result := &app.AreaSingle{
		Data: ConvertArea(c.db, ctx.Request, *a, addResolvedPath),
	}
	ctx.ResponseData.Header().Set("Location", rest.AbsoluteURL(ctx.Request, app.AreaHref(result.Data.ID)))
	return ctx.Created(result)
}
800068
func (r *Router) AddArea(areaID types.AreaID, cluster RouterSerfCluster, pinger Pinger, useTLS bool) error {
	r.Lock()
	defer r.Unlock()

	if r.isShutdown {
		return fmt.Errorf("cannot add area, router is shut down")
	}

	if _, ok := r.areas[areaID]; ok {
		return fmt.Errorf("area ID %q already exists", areaID)
	}

	area := &areaInfo{
		cluster:  cluster,
		pinger:   pinger,
		managers: make(map[string]*managerInfo),
		useTLS:   useTLS,
	}
	r.areas[areaID] = area

	// Do an initial populate of the manager so that we don't have to wait
	// for events to fire. This lets us attempt to use all the known servers
	// initially, and then will quickly detect that they are failed if we
	// can't reach them.
	for _, m := range cluster.Members() {
		ok, parts := metadata.IsConsulServer(m)
		if !ok {
			r.logger.Printf("[WARN]: consul: Non-server %q in server-only area %q",
				m.Name, areaID)
			continue
		}

		if err := r.addServer(area, parts); err != nil {
			return fmt.Errorf("failed to add server %q to area %q: %v", m.Name, areaID, err)
		}
	}

	return nil
}
1339164
func TextFieldFromInstance(val reflect.Value, t reflect.Type, fieldNo int, name string, typ ...string) *Field {
	ret := TextField(name, typ...)
	ret.SetValue(fmt.Sprintf("%v", val.Field(fieldNo).Interface()))
	return ret
}
906629
func parseField(parser *Parser) (*ast.Field, error) {
	var (
		name       *ast.Name
		alias      *ast.Name
		arguments  []*ast.Argument
		directives []*ast.Directive
		err        error
	)
	start := parser.Token.Start
	if name, err = parseName(parser); err != nil {
		return nil, err
	}
	if skp, err := skip(parser, lexer.COLON); err != nil {
		return nil, err
	} else if skp {
		alias = name
		if name, err = parseName(parser); err != nil {
			return nil, err
		}
	}
	if arguments, err = parseArguments(parser); err != nil {
		return nil, err
	}
	if directives, err = parseDirectives(parser); err != nil {
		return nil, err
	}
	var selectionSet *ast.SelectionSet
	if peek(parser, lexer.BRACE_L) {
		if selectionSet, err = parseSelectionSet(parser); err != nil {
			return nil, err
		}
	}
	return ast.NewField(&ast.Field{
		Alias:        alias,
		Name:         name,
		Arguments:    arguments,
		Directives:   directives,
		SelectionSet: selectionSet,
		Loc:          loc(parser, start),
	}), nil
}
754837
func WorkareaSet(xu *xgbutil.XUtil, workareas []Workarea) error {
	rects := make([]uint, len(workareas)*4)
	for i, workarea := range workareas {
		rects[i*4+0] = uint(workarea.X)
		rects[i*4+1] = uint(workarea.Y)
		rects[i*4+2] = workarea.Width
		rects[i*4+3] = workarea.Height
	}

	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_WORKAREA", "CARDINAL",
		rects...)
}
787357
func (c Cap) Area() float64 {
	return 2.0 * math.Pi * math.Max(zeroHeight, c.height)
}
1005744
public function textarea($name = null, $value = null)
    {
        return Textarea::create()
            ->attributeIf($name, 'name', $this->fieldName($name))
            ->attributeIf($name, 'id', $this->fieldName($name))
            ->value($this->old($name, $value));
    }
811837
func (c *Client) AddField(name string, val interface{}) {
	c.ensureTransmission()
	c.ensureBuilder()
	c.builder.AddField(name, val)
}
260855
func CreateInputModal(title string, x, y, width, height int, fg, bg termbox.Attribute) *InputModal {
	c := InputModal{title: title, x: x, y: y, width: width, height: height, fg: fg, bg: bg, bordered: true}
	c.input = CreateInputField(c.x+2, c.y+3, c.width-2, 2, c.fg, c.bg)
	c.showHelp = true
	c.input.bordered = true
	c.isVisible = true
	c.inputSelected = true
	return &c
}
1112115
func NewScriptField(fieldName string, script *Script) *ScriptField {
	return &ScriptField{FieldName: fieldName, script: script}
}
623276
func serializeForm(sel *goquery.Selection) (url.Values, url.Values) {
	input := sel.Find("input,button,textarea")
	if input.Length() == 0 {
		return url.Values{}, url.Values{}
	}

	fields := make(url.Values)
	buttons := make(url.Values)
	input.Each(func(_ int, s *goquery.Selection) {
		name, ok := s.Attr("name")
		if ok {
			typ, ok := s.Attr("type")
			if ok || s.Is("textarea") {
				if typ == "submit" {
					val, ok := s.Attr("value")
					if ok {
						buttons.Add(name, val)
					} else {
						buttons.Add(name, "")
					}
				} else {
					val, ok := s.Attr("value")
					if !ok {
						val = ""
					}
					fields.Add(name, val)
				}
			}
		}
	})

	return fields, buttons
}