This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#autocomplete').focus().keyup(function(event) { | |
| $.getJSON("\/?do=autoComplete", {'text': $('#autocomplete').val()}, function(payload) { | |
| $('ul.autocomplete').remove(); | |
| var list = $('<ul class="autocomplete"></ul>').insertAfter('#autocomplete'); | |
| for (var i in payload.autoComplete) { | |
| $('<li></li>').html(payload.autoComplete[i]).appendTo(list); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| - \App\Model\NejakeRepository | |
| services: | |
| nejakeRopository: \App\Model\NejakeRepository | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* The animation code */ | |
| @keyframes example { | |
| 0% {background-image: url("https://static.pexels.com/photos/7174/summer-grass.jpg");} | |
| 50% {background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTjOCNcnik0caAqRX601w3rTlf3ZTANFojDWVxc2WOkvOzu4NF7HQ");} | |
| 100% {background-image: url("https://static.pexels.com/photos/7174/summer-grass.jpg");} | |
| } | |
| /* The element to apply the animation to */ | |
| div { | |
| width: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Použití description do automaticky generovaného formuláře pro přípichnutí HTML či čehokoliv z formuláře | |
| <?php | |
| // da se pouziti i Nette\Utils\Html::el(); | |
| $form['upload']->setOption('description', 'nazev souboru'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $form->addText('zip', 'PSČ:') | |
| ->addCondition($form::FILLED) | |
| ->addFilter(function ($value) { | |
| return str_replace(' ', '', $value); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DISTINCT t1.id | |
| FROM tabulka t1 | |
| JOIN tabulka t2 ON t2.sloupec1 = t1.sloupec1 | |
| AND t2.sloupec2 = t1.sloupec2 | |
| AND t2.id < t1.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| $('#myform').submit(function() { | |
| window.open('', 'formpopup', 'width=400,height=400,resizeable,scrollbars'); | |
| this.target = 'formpopup'; | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.fn.containsOption = function (query) { | |
| var found = false; | |
| this.each(function () { | |
| if (this.nodeName.toLowerCase() == 'select') { | |
| for (var i = 0; i < this.options.length; i++) { | |
| if (query.value) { | |
| found = (query.value.constructor == RegExp) ? this.options[i].value.match(query.value) : this.options[i].value == query.value; | |
| } else if (query.text) { | |
| found = (query.text.constructor == RegExp) ? this.options[i].text.match(query.text) : this.options[i].text == query.text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ======================================================================= | |
| // Document Ready Example 1 | |
| // ======================================================================= | |
| $(document).ready(function () { | |
| // do jQuery stuff when DOM is ready | |
| }); | |
| // ======================================================================= | |
| // Document Ready Example 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function SelectorCache() { | |
| var collection = {}; | |
| function getFromCache(selector) { | |
| if (undefined === collection[selector]) { | |
| collection[selector] = $(selector); | |
| } | |
| return collection[selector]; | |
| } | |
| return { | |
| get: getFromCache |