forked from bitovi/documentjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic.js
54 lines (54 loc) · 1.32 KB
/
static.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
steal.then(function() {
/**
* @class DocumentJS.types.static
* @tag documentation
* @parent DocumentJS.types
* Sets the following functions and attributes to be added to Class or Constructor static (class) functions.
*
* ###Example
*
* @codestart
* $.Model.extend('Cookbook.Models.Recipe',
* /* @Static *|
* {
* /**
* * Retrieves recipes data from your backend services.
* * @param {Object} params params that might refine your results.
* * @param {Function} success a callback function that returns wrapped recipe objects.
* * @param {Function} error a callback function for an error in the ajax request.
* *|
* findAll : function(params, success, error){
* $.ajax({
* url: '/recipe',
* type: 'get',
* dataType: 'json',
* data: params,
* success: this.callback(['wrapMany',success]),
* error: error,
* fixture: "//cookbook/fixtures/recipes.json.get" //calculates the fixture path from the url and type.
* })
* },
* ...
* @codeend
*/
DocumentJS.Type("static",
/*
* @Static
*/
{
/*
* @return {Object} prototype data.
*/
code: function() {
return {
name: "static"
}
},
/*
* Possible scopes for @static.
*/
parent: /script|class/,
useName: true,
hasChildren: true
})
})