Exemple #1
0
		if b, ok := v[0].(bool); ok && b {
			fmt.Fprint(c, ` checked="checked"`)
			fmt.Fprint(c, ` onchange="submitform()"`)
		}
	},
	"html": template.HTMLFormatter,
	"str":  template.StringFormatter,
	"": func(c io.Writer, format string, v ...interface{}) {
		if b, ok := v[0].(bool); ok {
			if b {
				fmt.Fprint(c, ` checked="checked"`)
			}
			fmt.Fprint(c, ` onchange="submitform()"`)
			return
		}
		template.StringFormatter(c, format, v...)
	},
	"Sound":        compareStringThing,
	"Light":        compareStringThing,
	"VeryLight":    compareStringThing,
	"Natural":      compareStringThing,
	"StrongTO":     compareStringThing,
	"Michaels":     compareStringThing,
	"NotForce":     compareStringThing,
	"Force":        compareStringThing,
	"Invitational": compareStringThing,
	"Weak":         compareStringThing,
	"Intermediate": compareStringThing,
	"Strong":       compareStringThing,
	"OneLevel":     compareStringThing,
	"TwoLevel":     compareStringThing,
Exemple #2
0
	},
	"html": template.HTMLFormatter,
	"str":  template.StringFormatter,
	"": func(c io.Writer, v interface{}, format string) {
		if b, ok := v.(bool); ok {
			if b {
				fmt.Fprint(c, ` onchange="say('uncheck '+this.name)" checked="checked"`)
			}
			fmt.Fprint(c, ` onchange="say('check '+this.name)"`)
			return
		}
		if p, ok := v.(bridge.Points); ok {
			fmt.Fprintf(c, ` onchange="say('setpts '+this.name+'='+this.value)" maxlength="2" size="2" value="%d"`, p)
			return
		}
		template.StringFormatter(c, v, format)
	},
	"Sound":        compareStringThing,
	"Light":        compareStringThing,
	"VeryLight":    compareStringThing,
	"Natural":      compareStringThing,
	"StrongTO":     compareStringThing,
	"Michaels":     compareStringThing,
	"NotForce":     compareStringThing,
	"Force":        compareStringThing,
	"Invitational": compareStringThing,
	"Weak":         compareStringThing,
	"Intermediate": compareStringThing,
	"Strong":       compareStringThing,
	"OneLevel":     compareStringThing,
	"TwoLevel":     compareStringThing,