var okno=null; //global window variable used when resizing the window during the first search var sindceSearchTypeGlobal='keywordSearch'; //search type /* * Action performed when user presses a link from search resaults in Sindice search window */ function sindiceSearchBoxLinkSelected(link) { document.searchForm.sindiceResult.value=link; //set JDOM input type object with link text } /* * Sindice search window initial render and fill with static content * @searchType indicates the search types available from the widget, possible options: 'keywordSearch' , 'uriSearch', 'tab' * @param positionTop y coord of the window * @param positionLeft x coord of the window */ function sindiceSearchWindow(searchType, positionTop, positionLeft) { if (positionTop==null) positionTop=10; if (positionLeft==null) positionLeft=400; var win = null; if (document.getElementById('sindiceSearchWindow')!=null) return; // alert(document.getElementById('sindiceSearchWindow')); //test window (different size) if (searchType==null || (searchType!=null && searchType=='all')) win = new Window("sindiceSearchWindow",{className: "mac_os_x_custom", width:450, height:67, zIndex: 100, maxHeight:500, resizable: true, title: "Sindice search", showEffect: Element.show, hideEffect: Element.hide, draggable:true, wiredDrag: false}); else win = new Window("sindiceSearchWindow",{className: "mac_os_x_custom", width:450, height:61, zIndex: 100, maxHeight:500, resizable: true, title: "Sindice search", showEffect: Element.show, hideEffect: Element.hide, draggable:true, wiredDrag: false}); //if (searchType!=null && searchType=='uri') //put some initial content win.getContent().innerHTML= "
Lorem ipsum dolor sit amet, consectetur adipiscing elit, set eiusmod tempor incidunt et labore et dolore magna aliquam. Ut enim ad minim veniam, quis nostrud exerc. Irure dolor in reprehend incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse molestaie cillum. Tia non ob ea soluad incom dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda et tam. \ At vver eos et accusam dignissum qui blandit est praesent. Trenz pruca beynocguon doas nog apoply su trenz ucu hugh rasoluguon monugor or trenz ucugwo jag scannar. Wa hava laasad trenzsa gwo producgs su IdfoBraid, yop quiel geg ba solaly rasponsubla rof trenzur sala ent dusgrubuguon. Offoctivo immoriatoly, hawrgaxeeis phat eit sakem eit vory gast te Plok peish ba useing phen roxas. Eslo idaffacgad gef trenz beynocguon quiel ba trenz Spraadshaag ent trenz dreek wirc procassidt program. Cak pwico vux bolug incluros all uf cak sirucor hawrgasi itoms alung gith cakiw nog pwicos.\ Lor sum amet, commy nulputat. Duipit lum ipisl eros dolortionsed tin hent aliquis illam volor in ea feum in ut adipsustrud elent ulluptat. Duisl ullan ex et am vulputem augiam doloreet amet enibh eui te dipit acillutat acilis amet, suscil er iuscilla con utat, quisis eu feugait ad dolore commy nullam iuscilisl iureril ilisl del ut pratuer iliquis acipissit accum quis nulluptat. Dui bla faccumsan velis auguero con henis duismolor sumsandrem quat vulluptat alit er iniamcore exeriure vero core te dit ut nulla feummolore commod dipis augiamcommod tem ese dolestrud do odo odiamco eetummy nis aliquamcommy nonse eu feugue del eugiamconsed ming estrud magnis exero eumsandio enisim del dio od tat.sumsan et pratum velit ing etue te consequis alis nullan et, quis am iusci bla feummy.
" //check if search input field is set (in case window was previously renderd and is only refreshed now) var searchText = document.searchForm.sindiceResult.value; if (document.getElementById("sindiceSearchText")!=null) searchText = document.getElementById("sindiceSearchText").value; //fill div tag with static search window content (search form + logo) var static_content=""; static_content=static_content+"
"; static_content=static_content+""+""; static_content=static_content+""; static_content=static_content+"" + "" + "" + "
   "; if (searchType==null || (searchType!=null && searchType=='all')) { static_content=static_content+""; } static_content=static_content+"
 
" +"
" +"
"; document.getElementById('sindiceSearchBox').innerHTML=static_content; //show and position window win.setStatusBar("Type in the search string"); win.setDestroyOnClose(); win.showCenter(false,positionTop,positionLeft); okno=win; } /* * AJAX callback function, this is executed when the JSON response is appended into the webpage */ function set_search_win_content(jSON) { var dynamic_content=""; if (jSON!=null) { dynamic_content="
"; if (jSON.totalResults==0) dynamic_content=dynamic_content+"
" +"Didn't find any document for "+document.getElementById("sindiceSearchText").value+""; var linkName=""; for (var i=0;i0){ linkName = ""; for(var j=0;j"+linkName+"
" +"
" +"
" +entry.updated +" – " +entry.explicit_content_size+" triples" +" – " +entry.explicit_content_length+" b" +"
" +"
" +entry.link +"
" +"
"; } } document.getElementById('sindiceSearchBoxDynamicContent').innerHTML=dynamic_content; } /* * Query sindice search engine. Perfoms interface operations that have to be done before * the search(extend window) and embeds json response from sindice into the webpage */ function embedSindiceDynamicTag(searchType) { //var searchType=""; searchPrefix="http://api.sindice.com/v3/search?a_t=old-sindice-widget&q="; //begining of the search string , it can very in case of keyword/URI/property search var searchString = null; if (document.getElementById("sindiceSearchText")!=null) searchString = document.getElementById("sindiceSearchText").value; if (searchString!=null && searchString!="" && searchString!=" ") { var request = searchPrefix+escape(searchString)+"&format=json&callback=sindice"; //alert(request); var head = document.getElementsByTagName("head").item(0); var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", request); head.appendChild(script); //resize search window to make room for search results new Effect.ResizeWindow(okno, okno.getLocation().top,okno.getLocation().left, 450, 500, {duration: 2}); //insert a horizontal line and loading animation until search results are shown document.getElementById('sindiceSearchBoxDynamicContent').innerHTML="
" +"
" +"
" +"
" +"
" +"
" +"
" +"
" +"" +"
" +"
Loading
" +"
"; Effect.Appear('loadingSection'); Effect.Appear('loadingSection', { duration: 2.0 }); } else { //if the search string wasnt provided by the user, reset the results if (document.getElementById('sindiceSearchBoxDynamicContent').innerHTML!="") document.getElementById('sindiceSearchBoxDynamicContent').innerHTML="
"; } //end sindice } /* * Action performed when user presses a tab to choose search type between keyword and uri search (if activated) */ function sindiceChangeSearchType(searchType) { if (searchType=='uri') { document.getElementById('sindiceSearchBoxKeywordTab').className=''; document.getElementById('sindiceSearchBoxUriTab').className='selected'; //change actions for button and enter event in search box //document.getElementById('sindiceStartSearchButton').onclick=function() { embedSindiceDynamicTag('uriSearch');return false; }; //search button //submit event for the entire form document.getElementById('sindiceSearchForm').onsubmit=function() { embedSindiceDynamicTag('uriSearch');return false; }; } else { document.getElementById('sindiceSearchBoxUriTab').className=''; document.getElementById('sindiceSearchBoxKeywordTab').className='selected'; //change actions for button and enter event in search box //document.getElementById('sindiceStartSearchButton').onclick=function() { embedSindiceDynamicTag('keywordSearch');return false; }; //submit event for the entire form document.getElementById('sindiceSearchForm').onsubmit=function() { embedSindiceDynamicTag('keywordSearch');return false; }; } }