Skip to content

Commit 9e24a05

Browse files
committed
Namespace the various Foundation option interfaces to prevent conflicts.
1 parent 25cad40 commit 9e24a05

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

foundation/foundation-tests.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function plugin_list() {
2424
}
2525

2626
function abide_patterns() {
27-
var patterns : AbidePatterns;
27+
var patterns : FoundationAbidePatterns;
2828
patterns.alpha = /^[a-zA-Z]+$/;
2929
patterns.alpha_numeric = /^[a-zA-Z0-9]+$/;
3030
patterns.integer = /^[-+]?\d+$/;
@@ -44,7 +44,7 @@ function abide_patterns() {
4444
}
4545

4646
function abide_options() {
47-
var opts : AbideOptions = {};
47+
var opts : FoundationAbideOptions = {};
4848
opts.live_validate = false;
4949
opts.validate_on_blur = true;
5050
opts.focus_on_invalid = true;
@@ -65,7 +65,7 @@ function abide_options() {
6565
}
6666

6767
function accordion_options() {
68-
var opts : AccordionOptions = {};
68+
var opts : FoundationAccordionOptions = {};
6969
opts.content_class = "content";
7070
opts.active_class = "class-name";
7171
opts.multi_expand = false;
@@ -75,13 +75,13 @@ function accordion_options() {
7575
}
7676

7777
function alert_options() {
78-
var opts : AlertOptions = {};
78+
var opts : FoundationAlertOptions = {};
7979
opts.callback = empty_callback;
8080
return opts;
8181
}
8282

8383
function clearing_options() {
84-
var opts : ClearingOptions = {};
84+
var opts : FoundationClearingOptions = {};
8585
opts.templates = {
8686
viewing : '<div>Some HTML</div>'
8787
};
@@ -95,7 +95,7 @@ function clearing_options() {
9595
}
9696

9797
function dropdown_options() {
98-
var opts : DropdownOptions = {};
98+
var opts : FoundationDropdownOptions = {};
9999
opts.active_class = "class-name";
100100
opts.disabled_class = "disabled-class";
101101
opts.mega_class = "big";
@@ -108,14 +108,14 @@ function dropdown_options() {
108108
}
109109

110110
function equalizer_options() {
111-
var opts : EqualizerOptions = {};
111+
var opts : FoundationEqualizerOptions = {};
112112
opts.use_tallest = true;
113113
opts.equalize_on_stack = false;
114114
return opts;
115115
}
116116

117117
function interchange_options() {
118-
var opts : InterchangeOptions = {};
118+
var opts : FoundationInterchangeOptions = {};
119119
opts.load_attr = "interchange";
120120
opts.named_queries = {
121121
my_custom_query: "only screen and (max-width: 200px)"
@@ -127,7 +127,7 @@ function interchange_options() {
127127
}
128128

129129
function joyride_options() {
130-
var opts : JoyrideOptions = {};
130+
var opts : FoundationJoyrideOptions = {};
131131
opts.expose = false;
132132
opts.modal = true;
133133
opts.keyboard = true;
@@ -176,7 +176,7 @@ function joyride_options() {
176176
}
177177

178178
function magellan_options() {
179-
var opts : MagellanOptions = {};
179+
var opts : FoundationMagellanOptions = {};
180180
opts.active_class = ".active-element";
181181
opts.threshold = 20;
182182
opts.destination_threshold = 30;
@@ -189,14 +189,14 @@ function magellan_options() {
189189
}
190190

191191
function offcanvas_options() {
192-
var opts : OffCanvasOptions = {};
192+
var opts : FoundationOffCanvasOptions = {};
193193
opts.open_method = "overlap_single";
194194
opts.close_on_click = true;
195195
return opts;
196196
}
197197

198198
function orbit_options() {
199-
var opts : OrbitOptions = {};
199+
var opts : FoundationOrbitOptions = {};
200200
opts.animation = 'slide';
201201
opts.timer_speed = 10000;
202202
opts.pause_on_hover = true;
@@ -234,15 +234,15 @@ function orbit_options() {
234234
}
235235

236236
function reveal_css_options() {
237-
var opts : RevealCSSOptions = {};
237+
var opts : FoundationRevealCSSOptions = {};
238238
opts.opacity = 0;
239239
opts.visibility = 'hidden';
240240
opts.display = "inline-block";
241241
return opts;
242242
}
243243

244244
function reveal_options() {
245-
var opts : RevealOptions = {};
245+
var opts : FoundationRevealOptions = {};
246246
opts.animation = "linear";
247247
opts.animation_speed = 500;
248248
opts.close_on_background_click = false;
@@ -264,7 +264,7 @@ function reveal_options() {
264264
}
265265

266266
function slider_options() {
267-
var opts : SliderOptions;
267+
var opts : FoundationSliderOptions;
268268
opts.start = -1000;
269269
opts.end = 1000;
270270
opts.step = 50;
@@ -277,7 +277,7 @@ function slider_options() {
277277
}
278278

279279
function tab_options() {
280-
var opts : TabOptions = {};
280+
var opts : FoundationTabOptions = {};
281281
opts.active_class = "class-name";
282282
opts.callback = empty_callback;
283283
opts.deep_linking = false;
@@ -287,7 +287,7 @@ function tab_options() {
287287
}
288288

289289
function tooltip_options() {
290-
var opts : TooltipOptions = {};
290+
var opts : FoundationTooltipOptions = {};
291291
opts.additional_inheritable_classes = ["class1", "class2"];
292292
opts.tooltip_class = "tooltip";
293293
opts.append_to = "append-class";
@@ -304,7 +304,7 @@ function tooltip_options() {
304304
}
305305

306306
function topbar_options() {
307-
var opts : TopbarOptions = {};
307+
var opts : FoundationTopbarOptions = {};
308308
opts.index = 1;
309309
opts.sticky_class = "top-bar";
310310
opts.custom_back_text = true;
@@ -316,7 +316,7 @@ function topbar_options() {
316316
return opts;
317317
}
318318

319-
function foundation_options() : FoundationOptions {
319+
function foundation_options() {
320320
var opts : FoundationOptions = {};
321321
opts.abide = abide_options();
322322
opts.accordion = accordion_options();

foundation/foundation.d.ts

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// <reference path="../jquery/jquery.d.ts"/>
88

99
// http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration
10-
interface AbidePatterns {
10+
interface FoundationAbidePatterns {
1111
alpha? : RegExp;
1212
alpha_numeric? : RegExp;
1313
integer? : RegExp;
@@ -25,18 +25,18 @@ interface AbidePatterns {
2525
color? : RegExp;
2626
}
2727

28-
interface AbideOptions {
28+
interface FoundationAbideOptions {
2929
live_validate? : boolean;
3030
validate_on_blur? : boolean;
3131
focus_on_invalid? : boolean;
3232
error_labels? : boolean;
3333
timeout? : number;
34-
patterns? : AbidePatterns;
34+
patterns? : FoundationAbidePatterns;
3535
validators? : Object;
3636
}
3737

3838
// http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration
39-
interface AccordionOptions {
39+
interface FoundationAccordionOptions {
4040
content_class? : string;
4141
active_class? : string;
4242
multi_expand? : boolean;
@@ -45,12 +45,12 @@ interface AccordionOptions {
4545
}
4646

4747
// http://foundation.zurb.com/docs/components/alert_boxes.html
48-
interface AlertOptions {
48+
interface FoundationAlertOptions {
4949
callback? : () => any;
5050
}
5151

5252
// http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration
53-
interface ClearingOptions {
53+
interface FoundationClearingOptions {
5454
templates? : Object;
5555
close_selectors? : string;
5656
open_selectors? : string;
@@ -61,7 +61,7 @@ interface ClearingOptions {
6161
}
6262

6363
// http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration
64-
interface DropdownOptions {
64+
interface FoundationDropdownOptions {
6565
active_class? : string;
6666
disabled_class? : string;
6767
mega_class? : string;
@@ -73,20 +73,20 @@ interface DropdownOptions {
7373
}
7474

7575
// http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration
76-
interface EqualizerOptions {
76+
interface FoundationEqualizerOptions {
7777
use_tallest? : boolean;
7878
equalize_on_stack? : boolean;
7979
}
8080

8181
// http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries
82-
interface InterchangeOptions {
82+
interface FoundationInterchangeOptions {
8383
load_attr? : string;
8484
named_queries? : Object;
8585
directives? : Object;
8686
}
8787

8888
// http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration
89-
interface JoyrideOptions {
89+
interface FoundationJoyrideOptions {
9090
expose? : boolean;
9191
modal? : boolean;
9292
keyboard? : boolean;
@@ -133,7 +133,7 @@ interface JoyrideOptions {
133133
}
134134

135135
// http://foundation.zurb.com/docs/components/magellan.html#js
136-
interface MagellanOptions {
136+
interface FoundationMagellanOptions {
137137
active_class? : string;
138138
threshold? : number;
139139
destination_threshold? : number;
@@ -145,13 +145,13 @@ interface MagellanOptions {
145145
}
146146

147147
// http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration
148-
interface OffCanvasOptions {
148+
interface FoundationOffCanvasOptions {
149149
open_method? : string;
150150
close_on_click? : boolean;
151151
}
152152

153153
// http://foundation.zurb.com/docs/components/orbit.html#advanced
154-
interface OrbitOptions {
154+
interface FoundationOrbitOptions {
155155
animation? : string;
156156
timer_speed? : number;
157157
pause_on_hover? : boolean;
@@ -188,13 +188,13 @@ interface OrbitOptions {
188188
}
189189

190190
// http://foundation.zurb.com/docs/components/reveal.html
191-
interface RevealCSSOptions {
191+
interface FoundationRevealCSSOptions {
192192
opacity? : number;
193193
visibility? : string;
194194
display? : string;
195195
}
196196

197-
interface RevealOptions {
197+
interface FoundationRevealOptions {
198198
animation? : string;
199199
animation_speed? : number;
200200
close_on_background_click? : boolean;
@@ -209,13 +209,13 @@ interface RevealOptions {
209209
closed? : () => any;
210210
bg? : JQuery;
211211
css? : {
212-
open? : RevealCSSOptions;
213-
close? : RevealCSSOptions;
212+
open? : FoundationRevealCSSOptions;
213+
close? : FoundationRevealCSSOptions;
214214
};
215215
}
216216

217217
// http://foundation.zurb.com/docs/components/range_slider.html
218-
interface SliderOptions {
218+
interface FoundationSliderOptions {
219219
start? : number;
220220
end? : number;
221221
step? : number;
@@ -227,15 +227,15 @@ interface SliderOptions {
227227
}
228228

229229
// http://foundation.zurb.com/docs/components/tabs.html
230-
interface TabOptions {
230+
interface FoundationTabOptions {
231231
active_class? : string;
232232
callback? : () => any;
233233
deep_linking? : boolean;
234234
scroll_to_content? : boolean;
235235
is_hover? : boolean;
236236
}
237237

238-
interface TooltipOptions {
238+
interface FoundationTooltipOptions {
239239
additional_inheritable_classes? : string[];
240240
tooltip_class? : string;
241241
append_to? : string;
@@ -246,7 +246,7 @@ interface TooltipOptions {
246246
tip_template? : (selector : string, content : string) => string;
247247
}
248248

249-
interface TopbarOptions {
249+
interface FoundationTopbarOptions {
250250
index? : number;
251251
sticky_class? : string;
252252
custom_back_text? : boolean;
@@ -258,22 +258,22 @@ interface TopbarOptions {
258258
}
259259

260260
interface FoundationOptions {
261-
abide? : AbideOptions;
262-
accordion? : AccordionOptions;
263-
alert? : AlertOptions;
264-
clearing? : ClearingOptions;
265-
dropdown? : DropdownOptions;
266-
equalizer? : EqualizerOptions;
267-
interchange? : InterchangeOptions;
268-
joyride? : JoyrideOptions;
269-
magellan? : MagellanOptions;
270-
offcanvas? : OffCanvasOptions;
271-
orbit? : OrbitOptions;
272-
reveal? : RevealOptions;
273-
slider? : SliderOptions;
274-
tab? : TabOptions;
275-
tooltip? : TooltipOptions;
276-
topbar? : TopbarOptions;
261+
abide? : FoundationAbideOptions;
262+
accordion? : FoundationAccordionOptions;
263+
alert? : FoundationAlertOptions;
264+
clearing? : FoundationClearingOptions;
265+
dropdown? : FoundationDropdownOptions;
266+
equalizer? : FoundationEqualizerOptions;
267+
interchange? : FoundationInterchangeOptions;
268+
joyride? : FoundationJoyrideOptions;
269+
magellan? : FoundationMagellanOptions;
270+
offcanvas? : FoundationOffCanvasOptions;
271+
orbit? : FoundationOrbitOptions;
272+
reveal? : FoundationRevealOptions;
273+
slider? : FoundationSliderOptions;
274+
tab? : FoundationTabOptions;
275+
tooltip? : FoundationTooltipOptions;
276+
topbar? : FoundationTopbarOptions;
277277
}
278278

279279
interface FoundationStatic {

0 commit comments

Comments
 (0)