1/* SEEDUI 2 * 3 * Copyright 2020-2024 Seeds of Diversity Canada 4 */ 5 6function SEEDUI_BoxExpandInit( lang, urlWCore ) 7/********************************************** 8 Initialize seedui-boxexpand ui 9 10 <div class='seedui-boxexpand class_to_style_the_box'> 11 <div class='seedui-box-head'>stuff you want in the header</div> 12 <div class='seedui-box-body'>the body of your box</div> 13 </div> 14 15 The header will get an expand button and body will be initially hidden. 16 When you click on the button the body will slide visible and hidden. 17 */ 18{ 19 jQuery(document).ready(function($) { 20 /* Put the expand button and instruction on the left side of the header 21 */ 22 $('.seedui-boxexpand .seedui-box-head').prepend( 23 "<div class='seedui-boxexpand-expand-button'><img src='"+urlWCore+"img/ctrl/expand_button.gif'/></div>" 24 +"<div class='seedui-boxexpand-expand-instruction'>"+(lang=='FR' ? "Cliquez" : "Click to show")+"</div>"); 25 26 /* Clicking on the header makes the body slide down/up 27 */ 28 $('.seedui-boxexpand .seedui-box-head').click( function(e) { 29 let oHead = $(this); 30 let oBody = $(this).closest('.seedui-boxexpand').find('.seedui-box-body'); 31 // the position of the expand_button image tells us the open/close state 32 if( $(this).find('img').css('left') == '0px') { 33 // slide down and hide the instruction 34 $(this).find('img').css('left', '-14px'); 35 oBody.slideDown(500); 36 $(this).find('.seedui-boxexpand-expand-instruction').html(''); 37 } else { 38 // slide up 39 $(this).find('img').css('left', '0px'); 40 oBody.slideUp(500); 41 } 42 }); 43 }); 44} 45 46 47/* js for SEEDUIWidget::SearchControl reset button 48 49 Clear the search box and reset the select controls. 50 This is necessary because the values are hard-coded into the search control, so Reset's action is to put them there. 51 */ 52jQuery(document).ready( function($) { 53 $('.seedui_srchctrl_btn_formreset').click( function(e) { 54 e.preventDefault(); 55 let jForm = $(this).closest("form"); 56 jForm.find(".seedui_srchctrl_fld").val(""); // the value of "Any"" 57 jForm.find(".seedui_srchctrl_op").val("like"); // the value of "contains" 58 jForm.find(".seedui_srchctrl_text").val(""); 59 jForm.submit(); 60 }); 61}); 62 63 64/* Hack to replace video gallery figcaption>h3 with our font and our green background 65 */ 66jQuery(document).ready( function($) { 67 let j = $('figcaption'); 68 j.css('background-color', '#4e7722'); 69 70 j = $('figcaption h3'); 71 //j.css('font-family', 'Roboto'); 72 j.each(function () { this.style.setProperty( 'font-family', 'Roboto', 'important' ); }); // this allows priority to be set 73});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.