- The widget should be allocated a space to put the search box
- The search action will open up a modal, which contains result
- Initialization code should be easy
- Widget's markup should be namespaced with
vbusvn-
to avoid conflict with current page
<script type="text/javascript" src="http://vbus.vn/vbus-widget.js"></script>
...
<div id="vbus-vn-search-widget"></div> <!-- the place where the widget put content -->
- Download scripts
- Download css (seperate css for widget)
- JSONP (list of countries)
- Build search box
- Select2 plugin
- Date picker
- Bind actions
- Open the modal
- JSONP call to get the result
- Display it