Skip to content

Commit 2ca2826

Browse files
Update meteor version and take off basic docs
1 parent 7afb5b3 commit 2ca2826

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+13840
-7932
lines changed

.meteor/.finished-upgraders

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file contains information which helps Meteor properly upgrade your
2+
# app when you run 'meteor update'. You should check it into version control
3+
# with your project.
4+
5+
notices-for-0.9.0
6+
notices-for-0.9.1
7+
0.9.4-platform-file

.meteor/.id

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file contains a token that is unique to your project.
2+
# Check it into your repository along with the rest of this directory.
3+
# It can be used for purposes such as:
4+
# - ensuring you don't accidentally deploy one app on top of another
5+
# - providing package authors with aggregated statistics
6+
7+
1x3xybpy9qs9uwd4f0s

.meteor/packages

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ standard-app-packages
77
jquery
88
underscore
99
showdown
10-
code-prettify
1110
jquery-waypoints
12-
less
1311
spiderable
1412
appcache
15-
handlebars
13+
reload-safetybelt
14+
simple:markdown-templating
15+
simple:highlight.js
16+
less

.meteor/platforms

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server
2+
browser

.meteor/release

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sso-1
1+

client/api-box.html

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<template name="apiBoxTitle">
2+
<h3 id="{{id}}" class="api-title">
3+
<a class="name selflink" href="{{link}}">{{{name}}}</a>
4+
{{#if locus}}
5+
<span class="locus">{{locus}}</span>
6+
{{/if}}
7+
</h3>
8+
</template>
9+
10+
<template name="autoApiBox">
11+
{{#with apiData this}}
12+
<div class="api {{bare}} new-api-box">
13+
{{> apiBoxTitle name=signature locus=locus id=id}}
14+
15+
<div class="desc">
16+
{{#markdown}}{{summary}}{{/markdown}}
17+
</div>
18+
19+
{{#if paramsNoOptions}}
20+
<h4>Arguments</h4>
21+
<dl class="args">
22+
{{#each paramsNoOptions}}
23+
<dt>
24+
<span class="name">{{name}}</span>
25+
<span class="type">{{{typeNames type.names}}}</span>
26+
</dt>
27+
<dd>
28+
{{{description}}}
29+
</dd>
30+
{{/each}}
31+
</dl>
32+
{{/if}}
33+
34+
{{#if options}}
35+
<h4>Options</h4>
36+
<dl class="args">
37+
{{#each options}}
38+
<dt>
39+
<span class="name">{{name}}</span>
40+
<span class="type">{{{typeNames type.names}}}</span>
41+
</dt>
42+
<dd>
43+
{{{description}}}
44+
</dd>
45+
{{/each}}
46+
</dl>
47+
{{/if}}
48+
49+
{{#if UI.contentBlock}}
50+
{{#markdown}}{{> UI.contentBlock}}{{/markdown}}
51+
{{/if}}
52+
</div>
53+
{{/with}}
54+
</template>
55+
56+
<template name="api_box_args">
57+
<dl class="args">
58+
{{#each this}}
59+
<dt><span class="name">{{{name}}}</span>
60+
<span class="type">
61+
{{#if type_link}}
62+
<a href="#{{type_link}}">{{{type}}}</a>
63+
{{else}}
64+
{{{type}}}
65+
{{/if}}
66+
</span></dt>
67+
<dd>{{#markdown}}{{{descr}}}{{/markdown}}</dd>
68+
{{/each}}
69+
</dl>
70+
</template>

client/api-box.js

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
var apiData = function (options) {
2+
options = options || {};
3+
if (typeof options === "string") {
4+
options = {name: options};
5+
}
6+
7+
var root = DocsData[options.name];
8+
9+
if (! root) {
10+
console.log("API Data not found: " + options.name);
11+
}
12+
13+
if (_.has(options, 'options')) {
14+
root = _.clone(root);
15+
var includedOptions = options.options.split(';');
16+
root.options = _.filter(root.options, function (option) {
17+
return _.contains(includedOptions, option.name);
18+
});
19+
}
20+
21+
return root;
22+
};
23+
24+
var typeLink = function (displayName, url) {
25+
return "<a href='" + url + "'>" + displayName + "</a>";
26+
};
27+
28+
var toOrSentence = function (array) {
29+
if (array.length === 1) {
30+
return array[0];
31+
} else if (array.length === 2) {
32+
return array.join(" or ");
33+
}
34+
35+
return _.initial(array).join(", ") + ", or " + _.last(array);
36+
};
37+
38+
var typeNameTranslation = {
39+
"function": "Function",
40+
EJSON: typeLink("EJSON-able Object", "#ejson"),
41+
EJSONable: typeLink("EJSON-able Object", "#ejson"),
42+
"Tracker.Computation": typeLink("Tracker.Computation", "#tracker_computation"),
43+
MongoSelector: [
44+
typeLink("Mongo Selector", "#selectors"),
45+
typeLink("Object ID", "#mongo_object_id"),
46+
"String"
47+
],
48+
MongoModifier: typeLink("Mongo Modifier", "#modifiers"),
49+
MongoSortSpecifier: typeLink("Mongo Sort Specifier", "#sortspecifiers"),
50+
MongoFieldSpecifier: typeLink("Mongo Field Specifier", "#fieldspecifiers"),
51+
JSONCompatible: "JSON-compatible Object",
52+
EventMap: typeLink("Event Map", "#eventmaps"),
53+
DOMNode: typeLink("DOM Node", "https://developer.mozilla.org/en-US/docs/Web/API/Node"),
54+
"Blaze.View": typeLink("Blaze.View", "#blaze_view"),
55+
Template: typeLink("Blaze.Template", "#blaze_template"),
56+
DOMElement: typeLink("DOM Element", "https://developer.mozilla.org/en-US/docs/Web/API/element"),
57+
MatchPattern: typeLink("Match Pattern", "#matchpatterns")
58+
};
59+
60+
Template.autoApiBox.helpers({
61+
apiData: apiData,
62+
typeNames: function (nameList) {
63+
// change names if necessary
64+
nameList = _.map(nameList, function (name) {
65+
// decode the "Array.<Type>" syntax
66+
if (name.slice(0, 7) === "Array.<") {
67+
// get the part inside angle brackets like in Array<String>
68+
name = name.match(/<([^>]+)>/)[1];
69+
70+
if (name && typeNameTranslation.hasOwnProperty(name)) {
71+
return "Array of " + typeNameTranslation[name] + "s";
72+
}
73+
74+
if (name) {
75+
return "Array of " + name + "s";
76+
}
77+
78+
console.log("no array type defined");
79+
return "Array";
80+
}
81+
82+
if (typeNameTranslation.hasOwnProperty(name)) {
83+
return typeNameTranslation[name];
84+
}
85+
86+
return name;
87+
});
88+
89+
nameList = _.flatten(nameList);
90+
91+
return toOrSentence(nameList);
92+
},
93+
signature: function () {
94+
var signature;
95+
var escapedLongname = _.escape(this.longname);
96+
97+
if (this.istemplate || this.ishelper) {
98+
if (this.istemplate) {
99+
signature = "{{> ";
100+
} else {
101+
signature = "{{ ";
102+
}
103+
104+
signature += escapedLongname;
105+
106+
var params = this.params;
107+
108+
var paramNames = _.map(params, function (param) {
109+
var name = param.name;
110+
111+
name = name + "=" + name;
112+
113+
if (param.optional) {
114+
return "[" + name + "]";
115+
}
116+
117+
return name;
118+
});
119+
120+
signature += " " + paramNames.join(" ");
121+
122+
signature += " }}";
123+
} else {
124+
var beforeParens;
125+
if (this.scope === "instance") {
126+
beforeParens = "<em>" + apiData(this.memberof).instancename + "</em>." + this.name;
127+
} else if (this.kind === "class") {
128+
beforeParens = "new " + escapedLongname;
129+
} else {
130+
beforeParens = escapedLongname;
131+
}
132+
133+
signature = beforeParens;
134+
135+
// if it is a function, and therefore has arguments
136+
if (_.contains(["function", "class"], this.kind)) {
137+
var params = this.params;
138+
139+
var paramNames = _.map(params, function (param) {
140+
if (param.optional) {
141+
return "[" + param.name + "]";
142+
}
143+
144+
return param.name;
145+
});
146+
147+
signature += "(" + paramNames.join(", ") + ")";
148+
}
149+
}
150+
151+
return signature;
152+
},
153+
id: function () {
154+
if (true && nameToId[this.longname]) {
155+
return nameToId[this.longname];
156+
}
157+
158+
// fallback
159+
return this.longname.replace(/[.#]/g, "-");
160+
},
161+
paramsNoOptions: function () {
162+
return _.reject(this.params, function (param) {
163+
return param.name === "options";
164+
});
165+
}
166+
});
167+
168+
Template.apiBoxTitle.helpers({
169+
link: function () {
170+
return '#/' + 'full' + '/' + this.id;
171+
}
172+
});
173+
174+
Template.autoApiBox.onRendered(function () {
175+
this.$('pre code').each(function(i, block) {
176+
hljs.highlightBlock(block);
177+
});
178+
});
179+

0 commit comments

Comments
 (0)