From 5c238d9fce7371d1a859690e62fac4f8783e7901 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Mon, 19 Nov 2012 03:03:40 +0200 Subject: [PATCH] Add Foundation definitions and tests --- README.md | 1 + foundation/foundation-3.2.d.ts | 65 ++++++++++++++++++++++++++++++++++ foundation/foundation-tests.ts | 33 +++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 foundation/foundation-3.2.d.ts create mode 100644 foundation/foundation-tests.ts diff --git a/README.md b/README.md index 0db7e815a..a40c832d4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Complete * [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov)) +* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper)) * [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [History.js](https://github.com/balupton/History.js/) (by [Boris Yankov](https://github.com/borisyankov)) diff --git a/foundation/foundation-3.2.d.ts b/foundation/foundation-3.2.d.ts new file mode 100644 index 000000000..63d0a3eef --- /dev/null +++ b/foundation/foundation-3.2.d.ts @@ -0,0 +1,65 @@ +// Type definitions for Foundation 3.2 +// Project: http://foundation.zurb.com/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +interface OrbitOptions { + animation?: string; + animationSpeed?: number; + timer?: bool; + resetTimerOnClick?: bool; + advanceSpeed?: number; + pauseOnHover?: bool; + startClockOnMouseOut?: bool; + startClockOnMouseOutAfter?: number; + directionalNav?: number; + captions?: number; + captionAnimation?: string; + captionAnimationSpeed?: number; + bullets?: bool; + bulletThumbs?: bool; + bulletThumbLocation?: string; + afterSlideChange?: () => void; + fluid?: bool; +} + +interface RevealOptions { + animation?: string; + animationSpeed?: number; + closeOnBackgroundClick?: bool; + dismissModalClass?: string; + open?: () => void; + opened?: () => void; + close?: () => void; + closed?: () => void; +} + +interface JoyrideOptions { + tipLocation?: string; + nubPosition?: string; + scrollSpeed?: number; + timer?: number; + startTimerOnClick?: bool; + nextButton?: bool; + tipAnimation?: string; + pauseAfter?: number[]; + tipAnimationFadeSpeed?: number; + cookieMonster?: bool; + cookieName?: string; + cookieDomain?: bool; + tipContainer?: string; + postRideCallback?: () => void; + postStepCallback?: () => void; +} + +interface JQuery { + orbit(): JQuery; + orbit(OrbitOptions): JQuery; + reveal(): JQuery; + reveal(RevealOptions): JQuery; + joyride(): JQuery; + joyride(JoyrideOptions): JQuery; +} diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts new file mode 100644 index 000000000..5c562ea1b --- /dev/null +++ b/foundation/foundation-tests.ts @@ -0,0 +1,33 @@ +/// +/// + +function test_orbit() { + $("#featured").orbit(); + $('#featured').orbit({ + animation: 'fade', + animationSpeed: 800, + timer: true, + resetTimerOnClick: false, + advanceSpeed: 4000, + pauseOnHover: false, + startClockOnMouseOut: false, + startClockOnMouseOutAfter: 1000, + directionalNav: true, + captions: true, + captionAnimation: 'fade', + captionAnimationSpeed: 800, + bullets: false, + bulletThumbs: false, + bulletThumbLocation: '', + afterSlideChange: function () { }, + fluid: true + }); +} + +function test_fluid() { + $("#myModal").reveal(); +} + +function test_joyride() { + $("#chooseID").joyride(); +} \ No newline at end of file