├── README.md
├── ajax_suggest.php
├── ajax_suggest_excerpts.php
├── common.php
├── css
├── bootstrap-responsive.css
├── bootstrap-responsive.min.css
├── bootstrap.css
├── bootstrap.min.css
├── images
│ ├── ui-bg_diagonals-thick_18_b81900_40x40.png
│ ├── ui-bg_diagonals-thick_20_666666_40x40.png
│ ├── ui-bg_flat_10_000000_40x100.png
│ ├── ui-bg_glass_100_f6f6f6_1x400.png
│ ├── ui-bg_glass_100_fdf5ce_1x400.png
│ ├── ui-bg_glass_65_ffffff_1x400.png
│ ├── ui-bg_gloss-wave_35_f6a828_500x100.png
│ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png
│ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png
│ ├── ui-icons_222222_256x240.png
│ ├── ui-icons_228ef1_256x240.png
│ ├── ui-icons_ef8c08_256x240.png
│ ├── ui-icons_ffd27a_256x240.png
│ └── ui-icons_ffffff_256x240.png
├── jquery-ui-1.8.21.custom.css
├── my.less
└── style.css
├── functions.php
├── img
├── glyphicons-halflings-white.png
└── glyphicons-halflings.png
├── index.php
├── js
├── bootstrap-typeahead.js
├── bootstrap.js
├── bootstrap.min.js
├── less-1.3.0.min.js
└── less.min.js
├── qsuggest.php
├── scripts
├── docs.tar.gz
├── sphinx.conf
├── suggest.tar.gz
└── suggest
│ ├── README
│ └── suggest.php
├── suggestcomplete.php
├── suggestcompleteexcerpts.php
└── template
├── footer.php
├── footer_excerpts.php
├── header.php
└── paginator.php
/README.md:
--------------------------------------------------------------------------------
1 | SphinxAutocompleteExample
2 | =========================
3 |
4 | These samples illustrate autocomplete and type suggestion using Manticore/Sphinx search.
5 | Querying is made via SphinxQL using PDO driver.
6 | The sample data included contains a version of Sphinx documentation.
7 | The samples are featured on [this Sphinx blog post] (http://sphinxsearch.com/blog/2013/05/21/simple-autocomplete-and-correction-suggestion/).
8 |
9 | Requirements :
10 | -------------------------------------------
11 | LAMP
12 | Manticore or Sphinx search
13 | PHP with PDO mysql
14 |
15 | Installation :
16 | -------------------------------------------
17 | Edit `scripts/sphinx.conf` for setting proper paths and db credentials
18 | Import the sample tables in your database.
19 | Untar first the two archieves in `scripts` folder:
20 |
21 | $ tar -xzvf suggest.tar.gz
22 | $ tar -xzvf docs.tar.gz
23 | $ mysql < suggest.sql
24 | $ mysql < docs.sql
25 | Alternative you can build the suggest table by following instructions in `scripts/suggest/README`
26 |
27 | The samples use 3 indexes : `simplecompletefull` for doing the actual search, `simplecomplete` for autocomplete and `suggest` for suggestions.
28 | `simpletecompletefull` can be used for autocomplete as well, if the search for completion is made only on title ( `@title $query` ).
29 | Index the 3 indexes:
30 |
31 | $ indexer -c /path/to/sphinx.conf --all
32 |
33 | Start a new Manticore/Sphinx server using sphinx.conf from `scripts` folder or import the indexes if you already have a running Sphinx server.
34 |
35 | $ searchd -c /path/to/sphinx.conf
36 | In case you start a new Manticore/Sphinx server, be sure to change the ports in **sphinx.conf** and **common.php**.
37 | In **common.php** edit the database credentials. For Sphinx 2.1.1 or greater/Manticore or trunk version, set constant `SPHINX_20` to **false**.
38 | Autocomplete starts after typing 3 characters. To change this you need to edit in **sphinx.conf** `min_prefix_len` and `min_word_len` and in **footer.php** and **footer_excerpts.php** the `minLength` ( which trigger firing the ajax call).
39 |
40 | Live demo with Sphinx :
41 | -------------------------------------------
42 | http://demos.sphinxsearch.com/SphinxAutocompleteExample/
43 | License:
44 | -------------------------------------------
45 | Sphinx Samples is free software, and is released under the terms of the GPL version 2 or (at your option) any later version.
46 | Manticore website : https://manticoresearch.com/
47 | Manticore repository : https://github.com/manticoresoftware/manticore
48 | Sphinx website : http://sphinxsearch.com/
49 | Sphinx read-only repository :https://github.com/sphinxsearch/sphinx
50 |
--------------------------------------------------------------------------------
/ajax_suggest.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT 0,10 OPTION ranker=sph04");
9 |
10 |
11 | $aq = explode(' ',$q);
12 | if(strlen($aq[count($aq)-1])<3){
13 | $query = $q;
14 | }else{
15 | $query = $q.'*';
16 | }
17 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
18 | $stmt->execute();
19 |
20 | foreach($stmt->fetchAll() as $r){
21 | $arr[] = array('id' => utf8_encode($r['title']),'label' =>utf8_encode( $r['title']));
22 | }
23 |
24 | echo json_encode($arr);
25 | exit();
26 |
--------------------------------------------------------------------------------
/ajax_suggest_excerpts.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT 0,10 OPTION ranker=sph04");
9 |
10 |
11 | $aq = explode(' ',$q);
12 | if(strlen($aq[count($aq)-1])<3){
13 | $query = $q;
14 | }else{
15 | $query = $q.'*';
16 | }
17 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
18 | $stmt->execute();
19 |
20 | $docs = array();
21 | $title = "";
22 | $stmsnp = $ln_sph->prepare("CALL SNIPPETS(:doc,'simplecomplete',:query)");
23 | $stmsnp->bindValue(':query',$query,PDO::PARAM_STR);
24 | $stmsnp->bindParam(':doc',$title,PDO::PARAM_STR);
25 |
26 | foreach($stmt->fetchAll() as $r){
27 | $title = $r['title'];
28 | $stmsnp->execute();
29 | $r = $stmsnp->fetch();
30 | $arr[] = array('id' => utf8_encode($r['snippet']),'label' =>utf8_encode( $r['snippet']));
31 | }
32 |
33 |
34 | echo json_encode($arr);
35 | exit();
36 |
--------------------------------------------------------------------------------
/common.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/css/bootstrap-responsive.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.0.4
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */
10 |
11 | .clearfix {
12 | *zoom: 1;
13 | }
14 |
15 | .clearfix:before,
16 | .clearfix:after {
17 | display: table;
18 | content: "";
19 | }
20 |
21 | .clearfix:after {
22 | clear: both;
23 | }
24 |
25 | .hide-text {
26 | font: 0/0 a;
27 | color: transparent;
28 | text-shadow: none;
29 | background-color: transparent;
30 | border: 0;
31 | }
32 |
33 | .input-block-level {
34 | display: block;
35 | width: 100%;
36 | min-height: 28px;
37 | -webkit-box-sizing: border-box;
38 | -moz-box-sizing: border-box;
39 | -ms-box-sizing: border-box;
40 | box-sizing: border-box;
41 | }
42 |
43 | .hidden {
44 | display: none;
45 | visibility: hidden;
46 | }
47 |
48 | .visible-phone {
49 | display: none !important;
50 | }
51 |
52 | .visible-tablet {
53 | display: none !important;
54 | }
55 |
56 | .hidden-desktop {
57 | display: none !important;
58 | }
59 |
60 | @media (max-width: 767px) {
61 | .visible-phone {
62 | display: inherit !important;
63 | }
64 | .hidden-phone {
65 | display: none !important;
66 | }
67 | .hidden-desktop {
68 | display: inherit !important;
69 | }
70 | .visible-desktop {
71 | display: none !important;
72 | }
73 | }
74 |
75 | @media (min-width: 768px) and (max-width: 979px) {
76 | .visible-tablet {
77 | display: inherit !important;
78 | }
79 | .hidden-tablet {
80 | display: none !important;
81 | }
82 | .hidden-desktop {
83 | display: inherit !important;
84 | }
85 | .visible-desktop {
86 | display: none !important ;
87 | }
88 | }
89 |
90 | @media (max-width: 480px) {
91 | .nav-collapse {
92 | -webkit-transform: translate3d(0, 0, 0);
93 | }
94 | .page-header h1 small {
95 | display: block;
96 | line-height: 18px;
97 | }
98 | input[type="checkbox"],
99 | input[type="radio"] {
100 | border: 1px solid #ccc;
101 | }
102 | .form-horizontal .control-group > label {
103 | float: none;
104 | width: auto;
105 | padding-top: 0;
106 | text-align: left;
107 | }
108 | .form-horizontal .controls {
109 | margin-left: 0;
110 | }
111 | .form-horizontal .control-list {
112 | padding-top: 0;
113 | }
114 | .form-horizontal .form-actions {
115 | padding-right: 10px;
116 | padding-left: 10px;
117 | }
118 | .modal {
119 | position: absolute;
120 | top: 10px;
121 | right: 10px;
122 | left: 10px;
123 | width: auto;
124 | margin: 0;
125 | }
126 | .modal.fade.in {
127 | top: auto;
128 | }
129 | .modal-header .close {
130 | padding: 10px;
131 | margin: -10px;
132 | }
133 | .carousel-caption {
134 | position: static;
135 | }
136 | }
137 |
138 | @media (max-width: 767px) {
139 | body {
140 | padding-right: 20px;
141 | padding-left: 20px;
142 | }
143 | .navbar-fixed-top,
144 | .navbar-fixed-bottom {
145 | margin-right: -20px;
146 | margin-left: -20px;
147 | }
148 | .container-fluid {
149 | padding: 0;
150 | }
151 | .dl-horizontal dt {
152 | float: none;
153 | width: auto;
154 | clear: none;
155 | text-align: left;
156 | }
157 | .dl-horizontal dd {
158 | margin-left: 0;
159 | }
160 | .container {
161 | width: auto;
162 | }
163 | .row-fluid {
164 | width: 100%;
165 | }
166 | .row,
167 | .thumbnails {
168 | margin-left: 0;
169 | }
170 | [class*="span"],
171 | .row-fluid [class*="span"] {
172 | display: block;
173 | float: none;
174 | width: auto;
175 | margin-left: 0;
176 | }
177 | .input-large,
178 | .input-xlarge,
179 | .input-xxlarge,
180 | input[class*="span"],
181 | select[class*="span"],
182 | textarea[class*="span"],
183 | .uneditable-input {
184 | display: block;
185 | width: 100%;
186 | min-height: 28px;
187 | -webkit-box-sizing: border-box;
188 | -moz-box-sizing: border-box;
189 | -ms-box-sizing: border-box;
190 | box-sizing: border-box;
191 | }
192 | .input-prepend input,
193 | .input-append input,
194 | .input-prepend input[class*="span"],
195 | .input-append input[class*="span"] {
196 | display: inline-block;
197 | width: auto;
198 | }
199 | }
200 |
201 | @media (min-width: 768px) and (max-width: 979px) {
202 | .row {
203 | margin-left: -20px;
204 | *zoom: 1;
205 | }
206 | .row:before,
207 | .row:after {
208 | display: table;
209 | content: "";
210 | }
211 | .row:after {
212 | clear: both;
213 | }
214 | [class*="span"] {
215 | float: left;
216 | margin-left: 20px;
217 | }
218 | .container,
219 | .navbar-fixed-top .container,
220 | .navbar-fixed-bottom .container {
221 | width: 724px;
222 | }
223 | .span12 {
224 | width: 724px;
225 | }
226 | .span11 {
227 | width: 662px;
228 | }
229 | .span10 {
230 | width: 600px;
231 | }
232 | .span9 {
233 | width: 538px;
234 | }
235 | .span8 {
236 | width: 476px;
237 | }
238 | .span7 {
239 | width: 414px;
240 | }
241 | .span6 {
242 | width: 352px;
243 | }
244 | .span5 {
245 | width: 290px;
246 | }
247 | .span4 {
248 | width: 228px;
249 | }
250 | .span3 {
251 | width: 166px;
252 | }
253 | .span2 {
254 | width: 104px;
255 | }
256 | .span1 {
257 | width: 42px;
258 | }
259 | .offset12 {
260 | margin-left: 764px;
261 | }
262 | .offset11 {
263 | margin-left: 702px;
264 | }
265 | .offset10 {
266 | margin-left: 640px;
267 | }
268 | .offset9 {
269 | margin-left: 578px;
270 | }
271 | .offset8 {
272 | margin-left: 516px;
273 | }
274 | .offset7 {
275 | margin-left: 454px;
276 | }
277 | .offset6 {
278 | margin-left: 392px;
279 | }
280 | .offset5 {
281 | margin-left: 330px;
282 | }
283 | .offset4 {
284 | margin-left: 268px;
285 | }
286 | .offset3 {
287 | margin-left: 206px;
288 | }
289 | .offset2 {
290 | margin-left: 144px;
291 | }
292 | .offset1 {
293 | margin-left: 82px;
294 | }
295 | .row-fluid {
296 | width: 100%;
297 | *zoom: 1;
298 | }
299 | .row-fluid:before,
300 | .row-fluid:after {
301 | display: table;
302 | content: "";
303 | }
304 | .row-fluid:after {
305 | clear: both;
306 | }
307 | .row-fluid [class*="span"] {
308 | display: block;
309 | float: left;
310 | width: 100%;
311 | min-height: 28px;
312 | margin-left: 2.762430939%;
313 | *margin-left: 2.709239449638298%;
314 | -webkit-box-sizing: border-box;
315 | -moz-box-sizing: border-box;
316 | -ms-box-sizing: border-box;
317 | box-sizing: border-box;
318 | }
319 | .row-fluid [class*="span"]:first-child {
320 | margin-left: 0;
321 | }
322 | .row-fluid .span12 {
323 | width: 99.999999993%;
324 | *width: 99.9468085036383%;
325 | }
326 | .row-fluid .span11 {
327 | width: 91.436464082%;
328 | *width: 91.38327259263829%;
329 | }
330 | .row-fluid .span10 {
331 | width: 82.87292817100001%;
332 | *width: 82.8197366816383%;
333 | }
334 | .row-fluid .span9 {
335 | width: 74.30939226%;
336 | *width: 74.25620077063829%;
337 | }
338 | .row-fluid .span8 {
339 | width: 65.74585634900001%;
340 | *width: 65.6926648596383%;
341 | }
342 | .row-fluid .span7 {
343 | width: 57.182320438000005%;
344 | *width: 57.129128948638304%;
345 | }
346 | .row-fluid .span6 {
347 | width: 48.618784527%;
348 | *width: 48.5655930376383%;
349 | }
350 | .row-fluid .span5 {
351 | width: 40.055248616%;
352 | *width: 40.0020571266383%;
353 | }
354 | .row-fluid .span4 {
355 | width: 31.491712705%;
356 | *width: 31.4385212156383%;
357 | }
358 | .row-fluid .span3 {
359 | width: 22.928176794%;
360 | *width: 22.874985304638297%;
361 | }
362 | .row-fluid .span2 {
363 | width: 14.364640883%;
364 | *width: 14.311449393638298%;
365 | }
366 | .row-fluid .span1 {
367 | width: 5.801104972%;
368 | *width: 5.747913482638298%;
369 | }
370 | input,
371 | textarea,
372 | .uneditable-input {
373 | margin-left: 0;
374 | }
375 | input.span12,
376 | textarea.span12,
377 | .uneditable-input.span12 {
378 | width: 714px;
379 | }
380 | input.span11,
381 | textarea.span11,
382 | .uneditable-input.span11 {
383 | width: 652px;
384 | }
385 | input.span10,
386 | textarea.span10,
387 | .uneditable-input.span10 {
388 | width: 590px;
389 | }
390 | input.span9,
391 | textarea.span9,
392 | .uneditable-input.span9 {
393 | width: 528px;
394 | }
395 | input.span8,
396 | textarea.span8,
397 | .uneditable-input.span8 {
398 | width: 466px;
399 | }
400 | input.span7,
401 | textarea.span7,
402 | .uneditable-input.span7 {
403 | width: 404px;
404 | }
405 | input.span6,
406 | textarea.span6,
407 | .uneditable-input.span6 {
408 | width: 342px;
409 | }
410 | input.span5,
411 | textarea.span5,
412 | .uneditable-input.span5 {
413 | width: 280px;
414 | }
415 | input.span4,
416 | textarea.span4,
417 | .uneditable-input.span4 {
418 | width: 218px;
419 | }
420 | input.span3,
421 | textarea.span3,
422 | .uneditable-input.span3 {
423 | width: 156px;
424 | }
425 | input.span2,
426 | textarea.span2,
427 | .uneditable-input.span2 {
428 | width: 94px;
429 | }
430 | input.span1,
431 | textarea.span1,
432 | .uneditable-input.span1 {
433 | width: 32px;
434 | }
435 | }
436 |
437 | @media (min-width: 1200px) {
438 | .row {
439 | margin-left: -30px;
440 | *zoom: 1;
441 | }
442 | .row:before,
443 | .row:after {
444 | display: table;
445 | content: "";
446 | }
447 | .row:after {
448 | clear: both;
449 | }
450 | [class*="span"] {
451 | float: left;
452 | margin-left: 30px;
453 | }
454 | .container,
455 | .navbar-fixed-top .container,
456 | .navbar-fixed-bottom .container {
457 | width: 1170px;
458 | }
459 | .span12 {
460 | width: 1170px;
461 | }
462 | .span11 {
463 | width: 1070px;
464 | }
465 | .span10 {
466 | width: 970px;
467 | }
468 | .span9 {
469 | width: 870px;
470 | }
471 | .span8 {
472 | width: 770px;
473 | }
474 | .span7 {
475 | width: 670px;
476 | }
477 | .span6 {
478 | width: 570px;
479 | }
480 | .span5 {
481 | width: 470px;
482 | }
483 | .span4 {
484 | width: 370px;
485 | }
486 | .span3 {
487 | width: 270px;
488 | }
489 | .span2 {
490 | width: 170px;
491 | }
492 | .span1 {
493 | width: 70px;
494 | }
495 | .offset12 {
496 | margin-left: 1230px;
497 | }
498 | .offset11 {
499 | margin-left: 1130px;
500 | }
501 | .offset10 {
502 | margin-left: 1030px;
503 | }
504 | .offset9 {
505 | margin-left: 930px;
506 | }
507 | .offset8 {
508 | margin-left: 830px;
509 | }
510 | .offset7 {
511 | margin-left: 730px;
512 | }
513 | .offset6 {
514 | margin-left: 630px;
515 | }
516 | .offset5 {
517 | margin-left: 530px;
518 | }
519 | .offset4 {
520 | margin-left: 430px;
521 | }
522 | .offset3 {
523 | margin-left: 330px;
524 | }
525 | .offset2 {
526 | margin-left: 230px;
527 | }
528 | .offset1 {
529 | margin-left: 130px;
530 | }
531 | .row-fluid {
532 | width: 100%;
533 | *zoom: 1;
534 | }
535 | .row-fluid:before,
536 | .row-fluid:after {
537 | display: table;
538 | content: "";
539 | }
540 | .row-fluid:after {
541 | clear: both;
542 | }
543 | .row-fluid [class*="span"] {
544 | display: block;
545 | float: left;
546 | width: 100%;
547 | min-height: 28px;
548 | margin-left: 2.564102564%;
549 | *margin-left: 2.510911074638298%;
550 | -webkit-box-sizing: border-box;
551 | -moz-box-sizing: border-box;
552 | -ms-box-sizing: border-box;
553 | box-sizing: border-box;
554 | }
555 | .row-fluid [class*="span"]:first-child {
556 | margin-left: 0;
557 | }
558 | .row-fluid .span12 {
559 | width: 100%;
560 | *width: 99.94680851063829%;
561 | }
562 | .row-fluid .span11 {
563 | width: 91.45299145300001%;
564 | *width: 91.3997999636383%;
565 | }
566 | .row-fluid .span10 {
567 | width: 82.905982906%;
568 | *width: 82.8527914166383%;
569 | }
570 | .row-fluid .span9 {
571 | width: 74.358974359%;
572 | *width: 74.30578286963829%;
573 | }
574 | .row-fluid .span8 {
575 | width: 65.81196581200001%;
576 | *width: 65.7587743226383%;
577 | }
578 | .row-fluid .span7 {
579 | width: 57.264957265%;
580 | *width: 57.2117657756383%;
581 | }
582 | .row-fluid .span6 {
583 | width: 48.717948718%;
584 | *width: 48.6647572286383%;
585 | }
586 | .row-fluid .span5 {
587 | width: 40.170940171000005%;
588 | *width: 40.117748681638304%;
589 | }
590 | .row-fluid .span4 {
591 | width: 31.623931624%;
592 | *width: 31.5707401346383%;
593 | }
594 | .row-fluid .span3 {
595 | width: 23.076923077%;
596 | *width: 23.0237315876383%;
597 | }
598 | .row-fluid .span2 {
599 | width: 14.529914530000001%;
600 | *width: 14.4767230406383%;
601 | }
602 | .row-fluid .span1 {
603 | width: 5.982905983%;
604 | *width: 5.929714493638298%;
605 | }
606 | input,
607 | textarea,
608 | .uneditable-input {
609 | margin-left: 0;
610 | }
611 | input.span12,
612 | textarea.span12,
613 | .uneditable-input.span12 {
614 | width: 1160px;
615 | }
616 | input.span11,
617 | textarea.span11,
618 | .uneditable-input.span11 {
619 | width: 1060px;
620 | }
621 | input.span10,
622 | textarea.span10,
623 | .uneditable-input.span10 {
624 | width: 960px;
625 | }
626 | input.span9,
627 | textarea.span9,
628 | .uneditable-input.span9 {
629 | width: 860px;
630 | }
631 | input.span8,
632 | textarea.span8,
633 | .uneditable-input.span8 {
634 | width: 760px;
635 | }
636 | input.span7,
637 | textarea.span7,
638 | .uneditable-input.span7 {
639 | width: 660px;
640 | }
641 | input.span6,
642 | textarea.span6,
643 | .uneditable-input.span6 {
644 | width: 560px;
645 | }
646 | input.span5,
647 | textarea.span5,
648 | .uneditable-input.span5 {
649 | width: 460px;
650 | }
651 | input.span4,
652 | textarea.span4,
653 | .uneditable-input.span4 {
654 | width: 360px;
655 | }
656 | input.span3,
657 | textarea.span3,
658 | .uneditable-input.span3 {
659 | width: 260px;
660 | }
661 | input.span2,
662 | textarea.span2,
663 | .uneditable-input.span2 {
664 | width: 160px;
665 | }
666 | input.span1,
667 | textarea.span1,
668 | .uneditable-input.span1 {
669 | width: 60px;
670 | }
671 | .thumbnails {
672 | margin-left: -30px;
673 | }
674 | .thumbnails > li {
675 | margin-left: 30px;
676 | }
677 | .row-fluid .thumbnails {
678 | margin-left: 0;
679 | }
680 | }
681 |
682 | @media (max-width: 979px) {
683 | body {
684 | padding-top: 0;
685 | }
686 | .navbar-fixed-top,
687 | .navbar-fixed-bottom {
688 | position: static;
689 | }
690 | .navbar-fixed-top {
691 | margin-bottom: 18px;
692 | }
693 | .navbar-fixed-bottom {
694 | margin-top: 18px;
695 | }
696 | .navbar-fixed-top .navbar-inner,
697 | .navbar-fixed-bottom .navbar-inner {
698 | padding: 5px;
699 | }
700 | .navbar .container {
701 | width: auto;
702 | padding: 0;
703 | }
704 | .navbar .brand {
705 | padding-right: 10px;
706 | padding-left: 10px;
707 | margin: 0 0 0 -5px;
708 | }
709 | .nav-collapse {
710 | clear: both;
711 | }
712 | .nav-collapse .nav {
713 | float: none;
714 | margin: 0 0 9px;
715 | }
716 | .nav-collapse .nav > li {
717 | float: none;
718 | }
719 | .nav-collapse .nav > li > a {
720 | margin-bottom: 2px;
721 | }
722 | .nav-collapse .nav > .divider-vertical {
723 | display: none;
724 | }
725 | .nav-collapse .nav .nav-header {
726 | color: #999999;
727 | text-shadow: none;
728 | }
729 | .nav-collapse .nav > li > a,
730 | .nav-collapse .dropdown-menu a {
731 | padding: 6px 15px;
732 | font-weight: bold;
733 | color: #999999;
734 | -webkit-border-radius: 3px;
735 | -moz-border-radius: 3px;
736 | border-radius: 3px;
737 | }
738 | .nav-collapse .btn {
739 | padding: 4px 10px 4px;
740 | font-weight: normal;
741 | -webkit-border-radius: 4px;
742 | -moz-border-radius: 4px;
743 | border-radius: 4px;
744 | }
745 | .nav-collapse .dropdown-menu li + li a {
746 | margin-bottom: 2px;
747 | }
748 | .nav-collapse .nav > li > a:hover,
749 | .nav-collapse .dropdown-menu a:hover {
750 | background-color: #222222;
751 | }
752 | .nav-collapse.in .btn-group {
753 | padding: 0;
754 | margin-top: 5px;
755 | }
756 | .nav-collapse .dropdown-menu {
757 | position: static;
758 | top: auto;
759 | left: auto;
760 | display: block;
761 | float: none;
762 | max-width: none;
763 | padding: 0;
764 | margin: 0 15px;
765 | background-color: transparent;
766 | border: none;
767 | -webkit-border-radius: 0;
768 | -moz-border-radius: 0;
769 | border-radius: 0;
770 | -webkit-box-shadow: none;
771 | -moz-box-shadow: none;
772 | box-shadow: none;
773 | }
774 | .nav-collapse .dropdown-menu:before,
775 | .nav-collapse .dropdown-menu:after {
776 | display: none;
777 | }
778 | .nav-collapse .dropdown-menu .divider {
779 | display: none;
780 | }
781 | .nav-collapse .navbar-form,
782 | .nav-collapse .navbar-search {
783 | float: none;
784 | padding: 9px 15px;
785 | margin: 9px 0;
786 | border-top: 1px solid #222222;
787 | border-bottom: 1px solid #222222;
788 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
789 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
790 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
791 | }
792 | .navbar .nav-collapse .nav.pull-right {
793 | float: none;
794 | margin-left: 0;
795 | }
796 | .nav-collapse,
797 | .nav-collapse.collapse {
798 | height: 0;
799 | overflow: hidden;
800 | }
801 | .navbar .btn-navbar {
802 | display: block;
803 | }
804 | .navbar-static .navbar-inner {
805 | padding-right: 10px;
806 | padding-left: 10px;
807 | }
808 | }
809 |
810 | @media (min-width: 980px) {
811 | .nav-collapse.collapse {
812 | height: auto !important;
813 | overflow: visible !important;
814 | }
815 | }
816 |
--------------------------------------------------------------------------------
/css/bootstrap-responsive.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.0.4
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}@media(max-width:767px){.visible-phone{display:inherit!important}.hidden-phone{display:none!important}.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}}@media(min-width:768px) and (max-width:979px){.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:18px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{position:absolute;top:10px;right:10px;left:10px;width:auto;margin:0}.modal.fade.in{top:auto}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:auto;margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:28px;margin-left:2.762430939%;*margin-left:2.709239449638298%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:99.999999993%;*width:99.9468085036383%}.row-fluid .span11{width:91.436464082%;*width:91.38327259263829%}.row-fluid .span10{width:82.87292817100001%;*width:82.8197366816383%}.row-fluid .span9{width:74.30939226%;*width:74.25620077063829%}.row-fluid .span8{width:65.74585634900001%;*width:65.6926648596383%}.row-fluid .span7{width:57.182320438000005%;*width:57.129128948638304%}.row-fluid .span6{width:48.618784527%;*width:48.5655930376383%}.row-fluid .span5{width:40.055248616%;*width:40.0020571266383%}.row-fluid .span4{width:31.491712705%;*width:31.4385212156383%}.row-fluid .span3{width:22.928176794%;*width:22.874985304638297%}.row-fluid .span2{width:14.364640883%;*width:14.311449393638298%}.row-fluid .span1{width:5.801104972%;*width:5.747913482638298%}input,textarea,.uneditable-input{margin-left:0}input.span12,textarea.span12,.uneditable-input.span12{width:714px}input.span11,textarea.span11,.uneditable-input.span11{width:652px}input.span10,textarea.span10,.uneditable-input.span10{width:590px}input.span9,textarea.span9,.uneditable-input.span9{width:528px}input.span8,textarea.span8,.uneditable-input.span8{width:466px}input.span7,textarea.span7,.uneditable-input.span7{width:404px}input.span6,textarea.span6,.uneditable-input.span6{width:342px}input.span5,textarea.span5,.uneditable-input.span5{width:280px}input.span4,textarea.span4,.uneditable-input.span4{width:218px}input.span3,textarea.span3,.uneditable-input.span3{width:156px}input.span2,textarea.span2,.uneditable-input.span2{width:94px}input.span1,textarea.span1,.uneditable-input.span1{width:32px}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:30px}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:28px;margin-left:2.564102564%;*margin-left:2.510911074638298%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145300001%;*width:91.3997999636383%}.row-fluid .span10{width:82.905982906%;*width:82.8527914166383%}.row-fluid .span9{width:74.358974359%;*width:74.30578286963829%}.row-fluid .span8{width:65.81196581200001%;*width:65.7587743226383%}.row-fluid .span7{width:57.264957265%;*width:57.2117657756383%}.row-fluid .span6{width:48.717948718%;*width:48.6647572286383%}.row-fluid .span5{width:40.170940171000005%;*width:40.117748681638304%}.row-fluid .span4{width:31.623931624%;*width:31.5707401346383%}.row-fluid .span3{width:23.076923077%;*width:23.0237315876383%}.row-fluid .span2{width:14.529914530000001%;*width:14.4767230406383%}.row-fluid .span1{width:5.982905983%;*width:5.929714493638298%}input,textarea,.uneditable-input{margin-left:0}input.span12,textarea.span12,.uneditable-input.span12{width:1160px}input.span11,textarea.span11,.uneditable-input.span11{width:1060px}input.span10,textarea.span10,.uneditable-input.span10{width:960px}input.span9,textarea.span9,.uneditable-input.span9{width:860px}input.span8,textarea.span8,.uneditable-input.span8{width:760px}input.span7,textarea.span7,.uneditable-input.span7{width:660px}input.span6,textarea.span6,.uneditable-input.span6{width:560px}input.span5,textarea.span5,.uneditable-input.span5{width:460px}input.span4,textarea.span4,.uneditable-input.span4{width:360px}input.span3,textarea.span3,.uneditable-input.span3{width:260px}input.span2,textarea.span2,.uneditable-input.span2{width:160px}input.span1,textarea.span1,.uneditable-input.span1{width:60px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:18px}.navbar-fixed-bottom{margin-top:18px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 9px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#999;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:6px 15px;font-weight:bold;color:#999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#222}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:9px 15px;margin:9px 0;border-top:1px solid #222;border-bottom:1px solid #222;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
10 |
--------------------------------------------------------------------------------
/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
--------------------------------------------------------------------------------
/css/images/ui-bg_diagonals-thick_20_666666_40x40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
--------------------------------------------------------------------------------
/css/images/ui-bg_flat_10_000000_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_flat_10_000000_40x100.png
--------------------------------------------------------------------------------
/css/images/ui-bg_glass_100_f6f6f6_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_glass_100_f6f6f6_1x400.png
--------------------------------------------------------------------------------
/css/images/ui-bg_glass_100_fdf5ce_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_glass_100_fdf5ce_1x400.png
--------------------------------------------------------------------------------
/css/images/ui-bg_glass_65_ffffff_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_glass_65_ffffff_1x400.png
--------------------------------------------------------------------------------
/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
--------------------------------------------------------------------------------
/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
--------------------------------------------------------------------------------
/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
--------------------------------------------------------------------------------
/css/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/css/images/ui-icons_228ef1_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-icons_228ef1_256x240.png
--------------------------------------------------------------------------------
/css/images/ui-icons_ef8c08_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-icons_ef8c08_256x240.png
--------------------------------------------------------------------------------
/css/images/ui-icons_ffd27a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-icons_ffd27a_256x240.png
--------------------------------------------------------------------------------
/css/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/css/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/css/jquery-ui-1.8.21.custom.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery UI CSS Framework 1.8.21
3 | *
4 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming/API
9 | */
10 |
11 | /* Layout helpers
12 | ----------------------------------*/
13 | .ui-helper-hidden { display: none; }
14 | .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16 | .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17 | .ui-helper-clearfix:after { clear: both; }
18 | .ui-helper-clearfix { zoom: 1; }
19 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20 |
21 |
22 | /* Interaction Cues
23 | ----------------------------------*/
24 | .ui-state-disabled { cursor: default !important; }
25 |
26 |
27 | /* Icons
28 | ----------------------------------*/
29 |
30 | /* states and images */
31 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32 |
33 |
34 | /* Misc visuals
35 | ----------------------------------*/
36 |
37 | /* Overlays */
38 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
39 |
40 |
41 | /*!
42 | * jQuery UI CSS Framework 1.8.21
43 | *
44 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
45 | * Dual licensed under the MIT or GPL Version 2 licenses.
46 | * http://jquery.org/license
47 | *
48 | * http://docs.jquery.com/UI/Theming/API
49 | *
50 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
51 | */
52 |
53 |
54 | /* Component containers
55 | ----------------------------------*/
56 | .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
57 | .ui-widget .ui-widget { font-size: 1em; }
58 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
59 | .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
60 | .ui-widget-content a { color: #333333; }
61 | .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
62 | .ui-widget-header a { color: #ffffff; }
63 |
64 | /* Interaction states
65 | ----------------------------------*/
66 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
67 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
68 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
69 | .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
70 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
71 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
72 | .ui-widget :active { outline: none; }
73 |
74 | /* Interaction Cues
75 | ----------------------------------*/
76 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
77 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
78 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
79 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
80 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
81 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
82 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
83 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
84 |
85 | /* Icons
86 | ----------------------------------*/
87 |
88 | /* states and images */
89 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
90 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
91 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
92 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
93 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
94 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
95 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
96 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
97 |
98 | /* positioning */
99 | .ui-icon-carat-1-n { background-position: 0 0; }
100 | .ui-icon-carat-1-ne { background-position: -16px 0; }
101 | .ui-icon-carat-1-e { background-position: -32px 0; }
102 | .ui-icon-carat-1-se { background-position: -48px 0; }
103 | .ui-icon-carat-1-s { background-position: -64px 0; }
104 | .ui-icon-carat-1-sw { background-position: -80px 0; }
105 | .ui-icon-carat-1-w { background-position: -96px 0; }
106 | .ui-icon-carat-1-nw { background-position: -112px 0; }
107 | .ui-icon-carat-2-n-s { background-position: -128px 0; }
108 | .ui-icon-carat-2-e-w { background-position: -144px 0; }
109 | .ui-icon-triangle-1-n { background-position: 0 -16px; }
110 | .ui-icon-triangle-1-ne { background-position: -16px -16px; }
111 | .ui-icon-triangle-1-e { background-position: -32px -16px; }
112 | .ui-icon-triangle-1-se { background-position: -48px -16px; }
113 | .ui-icon-triangle-1-s { background-position: -64px -16px; }
114 | .ui-icon-triangle-1-sw { background-position: -80px -16px; }
115 | .ui-icon-triangle-1-w { background-position: -96px -16px; }
116 | .ui-icon-triangle-1-nw { background-position: -112px -16px; }
117 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
118 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
119 | .ui-icon-arrow-1-n { background-position: 0 -32px; }
120 | .ui-icon-arrow-1-ne { background-position: -16px -32px; }
121 | .ui-icon-arrow-1-e { background-position: -32px -32px; }
122 | .ui-icon-arrow-1-se { background-position: -48px -32px; }
123 | .ui-icon-arrow-1-s { background-position: -64px -32px; }
124 | .ui-icon-arrow-1-sw { background-position: -80px -32px; }
125 | .ui-icon-arrow-1-w { background-position: -96px -32px; }
126 | .ui-icon-arrow-1-nw { background-position: -112px -32px; }
127 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
128 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
129 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
130 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
131 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
132 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
133 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
134 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
135 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
136 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
137 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
138 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
139 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
140 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
141 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
142 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
143 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
144 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
145 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
146 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
147 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
148 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
149 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
150 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
151 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
152 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
153 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
154 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
155 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
156 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
157 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
158 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
159 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
160 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
161 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
162 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
163 | .ui-icon-arrow-4 { background-position: 0 -80px; }
164 | .ui-icon-arrow-4-diag { background-position: -16px -80px; }
165 | .ui-icon-extlink { background-position: -32px -80px; }
166 | .ui-icon-newwin { background-position: -48px -80px; }
167 | .ui-icon-refresh { background-position: -64px -80px; }
168 | .ui-icon-shuffle { background-position: -80px -80px; }
169 | .ui-icon-transfer-e-w { background-position: -96px -80px; }
170 | .ui-icon-transferthick-e-w { background-position: -112px -80px; }
171 | .ui-icon-folder-collapsed { background-position: 0 -96px; }
172 | .ui-icon-folder-open { background-position: -16px -96px; }
173 | .ui-icon-document { background-position: -32px -96px; }
174 | .ui-icon-document-b { background-position: -48px -96px; }
175 | .ui-icon-note { background-position: -64px -96px; }
176 | .ui-icon-mail-closed { background-position: -80px -96px; }
177 | .ui-icon-mail-open { background-position: -96px -96px; }
178 | .ui-icon-suitcase { background-position: -112px -96px; }
179 | .ui-icon-comment { background-position: -128px -96px; }
180 | .ui-icon-person { background-position: -144px -96px; }
181 | .ui-icon-print { background-position: -160px -96px; }
182 | .ui-icon-trash { background-position: -176px -96px; }
183 | .ui-icon-locked { background-position: -192px -96px; }
184 | .ui-icon-unlocked { background-position: -208px -96px; }
185 | .ui-icon-bookmark { background-position: -224px -96px; }
186 | .ui-icon-tag { background-position: -240px -96px; }
187 | .ui-icon-home { background-position: 0 -112px; }
188 | .ui-icon-flag { background-position: -16px -112px; }
189 | .ui-icon-calendar { background-position: -32px -112px; }
190 | .ui-icon-cart { background-position: -48px -112px; }
191 | .ui-icon-pencil { background-position: -64px -112px; }
192 | .ui-icon-clock { background-position: -80px -112px; }
193 | .ui-icon-disk { background-position: -96px -112px; }
194 | .ui-icon-calculator { background-position: -112px -112px; }
195 | .ui-icon-zoomin { background-position: -128px -112px; }
196 | .ui-icon-zoomout { background-position: -144px -112px; }
197 | .ui-icon-search { background-position: -160px -112px; }
198 | .ui-icon-wrench { background-position: -176px -112px; }
199 | .ui-icon-gear { background-position: -192px -112px; }
200 | .ui-icon-heart { background-position: -208px -112px; }
201 | .ui-icon-star { background-position: -224px -112px; }
202 | .ui-icon-link { background-position: -240px -112px; }
203 | .ui-icon-cancel { background-position: 0 -128px; }
204 | .ui-icon-plus { background-position: -16px -128px; }
205 | .ui-icon-plusthick { background-position: -32px -128px; }
206 | .ui-icon-minus { background-position: -48px -128px; }
207 | .ui-icon-minusthick { background-position: -64px -128px; }
208 | .ui-icon-close { background-position: -80px -128px; }
209 | .ui-icon-closethick { background-position: -96px -128px; }
210 | .ui-icon-key { background-position: -112px -128px; }
211 | .ui-icon-lightbulb { background-position: -128px -128px; }
212 | .ui-icon-scissors { background-position: -144px -128px; }
213 | .ui-icon-clipboard { background-position: -160px -128px; }
214 | .ui-icon-copy { background-position: -176px -128px; }
215 | .ui-icon-contact { background-position: -192px -128px; }
216 | .ui-icon-image { background-position: -208px -128px; }
217 | .ui-icon-video { background-position: -224px -128px; }
218 | .ui-icon-script { background-position: -240px -128px; }
219 | .ui-icon-alert { background-position: 0 -144px; }
220 | .ui-icon-info { background-position: -16px -144px; }
221 | .ui-icon-notice { background-position: -32px -144px; }
222 | .ui-icon-help { background-position: -48px -144px; }
223 | .ui-icon-check { background-position: -64px -144px; }
224 | .ui-icon-bullet { background-position: -80px -144px; }
225 | .ui-icon-radio-off { background-position: -96px -144px; }
226 | .ui-icon-radio-on { background-position: -112px -144px; }
227 | .ui-icon-pin-w { background-position: -128px -144px; }
228 | .ui-icon-pin-s { background-position: -144px -144px; }
229 | .ui-icon-play { background-position: 0 -160px; }
230 | .ui-icon-pause { background-position: -16px -160px; }
231 | .ui-icon-seek-next { background-position: -32px -160px; }
232 | .ui-icon-seek-prev { background-position: -48px -160px; }
233 | .ui-icon-seek-end { background-position: -64px -160px; }
234 | .ui-icon-seek-start { background-position: -80px -160px; }
235 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
236 | .ui-icon-seek-first { background-position: -80px -160px; }
237 | .ui-icon-stop { background-position: -96px -160px; }
238 | .ui-icon-eject { background-position: -112px -160px; }
239 | .ui-icon-volume-off { background-position: -128px -160px; }
240 | .ui-icon-volume-on { background-position: -144px -160px; }
241 | .ui-icon-power { background-position: 0 -176px; }
242 | .ui-icon-signal-diag { background-position: -16px -176px; }
243 | .ui-icon-signal { background-position: -32px -176px; }
244 | .ui-icon-battery-0 { background-position: -48px -176px; }
245 | .ui-icon-battery-1 { background-position: -64px -176px; }
246 | .ui-icon-battery-2 { background-position: -80px -176px; }
247 | .ui-icon-battery-3 { background-position: -96px -176px; }
248 | .ui-icon-circle-plus { background-position: 0 -192px; }
249 | .ui-icon-circle-minus { background-position: -16px -192px; }
250 | .ui-icon-circle-close { background-position: -32px -192px; }
251 | .ui-icon-circle-triangle-e { background-position: -48px -192px; }
252 | .ui-icon-circle-triangle-s { background-position: -64px -192px; }
253 | .ui-icon-circle-triangle-w { background-position: -80px -192px; }
254 | .ui-icon-circle-triangle-n { background-position: -96px -192px; }
255 | .ui-icon-circle-arrow-e { background-position: -112px -192px; }
256 | .ui-icon-circle-arrow-s { background-position: -128px -192px; }
257 | .ui-icon-circle-arrow-w { background-position: -144px -192px; }
258 | .ui-icon-circle-arrow-n { background-position: -160px -192px; }
259 | .ui-icon-circle-zoomin { background-position: -176px -192px; }
260 | .ui-icon-circle-zoomout { background-position: -192px -192px; }
261 | .ui-icon-circle-check { background-position: -208px -192px; }
262 | .ui-icon-circlesmall-plus { background-position: 0 -208px; }
263 | .ui-icon-circlesmall-minus { background-position: -16px -208px; }
264 | .ui-icon-circlesmall-close { background-position: -32px -208px; }
265 | .ui-icon-squaresmall-plus { background-position: -48px -208px; }
266 | .ui-icon-squaresmall-minus { background-position: -64px -208px; }
267 | .ui-icon-squaresmall-close { background-position: -80px -208px; }
268 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
269 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
270 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
271 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
272 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
273 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
274 |
275 |
276 | /* Misc visuals
277 | ----------------------------------*/
278 |
279 | /* Corner radius */
280 | .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
281 | .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
282 | .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
283 | .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
284 |
285 | /* Overlays */
286 | .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
287 | .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*!
288 | * jQuery UI Resizable 1.8.21
289 | *
290 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
291 | * Dual licensed under the MIT or GPL Version 2 licenses.
292 | * http://jquery.org/license
293 | *
294 | * http://docs.jquery.com/UI/Resizable#theming
295 | */
296 | .ui-resizable { position: relative;}
297 | .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
298 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
299 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
300 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
301 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
302 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
303 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
304 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
305 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
306 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
307 | * jQuery UI Selectable 1.8.21
308 | *
309 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
310 | * Dual licensed under the MIT or GPL Version 2 licenses.
311 | * http://jquery.org/license
312 | *
313 | * http://docs.jquery.com/UI/Selectable#theming
314 | */
315 | .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
316 | /*!
317 | * jQuery UI Accordion 1.8.21
318 | *
319 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
320 | * Dual licensed under the MIT or GPL Version 2 licenses.
321 | * http://jquery.org/license
322 | *
323 | * http://docs.jquery.com/UI/Accordion#theming
324 | */
325 | /* IE/Win - Fix animation bug - #4615 */
326 | .ui-accordion { width: 100%; }
327 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
328 | .ui-accordion .ui-accordion-li-fix { display: inline; }
329 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
330 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
331 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
332 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
333 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
334 | .ui-accordion .ui-accordion-content-active { display: block; }
335 | /*!
336 | * jQuery UI Autocomplete 1.8.21
337 | *
338 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
339 | * Dual licensed under the MIT or GPL Version 2 licenses.
340 | * http://jquery.org/license
341 | *
342 | * http://docs.jquery.com/UI/Autocomplete#theming
343 | */
344 | .ui-autocomplete { position: absolute; cursor: default; }
345 |
346 | /* workarounds */
347 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
348 |
349 | /*
350 | * jQuery UI Menu 1.8.21
351 | *
352 | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
353 | * Dual licensed under the MIT or GPL Version 2 licenses.
354 | * http://jquery.org/license
355 | *
356 | * http://docs.jquery.com/UI/Menu#theming
357 | */
358 | .ui-menu {
359 | list-style:none;
360 | padding: 2px;
361 | margin: 0;
362 | display:block;
363 | float: left;
364 | }
365 | .ui-menu .ui-menu {
366 | margin-top: -3px;
367 | }
368 | .ui-menu .ui-menu-item {
369 | margin:0;
370 | padding: 0;
371 | zoom: 1;
372 | float: left;
373 | clear: left;
374 | width: 100%;
375 | }
376 | .ui-menu .ui-menu-item a {
377 | text-decoration:none;
378 | display:block;
379 | padding:.2em .4em;
380 | line-height:1.5;
381 | zoom:1;
382 | }
383 | .ui-menu .ui-menu-item a.ui-state-hover,
384 | .ui-menu .ui-menu-item a.ui-state-active {
385 | font-weight: normal;
386 | margin: -1px;
387 | }
388 | /*!
389 | * jQuery UI Button 1.8.21
390 | *
391 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
392 | * Dual licensed under the MIT or GPL Version 2 licenses.
393 | * http://jquery.org/license
394 | *
395 | * http://docs.jquery.com/UI/Button#theming
396 | */
397 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
398 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
399 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
400 | .ui-button-icons-only { width: 3.4em; }
401 | button.ui-button-icons-only { width: 3.7em; }
402 |
403 | /*button text element */
404 | .ui-button .ui-button-text { display: block; line-height: 1.4; }
405 | .ui-button-text-only .ui-button-text { padding: .4em 1em; }
406 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
407 | .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
408 | .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
409 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
410 | /* no icon support for input elements, provide padding by default */
411 | input.ui-button { padding: .4em 1em; }
412 |
413 | /*button icon element(s) */
414 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
415 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
416 | .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
417 | .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
418 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
419 |
420 | /*button sets*/
421 | .ui-buttonset { margin-right: 7px; }
422 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
423 |
424 | /* workarounds */
425 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
426 | /*!
427 | * jQuery UI Dialog 1.8.21
428 | *
429 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
430 | * Dual licensed under the MIT or GPL Version 2 licenses.
431 | * http://jquery.org/license
432 | *
433 | * http://docs.jquery.com/UI/Dialog#theming
434 | */
435 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
436 | .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
437 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
438 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
439 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
440 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
441 | .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
442 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
443 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
444 | .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
445 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
446 | .ui-draggable .ui-dialog-titlebar { cursor: move; }
447 | /*!
448 | * jQuery UI Slider 1.8.21
449 | *
450 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
451 | * Dual licensed under the MIT or GPL Version 2 licenses.
452 | * http://jquery.org/license
453 | *
454 | * http://docs.jquery.com/UI/Slider#theming
455 | */
456 | .ui-slider { position: relative; text-align: left; }
457 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
458 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
459 |
460 | .ui-slider-horizontal { height: .8em; }
461 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
462 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
463 | .ui-slider-horizontal .ui-slider-range-min { left: 0; }
464 | .ui-slider-horizontal .ui-slider-range-max { right: 0; }
465 |
466 | .ui-slider-vertical { width: .8em; height: 100px; }
467 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
468 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
469 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
470 | .ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
471 | * jQuery UI Tabs 1.8.21
472 | *
473 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
474 | * Dual licensed under the MIT or GPL Version 2 licenses.
475 | * http://jquery.org/license
476 | *
477 | * http://docs.jquery.com/UI/Tabs#theming
478 | */
479 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
480 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
481 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
482 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
483 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
484 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
485 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
486 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
487 | .ui-tabs .ui-tabs-hide { display: none !important; }
488 | /*!
489 | * jQuery UI Datepicker 1.8.21
490 | *
491 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
492 | * Dual licensed under the MIT or GPL Version 2 licenses.
493 | * http://jquery.org/license
494 | *
495 | * http://docs.jquery.com/UI/Datepicker#theming
496 | */
497 | .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
498 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
499 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
500 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
501 | .ui-datepicker .ui-datepicker-prev { left:2px; }
502 | .ui-datepicker .ui-datepicker-next { right:2px; }
503 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
504 | .ui-datepicker .ui-datepicker-next-hover { right:1px; }
505 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
506 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
507 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
508 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
509 | .ui-datepicker select.ui-datepicker-month,
510 | .ui-datepicker select.ui-datepicker-year { width: 49%;}
511 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
512 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
513 | .ui-datepicker td { border: 0; padding: 1px; }
514 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
515 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
516 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
517 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
518 |
519 | /* with multiple calendars */
520 | .ui-datepicker.ui-datepicker-multi { width:auto; }
521 | .ui-datepicker-multi .ui-datepicker-group { float:left; }
522 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
523 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
524 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
525 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
526 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
527 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
528 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
529 | .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
530 |
531 | /* RTL support */
532 | .ui-datepicker-rtl { direction: rtl; }
533 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
534 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
535 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
536 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
537 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
538 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
539 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
540 | .ui-datepicker-rtl .ui-datepicker-group { float:right; }
541 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
542 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
543 |
544 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
545 | .ui-datepicker-cover {
546 | display: none; /*sorry for IE5*/
547 | display/**/: block; /*sorry for IE5*/
548 | position: absolute; /*must have*/
549 | z-index: -1; /*must have*/
550 | filter: mask(); /*must have*/
551 | top: -4px; /*must have*/
552 | left: -4px; /*must have*/
553 | width: 200px; /*must have*/
554 | height: 200px; /*must have*/
555 | }/*!
556 | * jQuery UI Progressbar 1.8.21
557 | *
558 | * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
559 | * Dual licensed under the MIT or GPL Version 2 licenses.
560 | * http://jquery.org/license
561 | *
562 | * http://docs.jquery.com/UI/Progressbar#theming
563 | */
564 | .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
565 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
--------------------------------------------------------------------------------
/css/my.less:
--------------------------------------------------------------------------------
1 | @navbarBackground : @blue
2 |
--------------------------------------------------------------------------------
/css/style.css:
--------------------------------------------------------------------------------
1 | .navbar-inner {
2 | background-color: #428ddf;
3 | background-image: -moz-linear-gradient(center top , #428ddf, #428ddf);
4 | }
5 |
6 | .navbar .brand {
7 | color: #ffffff
8 | }
9 |
10 | .navbar .nav .active > a, .navbar .nav .active > a:hover {
11 | background-color: #155BA9;
12 | }
13 | .ui-widget-content
14 | {
15 | background:#FFFFFF;
16 | }
--------------------------------------------------------------------------------
/functions.php:
--------------------------------------------------------------------------------
1 | prepare("CALL SUGGEST(:keyword,'$index')");
14 | $stmt->bindValue(':keyword', $keyword,PDO::PARAM_STR);
15 | $stmt->execute();
16 | $row = $stmt->fetch(PDO::FETCH_ASSOC);
17 | return $row['suggest'];
18 | }
19 |
20 | function MakeMultiQSuggest($words,$query,$index,$ln_sph)
21 | {
22 | $suggested = array();
23 | $llimf = 0;
24 | $i = 0;
25 | foreach ($words as $key => $word) {
26 | if ($word['docs'] != 0)
27 | $llimf +=$word['docs'];$i++;
28 | }
29 | $llimf = $llimf / ($i * $i);
30 | foreach ($words as $key => $word) {
31 | if ($word['docs'] == 0 | $word['docs'] < $llimf) {
32 | $mis[] = $word['keyword'];
33 | }
34 | }
35 | if (count($mis) > 0) {
36 | foreach ($mis as $m) {
37 | $re = MakeQSuggest($m,$index, $ln_sph);
38 | if ($re) {
39 | if($m!=$re)
40 | $suggested[$m] = $re;
41 | }
42 | }
43 | if(count($words) ==1 && empty($suggested)) {
44 | return false;
45 | }
46 | $phrase = explode(' ', $query);
47 | foreach ($phrase as $k => $word) {
48 | if (isset($suggested[strtolower($word)]))
49 | $phrase[$k] = $suggested[strtolower($word)];
50 | }
51 | $phrase = implode(' ', $phrase);
52 | return $phrase;
53 | }else{
54 | return false;
55 | }
56 | }
57 | function MakeSuggestion($keyword,$ln)
58 | {
59 | $trigrams = BuildTrigrams($keyword);
60 | $query = "\"$trigrams\"/1";
61 | $len = strlen($keyword);
62 |
63 | $delta = LENGTH_THRESHOLD;
64 | $weight = 'weight()';
65 | if(SPHINX_20 == true) {
66 | $weight ='@weight';
67 | }
68 | $stmt = $ln->prepare("SELECT *, $weight as w, w+:delta-ABS(len-:len) as myrank FROM suggest WHERE MATCH(:match) AND len BETWEEN :lowlen AND :highlen
69 | ORDER BY myrank DESC, freq DESC
70 | LIMIT 0,:topcount OPTION ranker=wordcount");
71 |
72 | $stmt->bindValue(':match', $query, PDO::PARAM_STR);
73 | $stmt->bindValue(':len', $len, PDO::PARAM_INT);
74 | $stmt->bindValue(':delta', $delta, PDO::PARAM_INT);
75 | $stmt->bindValue(':lowlen', $len - $delta, PDO::PARAM_INT);
76 | $stmt->bindValue(':highlen', $len + $delta, PDO::PARAM_INT);
77 | $stmt->bindValue(':topcount',TOP_COUNT, PDO::PARAM_INT);
78 | $stmt->execute();
79 |
80 |
81 | if (!$rows = $stmt->fetchAll())
82 | return false;
83 | // further restrict trigram matches with a sane Levenshtein distance limit
84 | foreach ($rows as $match) {
85 | $suggested = $match["keyword"];
86 | if (levenshtein($keyword, $suggested) <= LEVENSHTEIN_THRESHOLD)
87 | return $suggested;
88 | }
89 |
90 | return $keyword;
91 | }
92 |
93 | function MakePhaseSuggestion($words,$query,$ln_sph)
94 | {
95 | $suggested = array();
96 | $llimf = 0;
97 | $i = 0;
98 | foreach ($words as $key => $word) {
99 | if ($word['docs'] != 0)
100 | $llimf +=$word['docs'];$i++;
101 | }
102 | $llimf = $llimf / ($i * $i);
103 | foreach ($words as $key => $word) {
104 | if ($word['docs'] == 0 | $word['docs'] < $llimf) {
105 | $mis[] = $word['keyword'];
106 | }
107 | }
108 | if (count($mis) > 0) {
109 | foreach ($mis as $m) {
110 | $re = MakeSuggestion($m, $ln_sph);
111 | if ($re) {
112 | if($m!=$re)
113 | $suggested[$m] = $re;
114 | }
115 | }
116 | if(count($words) ==1 && empty($suggested)) {
117 | return false;
118 | }
119 | $phrase = explode(' ', $query);
120 | foreach ($phrase as $k => $word) {
121 | if (isset($suggested[strtolower($word)]))
122 | $phrase[$k] = $suggested[strtolower($word)];
123 | }
124 | $phrase = implode(' ', $phrase);
125 | return $phrase;
126 | }else{
127 | return false;
128 | }
129 | }
130 |
131 | ?>
132 |
--------------------------------------------------------------------------------
/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT $start,$offset OPTION ranker=sph04,field_weights=(title=100,content=1)");
19 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
20 | $stmt->execute();
21 | $rows = $stmt->fetchAll();
22 | $meta = $ln_sph->query("SHOW META")->fetchAll();
23 | foreach($meta as $m) {
24 | $meta_map[$m['Variable_name']] = $m['Value'];
25 | }
26 | $total_found = $meta_map['total_found'];
27 | $total = $meta_map['total'];
28 | $ids = array();
29 | $tmpdocs = array();
30 | if (count($rows)> 0) {
31 | foreach ($rows as $v) {
32 | $ids[] = $v['id'];
33 | }
34 | //grab the raw content from database
35 | $q = "SELECT id,title ,content FROM docs WHERE id IN (" . implode(',', $ids) . ")";
36 |
37 | foreach($ln->query($q) as $row)
38 | $tmpdocs[$row['id']] = array('title' => $row['title'], 'content' => $row[content]);
39 | //it's important to keep the order returned by Sphinx
40 | foreach ($ids as $id) {
41 | $docs[] = $tmpdocs[$id];
42 | }
43 | }
44 | }
45 | ?>
46 |
50 |
51 |
61 |
62 | Simple autocomplete on title
63 |
64 |
65 |
66 |
Autocomplete is made using star on a titles index (with infixes).
67 |
Start typing in the field below
68 |
69 |
74 |
75 |
76 |
77 |
78 |
79 | Total found:=$total_found?>
80 |
81 |
82 |
83 | 0): ?>
84 |
85 |
86 |
87 |
88 |
89 | = $doc['title'] ?>
90 |
91 |
92 | = substr(strip_tags($doc['content']), 0, 500) . '...' ?>
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
Nothing found!
101 |
102 |
103 |
107 |
--------------------------------------------------------------------------------
/js/bootstrap-typeahead.js:
--------------------------------------------------------------------------------
1 | /* =============================================================
2 | * bootstrap-typeahead.js v2.0.3
3 | * http://twitter.github.com/bootstrap/javascript.html#typeahead
4 | * =============================================================
5 | * Copyright 2012 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ============================================================ */
19 |
20 | /*
21 | *
22 | * Modifications by Paul Warelis
23 | *
24 | */
25 |
26 | !function($){
27 |
28 | "use strict"; // jshint ;_;
29 |
30 | /* TYPEAHEAD PUBLIC CLASS DEFINITION
31 | * ================================= */
32 |
33 | var Typeahead = function (element, options) {
34 | this.$element = $(element)
35 | this.options = $.extend({}, $.fn.typeahead.defaults, options)
36 | this.matcher = this.options.matcher || this.matcher
37 | this.sorter = this.options.sorter || this.sorter
38 | this.highlighter = this.options.highlighter || this.highlighter
39 | this.updater = this.options.updater || this.updater
40 | this.$menu = $(this.options.menu).appendTo('body')
41 | if (this.options.ajax) {
42 | var ajax = this.options.ajax;
43 | if (typeof ajax == "string") {
44 | ajax = { url:ajax };
45 | }
46 | this.ajax = {
47 | url : ajax.url,
48 | timeout : ajax.timeout || 300,
49 | method: ajax.method || "post",
50 | triggerLength : ajax.triggerLength || 3,
51 | loadingClass : ajax.loadingClass || null,
52 | displayField : ajax.displayField || null,
53 | preDispatch : ajax.preDispatch || null,
54 | preProcess : ajax.preProcess || null
55 | }
56 | this.query = "";
57 | } else {
58 | this.source = this.options.source
59 | this.ajax = null;
60 | }
61 | this.shown = false
62 | this.listen()
63 | }
64 |
65 | Typeahead.prototype = {
66 |
67 | constructor: Typeahead,
68 |
69 | select: function () {
70 | var val = this.$menu.find('.active').attr('data-value')
71 | this.$element
72 | .val(this.updater(val))
73 | .change()
74 | return this.hide()
75 | },
76 |
77 | updater: function (item) {
78 | return item
79 | },
80 |
81 | show: function () {
82 | var pos = $.extend({}, this.$element.offset(), {
83 | height: this.$element[0].offsetHeight
84 | })
85 |
86 | this.$menu.css({
87 | top: pos.top + pos.height,
88 | left: pos.left
89 | })
90 |
91 | this.$menu.show()
92 | this.shown = true
93 | return this
94 | },
95 |
96 | hide: function () {
97 | this.$menu.hide()
98 | this.shown = false
99 | return this
100 | },
101 |
102 | ajaxLookup: function () {
103 |
104 | var query = this.$element.val();
105 |
106 | if (query == this.query) {
107 | return this;
108 | }
109 |
110 | // Query changed
111 | this.query = query
112 |
113 | // Cancel last timer if set
114 | if (this.ajax.timerId) {
115 | clearTimeout(this.ajax.timerId);
116 | this.ajax.timerId = null;
117 | }
118 |
119 | if (!query || query.length < this.ajax.triggerLength) {
120 | // cancel the ajax callback if in progress
121 | if (this.ajax.xhr) {
122 | this.ajax.xhr.abort();
123 | this.ajax.xhr = null;
124 | this.ajaxToggleLoadClass(false);
125 | }
126 | return this.shown ? this.hide() : this
127 | }
128 |
129 | function execute() {
130 | this.ajaxToggleLoadClass(true);
131 |
132 | // Cancel last call if already in progress
133 | if (this.ajax.xhr) this.ajax.xhr.abort();
134 |
135 | var params = this.ajax.preDispatch ? this.ajax.preDispatch(query) : { query : query }
136 | var jAjax = (this.ajax.method == "post") ? $.post : $.get;
137 | this.ajax.xhr = jAjax(this.ajax.url, params, $.proxy(this.ajaxSource, this));
138 | this.ajax.timerId = null;
139 | }
140 |
141 | // Query is good to send, set a timer
142 | this.ajax.timerId = setTimeout($.proxy(execute, this), this.ajax.timeout);
143 |
144 | return this;
145 | },
146 |
147 | ajaxSource: function (data) {
148 | this.ajaxToggleLoadClass(false);
149 |
150 | var that = this, items
151 |
152 | if (!this.ajax.xhr) return;
153 |
154 | if (this.ajax.preProcess) {
155 | data = this.ajax.preProcess(data);
156 | }
157 | // Save for selection retreival
158 | this.ajax.data = data;
159 |
160 | items = $.grep(data, function (item) {
161 | if (that.ajax.displayField) {
162 | item = item[that.ajax.displayField]
163 | }
164 | if (that.matcher(item)) return item
165 | })
166 |
167 | items = this.sorter(items)
168 |
169 | if (!items.length) {
170 | return this.shown ? this.hide() : this
171 | }
172 |
173 | this.ajax.xhr = null;
174 | return this.render(items.slice(0, this.options.items)).show()
175 | },
176 |
177 | ajaxToggleLoadClass: function (enable) {
178 | if (!this.ajax.loadingClass) return;
179 | this.$element.toggleClass(this.ajax.loadingClass, enable);
180 | },
181 |
182 | lookup: function (event) {
183 | var that = this, items
184 |
185 | this.query = this.$element.val()
186 |
187 | if (!this.query) {
188 | return this.shown ? this.hide() : this
189 | }
190 |
191 | items = $.grep(this.source, function (item) {
192 | return that.matcher(item)
193 | })
194 |
195 | items = this.sorter(items)
196 |
197 | if (!items.length) {
198 | return this.shown ? this.hide() : this
199 | }
200 |
201 | return this.render(items.slice(0, this.options.items)).show()
202 | },
203 |
204 | matcher: function (item) {
205 | return true;
206 | },
207 |
208 | sorter: function (items) {
209 | var beginswith = [],
210 | caseSensitive = [],
211 | caseInsensitive = [],
212 | item
213 |
214 | while (item = items.shift()) {
215 | if (this.ajax && this.ajax.displayField) {
216 | item = item[this.ajax.displayField]
217 | }
218 | if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
219 | else if (~item.indexOf(this.query)) caseSensitive.push(item)
220 | else caseInsensitive.push(item)
221 | }
222 |
223 | return beginswith.concat(caseSensitive, caseInsensitive)
224 | },
225 |
226 | highlighter: function (item) {
227 | var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
228 | return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
229 | return '
' + match + ' '
230 | })
231 | },
232 |
233 | render: function (items) {
234 | var that = this
235 |
236 | items = $(items).map(function (i, item) {
237 | i = $(that.options.item).attr('data-value', item)
238 | i.find('a').html(that.highlighter(item))
239 | return i[0]
240 | })
241 |
242 | items.first().addClass('active')
243 | this.$menu.html(items)
244 | return this
245 | },
246 |
247 | next: function (event) {
248 | var active = this.$menu.find('.active').removeClass('active'),
249 | next = active.next()
250 |
251 | if (!next.length) {
252 | next = $(this.$menu.find('li')[0])
253 | }
254 |
255 | next.addClass('active')
256 | },
257 |
258 | prev: function (event) {
259 | var active = this.$menu.find('.active').removeClass('active'),
260 | prev = active.prev()
261 |
262 | if (!prev.length) {
263 | prev = this.$menu.find('li').last()
264 | }
265 |
266 | prev.addClass('active')
267 | },
268 |
269 | listen: function () {
270 | this.$element
271 | .on('blur', $.proxy(this.blur, this))
272 | .on('keypress', $.proxy(this.keypress, this))
273 | .on('keyup', $.proxy(this.keyup, this))
274 |
275 | // Firefox needs this too
276 | this.$element.on('keydown', $.proxy(this.keypress, this))
277 |
278 | this.$menu
279 | .on('click', $.proxy(this.click, this))
280 | .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
281 | },
282 |
283 | keyup: function (e) {
284 | switch(e.keyCode) {
285 | case 40: // down arrow
286 | case 38: // up arrow
287 | break
288 |
289 | case 9: // tab
290 | case 13: // enter
291 | if (!this.shown) return
292 | this.select()
293 | break
294 |
295 | case 27: // escape
296 | if (!this.shown) return
297 | this.hide()
298 | break
299 |
300 | default:
301 | if (this.ajax) this.ajaxLookup()
302 | else this.lookup()
303 | }
304 |
305 | e.stopPropagation()
306 | e.preventDefault()
307 | },
308 |
309 | keypress: function (e) {
310 | if (!this.shown) return
311 |
312 | switch(e.keyCode) {
313 | case 9: // tab
314 | case 13: // enter
315 | case 27: // escape
316 | e.preventDefault()
317 | break
318 |
319 | case 38: // up arrow
320 | if (e.type != 'keydown') break
321 | e.preventDefault()
322 | this.prev()
323 | break
324 |
325 | case 40: // down arrow
326 | if (e.type != 'keydown') break
327 | e.preventDefault()
328 | this.next()
329 | break
330 | }
331 |
332 | e.stopPropagation()
333 | },
334 |
335 | blur: function (e) {
336 | var that = this
337 | setTimeout(function () { that.hide() }, 150)
338 | },
339 |
340 | click: function (e) {
341 | e.stopPropagation()
342 | e.preventDefault()
343 | this.select()
344 | },
345 |
346 | mouseenter: function (e) {
347 | this.$menu.find('.active').removeClass('active')
348 | $(e.currentTarget).addClass('active')
349 | }
350 | }
351 |
352 |
353 | /* TYPEAHEAD PLUGIN DEFINITION
354 | * =========================== */
355 |
356 | $.fn.typeahead = function (option) {
357 | return this.each(function () {
358 | var $this = $(this),
359 | data = $this.data('typeahead'),
360 | options = typeof option == 'object' && option
361 | if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
362 | if (typeof option == 'string') data[option]()
363 | })
364 | }
365 |
366 | $.fn.typeahead.defaults = {
367 | source: [],
368 | items: 8,
369 | menu: '',
370 | item: '
'
371 | }
372 |
373 | $.fn.typeahead.Constructor = Typeahead
374 |
375 | /* TYPEAHEAD DATA-API
376 | * ================== */
377 |
378 | $(function () {
379 | $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
380 | var $this = $(this)
381 | if ($this.data('typeahead')) return
382 | e.preventDefault()
383 | $this.typeahead($this.data())
384 | })
385 | })
386 |
387 | }(window.jQuery);
--------------------------------------------------------------------------------
/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap.js by @fat & @mdo
3 | * Copyright 2012 Twitter, Inc.
4 | * http://www.apache.org/licenses/LICENSE-2.0.txt
5 | */
6 | !function(a){a(function(){"use strict",a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=c,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(a){return a||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j=a.Event("slide");this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c);e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():f.interval&&e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning)return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning)return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e,f,g;if(c.is(".disabled, :disabled"))return;return f=c.attr("data-target"),f||(f=c.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),e=a(f),e.length||(e=c.parent()),g=e.hasClass("open"),d(),g||e.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('
').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;a("body").addClass("modal-open"),this.isShown=!0,g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();var e=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.show)return c.show();clearTimeout(this.timeout),c.hoverState="in",this.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!c.options.delay||!c.options.delay.hide)return c.hide();c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},isHTML:function(a){return typeof a!="string"||a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(a)},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.isHTML(b)?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover",title:"",delay:0}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.isHTML(b)?"html":"text"](b),a.find(".popover-content > *")[this.isHTML(c)?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'
'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body"),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){var b=this,c;this.offsets=a([]),this.targets=a([]),c=this.$body.find(this.selector).map(function(){var b=a(this),c=b.data("target")||b.attr("href"),d=/^#\w/.test(c)&&a(c);return d&&c.length&&[[d.position().top,c]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu")&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f,g;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],g=a.Event("show",{relatedTarget:e}),b.trigger(g);if(g.isDefaultPrevented())return;f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){return c.matcher(a)}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){var b=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return a.replace(new RegExp("("+b+")","ig"),function(a,b){return"
"+b+" "})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},keypress:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:if(a.type!="keydown")break;a.preventDefault(),this.prev();break;case 40:if(a.type!="keydown")break;a.preventDefault(),this.next()}a.stopPropagation()},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);
--------------------------------------------------------------------------------
/js/less-1.3.0.min.js:
--------------------------------------------------------------------------------
1 | //
2 | // LESS - Leaner CSS v1.3.0
3 | // http://lesscss.org
4 | //
5 | // Copyright (c) 2009-2011, Alexis Sellier
6 | // Licensed under the Apache 2.0 License.
7 | //
8 | (function(a,b){function c(b){return a.less[b.split("/")[1]]}function l(){var a=document.getElementsByTagName("style");for(var b=0;b
0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&g&&(t("saving "+e+" to cache."),g.setItem(e,a),g.setItem(e+":timestamp",c))}function q(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var g=r(),h=f?!1:d.async;typeof g.overrideMimeType=="function"&&g.overrideMimeType("text/css"),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),f?g.status===0||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){g.readyState==4&&i(g,c,e)}:i(g,c,e)}function r(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){return t("browser doesn't support AJAX."),null}}function s(a){return a&&a.parentNode.removeChild(a)}function t(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function u(a,b){var c="less-error-message:"+o(b),e='{line} {content} ',f=document.createElement("div"),g,h,i=[],j=a.filename||b;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+" "+'in '+j+" ";var k=function(a,b,c){a.extract[b]&&i.push(e.replace(/\{line\}/,parseInt(a.line)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.stack?h+=" "+a.stack.split("\n").slice(1).join(" "):a.extract&&(k(a,0,""),k(a,1,"line"),k(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":
"+""),f.innerHTML=h,p([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}typeof define=="function"&&define.amd&&define("less",[],function(){return d}),Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"||a instanceof Array}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c=this.length>>>0;for(var d=0;d>>0,c=new Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else do{if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}while(!0);for(;c=b)return-1;c<0&&(c+=b);for(;cl&&(k[g]=k[g].slice(f-l),l=f)}function t(a){var c,d,e,h,i,j,n,o;if(a instanceof Function)return a.call(m.parsers);if(typeof a=="string")c=b.charAt(f)===a?a:null,e=1,s();else{s();if(c=a.exec(k[g]))e=c[0].length;else return null}if(c){o=f+=e,j=f+k[g].length-e;while(f=0&&b.charAt(c)!=="\n";c--)d++;return{line:typeof a=="number"?(b.slice(0,a).match(/\n/g)||"").length:null,column:d}}function A(a,b){var c=y(a,b),d=z(a.index,c),e=d.line,f=d.column,g=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.filename,this.index=a.index,this.line=typeof e=="number"?e+1:null,this.callLine=a.call&&z(a.call,c).line+1,this.callExtract=g[z(a.call,c).line],this.stack=a.stack,this.column=f,this.extract=[g[e-1],g[e],g[e+1]]}var b,f,g,h,i,j,k,l,m,n=this,o=function(){},p=this.imports={paths:a&&a.paths||[],queue:[],files:{},contents:{},mime:a&&a.mime,error:null,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a,d,f){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=d,e.contents[b]=f,a&&!e.error&&(e.error=a),c(a,d),e.queue.length===0&&o()},a)}};return this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null,m={imports:p,parse:function(h,i){var n,p,q,r,s,u,v=[],w,x=null;f=g=l=j=0,b=h.replace(/\r\n/g,"\n"),k=function(c){var d=0,e=/[^"'`\{\}\/\(\)\\]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`\\\r\n]|\\.)*)`/g,h=0,i,j=c[0],k;for(var l=0,m,n;l0&&(x=new A({index:l,type:"Parse",message:"missing closing `}`",filename:a.filename},a)),c.map(function(a){return a.join("")})}([[]]);if(x)return i(x);try{n=new e.Ruleset([],t(this.parsers.primary)),n.root=!0}catch(y){return i(new A(y,a))}n.toCSS=function(b){var f,g,h;return function(f,g){var h=[],i;f=f||{},typeof g=="object"&&!Array.isArray(g)&&(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,0)}),h=[new e.Ruleset(null,g)]);try{var j=b.call(this,{frames:h}).toCSS([],{compress:f.compress||!1})}catch(k){throw new A(k,a)}if(i=m.imports.error)throw i instanceof A?i:new A(i,a);return f.yuicompress&&d.mode==="node"?c("./cssmin").compressor.cssmin(j):f.compress?j.replace(/(\s)+/g,"$1"):j}}(n.eval);if(f=0&&b.charAt(z)!=="\n";z--)B++;x={type:"Parse",message:"Syntax Error on line "+s,index:f,filename:a.filename,line:s,column:B,extract:[u[s-2],u[s-1],u[s]]}}this.imports.queue.length>0?o=function(){i(x,n)}:i(x,n)},parsers:{primary:function(){var a,b=[];while((a=t(this.mixin.definition)||t(this.rule)||t(this.ruleset)||t(this.mixin.call)||t(this.comment)||t(this.directive))||t(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(f)!=="/")return;if(b.charAt(f+1)==="/")return new e.Comment(t(/^\/\/.*/),!0);if(a=t(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)},entities:{quoted:function(){var a,c=f,d;b.charAt(c)==="~"&&(c++,d=!0);if(b.charAt(c)!=='"'&&b.charAt(c)!=="'")return;d&&t("~");if(a=t(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],d)},keyword:function(){var a;if(a=t(/^[_A-Za-z-][_A-Za-z0-9-]*/))return e.colors.hasOwnProperty(a)?new e.Color(e.colors[a].slice(1)):new e.Keyword(a)},call:function(){var b,c,d=f;if(!(b=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(k[g])))return;b=b[1].toLowerCase();if(b==="url")return null;f+=b.length;if(b==="alpha")return t(this.alpha);t("("),c=t(this.entities.arguments);if(!t(")"))return;if(b)return new e.Call(b,c,d,a.filename)},arguments:function(){var a=[],b;while(b=t(this.entities.assignment)||t(this.expression)){a.push(b);if(!t(","))break}return a},literal:function(){return t(this.entities.dimension)||t(this.entities.color)||t(this.entities.quoted)},assignment:function(){var a,b;if((a=t(/^\w+(?=\s?=)/i))&&t("=")&&(b=t(this.entity)))return new e.Assignment(a,b)},url:function(){var a;if(b.charAt(f)!=="u"||!t(/^url\(/))return;return a=t(this.entities.quoted)||t(this.entities.variable)||t(this.entities.dataURI)||t(/^[-\w%@$\/.&=:;#+?~]+/)||"",u(")"),new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),p.paths)},dataURI:function(){var a;if(t(/^data:/)){a={},a.mime=t(/^[^\/]+\/[^,;)]+/)||"",a.charset=t(/^;\s*charset=[^,;)]+/)||"",a.base64=t(/^;\s*base64/)||"",a.data=t(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var c,d=f;if(b.charAt(f)==="@"&&(c=t(/^@@?[\w-]+/)))return new e.Variable(c,d,a.filename)},color:function(){var a;if(b.charAt(f)==="#"&&(a=t(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,c=b.charCodeAt(f);if(c>57||c<45||c===47)return;if(a=t(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,c=f,d;b.charAt(c)==="~"&&(c++,d=!0);if(b.charAt(c)!=="`")return;d&&t("~");if(a=t(/^`([^`]*)`/))return new e.JavaScript(a[1],f,d)}},variable:function(){var a;if(b.charAt(f)==="@"&&(a=t(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!w(/^[@\w.%-]+\/[@\w.-]+/))return;if((a=t(this.entity))&&t("/")&&(b=t(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var c=[],d,g,h,i=f,j=b.charAt(f),k=!1;if(j!=="."&&j!=="#")return;while(d=t(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))c.push(new e.Element(g,d,f)),g=t(">");t("(")&&(h=t(this.entities.arguments))&&t(")"),t(this.important)&&(k=!0);if(c.length>0&&(t(";")||w("}")))return new e.mixin.Call(c,h||[],i,a.filename,k)},definition:function(){var a,c=[],d,g,h,i,j,k=!1;if(b.charAt(f)!=="."&&b.charAt(f)!=="#"||w(/^[^{]*(;|})/))return;q();if(d=t(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=d[1];do{if(b.charAt(f)==="."&&t(/^\.{3}/)){k=!0;break}if(!(h=t(this.entities.variable)||t(this.entities.literal)||t(this.entities.keyword)))break;if(h instanceof e.Variable)if(t(":"))i=u(this.expression,"expected expression"),c.push({name:h.name,value:i});else{if(t(/^\.{3}/)){c.push({name:h.name,variadic:!0}),k=!0;break}c.push({name:h.name})}else c.push({value:h})}while(t(","));u(")"),t(/^when/)&&(j=u(this.conditions,"expected condition")),g=t(this.block);if(g)return new e.mixin.Definition(a,c,g,j,k);r()}}},entity:function(){return t(this.entities.literal)||t(this.entities.variable)||t(this.entities.url)||t(this.entities.call)||t(this.entities.keyword)||t(this.entities.javascript)||t(this.comment)},end:function(){return t(";")||w("}")},alpha:function(){var a;if(!t(/^\(opacity=/i))return;if(a=t(/^\d+/)||t(this.entities.variable))return u(")"),new e.Alpha(a)},element:function(){var a,b,c,d;c=t(this.combinator),a=t(/^(?:\d+\.\d+|\d+)%/)||t(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||t("*")||t(this.attribute)||t(/^\([^)@]+\)/),a||t("(")&&(d=t(this.entities.variable))&&t(")")&&(a=new e.Paren(d));if(a)return new e.Element(c,a,f);if(c.value&&c.value.charAt(0)==="&")return new e.Element(c,null,f)},combinator:function(){var a,c=b.charAt(f);if(c===">"||c==="+"||c==="~"){f++;while(b.charAt(f)===" ")f++;return new e.Combinator(c)}if(c==="&"){a="&",f++,b.charAt(f)===" "&&(a="& ");while(b.charAt(f)===" ")f++;return new e.Combinator(a)}return b.charAt(f-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,c,d=[],g,h;if(t("("))return a=t(this.entity),u(")"),new e.Selector([new e.Element("",a,f)]);while(c=t(this.element)){g=b.charAt(f),d.push(c);if(g==="{"||g==="}"||g===";"||g===",")break}if(d.length>0)return new e.Selector(d)},tag:function(){return t(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||t("*")},attribute:function(){var a="",b,c,d;if(!t("["))return;if(b=t(/^[a-zA-Z-]+/)||t(this.entities.quoted))(d=t(/^[|~*$^]?=/))&&(c=t(this.entities.quoted)||t(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!t("]"))return;if(a)return"["+a+"]"},block:function(){var a;if(t("{")&&(a=t(this.primary))&&t("}"))return a},ruleset:function(){var b=[],c,d,g;q();while(c=t(this.selector)){b.push(c),t(this.comment);if(!t(","))break;t(this.comment)}if(b.length>0&&(d=t(this.block)))return new e.Ruleset(b,d,a.strictImports);j=f,r()},rule:function(){var a,c,d=b.charAt(f),h,l;q();if(d==="."||d==="#"||d==="&")return;if(a=t(this.variable)||t(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(k[g]))?(f+=l[0].length-1,c=new e.Anonymous(l[1])):a==="font"?c=t(this.font):c=t(this.value),h=t(this.important);if(c&&t(this.end))return new e.Rule(a,c,h,i);j=f,r()}},"import":function(){var a,b,c=f;if(t(/^@import\s+/)&&(a=t(this.entities.quoted)||t(this.entities.url))){b=t(this.mediaFeatures);if(t(";"))return new e.Import(a,p,b,c)}},mediaFeature:function(){var a,b,c=[];do if(a=t(this.entities.keyword))c.push(a);else if(t("(")){b=t(this.property),a=t(this.entity);if(!t(")"))return null;if(b&&a)c.push(new e.Paren(new e.Rule(b,a,null,f,!0)));else if(a)c.push(new e.Paren(a));else return null}while(a);if(c.length>0)return new e.Expression(c)},mediaFeatures:function(){var a,b=[];do if(a=t(this.mediaFeature)){b.push(a);if(!t(","))break}else if(a=t(this.entities.variable)){b.push(a);if(!t(","))break}while(a);return b.length>0?b:null},media:function(){var a,b;if(t(/^@media/)){a=t(this.mediaFeatures);if(b=t(this.block))return new e.Media(b,a)}},directive:function(){var a,c,d,g,h,i;if(b.charAt(f)!=="@")return;if(c=t(this["import"])||t(this.media))return c;if(a=t(/^@page|@keyframes/)||t(/^@(?:-webkit-|-moz-|-o-|-ms-)[a-z0-9-]+/)){g=(t(/^[^{]+/)||"").trim();if(d=t(this.block))return new e.Directive(a+" "+g,d)}else if(a=t(/^@[-a-z]+/))if(a==="@font-face"){if(d=t(this.block))return new e.Directive(a,d)}else if((c=t(this.entity))&&t(";"))return new e.Directive(a,c)},font:function(){var a=[],b=[],c,d,f,g;while(g=t(this.shorthand)||t(this.entity))b.push(g);a.push(new e.Expression(b));if(t(","))while(g=t(this.expression)){a.push(g);if(!t(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=t(this.expression)){b.push(a);if(!t(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(f)==="!")return t(/^! *important/)},sub:function(){var a;if(t("(")&&(a=t(this.expression))&&t(")"))return a},multiplication:function(){var a,b,c,d;if(a=t(this.operand)){while(!w(/^\/\*/)&&(c=t("/")||t("*"))&&(b=t(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,c,d,g;if(a=t(this.multiplication)){while((d=t(/^[-+]\s+/)||b.charAt(f-1)!=" "&&(t("+")||t("-")))&&(c=t(this.multiplication)))g=new e.Operation(d,[g||a,c]);return g||a}},conditions:function(){var a,b,c=f,d;if(a=t(this.condition)){while(t(",")&&(b=t(this.condition)))d=new e.Condition("or",d||a,b,c);return d||a}},condition:function(){var a,b,c,d,g=f,h=!1;t(/^not/)&&(h=!0),u("(");if(a=t(this.addition)||t(this.entities.keyword)||t(this.entities.quoted))return(d=t(/^(?:>=|=<|[<=>])/))?(b=t(this.addition)||t(this.entities.keyword)||t(this.entities.quoted))?c=new e.Condition(d,a,b,g,h):v("expected expression"):c=new e.Condition("=",a,new e.Keyword("true"),g,h),u(")"),t(/^and/)?new e.Condition("and",c,t(this.condition)):c},operand:function(){var a,c=b.charAt(f+1);b.charAt(f)==="-"&&(c==="@"||c==="(")&&(a=t("-"));var d=t(this.sub)||t(this.entities.dimension)||t(this.entities.color)||t(this.entities.variable)||t(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),d]):d},expression:function(){var a,b,c=[],d;while(a=t(this.addition)||t(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=t(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}};if(d.mode==="browser"||d.mode==="rhino")d.Parser.importer=function(a,b,c,d){!/^([a-z]+:)?\//.test(a)&&b.length>0&&(a=b[0]+a),n({href:a,title:a,type:d.mime},function(e){e&&typeof d.errback=="function"?d.errback.call(null,a,b,c,d):c.apply(null,arguments)},!0)};(function(a){function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function d(a){return Math.min(1,Math.max(0,a))}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){return a=a<0?a+1:a>1?a-1:a,a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();return e.s+=c.value/100,e.s=d(e.s),b(e)},desaturate:function(a,c){var e=a.toHSL();return e.s-=c.value/100,e.s=d(e.s),b(e)},lighten:function(a,c){var e=a.toHSL();return e.l+=c.value/100,e.l=d(e.l),b(e)},darken:function(a,c){var e=a.toHSL();return e.l-=c.value/100,e.l=d(e.l),b(e)},fadein:function(a,c){var e=a.toHSL();return e.a+=c.value/100,e.a=d(e.a),b(e)},fadeout:function(a,c){var e=a.toHSL();return e.a-=c.value/100,e.a=d(e.a),b(e)},fade:function(a,c){var e=a.toHSL();return e.a=c.value/100,e.a=d(e.a),b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;return d.h=e<0?360+e:e,b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e255?255:a<0?0:a).toString(16),a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b255?255:a<0?0:a).toString(16),a.length===1?"0"+a:a}).join("")}}}(c("../tree")),function(a){a.Comment=function(a,b){this.value=a,this.silent=!!b},a.Comment.prototype={toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype.eval=function(a){var b=this.lvalue.eval(a),c=this.rvalue.eval(a),d=this.index,e,e=function(a){switch(a){case"and":return b&&c;case"or":return b||c;default:if(b.compare)e=b.compare(c);else if(c.compare)e=c.compare(b);else throw{type:"Type",message:"Unable to perform comparison",index:d};switch(e){case-1:return a==="<"||a==="=<";case 0:return a==="="||a===">="||a==="=<";case 1:return a===">"||a===">="}}}(this.op);return this.negate?!e:e}}(c("../tree")),function(a){a.Dimension=function(a,b){this.value=parseFloat(a),this.unit=b||null},a.Dimension.prototype={eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},toCSS:function(){var a=this.value+this.unit;return a},operate:function(b,c){return new a.Dimension(a.operate(b,this.value,c.value),this.unit||c.unit)},compare:function(b){return b instanceof a.Dimension?b.value>this.value?-1:b.value":a.compress?">":" > "}[this.value]}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value.length===1?this.value[0].eval(b):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS?b.toCSS(a):""}).join(" ")}}}(c("../tree")),function(a){a.Import=function(b,c,d,e){var f=this;this.index=e,this._path=b,this.features=d&&new a.Value(d),b instanceof a.Quoted?this.path=/\.(le?|c)ss(\?.*)?$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css(\?.*)?$/.test(this.path),this.css||c.push(this.path,function(b,c){b&&(b.index=e),f.root=c||new a.Ruleset([],[])})},a.Import.prototype={toCSS:function(a){var b=this.features?" "+this.features.toCSS(a):"";return this.css?"@import "+this._path.toCSS()+b+";\n":""},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.css)return this;c=new a.Ruleset([],this.root.rules.slice(0));for(var e=0;e1){var d=new a.Element("&",null,0),e=[new a.Selector([d])];c=new a.Ruleset(e,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(a.length===0)return[];if(a.length===1)return a[0];var b=[],c=this.permute(a.slice(1));for(var d=0;d0){c=this.arguments&&this.arguments.map(function(b){return b.eval(a)});for(var g=0;gthis.params.length)return!1;if(this.required>0&&c>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(b,a)].concat(b.frames)}))return!1;d=Math.min(c,this.arity);for(var f=0;fe.selectors[g].elements.length?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}}),this._lookups[g]=d)},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;this.root||(b.length===0?g=this.selectors.map(function(a){return[a]}):this.joinSelectors(g,b,this.selectors));for(var j=0;j0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":",\n"),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f),d.join("")+(c.compress?"\n":"")},joinSelectors:function(a,b,c){for(var d=0;d0&&e.push(new a.Selector(g)),h.length>0&&f.push(new a.Selector(h));for(var l=0;l0&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("../tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("../tree")),function(a){a.Variable=function(a,b,c){this.name=a,this.index=b,this.file=c},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{type:"Name",message:"variable "+e+" is undefined",filename:this.file,index:this.index}}}}(c("../tree")),function(a){a.find=function(a,b){for(var c=0,d;c1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)}}(c("./tree"));var f=location.protocol==="file:"||location.protocol==="chrome:"||location.protocol==="chrome-extension:"||location.protocol==="resource:";d.env=d.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||f?"development":"production"),d.async=!1,d.poll=d.poll||(f?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&m(function(a,b,c,d,e){b&&p(b.toCSS(),d,e.lastModified)})},d.poll)):d.optimization=3;var g;try{g=typeof a.localStorage=="undefined"?null:a.localStorage}catch(h){g=null}var i=document.getElementsByTagName("link"),j=/^text\/(x-)?less$/;d.sheets=[];for(var k=0;k0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&g&&(t("saving "+e+" to cache."),g.setItem(e,a),g.setItem(e+":timestamp",c))}function q(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var g=r(),h=f?!1:d.async;typeof g.overrideMimeType=="function"&&g.overrideMimeType("text/css"),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),f?g.status===0||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){g.readyState==4&&i(g,c,e)}:i(g,c,e)}function r(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){return t("browser doesn't support AJAX."),null}}function s(a){return a&&a.parentNode.removeChild(a)}function t(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function u(a,b){var c="less-error-message:"+o(b),e='{line} {content} ',f=document.createElement("div"),g,h,i=[],j=a.filename||b;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+" "+'in '+j+" ";var k=function(a,b,c){a.extract[b]&&i.push(e.replace(/\{line\}/,parseInt(a.line)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.stack?h+=" "+a.stack.split("\n").slice(1).join(" "):a.extract&&(k(a,0,""),k(a,1,"line"),k(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":
"+""),f.innerHTML=h,p([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}typeof define=="function"&&define.amd&&define("less",[],function(){return d}),Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"||a instanceof Array}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c=this.length>>>0;for(var d=0;d>>0,c=new Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else do{if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}while(!0);for(;c=b)return-1;c<0&&(c+=b);for(;cl&&(k[g]=k[g].slice(f-l),l=f)}function t(a){var c,d,e,h,i,j,n,o;if(a instanceof Function)return a.call(m.parsers);if(typeof a=="string")c=b.charAt(f)===a?a:null,e=1,s();else{s();if(c=a.exec(k[g]))e=c[0].length;else return null}if(c){o=f+=e,j=f+k[g].length-e;while(f=0&&b.charAt(c)!=="\n";c--)d++;return{line:typeof a=="number"?(b.slice(0,a).match(/\n/g)||"").length:null,column:d}}function A(a,b){var c=y(a,b),d=z(a.index,c),e=d.line,f=d.column,g=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.filename,this.index=a.index,this.line=typeof e=="number"?e+1:null,this.callLine=a.call&&z(a.call,c).line+1,this.callExtract=g[z(a.call,c).line],this.stack=a.stack,this.column=f,this.extract=[g[e-1],g[e],g[e+1]]}var b,f,g,h,i,j,k,l,m,n=this,o=function(){},p=this.imports={paths:a&&a.paths||[],queue:[],files:{},contents:{},mime:a&&a.mime,error:null,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a,d,f){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=d,e.contents[b]=f,a&&!e.error&&(e.error=a),c(a,d),e.queue.length===0&&o()},a)}};return this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null,m={imports:p,parse:function(h,i){var n,p,q,r,s,u,v=[],w,x=null;f=g=l=j=0,b=h.replace(/\r\n/g,"\n"),k=function(c){var d=0,e=/[^"'`\{\}\/\(\)\\]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`\\\r\n]|\\.)*)`/g,h=0,i,j=c[0],k;for(var l=0,m,n;l0&&(x=new A({index:l,type:"Parse",message:"missing closing `}`",filename:a.filename},a)),c.map(function(a){return a.join("")})}([[]]);if(x)return i(x);try{n=new e.Ruleset([],t(this.parsers.primary)),n.root=!0}catch(y){return i(new A(y,a))}n.toCSS=function(b){var f,g,h;return function(f,g){var h=[],i;f=f||{},typeof g=="object"&&!Array.isArray(g)&&(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,0)}),h=[new e.Ruleset(null,g)]);try{var j=b.call(this,{frames:h}).toCSS([],{compress:f.compress||!1})}catch(k){throw new A(k,a)}if(i=m.imports.error)throw i instanceof A?i:new A(i,a);return f.yuicompress&&d.mode==="node"?c("./cssmin").compressor.cssmin(j):f.compress?j.replace(/(\s)+/g,"$1"):j}}(n.eval);if(f=0&&b.charAt(z)!=="\n";z--)B++;x={type:"Parse",message:"Syntax Error on line "+s,index:f,filename:a.filename,line:s,column:B,extract:[u[s-2],u[s-1],u[s]]}}this.imports.queue.length>0?o=function(){i(x,n)}:i(x,n)},parsers:{primary:function(){var a,b=[];while((a=t(this.mixin.definition)||t(this.rule)||t(this.ruleset)||t(this.mixin.call)||t(this.comment)||t(this.directive))||t(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(f)!=="/")return;if(b.charAt(f+1)==="/")return new e.Comment(t(/^\/\/.*/),!0);if(a=t(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)},entities:{quoted:function(){var a,c=f,d;b.charAt(c)==="~"&&(c++,d=!0);if(b.charAt(c)!=='"'&&b.charAt(c)!=="'")return;d&&t("~");if(a=t(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],d)},keyword:function(){var a;if(a=t(/^[_A-Za-z-][_A-Za-z0-9-]*/))return e.colors.hasOwnProperty(a)?new e.Color(e.colors[a].slice(1)):new e.Keyword(a)},call:function(){var b,c,d=f;if(!(b=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(k[g])))return;b=b[1].toLowerCase();if(b==="url")return null;f+=b.length;if(b==="alpha")return t(this.alpha);t("("),c=t(this.entities.arguments);if(!t(")"))return;if(b)return new e.Call(b,c,d,a.filename)},arguments:function(){var a=[],b;while(b=t(this.entities.assignment)||t(this.expression)){a.push(b);if(!t(","))break}return a},literal:function(){return t(this.entities.dimension)||t(this.entities.color)||t(this.entities.quoted)},assignment:function(){var a,b;if((a=t(/^\w+(?=\s?=)/i))&&t("=")&&(b=t(this.entity)))return new e.Assignment(a,b)},url:function(){var a;if(b.charAt(f)!=="u"||!t(/^url\(/))return;return a=t(this.entities.quoted)||t(this.entities.variable)||t(this.entities.dataURI)||t(/^[-\w%@$\/.&=:;#+?~]+/)||"",u(")"),new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),p.paths)},dataURI:function(){var a;if(t(/^data:/)){a={},a.mime=t(/^[^\/]+\/[^,;)]+/)||"",a.charset=t(/^;\s*charset=[^,;)]+/)||"",a.base64=t(/^;\s*base64/)||"",a.data=t(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var c,d=f;if(b.charAt(f)==="@"&&(c=t(/^@@?[\w-]+/)))return new e.Variable(c,d,a.filename)},color:function(){var a;if(b.charAt(f)==="#"&&(a=t(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,c=b.charCodeAt(f);if(c>57||c<45||c===47)return;if(a=t(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,c=f,d;b.charAt(c)==="~"&&(c++,d=!0);if(b.charAt(c)!=="`")return;d&&t("~");if(a=t(/^`([^`]*)`/))return new e.JavaScript(a[1],f,d)}},variable:function(){var a;if(b.charAt(f)==="@"&&(a=t(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!w(/^[@\w.%-]+\/[@\w.-]+/))return;if((a=t(this.entity))&&t("/")&&(b=t(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var c=[],d,g,h,i=f,j=b.charAt(f),k=!1;if(j!=="."&&j!=="#")return;while(d=t(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))c.push(new e.Element(g,d,f)),g=t(">");t("(")&&(h=t(this.entities.arguments))&&t(")"),t(this.important)&&(k=!0);if(c.length>0&&(t(";")||w("}")))return new e.mixin.Call(c,h||[],i,a.filename,k)},definition:function(){var a,c=[],d,g,h,i,j,k=!1;if(b.charAt(f)!=="."&&b.charAt(f)!=="#"||w(/^[^{]*(;|})/))return;q();if(d=t(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=d[1];do{if(b.charAt(f)==="."&&t(/^\.{3}/)){k=!0;break}if(!(h=t(this.entities.variable)||t(this.entities.literal)||t(this.entities.keyword)))break;if(h instanceof e.Variable)if(t(":"))i=u(this.expression,"expected expression"),c.push({name:h.name,value:i});else{if(t(/^\.{3}/)){c.push({name:h.name,variadic:!0}),k=!0;break}c.push({name:h.name})}else c.push({value:h})}while(t(","));u(")"),t(/^when/)&&(j=u(this.conditions,"expected condition")),g=t(this.block);if(g)return new e.mixin.Definition(a,c,g,j,k);r()}}},entity:function(){return t(this.entities.literal)||t(this.entities.variable)||t(this.entities.url)||t(this.entities.call)||t(this.entities.keyword)||t(this.entities.javascript)||t(this.comment)},end:function(){return t(";")||w("}")},alpha:function(){var a;if(!t(/^\(opacity=/i))return;if(a=t(/^\d+/)||t(this.entities.variable))return u(")"),new e.Alpha(a)},element:function(){var a,b,c,d;c=t(this.combinator),a=t(/^(?:\d+\.\d+|\d+)%/)||t(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||t("*")||t(this.attribute)||t(/^\([^)@]+\)/),a||t("(")&&(d=t(this.entities.variable))&&t(")")&&(a=new e.Paren(d));if(a)return new e.Element(c,a,f);if(c.value&&c.value.charAt(0)==="&")return new e.Element(c,null,f)},combinator:function(){var a,c=b.charAt(f);if(c===">"||c==="+"||c==="~"){f++;while(b.charAt(f)===" ")f++;return new e.Combinator(c)}if(c==="&"){a="&",f++,b.charAt(f)===" "&&(a="& ");while(b.charAt(f)===" ")f++;return new e.Combinator(a)}return b.charAt(f-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,c,d=[],g,h;if(t("("))return a=t(this.entity),u(")"),new e.Selector([new e.Element("",a,f)]);while(c=t(this.element)){g=b.charAt(f),d.push(c);if(g==="{"||g==="}"||g===";"||g===",")break}if(d.length>0)return new e.Selector(d)},tag:function(){return t(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||t("*")},attribute:function(){var a="",b,c,d;if(!t("["))return;if(b=t(/^[a-zA-Z-]+/)||t(this.entities.quoted))(d=t(/^[|~*$^]?=/))&&(c=t(this.entities.quoted)||t(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!t("]"))return;if(a)return"["+a+"]"},block:function(){var a;if(t("{")&&(a=t(this.primary))&&t("}"))return a},ruleset:function(){var b=[],c,d,g;q();while(c=t(this.selector)){b.push(c),t(this.comment);if(!t(","))break;t(this.comment)}if(b.length>0&&(d=t(this.block)))return new e.Ruleset(b,d,a.strictImports);j=f,r()},rule:function(){var a,c,d=b.charAt(f),h,l;q();if(d==="."||d==="#"||d==="&")return;if(a=t(this.variable)||t(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(k[g]))?(f+=l[0].length-1,c=new e.Anonymous(l[1])):a==="font"?c=t(this.font):c=t(this.value),h=t(this.important);if(c&&t(this.end))return new e.Rule(a,c,h,i);j=f,r()}},"import":function(){var a,b,c=f;if(t(/^@import\s+/)&&(a=t(this.entities.quoted)||t(this.entities.url))){b=t(this.mediaFeatures);if(t(";"))return new e.Import(a,p,b,c)}},mediaFeature:function(){var a,b,c=[];do if(a=t(this.entities.keyword))c.push(a);else if(t("(")){b=t(this.property),a=t(this.entity);if(!t(")"))return null;if(b&&a)c.push(new e.Paren(new e.Rule(b,a,null,f,!0)));else if(a)c.push(new e.Paren(a));else return null}while(a);if(c.length>0)return new e.Expression(c)},mediaFeatures:function(){var a,b=[];do if(a=t(this.mediaFeature)){b.push(a);if(!t(","))break}else if(a=t(this.entities.variable)){b.push(a);if(!t(","))break}while(a);return b.length>0?b:null},media:function(){var a,b;if(t(/^@media/)){a=t(this.mediaFeatures);if(b=t(this.block))return new e.Media(b,a)}},directive:function(){var a,c,d,g,h,i;if(b.charAt(f)!=="@")return;if(c=t(this["import"])||t(this.media))return c;if(a=t(/^@page|@keyframes/)||t(/^@(?:-webkit-|-moz-|-o-|-ms-)[a-z0-9-]+/)){g=(t(/^[^{]+/)||"").trim();if(d=t(this.block))return new e.Directive(a+" "+g,d)}else if(a=t(/^@[-a-z]+/))if(a==="@font-face"){if(d=t(this.block))return new e.Directive(a,d)}else if((c=t(this.entity))&&t(";"))return new e.Directive(a,c)},font:function(){var a=[],b=[],c,d,f,g;while(g=t(this.shorthand)||t(this.entity))b.push(g);a.push(new e.Expression(b));if(t(","))while(g=t(this.expression)){a.push(g);if(!t(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=t(this.expression)){b.push(a);if(!t(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(f)==="!")return t(/^! *important/)},sub:function(){var a;if(t("(")&&(a=t(this.expression))&&t(")"))return a},multiplication:function(){var a,b,c,d;if(a=t(this.operand)){while(!w(/^\/\*/)&&(c=t("/")||t("*"))&&(b=t(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,c,d,g;if(a=t(this.multiplication)){while((d=t(/^[-+]\s+/)||b.charAt(f-1)!=" "&&(t("+")||t("-")))&&(c=t(this.multiplication)))g=new e.Operation(d,[g||a,c]);return g||a}},conditions:function(){var a,b,c=f,d;if(a=t(this.condition)){while(t(",")&&(b=t(this.condition)))d=new e.Condition("or",d||a,b,c);return d||a}},condition:function(){var a,b,c,d,g=f,h=!1;t(/^not/)&&(h=!0),u("(");if(a=t(this.addition)||t(this.entities.keyword)||t(this.entities.quoted))return(d=t(/^(?:>=|=<|[<=>])/))?(b=t(this.addition)||t(this.entities.keyword)||t(this.entities.quoted))?c=new e.Condition(d,a,b,g,h):v("expected expression"):c=new e.Condition("=",a,new e.Keyword("true"),g,h),u(")"),t(/^and/)?new e.Condition("and",c,t(this.condition)):c},operand:function(){var a,c=b.charAt(f+1);b.charAt(f)==="-"&&(c==="@"||c==="(")&&(a=t("-"));var d=t(this.sub)||t(this.entities.dimension)||t(this.entities.color)||t(this.entities.variable)||t(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),d]):d},expression:function(){var a,b,c=[],d;while(a=t(this.addition)||t(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=t(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}};if(d.mode==="browser"||d.mode==="rhino")d.Parser.importer=function(a,b,c,d){!/^([a-z]+:)?\//.test(a)&&b.length>0&&(a=b[0]+a),n({href:a,title:a,type:d.mime},function(e){e&&typeof d.errback=="function"?d.errback.call(null,a,b,c,d):c.apply(null,arguments)},!0)};(function(a){function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function d(a){return Math.min(1,Math.max(0,a))}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){return a=a<0?a+1:a>1?a-1:a,a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();return e.s+=c.value/100,e.s=d(e.s),b(e)},desaturate:function(a,c){var e=a.toHSL();return e.s-=c.value/100,e.s=d(e.s),b(e)},lighten:function(a,c){var e=a.toHSL();return e.l+=c.value/100,e.l=d(e.l),b(e)},darken:function(a,c){var e=a.toHSL();return e.l-=c.value/100,e.l=d(e.l),b(e)},fadein:function(a,c){var e=a.toHSL();return e.a+=c.value/100,e.a=d(e.a),b(e)},fadeout:function(a,c){var e=a.toHSL();return e.a-=c.value/100,e.a=d(e.a),b(e)},fade:function(a,c){var e=a.toHSL();return e.a=c.value/100,e.a=d(e.a),b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;return d.h=e<0?360+e:e,b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e255?255:a<0?0:a).toString(16),a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b255?255:a<0?0:a).toString(16),a.length===1?"0"+a:a}).join("")}}}(c("../tree")),function(a){a.Comment=function(a,b){this.value=a,this.silent=!!b},a.Comment.prototype={toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype.eval=function(a){var b=this.lvalue.eval(a),c=this.rvalue.eval(a),d=this.index,e,e=function(a){switch(a){case"and":return b&&c;case"or":return b||c;default:if(b.compare)e=b.compare(c);else if(c.compare)e=c.compare(b);else throw{type:"Type",message:"Unable to perform comparison",index:d};switch(e){case-1:return a==="<"||a==="=<";case 0:return a==="="||a===">="||a==="=<";case 1:return a===">"||a===">="}}}(this.op);return this.negate?!e:e}}(c("../tree")),function(a){a.Dimension=function(a,b){this.value=parseFloat(a),this.unit=b||null},a.Dimension.prototype={eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},toCSS:function(){var a=this.value+this.unit;return a},operate:function(b,c){return new a.Dimension(a.operate(b,this.value,c.value),this.unit||c.unit)},compare:function(b){return b instanceof a.Dimension?b.value>this.value?-1:b.value":a.compress?">":" > "}[this.value]}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value.length===1?this.value[0].eval(b):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS?b.toCSS(a):""}).join(" ")}}}(c("../tree")),function(a){a.Import=function(b,c,d,e){var f=this;this.index=e,this._path=b,this.features=d&&new a.Value(d),b instanceof a.Quoted?this.path=/\.(le?|c)ss(\?.*)?$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css(\?.*)?$/.test(this.path),this.css||c.push(this.path,function(b,c){b&&(b.index=e),f.root=c||new a.Ruleset([],[])})},a.Import.prototype={toCSS:function(a){var b=this.features?" "+this.features.toCSS(a):"";return this.css?"@import "+this._path.toCSS()+b+";\n":""},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.css)return this;c=new a.Ruleset([],this.root.rules.slice(0));for(var e=0;e1){var d=new a.Element("&",null,0),e=[new a.Selector([d])];c=new a.Ruleset(e,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(a.length===0)return[];if(a.length===1)return a[0];var b=[],c=this.permute(a.slice(1));for(var d=0;d0){c=this.arguments&&this.arguments.map(function(b){return b.eval(a)});for(var g=0;gthis.params.length)return!1;if(this.required>0&&c>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(b,a)].concat(b.frames)}))return!1;d=Math.min(c,this.arity);for(var f=0;fe.selectors[g].elements.length?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}}),this._lookups[g]=d)},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;this.root||(b.length===0?g=this.selectors.map(function(a){return[a]}):this.joinSelectors(g,b,this.selectors));for(var j=0;j0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":",\n"),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f),d.join("")+(c.compress?"\n":"")},joinSelectors:function(a,b,c){for(var d=0;d0&&e.push(new a.Selector(g)),h.length>0&&f.push(new a.Selector(h));for(var l=0;l0&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("../tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("../tree")),function(a){a.Variable=function(a,b,c){this.name=a,this.index=b,this.file=c},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{type:"Name",message:"variable "+e+" is undefined",filename:this.file,index:this.index}}}}(c("../tree")),function(a){a.find=function(a,b){for(var c=0,d;c1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)}}(c("./tree"));var f=location.protocol==="file:"||location.protocol==="chrome:"||location.protocol==="chrome-extension:"||location.protocol==="resource:";d.env=d.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||f?"development":"production"),d.async=!1,d.poll=d.poll||(f?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&m(function(a,b,c,d,e){b&&p(b.toCSS(),d,e.lastModified)})},d.poll)):d.optimization=3;var g;try{g=typeof a.localStorage=="undefined"?null:a.localStorage}catch(h){g=null}var i=document.getElementsByTagName("link"),j=/^text\/(x-)?less$/;d.sheets=[];for(var k=0;kprepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT $start,$offset OPTION ranker=sph04,field_weights=(title=100,content=1)");
21 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
22 | $stmt->execute();
23 | $rows = $stmt->fetchAll();
24 | $meta = $ln_sph->query("SHOW META")->fetchAll();
25 | foreach($meta as $m) {
26 | $meta_map[$m['Variable_name']] = $m['Value'];
27 | }
28 | $total_found = $meta_map['total_found'];
29 | $total = $meta_map['total'];
30 | $ids = array();
31 | $tmpdocs = array();
32 | if (count($rows)> 0) {
33 | foreach ($rows as $v) {
34 | $ids[] = $v['id'];
35 | }
36 | $q = "SELECT id,title ,content FROM docs WHERE id IN (" . implode(',', $ids) . ")";
37 | foreach ($ln->query($q) as $row) {
38 | $tmpdocs[$row['id']] = array('title' => $row['title'], 'content' => $row['content']);
39 | }
40 | foreach ($ids as $id) {
41 | $docs[] = $tmpdocs[$id];
42 | }
43 | } else {
44 | $words = array();
45 | foreach($meta_map as $k=>$v) {
46 |
47 | if(preg_match('/keyword\[\d+]/', $k)) {
48 | preg_match('/\d+/', $k,$key);
49 | $key = $key[0];
50 | $words[$key]['keyword'] = $v;
51 | }
52 | if(preg_match('/docs\[\d+]/', $k)) {
53 | preg_match('/\d+/', $k,$key);
54 | $key = $key[0];
55 | $words[$key]['docs'] = $v;
56 | }
57 | }
58 | $suggest = MakeMultiQSuggest($words, $query,$indexes, $ln_sph);
59 | }
60 | }
61 | ?>
62 |
66 |
67 |
76 |
77 | Demo autocomplete with CALL SUGGEST
78 |
79 |
80 |
81 |
82 | Autocomplete is made using star on a titles index (with infixes). Correction
83 | suggest can be made inside a phrase , by trying to find a suggestion
84 | for each wrong typed word or word with low hits.
85 | This example uses the new CALL SUGGEST function and requires Sphinx 2.3.2-beta or newer.
86 | CALL SUGGEST works only on indexes with infixes, so we need to reindex the main index with infixing.
87 |
88 |
Start typing in the field below
89 |
90 |
96 |
97 |
98 |
99 |
100 |
108 |
109 |
110 |
111 | Total found:=$total_found?>
112 |
113 |
114 |
115 | 0): ?>
116 |
117 |
118 |
119 |
120 |
121 | = $doc['title'] ?>
122 |
123 |
124 | = substr(strip_tags($doc['content']), 0, 500) . '...' ?>
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
Nothing found!
133 |
134 |
135 |
139 |
--------------------------------------------------------------------------------
/scripts/docs.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/scripts/docs.tar.gz
--------------------------------------------------------------------------------
/scripts/sphinx.conf:
--------------------------------------------------------------------------------
1 | source suggest
2 | {
3 | type = mysql
4 | sql_host = localhost
5 | sql_user = MYUSER
6 | sql_pass = MYPASS
7 | sql_db = MYDB
8 | sql_port = 3306
9 |
10 | sql_query_pre = SET NAMES utf8
11 | sql_query = SELECT id, trigrams, freq, LENGTH(keyword) AS len, keyword FROM suggest
12 | sql_attr_uint = freq
13 | sql_attr_uint = len
14 | sql_attr_string = keyword
15 | }
16 |
17 | index suggest
18 | {
19 | source = suggest
20 | path = /PATH/TO/suggest_idx
21 | docinfo = extern
22 | charset_type = utf-8
23 | }
24 |
25 | source simplecomplete
26 | {
27 | type = mysql
28 | sql_host = localhost
29 | sql_user = MYUSER
30 | sql_pass = MYPASS
31 | sql_db = MYDB
32 | sql_port = 3306
33 |
34 | sql_query = select id,title from docs
35 | sql_field_string = title
36 | }
37 |
38 | index simplecomplete
39 | {
40 | source = simplecomplete
41 | path = /PATH/TO/simplecomplete_idx
42 | docinfo = extern
43 | charset_type = utf-8
44 | min_word_len = 3
45 | enable_star = 1
46 | min_prefix_len = 3
47 | }
48 | source simplecompletefull
49 | {
50 | type = mysql
51 | sql_host = localhost
52 | sql_user = MYUSER
53 | sql_pass = MYPASS
54 | sql_db = MYDB
55 | sql_port = 3306
56 |
57 | sql_query_pre = SET NAMES utf8
58 | sql_query = select id,title,content from docs
59 | }
60 |
61 | index simplecompletefull
62 | {
63 | source = simplecompletefull
64 | path = /PATH/TO/simplecompletefull_idx
65 | docinfo = extern
66 | charset_type = utf-8
67 | min_word_len = 3
68 | #min_infix_len = 3 # for CALL SUGGEST
69 | }
70 |
71 | indexer
72 | {
73 | mem_limit = 64M
74 | }
75 |
76 | searchd
77 | {
78 | listen = 9312
79 | listen = 9306:mysql41
80 | log = /PATH/TO/searchd.log
81 | query_log = /PATH/TO/query.log
82 | query_log_format = sphinxql
83 | read_timeout = 5
84 | max_children = 30
85 | pid_file = /PATH/TO/searchd.pid
86 | max_matches = 1000
87 | seamless_rotate = 1
88 | preopen_indexes = 1
89 | unlink_old = 1
90 | workers = threads
91 | }
92 |
--------------------------------------------------------------------------------
/scripts/suggest.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adriannuta/SphinxAutocompleteExample/58d74c89d30a9d9ea4a8e69fa2e2f1c5aa6bfa07/scripts/suggest.tar.gz
--------------------------------------------------------------------------------
/scripts/suggest/README:
--------------------------------------------------------------------------------
1 | Suggestions sample
2 | -------------------
3 |
4 | 0) What's this. This sample shows how to implement simple keyword
5 | correction suggestions (ie. "did you mean") using Sphinx.
6 |
7 | 1) Requirements. You will need Sphinx, MySQL, and PHP CLI.
8 |
9 | 2) Quickstart. (Skip first indexer command to use bundled sample.)
10 |
11 | indexer YOURINDEX --config YOURCONFIG.CONF --buildstops dict.txt 100000 --buildfreqs
12 | cat dict.txt | php suggest.php --builddict > dict.sql
13 | mysql -u root test < dict.sql
14 | indexer --config suggest.conf --all
15 | searchd --config suggest.conf
16 | php suggest.php --query sphynx
17 |
18 | --eof--
19 |
--------------------------------------------------------------------------------
/scripts/suggest/suggest.php:
--------------------------------------------------------------------------------
1 | SetMatchMode ( SPH_MATCH_EXTENDED2 );
82 | $cl->SetRankingMode ( SPH_RANK_WORDCOUNT );
83 | $cl->SetFilterRange ( "len", $len-$delta, $len+$delta );
84 | $cl->SetSelect ( "*, @weight+$delta-abs(len-$len) AS myrank" );
85 | $cl->SetSortMode ( SPH_SORT_EXTENDED, "myrank DESC, freq DESC" );
86 | $cl->SetArrayResult ( true );
87 |
88 | // pull top-N best trigram matches and run them through Levenshtein
89 | $res = $cl->Query ( $query, "suggest", 0, TOP_COUNT );
90 |
91 | if ( !$res || !$res["matches"] )
92 | return false;
93 |
94 | if ( SUGGEST_DEBUG )
95 | {
96 | print "--- DEBUG START ---\n";
97 |
98 | foreach ( $res["matches"] as $match )
99 | {
100 | $w = $match["keyword"];
101 | $myrank = @$match["attrs"]["myrank"];
102 | if ( $myrank )
103 | $myrank = ", myrank=$myrank";
104 | $levdist = levenshtein ( $keyword, $w );
105 |
106 | print "id=$match[id], weight=$match[weight], freq={$match[attrs][freq]}{$myrank}, word=$w, levdist=$levdist\n";
107 | }
108 |
109 | print "--- DEBUG END ---\n";
110 | }
111 |
112 | // further restrict trigram matches with a sane Levenshtein distance limit
113 | foreach ( $res["matches"] as $match )
114 | {
115 | $suggested = $match["attrs"]["keyword"];
116 | if ( levenshtein ( $keyword, $suggested )<=LEVENSHTEIN_THRESHOLD )
117 | return $suggested;
118 | }
119 | return $keyword;
120 | }
121 |
122 | /// main
123 | if ( $_SERVER["argc"]<2 )
124 | {
125 | die ( "usage:\n"
126 | . "php suggest.php --builddict\treads stopwords from stdin, prints SQL dump of the dictionary to stdout\n"
127 | . "php suggest.php --query WORD\tqueries Sphinx, prints suggestion\n" );
128 | }
129 |
130 | if ( $_SERVER["argv"][1]=="--builddict" )
131 | {
132 | $in = fopen ( "php://stdin", "r" );
133 | $out = fopen ( "php://stdout", "w+" );
134 | BuildDictionarySQL ( $out, $in );
135 | }
136 |
137 | if ( $_SERVER["argv"][1]=="--query" )
138 | {
139 | mysql_connect ( "localhost", "root", "" ) or die ( "mysql_connect() failed: ".mysql_error() );
140 | mysql_select_db ( "test" ) or die ( "mysql_select_db() failed: ".mysql_error() );
141 |
142 | $keyword = $_SERVER["argv"][2];
143 | printf ( "keyword: %s\nsuggestion: %s\n", $keyword, MakeSuggestion($keyword) );
144 | }
145 |
--------------------------------------------------------------------------------
/suggestcomplete.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT $start,$offset OPTION ranker=sph04,field_weights=(title=100,content=1)");
21 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
22 | $stmt->execute();
23 | $rows = $stmt->fetchAll();
24 | $meta = $ln_sph->query("SHOW META")->fetchAll();
25 | foreach($meta as $m) {
26 | $meta_map[$m['Variable_name']] = $m['Value'];
27 | }
28 | $total_found = $meta_map['total_found'];
29 | $total = $meta_map['total'];
30 | $ids = array();
31 | $tmpdocs = array();
32 | if (count($rows)> 0) {
33 | foreach ($rows as $v) {
34 | $ids[] = $v['id'];
35 | }
36 | $q = "SELECT id,title ,content FROM docs WHERE id IN (" . implode(',', $ids) . ")";
37 | foreach ($ln->query($q) as $row) {
38 | $tmpdocs[$row['id']] = array('title' => $row['title'], 'content' => $row['content']);
39 | }
40 | foreach ($ids as $id) {
41 | $docs[] = $tmpdocs[$id];
42 | }
43 | } else {
44 | $words = array();
45 | foreach($meta_map as $k=>$v) {
46 |
47 | if(preg_match('/keyword\[\d+]/', $k)) {
48 | preg_match('/\d+/', $k,$key);
49 | $key = $key[0];
50 | $words[$key]['keyword'] = $v;
51 | }
52 | if(preg_match('/docs\[\d+]/', $k)) {
53 | preg_match('/\d+/', $k,$key);
54 | $key = $key[0];
55 | $words[$key]['docs'] = $v;
56 | }
57 | }
58 | $suggest = MakePhaseSuggestion($words, $query, $ln_sph);
59 | }
60 | }
61 | ?>
62 |
66 |
67 |
76 |
77 | Demo autocomplete with correction suggestion
78 |
79 |
80 |
81 |
82 | Autocomplete is made using star on a titles index (with infixes). Correction
83 | suggest can be made inside a phrase , by trying to find a suggestion
84 | for each wrong typed word or word with low hits. Trigrams are
85 | used in the process and there are also sane checks ( based on length
86 | and levenshtein algorithm). It does not guarantee the new
87 | corrected phrase will do matching.This can be done by doing a query
88 | with the new phrase.
89 |
90 |
Start typing in the field below
91 |
92 |
98 |
99 |
100 |
101 |
102 |
110 |
111 |
112 |
113 | Total found:=$total_found?>
114 |
115 |
116 |
117 | 0): ?>
118 |
119 |
120 |
121 |
122 |
123 | = $doc['title'] ?>
124 |
125 |
126 | = substr(strip_tags($doc['content']), 0, 500) . '...' ?>
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
Nothing found!
135 |
136 |
137 |
141 |
--------------------------------------------------------------------------------
/suggestcompleteexcerpts.php:
--------------------------------------------------------------------------------
1 | prepare("SELECT * FROM $indexes WHERE MATCH(:match) LIMIT $start,$offset OPTION ranker=sph04,field_weights=(title=100,content=1)");
21 | $stmt->bindValue(':match', $query,PDO::PARAM_STR);
22 | $stmt->execute();
23 | $rows = $stmt->fetchAll();
24 |
25 | $meta = $ln_sph->query("SHOW META")->fetchAll();
26 | foreach($meta as $m) {
27 | $meta_map[$m['Variable_name']] = $m['Value'];
28 | }
29 | $total_found = $meta_map['total_found'];
30 | $total = $$meta_map['total'];
31 | $ids = array();
32 | $tmpdocs = array();
33 | if (count($rows) > 0) {
34 | foreach ($rows as $v) {
35 | $ids[] = $v['id'];
36 | }
37 | $q = "SELECT id, title , content FROM docs WHERE id IN (" . implode(',', $ids) . ")";
38 | foreach ($ln->query($q) as $row) {
39 | $tmpdocs[$row['id']] = array('title' => $row['title'], 'content' => $row['content']);
40 | }
41 | foreach ($ids as $id) {
42 | $docs[] = $tmpdocs[$id];
43 | }
44 | } else {
45 | $words = array();
46 | foreach($meta_map as $k=>$v) {
47 | if(preg_match('/keyword\[\d+]/', $k)) {
48 | preg_match('/\d+/', $k,$key);
49 | $key = $key[0];
50 | $words[$key]['keyword'] = $v;
51 | }
52 | if(preg_match('/docs\[\d+]/', $k)) {
53 | preg_match('/\d+/', $k,$key);
54 | $key = $key[0];
55 | $words[$key]['docs'] = $v;
56 | }
57 | }
58 | $suggest = MakePhaseSuggestion($words, $query, $ln_sph);
59 | }
60 | }
61 | ?>
62 |
66 |
67 |
76 |
77 | Simple autocomplete on title
78 |
79 |
80 |
81 |
Autocomplete is made using star on a titles index (with infixes).
82 |
Start typing in the field below
83 |
84 |
90 |
91 |
92 |
93 |
94 |
102 |
103 |
104 | 0): ?>
105 |
106 |
107 | Total found:=$total_found?>
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | = $doc['title'] ?>
116 |
117 |
118 | = substr(strip_tags($doc['content']), 0, 500) . '...' ?>
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
Nothing found!
127 |
128 |
129 |
133 |
--------------------------------------------------------------------------------
/template/footer.php:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
57 |
58 |