From e8b3b4c4cee3786bc71bd205c269f59110eac2f6 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Tue, 14 Jan 2014 22:19:02 +0100 Subject: [PATCH 1/9] Added JQueryMobilePath interface See http://api.jquerymobile.com/category/methods/path/ --- jquerymobile/jquerymobile.d.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index e7f92e8a2..dfc2a1de7 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -298,6 +298,30 @@ interface LoaderOptions { textonly?: boolean; } +interface JQueryMobilePath { + get(url: string): string; + getDocumentBase(asParsedObject?: boolean): any; + getDocumentUrl(asParsedObject?: boolean): any; + getLocation(): string; + isAbsoluteUrl(url: string): boolean; + isRelativeUrl(url: string): boolean; + makeUrlAbsolute(relUrl: string, absUrl: string): string; + parseLocation(): ParsedPath; + parseUrl(url): ParsedPath; +} + +interface ParsedPath { + hash: string; + host: string; + hostname: string; + href: string; + pathname: string; + port: string; + protocol: string; + search: string; +} + + interface JQueryMobile extends JQueryMobileOptions { version: string; @@ -321,7 +345,7 @@ interface JQueryMobile extends JQueryMobileOptions { touchOverflow: any; showCategory: any; - path: any; + path: JQueryMobilePath; dialog: any; popup: any; From 2f06bb165b10d96de3e224e4cfe4b43b84bfc934 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Tue, 14 Jan 2014 22:22:03 +0100 Subject: [PATCH 2/9] Added flipswitch widget. --- jquerymobile/jquerymobile.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index dfc2a1de7..d73675d97 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -355,6 +355,7 @@ interface JQueryMobile extends JQueryMobileOptions { collapsibleset: any; textinput: any; slider: any; + flipswitch: any; checkboxradio: any; selectmenu: any; listview: any; @@ -411,6 +412,9 @@ interface JQuery { slider(options: SliderOptions): JQuery; slider(events: SliderEvents): JQuery; + flipswitch(): JQuery; + flipswitch(command: string): JQuery; + checkboxradio(): JQuery; checkboxradio(command: string): JQuery; checkboxradio(options: CheckboxRadioOptions): JQuery; From 7b2bc7f87214ecdd7994124d4a7c7871b1255925 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Tue, 14 Jan 2014 22:23:48 +0100 Subject: [PATCH 3/9] Bump to 1.4 Removed showPageLoadingMsg and hidePageLoadingMsg --- jquerymobile/jquerymobile.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index d73675d97..a3a07f066 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery Mobile 1.2 +// Type definitions for jQuery Mobile 1.4 // Project: http://jquerymobile.com/ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -338,8 +338,6 @@ interface JQueryMobile extends JQueryMobileOptions { options: JQueryMobileOptions; transitionFallbacks: any; - showPageLoadingMsg(): void; - hidePageLoadingMsg(): void; loader: any; page: any; From 4556398069496512dd8991ddaff8d768471d1d6f Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Tue, 14 Jan 2014 22:28:29 +0100 Subject: [PATCH 4/9] Added new enhanceWithin() method. --- jquerymobile/jquerymobile.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index a3a07f066..efb028b8f 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -366,6 +366,8 @@ interface JQuerySupport { interface JQuery { + enhanceWithin(): JQuery; + dialog(): JQuery; dialog(command: string): JQuery; dialog(options: DialogOptions): JQuery; From 1c695a17ee7f0f01a18d29090ffe06acb371eb89 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Tue, 14 Jan 2014 22:28:46 +0100 Subject: [PATCH 5/9] Added pagecontainer as a property. --- jquerymobile/jquerymobile.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index efb028b8f..44dc78e62 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -331,6 +331,7 @@ interface JQueryMobile extends JQueryMobileOptions { loadPage(url: any, options?: LoadPageOptions): void; loading(command: string, options?: LoaderOptions): void; + pageContainer: any; base: any; silentScroll(yPos: number): void; activePage: JQuery; From 2625222bb4adc940fe36f35c26f984173da0e5a4 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Wed, 15 Jan 2014 15:48:56 +0100 Subject: [PATCH 6/9] Fixed loading method Added empty loading method + return a JQuery object instead of void --- jquerymobile/jquerymobile.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index 44dc78e62..48c6459e1 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -329,7 +329,8 @@ interface JQueryMobile extends JQueryMobileOptions { changePage(to: any, options?: ChangePageOptions): void; initializePage(): void; loadPage(url: any, options?: LoadPageOptions): void; - loading(command: string, options?: LoaderOptions): void; + loading(): JQuery; + loading(command: string, options?: LoaderOptions): JQuery; pageContainer: any; base: any; From 4df797ddbc8894bdc39b9b8f78101fbed0304308 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Thu, 16 Jan 2014 16:26:45 +0100 Subject: [PATCH 7/9] Removed methods which don't exist anymore. --- jquerymobile/jquerymobile-tests.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/jquerymobile/jquerymobile-tests.ts b/jquerymobile/jquerymobile-tests.ts index a21340932..19231849f 100644 --- a/jquerymobile/jquerymobile-tests.ts +++ b/jquerymobile/jquerymobile-tests.ts @@ -25,9 +25,6 @@ function test_api() { var isAbs = $.mobile.path.isAbsoluteUrl("//foo.com/a/file.html"); var dirName = $.mobile.path.get("http://foo.com/a"); $.mobile.silentScroll(100); - - $.mobile.showPageLoadingMsg(); - $.mobile.hidePageLoadingMsg(); } function test_pagesDialogs() { @@ -258,4 +255,4 @@ function test_listview() { function test_misc() { $.mobile.initializePage(); -} +} From 1be250fdbefd79e4275cafe4ded1bba978f3fdcd Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Thu, 16 Jan 2014 16:27:30 +0100 Subject: [PATCH 8/9] Fixed issue with noImplicitAny --- jquerymobile/jquerymobile.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index 48c6459e1..56139b5ba 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -307,7 +307,7 @@ interface JQueryMobilePath { isRelativeUrl(url: string): boolean; makeUrlAbsolute(relUrl: string, absUrl: string): string; parseLocation(): ParsedPath; - parseUrl(url): ParsedPath; + parseUrl(url: string): ParsedPath; } interface ParsedPath { From 75b4512de3958827ac073aec29f5149c5d6d4c1e Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Fri, 17 Jan 2014 09:17:22 +0100 Subject: [PATCH 9/9] Added flipswitch options --- jquerymobile/jquerymobile.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index 56139b5ba..d81e43900 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -143,6 +143,18 @@ interface SliderEvents { slidestop?: JQueryMobileEvent; } +interface FlipswitchOptions { + corners?: boolean; + defaults?: boolean; + disabled?: boolean; + enhanced?: boolean; + mini?: boolean; + offText?: string; + onText?: string; + theme?: string; + wrapperClass?: string; +} + interface CheckboxRadioOptions { mini?: boolean; theme?: string; @@ -416,6 +428,7 @@ interface JQuery { flipswitch(): JQuery; flipswitch(command: string): JQuery; + flipswitch(options: FlipswitchOptions): JQuery; checkboxradio(): JQuery; checkboxradio(command: string): JQuery;