Merge pull request #2049 from johnnyreilly/master

jQuery UI: continued on option getters / setters
This commit is contained in:
John Reilly
2014-04-16 17:43:05 +01:00
2 changed files with 128 additions and 1 deletions
+48 -1
View File
@@ -1165,7 +1165,6 @@ function test_datepicker() {
var $set: JQuery = $(".selector").datepicker("option", "altField", "#actualDate");
}
// Options
function altFormat() {
$(".selector").datepicker({ altFormat: "yy-mm-dd" });
@@ -1176,6 +1175,54 @@ function test_datepicker() {
var $set: JQuery = $(".selector").datepicker("option", "altFormat", "yy-mm-dd");
}
function appendText() {
$(".selector").datepicker({ appendText: "(yyyy-mm-dd)" });
// getter
var appendText: string = $(".selector").datepicker("option", "appendText");
// setter
var $set: JQuery = $(".selector").datepicker("option", "appendText", "(yyyy-mm-dd)");
}
function autoSize() {
$(".selector").datepicker({ autoSize: true });
// getter
var autoSize: boolean = $(".selector").datepicker("option", "autoSize");
// setter
var $set: JQuery = $(".selector").datepicker("option", "autoSize", true);
}
function buttonImage() {
$(".selector").datepicker({ buttonImage: "/images/datepicker.gif" });
// getter
var buttonImage: string = $(".selector").datepicker("option", "buttonImage");
// setter
var $set: JQuery = $(".selector").datepicker("option", "buttonImage", "/images/datepicker.gif");
}
function buttonImageOnly() {
$(".selector").datepicker({ buttonImageOnly: true });
// getter
var buttonImageOnly: boolean = $(".selector").datepicker("option", "buttonImageOnly");
// setter
var $set: JQuery = $(".selector").datepicker("option", "buttonImageOnly", true);
}
function buttonText() {
$(".selector").datepicker({ buttonText: "Choose" });
var buttonText: string = $(".selector").datepicker("option", "buttonText");
// setter
var $set: JQuery = $(".selector").datepicker("option", "buttonText", "Choose");
}
}
+80
View File
@@ -986,6 +986,86 @@ interface JQuery {
*/
datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery;
/**
* Get the appendText option, after initialization
*
* @param methodName 'option'
* @param optionName 'appendText'
*/
datepicker(methodName: 'option', optionName: 'appendText'): string;
/**
* Set the appendText option, after initialization
*
* @param methodName 'option'
* @param optionName 'appendText'
* @param appendTextValue The text to display after each date field, e.g., to show the required format.
*/
datepicker(methodName: 'option', optionName: 'appendText', appendTextValue: string): JQuery;
/**
* Get the autoSize option, after initialization
*
* @param methodName 'option'
* @param optionName 'autoSize'
*/
datepicker(methodName: 'option', optionName: 'autoSize'): boolean;
/**
* Set the autoSize option, after initialization
*
* @param methodName 'option'
* @param optionName 'autoSize'
* @param autoSizeValue Set to true to automatically resize the input field to accommodate dates in the current dateFormat.
*/
datepicker(methodName: 'option', optionName: 'autoSize', autoSizeValue: boolean): JQuery;
/**
* Get the buttonImage option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonImage'
*/
datepicker(methodName: 'option', optionName: 'buttonImage'): string;
/**
* Set the buttonImage option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonImage'
* @param buttonImageValue A URL of an image to use to display the datepicker when the showOn option is set to "button" or "both". If set, the buttonText option becomes the alt value and is not directly displayed.
*/
datepicker(methodName: 'option', optionName: 'buttonImage', buttonImageValue: string): JQuery;
/**
* Get the buttonImageOnly option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonImageOnly'
*/
datepicker(methodName: 'option', optionName: 'buttonImageOnly'): boolean;
/**
* Set the buttonImageOnly option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonImageOnly'
* @param buttonImageOnlyValue Whether the button image should be rendered by itself instead of inside a button element. This option is only relevant if the buttonImage option has also been set.
*/
datepicker(methodName: 'option', optionName: 'buttonImageOnly', buttonImageOnlyValue: boolean): JQuery;
/**
* Get the buttonText option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonText'
*/
datepicker(methodName: 'option', optionName: 'buttonText'): string;
/**
* Set the buttonText option, after initialization
*
* @param methodName 'option'
* @param optionName 'buttonText'
* @param buttonTextValue The text to display on the trigger button. Use in conjunction with the showOn option set to "button" or "both".
*/
datepicker(methodName: 'option', optionName: 'buttonText', buttonTextValue: string): JQuery;
/**
* Gets the value currently associated with the specified optionName.
*