/
index.phtml
133 lines (120 loc) · 5.59 KB
/
index.phtml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<div id="catch-phrase"><i>simple</i> <b>API search</b></div>
<table id="external_table"><tbody><tr id="topbar"><td>
<div id="search">
<form action="post" onsubmit="return false">
<span id="small-logo" style="display:none" title="Return to the short description">back to sna<span class="snaapi">api</span></span>
<input type="text" class="text" size="50" maxlength="50" name="search" autocomplete="off" />
<div class="dropdown" style="display:none"></div>
<div class="filters" style="display:none"></div>
</form>
</div>
<div id="result" style="display:none"></div></td></tr>
<tr><td id="external_page" style="display:none"></td></tr></tbody></table>
<?
$hide = ($this->category && $this->id && $this->type) ? ' style="display:none"' : '';
if( !Zend_Auth::getInstance()->hasIdentity() ) { ?>
<div id="whyjoin"<?=$hide?>>
<div class="rhetorical">Why should you <a href="/signup">sign up</a>?</div>
<div class="answer">Because snaapi's about to make your life <i>easier</i>.</div>
<div class="more-details"><p>The idea behind snaapi is simple: to <b>provide a simple interface for
common programming APIs</b>.</p>
<p>We've built spiders that scour popular API documentations, index their functions, and make
them available in the snaapi index.</p>
<p><b>But here's the cool part</b>. Once
an API is listed in the database, <i>anyone</i> can add snippets of code and links to websites
that dive deeper into the function's use. <b>This lets snaapi not only index APIs, but also the
useful, community-created content that surrounds them</b>.</p>
<p>Did we mention that <b>we support OpenID</b>?</p>
<div id="auth"><div class="login">
<div class="form">
<form method="post" action="/auth/login"><fieldset>
<div class="services">
<img src="/gfx/openidicon.gif" alt="Services" title="OpenID Services" />
<div class="list">
<div class="service myOpenID"><img width="16" height="16" src="http://www.myopenid.com/favicon.ico" alt="" />myOpenID</div>
<div class="service yahoo"><img width="16" height="16" src="http://www.yahoo.com/favicon.ico" alt="" />Yahoo!</div>
<div class="service flickr"><img width="16" height="16" src="http://flickr.com/favicon.ico" alt="" />flickr</div>
<div class="service blogger"><img width="16" height="16" src="http://www.aol.com/favicon.ico" alt="" />Blogger</div>
<div class="bottombar"><span class="servicename"></span> username: <input class="text" type="text" value="username" /></div>
</div>
</div>
<div class="loginform">
<input id="openid_url" class="text" type="text" name="openid_url" size="35" maxlength="100" autocomplete="off"value="<?= isset($this->openid_url) ? $this->openid_url : 'http://' ?>" />
<input class="button" type="submit" name="openid_action" value="log in" />
</div>
<? if( isset($this->error) ) { ?>
<div class="errors">
<?= $this->error ?>
</div>
<? } ?>
</fieldset></form>
</div>
</div></div>
<div id="social_sites">
<script type="text/javascript">
digg_url = "http://snaapi.com/";
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
</div>
</div>
<? } else { ?>
<div id="whyjoin"<?=$hide?>>
<div class="rhetorical">Welcome to snaapi!</div>
<div class="more-details"><p>How do you use this thing? <b>Type the name of a function you want to find.</b></p>
<p>By
default snaapi searches <i>all</i> languages and frameworks, but if you want to be more specific just
type <tt>#<i>language</i></tt>. If the language you want is indexed it'll show up in the list
for you to select.</p>
<p>tip: We're hoping to make <tt>#<i>language</i> <i>function name</i></tt> work soon,
but for the time being you'll have to hit enter after selecting your language.</p>
<p>If you have any questions, <a href="/contact">drop us a line</a>.</p></div>
<div id="social_sites">
<script type="text/javascript">
digg_url = "http://snaapi.com/";
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
</div>
<? } ?>
<?php
$this->headLink()->appendStylesheet('/css/openid.css');
$this->headLink()->appendStylesheet('/css/index.css');
$this->inlineScript()->appendFile('/js/jquery.cookie.js');
if ('production' == $this->env) {
$this->inlineScript()->appendFile('/js/snap/core.js');
$this->inlineScript()->appendFile('/js/snap/ui.js');
} else {
$this->inlineScript()->appendFile('/js/snap/core/snap.js');
$this->inlineScript()->appendFile('/js/snap/ui/ghost-input.js');
$this->inlineScript()->appendFile('/js/snap/ui/database.js');
$this->inlineScript()->appendFile('/js/snap/ui/type-ahead.js');
$this->inlineScript()->appendFile('/js/snap/ui/openid-login.js');
}
$this->inlineScript()->appendFile('/js/page/dashboard.js');
if( $this->category && $this->type && $this->filter_type ) {
if( $this->id ) {
?>
<div id="search_engine">
<h1><?= $this->function_name ?></h1>
<h2><?= $this->function_desc ?></h2>
</div>
<?php
$this->inlineScript()->prependScript(
'window.sel = {'.
'category:'.$this->category.','.
'function_id:'.$this->id.','.
'name:"'.$this->function_name.'",'.
'type:"'.$this->type.'",'.
'filter_type:"'.$this->filter_type.'",'.
'hierarchy:'.$this->hierarchy.'};'
);
} else {
$this->inlineScript()->prependScript(
'window.sel = {'.
'category:'.$this->category.','.
'type:"'.$this->type.'",'.
'filter_type:"'.$this->filter_type.'"};'
);
}
}