|
1 | 1 | <!doctype html>
|
2 |
| -<html xmlns:x="http://xtpl.ru/"> |
| 2 | +<html> |
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8"/>
|
5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
|
21 | 21 |
|
22 | 22 | <script x-ctrl="main" type="text/xtpl-xml">
|
23 | 23 | <div id="sidebar" class="sidebar">
|
24 |
| - <div> |
25 |
| - <div class="menu"> |
| 24 | + <div class="menu"> |
| 25 | + <div> |
26 | 26 | <ul x:if="ctx.lang == 'ru'">
|
27 | 27 | <li><a href="https://github.com/mailru/FileAPI">Репозиторий на GitHub</a></li>
|
28 | 28 | <li><a href="http://rubaxa.github.io/jquery.fileapi/">jQuery Plugin</a></li>
|
|
33 | 33 | <li><a href="./examples/caman.html">Пример #5: CamanJS</a></li>
|
34 | 34 | <li><a href="#en/{{ctx.relpath}}">English version</a></li>
|
35 | 35 | </ul>
|
| 36 | + </div> |
36 | 37 |
|
| 38 | + <div> |
37 | 39 | <ul x:if="ctx.lang != 'ru'">
|
38 | 40 | <li><a href="https://github.com/mailru/FileAPI">GitHub repository</a></li>
|
39 | 41 | <li><a href="http://rubaxa.github.io/jquery.fileapi/">jQuery Plugin</a></li>
|
|
45 | 47 | <li><a href="#ru/{{ctx.relpath}}">Русская версия</a></li>
|
46 | 48 | </ul>
|
47 | 49 | </div>
|
| 50 | + </div> |
48 | 51 |
|
| 52 | + <div> |
49 | 53 | <div class="menu" x:repeat="item in ctx.api">
|
50 | 54 | <a href="#{{ctx.lang}}/{{item.label}}" class="menu__name">{{item['class']}}</a>
|
51 | 55 | <ul>
|
|
59 | 63 | </li>
|
60 | 64 | </ul>
|
61 | 65 | </div>
|
62 |
| - <div style="height: 5px;"></div> |
63 | 66 | </div>
|
| 67 | + |
| 68 | + <div style="height: 5px;"></div> |
64 | 69 | </div>
|
65 | 70 |
|
66 | 71 | <div>
|
|
70 | 75 | <div class="content">
|
71 | 76 | <div class="logo"></div>
|
72 | 77 |
|
73 |
| - <div x:repeat="item in ctx.api"> |
74 |
| - <a name="{{ctx.lang}}/{{item.label}}"></a> |
| 78 | + <div> |
| 79 | + <div x:repeat="item in ctx.api"> |
| 80 | + <a name="{{ctx.lang}}/{{item.label}}"></a> |
75 | 81 |
|
76 |
| - <h3>{{item['class']}}</h3> |
| 82 | + <h3>{{item['class']}}</h3> |
77 | 83 |
|
78 |
| - <div style="margin-bottom: 30px;"> |
79 |
| - <div> |
80 |
| - {*item.descr[ctx.lang] | markdown*} |
81 |
| - </div> |
82 |
| - <br/> |
83 |
| - |
84 |
| - <div style="margin-left: 20px;"> |
85 |
| - <div x:repeat="prop in item.props"> |
86 |
| - <a name="{{ctx.lang}}/{{prop.label}}"></a> |
87 |
| - <h4 class="fn" data-anchor="prop"> |
88 |
| - <x:value>prop.name</x:value> |
89 |
| - <x:if test="prop.type != -1"> |
90 |
| - <x:text value=": "/> |
91 |
| - <span class="type">{{prop.type}}</span> |
92 |
| - </x:if> |
93 |
| - </h4> |
94 |
| - |
95 |
| - <div class="descr"> |
96 |
| - {*prop.descr[ctx.lang] | markdown*} |
97 |
| - </div> |
| 84 | + <div style="margin-bottom: 30px;"> |
| 85 | + <div>{*item.descr[ctx.lang] | markdown*}</div> |
| 86 | + <br/> |
98 | 87 |
|
99 |
| - <div x:if="prop.code" x:highlight="prop.code.source[ctx.lang]"></div> |
100 |
| - <div x:if="prop.code" style="height: 20px;"></div> |
101 |
| - </div> |
| 88 | + <div style="margin-left: 20px;"> |
| 89 | + <div> |
| 90 | + <div x:repeat="prop in item.props"> |
| 91 | + <a name="{{ctx.lang}}/{{prop.label}}"></a> |
102 | 92 |
|
103 |
| - <div x:repeat="fn in item.fn"> |
104 |
| - <div x:repeat="variant in fn.variants"> |
105 |
| - <a name="{{ctx.lang}}/{{fn.label}}"></a> |
106 |
| - |
107 |
| - <h4 data-anchor="fn" class="fn"> |
108 |
| - <span class="fn__name">{{fn.name}}</span> |
109 |
| - <span class="fn__args"> |
110 |
| - <span>( </span> |
111 |
| - <span x:repeat="(idx, arg) in variant.args"> |
112 |
| - <x:if test="arg.optional"> |
113 |
| - <span class="fn__arg__optional"> |
114 |
| - <span>[</span> |
115 |
| - <span x:if="idx">, </span> |
116 |
| - <span>{{arg.name}}:</span> |
117 |
| - <span class="type">{{arg.type}}</span> |
118 |
| - <span>]</span> |
119 |
| - </span> |
120 |
| - </x:if> |
121 |
| - |
122 |
| - <x:if test="!arg.optional"> |
123 |
| - <span x:if="idx">, </span> |
124 |
| - <span>{{arg.name}}:</span> |
125 |
| - <span class="type">{{arg.type}}</span> |
126 |
| - </x:if> |
127 |
| - </span> |
128 |
| - <span> ):</span> |
129 |
| - </span> |
130 |
| - <span class="type">{{fn.returns}}</span> |
131 |
| - </h4> |
132 |
| - |
133 |
| - <div class="descr"> |
134 |
| - {*variant.descr[ctx.lang] | markdown*} |
135 |
| - </div> |
| 93 | + <h4 class="fn" data-anchor="prop"> |
| 94 | + <span><x:value>prop.name</x:value></span> |
| 95 | + <x:if test="prop.type != -1"> |
| 96 | + <x:text value=": "/> |
| 97 | + <span class="type">{{prop.type}}</span> |
| 98 | + </x:if> |
| 99 | + </h4> |
136 | 100 |
|
137 |
| - <ul> |
138 |
| - <li x:repeat="arg in variant.args"> |
139 |
| - <b>{{arg.name}}</b> |
140 |
| - <span> — </span> |
141 |
| - <span>{{fn.args[arg.name][ctx.lang]}}</span> |
142 |
| - </li> |
143 |
| - </ul> |
| 101 | + <div class="descr">{*prop.descr[ctx.lang] | markdown*}</div> |
144 | 102 |
|
145 |
| - <div x:if="fn.code" x:highlight="fn.code.source[ctx.lang]"></div> |
| 103 | + <div x:if="prop.code" x:highlight="prop.code.source[ctx.lang]"></div> |
| 104 | + <div x:if="prop.code" style="height: 20px;"></div> |
| 105 | + </div> |
| 106 | + </div> |
146 | 107 |
|
147 |
| - <div style="height: 20px;"></div> |
| 108 | + <div> |
| 109 | + <div x:repeat="fn in item.fn"> |
| 110 | + <div x:repeat="variant in fn.variants"> |
| 111 | + <a name="{{ctx.lang}}/{{fn.label}}"></a> |
| 112 | + |
| 113 | + <h4 data-anchor="fn" class="fn"> |
| 114 | + <span class="fn__name">{{fn.name}}</span> |
| 115 | + <span class="fn__args"> |
| 116 | + <span>( </span> |
| 117 | + <span> |
| 118 | + <span x:repeat="(idx, arg) in variant.args"> |
| 119 | + <span> |
| 120 | + <x:if test="arg.optional"> |
| 121 | + <span class="fn__arg__optional"> |
| 122 | + <span>[</span> |
| 123 | + <span x:if="idx">, </span> |
| 124 | + <span>{{arg.name}}:</span> |
| 125 | + <span class="type">{{arg.type}}</span> |
| 126 | + <span>]</span> |
| 127 | + </span> |
| 128 | + </x:if> |
| 129 | + </span> |
| 130 | + |
| 131 | + <span> |
| 132 | + <x:if test="!arg.optional"> |
| 133 | + <span x:if="idx">, </span> |
| 134 | + <span>{{arg.name}}:</span> |
| 135 | + <span class="type">{{arg.type}}</span> |
| 136 | + </x:if> |
| 137 | + </span> |
| 138 | + </span> |
| 139 | + </span> |
| 140 | + <span> ):</span> |
| 141 | + </span> |
| 142 | + <span class="type">{{fn.returns}}</span> |
| 143 | + </h4> |
| 144 | + |
| 145 | + <div class="descr"> |
| 146 | + {*variant.descr[ctx.lang] | markdown*} |
| 147 | + </div> |
| 148 | + |
| 149 | + <ul> |
| 150 | + <li x:repeat="arg in variant.args"> |
| 151 | + <b>{{arg.name}}</b> |
| 152 | + <span> — </span> |
| 153 | + <span>{{fn.args[arg.name][ctx.lang]}}</span> |
| 154 | + </li> |
| 155 | + </ul> |
| 156 | + |
| 157 | + <div> |
| 158 | + <div x:if="fn.code" x:highlight="fn.code.source[ctx.lang]"></div> |
| 159 | + </div> |
| 160 | + |
| 161 | + <div style="height: 20px;"></div> |
| 162 | + </div> |
| 163 | + </div> |
148 | 164 | </div>
|
149 | 165 | </div>
|
150 | 166 | </div>
|
@@ -211,20 +227,22 @@ <h4 data-anchor="fn" class="fn">
|
211 | 227 | };
|
212 | 228 |
|
213 | 229 |
|
214 |
| - $(window).bind('hashchange', function (){ |
| 230 | + $(window).bind('hashchange', function (evt, force){ |
215 | 231 | var href = location.toString().split('#').pop();
|
216 | 232 | var lang = (href.match(_rlang) || [,ctx.lang])[1];
|
217 | 233 |
|
218 | 234 | ctx.lang = lang;
|
219 | 235 | ctx.relpath = href.replace(/^.+\//, '');
|
220 | 236 |
|
221 |
| - ctx.$apply(_updScroll); |
222 |
| - }).trigger('hashchange'); |
223 |
| - |
224 |
| - |
| 237 | + if( !force ){ |
| 238 | + ctx.$apply(_updScroll); |
| 239 | + } |
| 240 | + }).trigger('hashchange', true); |
| 241 | +// |
| 242 | +// |
225 | 243 | $.getJSON('./statics/docs.json?ver='+FileAPI.version, function (json){
|
226 | 244 | ctx.api = json;
|
227 |
| - ctx.$apply(_updScroll); |
| 245 | + ctx.$apply(); |
228 | 246 | });
|
229 | 247 |
|
230 | 248 | window.ctx = ctx;
|
|
0 commit comments