Created
September 23, 2009 02:02
-
-
Save c4milo/191626 to your computer and use it in GitHub Desktop.
This file contains 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
Liferay.PEC = Liferay.PEC || {} | |
Liferay.PEC.Search = new Liferay.Class( { | |
initialize : function(portletns) { | |
var instance = this; | |
jQuery('#' + portletns + 'pecsearch_content').tabs({selected: 0}).removeAttr('style'); | |
jQuery('#' + portletns + 'sortable').sortable({axis: 'x'}); | |
jQuery('#' + portletns + 'search').click(this._search); | |
jQuery('#' + portletns + 'advanced_search').click(function(){window.location = "/web/guest/advanced-search"}); | |
jQuery('#' + portletns + 'assisted_search').click(function(){window.location = "/web/guest/assisted-search"}); | |
}, | |
_search: function() { | |
//jQuery.getJSON(url del buscador) | |
Liferay.trigger('search_results', jQuery.parseJSON('{ "header": {"numberOfResults": 20, "pageNumber": 0}, "resultsByContentType": [{"news": 2}, {"blogs": 2}, {"state-services": 2}, {"wikis": 2}, {"forums": 2}, {"general-info": 2}], "resultList": [{"contentType":"news", "docs": [{"id": "1", "title": "Noticias sobre el portal del estado colombiano", "description": "erase una vez una noticia...", "url": "http://localhost/noticias"}, {"id": "2", "title": "Noticias sobre el portal del estado colombiano 2", "description": "erase una vez una noticia 2...", "url": "http://localhost/noticias2"}]}, {"contentType":"blogs", "docs": [{"id": "3", "title": "Blogs sobre el portal del estado colombiano", "description": "erase una vez un blog...", "url":"http://localhost/blog"}, {"id": "4", "title": "Blogs sobre el portal del estado colombiano 2", "description": "erase una vez un blog 2...", "url": "http://localhost/blogs2"}]}, {"contentType":"state-services", "docs": [{"id": "5", "title": "Servicios del Estado sobre el portal del estado colombiano", "description": "erase una vez un servicio del estado...", "url": "http://localhost/servicio-estado"}, {"id": "6", "title": "Servicios del Estado sobre el portal del estado colombiano 2", "description": "erase una vez un servicio del estado 2...", "url": "http://localhost/servicio-estado2"}]}, {"contentType":"wikis", "docs": [{"id": "7", "title": "Wikis sobre el portal del estado colombiano", "description": "erase una vez un wiki...", "url": "http://localhost/wikis"}, {"id": "8", "title": "Wikis sobre el portal del estado colombiano 2", "description": "erase una vez un wiki 2...", "url": "http://localhost/wikis2"}]}, {"contentType":"forums", "docs": [{"id": "9", "title": "Foros sobre el portal del estado colombiano", "description": "erase una vez un foro...", "url": "http://localhost/forums"}, {"id": "10", "title": "Foros sobre el portal del estado colombiano 2", "description": "erase una vez un foro 2...", "url": "http://localhost/forums2"}]}, {"contentType":"general-info", "docs":[{"id": "11", "title": "Información General sobre el portal del estado colombiano", "description": "erase una vez una información general...", "url": "http://localhost/general-info"}, {"id": "12", "title": "Información General sobre el portal del estado colombiano 2", "description": "erase una vez una información general 2...", "url": "http://localhost/general-info2"}]}]}')); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment