<commit_before><?php

/**
 * @package     omeka
 * @subpackage  solr-search
 * @copyright   2012 Rector and Board of Visitors, University of Virginia
 * @license     http://www.apache.org/licenses/LICENSE-2.0.html
 */

?>

<?php queue_css_file('results'); ?>

<?php echo head(array('title' => __('Solr Search')));?>

<script type="text/javascript" charset="utf-8">
//<![CDATA[
//For automatic pagination
jQuery(window).load(function () {

    var loadImageURL = <?php echo js_escape(img("ajax-loader.gif")); ?>;

    var resultList = <?php echo js_escape(url('solr-search/results/result-list')); ?>; //defining the result list php

    var nomoreposts = "<?php echo __('No more posts to show.'); ?>";

    jQuery(window).scroll(function(){
        if(Math.round(jQuery(window).scrollTop()) >= (jQuery(document).height() - jQuery(window).height() - 100)){ //rounding to be sure
            jQuery('div#loadmoreajaxloader').show();
            jQuery.ajax({
            url: resultList,
            success: function(html){
                if(html){
                    jQuery("#solr-results").append(html);
                    jQuery('div#loadmoreajaxloader').hide();
                }else{
                    jQuery('div#loadmoreajaxloader').html('<center>' + nomoreposts + '</center>');
                }
            }
            });
        }
    });
    
    //For showing less facets
    
    jQuery(function(){

    	var maxItems = 5;
    	//var fullHeight = hiddenContent.height();

    	jQuery('.facet').each(function() {
    		var ul = jQuery(this).find('ul');

    		if(ul.children('li').size() <= maxItems) return;

    		var hiddenElements = ul.find('li:gt(' + maxItems + ')').hide();

    		var showCaption = <?php echo '"[+] ' . __('Show remaining') . ' "'; ?> + hiddenElements.size();
    		
    		ul.append(
    			jQuery('<li class="facet-show-more" style="content:+"><a href="#">' + showCaption + '</a></li>').click( function(e){
    					e.preventDefault();
    					if(jQuery(this).siblings(':hidden').length > 0){
    						jQuery(this).siblings(':hidden').slideDown(200);
    						jQuery(this).find('a').text(<?php echo '"[-] ' . __('Show less') . '"'; ?>);
    					}else{
    						hiddenElements.slideUp(200);
    						jQuery(this).find('a').text(showCaption);
    						jQuery(this).show();
    					}
    				}
    			)
    		);

    	});



    });
});
//]]>
</script>

<h1><?php echo __('Search the Collection'); ?></h1>

<style>
	#content > div{
		-webkit-box-shadow: none;
		box-shadow: none;
	}
</style>

<!-- Search form. -->
  <form id="solr-search-form">
    <span class="float-wrap">
      <input style="width:350px;" type="text" title="<?php echo __('Search keywords') ?>" name="q" value="<?php
        echo array_key_exists('q', $_GET) ? $_GET['q'] : '';
      ?>" />
      <input type="submit" value="<?php echo __("Search"); ?>" />&nbsp&nbsp
      <?php echo link_to_item_search(__('Advanced Search')); ?>
    </span>
  </form>

<br>

<div id="solr" style="border:0px">
    <!-- Applied facets. -->
    <div id="solr-applied-facets" style="float:left">
	    <ul>
    		<!-- Get the applied facets. -->
    		<?php 
    			$count = 0;
    			foreach (SolrSearch_Helpers_Facet::parseFacets() as $f): 
    				$count++;
    		?>
    		  <li>

    			<!-- Facet label. -->
    			<?php $label = SolrSearch_Helpers_Facet::keyToLabel($f[0]); ?>
    			<span class="applied-facet-label"><?php echo __($label); ?>:</span>
    			<span class="applied-facet-value"><?php echo $f[1]; ?></span>

    			<!-- Remove link. -->
    			<?php $url = SolrSearch_Helpers_Facet::removeFacet($f[0], $f[1]); ?>
    			(<a href="<?php echo $url; ?>"><?php echo __('remove'); ?></a>)

    		  </li>
    		<?php
    			endforeach;		
    		?>
    	</ul>
	
    	<?php if($count == 0) echo '<span>Geen filters geselecteerd</span>' ?>
    </div>
    
    <div id="visualize-results" style="float:right;">
        <?php 
            $q = array_key_exists("q", $_REQUEST) ? $_REQUEST["q"] : "";
            $facet = array_key_exists("facet", $_REQUEST) ? $_REQUEST["facet"] : "";
         ?>
        <a href=" <?php echo url("") . "visuals/map?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "><span class="icon-Verhalenkaart" style="font-size:2em"></span> on map</a>
<!--    |<a href=" <?php echo url("") . "visuals/wordcloud?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "> as wordcloud</a> 
        |<a href=" <?php echo url("") . "visuals/network?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "> as network</a> -->
    </div>
</div><commit_msg>Cloud link for solrsearch<commit_after><?php

/**
 * @package     omeka
 * @subpackage  solr-search
 * @copyright   2012 Rector and Board of Visitors, University of Virginia
 * @license     http://www.apache.org/licenses/LICENSE-2.0.html
 */

?>

<?php queue_css_file('results'); ?>

<?php echo head(array('title' => __('Solr Search')));?>

<script type="text/javascript" charset="utf-8">
//<![CDATA[
//For automatic pagination
jQuery(window).load(function () {

    var loadImageURL = <?php echo js_escape(img("ajax-loader.gif")); ?>;

    var resultList = <?php echo js_escape(url('solr-search/results/result-list')); ?>; //defining the result list php

    var nomoreposts = "<?php echo __('No more posts to show.'); ?>";

    jQuery(window).scroll(function(){
        if(Math.round(jQuery(window).scrollTop()) >= (jQuery(document).height() - jQuery(window).height() - 100)){ //rounding to be sure
            jQuery('div#loadmoreajaxloader').show();
            jQuery.ajax({
            url: resultList,
            success: function(html){
                if(html){
                    jQuery("#solr-results").append(html);
                    jQuery('div#loadmoreajaxloader').hide();
                }else{
                    jQuery('div#loadmoreajaxloader').html('<center>' + nomoreposts + '</center>');
                }
            }
            });
        }
    });
    
    //For showing less facets
    
    jQuery(function(){

    	var maxItems = 5;
    	//var fullHeight = hiddenContent.height();

    	jQuery('.facet').each(function() {
    		var ul = jQuery(this).find('ul');

    		if(ul.children('li').size() <= maxItems) return;

    		var hiddenElements = ul.find('li:gt(' + maxItems + ')').hide();

    		var showCaption = <?php echo '"[+] ' . __('Show remaining') . ' "'; ?> + hiddenElements.size();
    		
    		ul.append(
    			jQuery('<li class="facet-show-more" style="content:+"><a href="#">' + showCaption + '</a></li>').click( function(e){
    					e.preventDefault();
    					if(jQuery(this).siblings(':hidden').length > 0){
    						jQuery(this).siblings(':hidden').slideDown(200);
    						jQuery(this).find('a').text(<?php echo '"[-] ' . __('Show less') . '"'; ?>);
    					}else{
    						hiddenElements.slideUp(200);
    						jQuery(this).find('a').text(showCaption);
    						jQuery(this).show();
    					}
    				}
    			)
    		);

    	});



    });
});
//]]>
</script>

<h1><?php echo __('Search the Collection'); ?></h1>

<style>
	#content > div{
		-webkit-box-shadow: none;
		box-shadow: none;
	}
</style>

<!-- Search form. -->
  <form id="solr-search-form">
    <span class="float-wrap">
      <input style="width:350px;" type="text" title="<?php echo __('Search keywords') ?>" name="q" value="<?php
        echo array_key_exists('q', $_GET) ? $_GET['q'] : '';
      ?>" />
      <input type="submit" value="<?php echo __("Search"); ?>" />&nbsp&nbsp
      <?php echo link_to_item_search(__('Advanced Search')); ?>
    </span>
  </form>

<br>

<div id="solr" style="border:0px">
    <!-- Applied facets. -->
    <div id="solr-applied-facets" style="float:left">
	    <ul>
    		<!-- Get the applied facets. -->
    		<?php 
    			$count = 0;
    			foreach (SolrSearch_Helpers_Facet::parseFacets() as $f): 
    				$count++;
    		?>
    		  <li>

    			<!-- Facet label. -->
    			<?php $label = SolrSearch_Helpers_Facet::keyToLabel($f[0]); ?>
    			<span class="applied-facet-label"><?php echo __($label); ?>:</span>
    			<span class="applied-facet-value"><?php echo $f[1]; ?></span>

    			<!-- Remove link. -->
    			<?php $url = SolrSearch_Helpers_Facet::removeFacet($f[0], $f[1]); ?>
    			(<a href="<?php echo $url; ?>"><?php echo __('remove'); ?></a>)

    		  </li>
    		<?php
    			endforeach;		
    		?>
    	</ul>
	
    	<?php if($count == 0) echo '<span>Geen filters geselecteerd</span>' ?>
    </div>
    
    <div id="visualize-results" style="float:right;">
        <?php 
            $q = array_key_exists("q", $_REQUEST) ? $_REQUEST["q"] : "";
            $facet = array_key_exists("facet", $_REQUEST) ? $_REQUEST["facet"] : "";
         ?>
        <a href=" <?php echo url("") . "visuals/map?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "><span class="icon-Verhalenkaart" style="font-size:2em"></span> on map</a>
        |<a href=" <?php echo url("") . "visuals/cloud?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "> as wordcloud</a> 
<!--        |<a href=" <?php echo url("") . "visuals/network?q=" . urlencode($q) . "&facet=" . urlencode($facet) ?> "> as network</a> -->
    </div>
</div>
{'fraction_non_alphanumeric': 0.2167283816162056, 'fraction_numerical': 0.006752341537791331, 'mean_word_length': 2.5237912509593246, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 167, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '643599', 'n_tokens_mistral': 3318, 'n_tokens_neox': 3106, 'n_words': 578}