- bootstrap with typeahead
- jquery
This will use bootstrap with typeahead to create an autocomplete search.
| <?php | |
| class AppController extends Controller { | |
| public $permissions = array( | |
| 'Admin' => '*', | |
| 'Student'=>array( | |
| array('controller'=>'pages', 'action'=>'display'), | |
| array('controller'=>'books', 'action'=>'*') | |
| ) | |
| ); |
| // Inspired by https://github.com/logicalparadox/backbone.iobind/blob/master/lib/sync.js | |
| // Overwrite Backbone.sync method | |
| Backbone.sync = function(method, model, options){ | |
| // create a connection to the server | |
| var ws = new WebSocket('ws://127.0.0.1:1234'); | |
| // send the command in url only if the connection is opened | |
| // command attribute is used in server-side. | |
| ws.onopen = function(){ |
Source: A Plug-in by Igor Escobar on Github.
This is a very basic guide, just to understand what's needed to set it up.
If you have any questions you can find me at https://nostr.com/8355095016fddbe31fcf1453b26f613553e9758cf2263e190eac8fd96a3d3de9
Create a file that resolves to <domain>/.well-known/nostr.json, and fill it out like this (enter the name you want to use, and input your own public key, make sure its the HEX-key):
{ # This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string