Skip to content

Commit 2f1ba9a

Browse files
committed
Merge branch 'master' into patch-2
Conflicts: angularfire/angularfire.d.ts
2 parents f35df7a + 36a4540 commit 2f1ba9a

File tree

10 files changed

+5207
-12
lines changed

10 files changed

+5207
-12
lines changed

angular-file-upload/angular-file-upload-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ module controllers {
2929
},
3030
file: file
3131
})
32+
.abort()
33+
.xhr((evt: any) => {
34+
console.log('xhr');
35+
})
3236
.progress((evt: angular.angularFileUpload.IFileProgressEvent) => {
3337
var percent = parseInt((100.0 * evt.loaded / evt.total).toString(), 10);
3438
console.log("upload progress: " + percent + "% for " + evt.config.file.name);

angular-file-upload/angular-file-upload.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ declare module angular.angularFileUpload {
1414
}
1515

1616
interface IUploadPromise<T> extends IHttpPromise<T> {
17-
17+
abort(): IUploadPromise<T>;
1818
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
19+
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
1920
}
2021

2122
interface IFileUploadConfig extends IRequestConfig {

angularfire/angularfire-tests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
4646

4747
// AngularFireObject
4848
{
49-
var obj = sync.$asObject();
49+
var obj = $FirebaseObject(ref);
5050

5151
// $id
5252
if (obj.$id !== ref.name()) throw "error";
@@ -63,7 +63,7 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
6363
});
6464

6565
// $ref()
66-
if (obj.$ref() !== sync) throw "error";
66+
if (obj.$ref() !== ref) throw "error";
6767

6868
// $bindTo()
6969
obj.$bindTo($scope, "data").then(function () {
@@ -92,10 +92,10 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
9292

9393
// AngularFireArray
9494
{
95-
var list = sync.$asArray();
95+
var list = $FirebaseArray(ref);
9696

9797
// $ref()
98-
if (list.$ref() !== sync) throw "error";
98+
if (list.$ref() !== ref) throw "error";
9999

100100
// $add()
101101
list.$add({ foo: "foo value" });

angularfire/angularfire.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ interface AngularFireObject extends AngularFireSimpleObject {
9494
/**
9595
* @returns {Firebase} the original Firebase instance used to create this object.
9696
*/
97-
$ref(): AngularFire;
97+
$ref(): Firebase;
9898

9999
/**
100100
* Creates a 3-way data sync between this object, the Firebase server, and a
@@ -277,7 +277,7 @@ interface AngularFireArray extends Array<AngularFireSimpleObject> {
277277
/**
278278
* @returns {Firebase} the original Firebase ref used to create this object.
279279
*/
280-
$ref(): AngularFire;
280+
$ref(): Firebase;
281281

282282
/**
283283
* Listeners passed into this method are notified whenever a new change (add, updated,

farbtastic/farbtastic-tests.ts

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/// <reference path="farbtastic.d.ts" />
2+
3+
var callback = () => {};
4+
var domNode = document.createElement("div");
5+
6+
// Basic usage
7+
8+
// Can add a ready() handler to the document which initializes the color picker and links it to the text field
9+
$(document).ready(function() {
10+
$("#colorpicker").farbtastic("#color");
11+
});
12+
13+
// Advanced Usage: jQuery Method
14+
15+
// Create color pickers in the selected objects
16+
$("#colorpicker").farbtastic();
17+
18+
// Optional callback using a callback function
19+
$("#colorpicker").farbtastic(callback);
20+
$("#colourpicker").farbtastic(function (color) {
21+
console.log(typeof color === "string");
22+
});
23+
24+
// Optional callback using a DOM node
25+
$("#colorpicker").farbtastic(domNode);
26+
27+
// Optional callback using a jQuery object
28+
$("#colorpicker").farbtastic($("#color"));
29+
30+
// Optional callback using a jQuery selector
31+
$("#colorpicker").farbtastic("#color");
32+
33+
// Advanced Usage: Object
34+
35+
// Can invoke method for returning Farbtastic object instead of a jQuery object
36+
$.farbtastic(domNode);
37+
$.farbtastic($("#color"));
38+
$.farbtastic("#color");
39+
40+
// Optional callback using a callback function
41+
$.farbtastic(domNode, callback);
42+
$.farbtastic($("#color"), callback);
43+
$.farbtastic("#color", callback);
44+
45+
// Optional callback using a DOM node
46+
$.farbtastic(domNode, domNode);
47+
$.farbtastic($("#color"), domNode);
48+
$.farbtastic("#color", domNode);
49+
50+
// Optional callback using a jQuery object
51+
$.farbtastic(domNode, $("#color"));
52+
$.farbtastic($("#color"), $("#color"));
53+
$.farbtastic("#color", $("#color"));
54+
55+
// Optional callback using a jQuery selector
56+
$.farbtastic(domNode, "#color");
57+
$.farbtastic($("#color"), "#color");
58+
$.farbtastic("#color", "#color");
59+
60+
// Advanced Usage: Options
61+
$("#colorpicker").farbtastic({
62+
callback: (color) => {
63+
console.log(color);
64+
}
65+
});
66+
$.farbtastic(domNode, {
67+
width: 500
68+
});
69+
$.farbtastic($("#color"), {
70+
wheelWidth: 300
71+
});
72+
$.farbtastic("#color", {});
73+
74+
// Advanced Usage: Methods
75+
$.farbtastic("#colorpicker").linkTo(callback);
76+
$.farbtastic("#colorpicker").linkTo(domNode);
77+
$.farbtastic("#colorpicker").linkTo("#color");
78+
$.farbtastic("#colorpicker").linkTo($("#color"));
79+
80+
$.farbtastic("#colorpicker").setColor("#aabbcc");
81+
$.farbtastic("#colorpicker").setColor([0.1, 0.2, 0.3]);
82+
$.farbtastic("#colorpicker").setHSL([0.1, 0.2, 0.3]);
83+
84+
// Advanced Usage: Properties
85+
$.farbtastic("#colorpicker").color === "#aabbcc";
86+
$.farbtastic("#colorpicker").hsl === [0.1, 0.2, 0.3];
87+
$.farbtastic("#colorpicker").linked === $("#colorpicker");
88+
$.farbtastic("#colorpicker").linked === callback;
89+
90+
// Can chain jQuery methods
91+
$("#colorpicker")
92+
.farbtastic()
93+
.addClass("color-picker");
94+
95+
// Can chain Farbtastic methods
96+
$.farbtastic("#colorpicker")
97+
.linkTo(domNode)
98+
.setColor("#000000")
99+
.setHSL([0, 0, 0]);
100+

farbtastic/farbtastic.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Type definitions for Farbtastic: jQuery Color Wheel v2.0.0-alpha.1
2+
// Project: http://mattfarina.github.io/farbtastic/
3+
// Definitions by: Matt Brooks <https://github.com/EnableSoftware>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../jquery/jquery.d.ts" />
7+
8+
declare module JQueryFarbtastic {
9+
type Placeholder = string | Element | JQuery;
10+
type CallbackFunction = (color: string) => any;
11+
type Callback = CallbackFunction | Placeholder;
12+
13+
interface Options {
14+
callback?: Callback;
15+
width?: number;
16+
wheelWidth?: number;
17+
}
18+
19+
interface Farbtastic {
20+
linked: CallbackFunction | JQuery;
21+
color: string;
22+
hsl: number[];
23+
24+
linkTo(callback: Callback): Farbtastic;
25+
setColor(color: string | number[]): Farbtastic;
26+
setHSL(hsl: number[]): Farbtastic;
27+
}
28+
}
29+
30+
interface JQueryStatic {
31+
farbtastic(placeholder: JQueryFarbtastic.Placeholder, callback: JQueryFarbtastic.Callback): JQueryFarbtastic.Farbtastic;
32+
farbtastic(placeholder: JQueryFarbtastic.Placeholder, options: JQueryFarbtastic.Options): JQueryFarbtastic.Farbtastic;
33+
farbtastic(placeholder: JQueryFarbtastic.Placeholder): JQueryFarbtastic.Farbtastic;
34+
}
35+
36+
interface JQuery {
37+
farbtastic(callback: JQueryFarbtastic.Callback): JQuery;
38+
farbtastic(options: JQueryFarbtastic.Options): JQuery;
39+
farbtastic(): JQuery;
40+
}

jquery.placeholder/jquery.placeholder-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
/// <reference path="jquery.placeholder.d.ts"/>
33

44
$('input').placeholder();
5+
6+
// specify custom class
7+
$('input').placeholder({ customClass: 'my-placeholder' });
8+
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// Type definitions for jquery.placeholder.js 2.0.7
1+
// Type definitions for jquery.placeholder.js 2.1.1
22
// Project: https://github.com/mathiasbynens/jquery-placeholder
3-
// Definitions by: Peter Gill <https://github.com/majorsilence>
3+
// Definitions by: Peter Gill <https://github.com/majorsilence>, Neil Culver <https://github.com/EnableSoftware>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
55

66
/// <reference path="../jquery/jquery.d.ts"/>
77

88
interface JQuery {
9-
10-
placeholder() : void;
11-
9+
placeholder(options: { customClass: string }) : JQuery
10+
placeholder() : JQuery
1211
}
1312

0 commit comments

Comments
 (0)