public static TextBoxDescriptor AsProductSelector(this TagsHelper helper) { TextBoxDescriptor descriptor = helper.AsTextBox(); descriptor.AddClass(StringKeys.SelectProductClass); descriptor.AddProperty("data-width", "100%"); descriptor.AddProperty("data-url", Urls.SelectProduct); descriptor.SetTemplate("ProductSelector"); descriptor.ReadOnly(); return(descriptor); }
public static TextBoxDescriptor AsImageCaptcha(this TagsHelper tagsHelper) { TextBoxDescriptor textBoxDescriptor = tagsHelper.AsTextBox(); textBoxDescriptor.SetDisplayName("Captcha"); textBoxDescriptor.PlaceHolder("Captcha"); textBoxDescriptor.Required(); textBoxDescriptor.SetTemplate("ImageCaptcha"); textBoxDescriptor.Validator.Add(new ImageCaptchaModelValidator(textBoxDescriptor.Name)); textBoxDescriptor.MaxLength(10); textBoxDescriptor.AddClass("image-captcha"); return(textBoxDescriptor); }
public static TextBoxDescriptor PageSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectPageClass).AddProperty("data-url", Urls.SelectPage)); }
public static TextBoxDescriptor UrlPart(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.UrlPart).SetTemplate("UrlPart").RegularExpression(RegularExpression.LetterNumberOrLine)); }
public static TextBoxDescriptor FileSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectMediaClass).AddProperty("data-url", Urls.SelectMedia).AddProperty("placeholder", "选择文件")); }
public static TextBoxDescriptor MediaSelector(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.SelectImageClass).AddProperty("data-url", Urls.SelectMedia).AddProperty("placeholder", "可粘贴上传图片")); }
public static TextBoxDescriptor UrlPart(this TextBoxDescriptor descriptor) { return(descriptor.AddClass(StringKeys.UrlPart).SetTemplate("UrlPart")); }