you will need to create a input element
<input type="text" id="searchbox" />
and then you need to call the search function like this:
var q = $('#searchbox').val();
var flickr = new Galleria.Flickr();
flickr.search(q, function(data) {
Galleria.run('.galleria', {
dataSource: data
});
});
For this to work you need jquery referenced in your page. else use this to get the variable from an input element:
var q = document.getElementById("searchbox").value
EDIT
as you said you want it to be executed after input, so you need to add an event listener to that Input element.
$('#searchbox').on('input', function() {
var q = $('#searchbox').val();
var flickr = new Galleria.Flickr();
flickr.search(q, function(data) {
Galleria.run('.galleria', {
dataSource: data
});
});
}
now this triggers every time you change the value in the textbox, you may be better off with a function call on pressing a submit button or [ENTER]
to make it work using the Enter key use the following code:
jQuery(document).on('keydown', '#searchbox', function(ev) {
if(ev.which === 13) {
var q = $('#searchbox').val();
var flickr = new Galleria.Flickr();
flickr.search(q, function(data) {
Galleria.run('.galleria', {
dataSource: data
});
});
}
});