mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-23 04:47:24 +08:00
76
jquery.uniform/jquery.uniform-tests.ts
Normal file
76
jquery.uniform/jquery.uniform-tests.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
/// <reference path="jquery.uniform.d.ts" />
|
||||
|
||||
// Style all <select> elements
|
||||
$("select").uniform();
|
||||
// Style everything
|
||||
$("select, input, a.button, button").uniform();
|
||||
// Avoid styling some elements
|
||||
$("select").not(".skip_these").uniform(); // Method 1
|
||||
$('select[class!="skip_these"]').uniform(); // Method 2
|
||||
|
||||
$("select").uniform({
|
||||
fileDefaultText: 'Keine Datei ausgew<65>hlt',
|
||||
fileButtonText: 'W<>hlen Sie Datei',
|
||||
});
|
||||
|
||||
$.uniform.defaults.checkedClass = "uniformCheckedClass";
|
||||
$.uniform.defaults.fileButtonHtml = "Pick a file";
|
||||
|
||||
$("select").uniform({activeClass: 'myActiveClass'});
|
||||
|
||||
$("input[type=button]").uniform({buttonClass: 'myBtnClass'});
|
||||
|
||||
$(":checkbox").uniform({checkboxClass: 'myCheckClass'});
|
||||
|
||||
$(":radio, :checkbox").uniform({checkedClass: 'myCheckedClass'});
|
||||
|
||||
$("select").uniform({disabledClass: 'myDisabledClass'});
|
||||
|
||||
$("select").uniform({eventNamespace: '.uniformEvents'});
|
||||
|
||||
$(":file").uniform({fileButtonClass: 'myFileBtnClass'});
|
||||
|
||||
$(":file").uniform({fileButtonHtml: 'Choose …'});
|
||||
|
||||
$(":file").uniform({fileClass: 'myFileClass'});
|
||||
|
||||
$(":file").uniform({fileDefaultHtml: 'Select a file please'});
|
||||
|
||||
$(":file").uniform({filenameClass: 'myFilenameClass'});
|
||||
|
||||
$("select").uniform({focusClass: 'myFocusClass'});
|
||||
|
||||
$("select").uniform({hoverClass: 'myHoverClass'});
|
||||
|
||||
$("select").uniform({idPrefix: 'container'});
|
||||
|
||||
$("input").uniform({inputAddTypeAsClass: true});
|
||||
|
||||
$("input").uniform({inputClass: "inputElement"});
|
||||
|
||||
$(":radio").uniform({radioClass: 'myRadioClass'});
|
||||
|
||||
$("input[type='reset']").uniform({resetDefaultHtml: "Clear"});
|
||||
|
||||
$("select").uniform({resetSelector: 'input[type="reset"]'});
|
||||
|
||||
$("select").uniform({selectClass: 'mySelectClass'});
|
||||
|
||||
$("select").uniform({selectMultiClass: 'myMultiSelectClass'});
|
||||
|
||||
$("input[type='submit']").uniform({resetDefaultHtml: "Submit Form"});
|
||||
|
||||
$("textarea").uniform({textareaClass: "myTextareaClass"});
|
||||
|
||||
$("select").uniform({useID: false});
|
||||
|
||||
$('input.blue').uniform({wrapperClass: "blueTheme"});
|
||||
$('input').uniform({wrapperClass: "defaultTheme"});
|
||||
|
||||
$.uniform.update("#myUpdatedCheckbox");
|
||||
|
||||
$.uniform.update();
|
||||
|
||||
$.uniform.restore("select");
|
||||
|
||||
var uniforms = $.uniform.elements;
|
||||
49
jquery.uniform/jquery.uniform.d.ts
vendored
Normal file
49
jquery.uniform/jquery.uniform.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// Type definitions for Uniform.js
|
||||
// Project: https://github.com/pixelmatrix/uniform
|
||||
// Definitions by: flyfishMT <https://github.com/flyfishMT/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
interface UniformOptions {
|
||||
activeClass?: string;
|
||||
autoHide?: boolean;
|
||||
buttonClass?: string;
|
||||
checkboxClass?: string;
|
||||
checkedClass?: string;
|
||||
disabledClass?: string;
|
||||
eventNamespace?: string;
|
||||
fileButtonClass?: string;
|
||||
fileButtonHtml?: string;
|
||||
fileClass?: string;
|
||||
fileDefaultHtml?: string;
|
||||
filenameClass?: string;
|
||||
focusClass?: string;
|
||||
hoverClass?: string;
|
||||
idPrefix?: string;
|
||||
inputAddTypeAsClass?: boolean;
|
||||
radioClass?: string;
|
||||
resetDefaultHtml?: string;
|
||||
resetSelector?: any;
|
||||
selectAutoWidth?: boolean;
|
||||
selectClass?: string;
|
||||
selectMultiClass?: string;
|
||||
submitDefaultHtml?: string;
|
||||
textareaClass?: string;
|
||||
useID?: boolean;
|
||||
wrapperClass?: string;
|
||||
}
|
||||
interface Uniform {
|
||||
(options?: UniformOptions): JQuery;
|
||||
update(elemOrSelector?: any): void;
|
||||
restore(elemOrSelector?: any): void;
|
||||
elements: JQuery[];
|
||||
defaults: UniformOptions;
|
||||
}
|
||||
interface JQueryStatic {
|
||||
uniform: Uniform;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
uniform: Uniform;
|
||||
}
|
||||
Reference in New Issue
Block a user