1$( document ).ready(function(){ 2 3 temp=$('#SpForSPARQL').html(); 4 G_SP=temp.replace(" ","%20"); 5 6 urlJSON="https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=SELECT%20%3Fitem%20%3FitemLabel%20%3FnomSc%20%3Fimage%20%20WHERE%20{%0A%20%20%3Fitem%20wdt%3AP225%20'" + G_SP + "'.%0A%20%20%3Fitem%20wdt%3AP18%20%3Fimage.%0A}%20LIMIT%201" 7 8 SpJSON = (function () { 9 var SpJSON = null; 10 $.ajax({ 11 'async': false, 12 'global': false, 13 'url': urlJSON, 14 'dataType': "json", 15 'success': function (data) { 16 SpJSON = data; 17 } 18 }); 19 return SpJSON; 20 }); 21 22 SpJSON=SpJSON(); 23 bindings=SpJSON.results["bindings"] 24 console.log(); 25 26 if (bindings.length === 0) { 27 $("#WikiImage").attr('class','img-thumbnail logo'); 28 $("#WikiImage").attr('style','width:40px;height:55px;'); 29 $("#WikiImage").attr('title','No images found in WikiCommons'); 30 } else { 31 ImageURL=bindings[0]["image"]["value"]; 32 console.log(ImageURL); 33 $("#WikiImage").attr('src',ImageURL); 34 $("#WikiImage").attr('class','img-thumbnail'); 35 $("#WikiImageHref").attr('href',ImageURL); 36 } 37}); 38$(document).ready(function(){ 39 40 for (i=1;i<9;i++){ 41 $("#Form"+i).hide(); 42 } 43 44 $(".sketch").click(function(){ 45 num=$(this).attr('id'); 46 47 for (i=1;i<9;i++){ 48 49 if (num!=i){ 50 $("#Form"+i).hide(); 51 } 52 else{ 53 $("#Form"+i).show(); 54 } 55 } 56 }); 57 58}); 59/* 60jQuery Redirect v1.1.1 61 62Copyright (c) 2013-2017 Miguel Galante 63Copyright (c) 2011-2013 Nemanja Avramovic, www.avramovic.info 64 65Licensed under CC BY-SA 4.0 License: http://creativecommons.org/licenses/by-sa/4.0/ 66 67This means everyone is allowed to: 68 69Share - copy and redistribute the material in any medium or format 70Adapt - remix, transform, and build upon the material for any purpose, even commercially. 71Under following conditions: 72 73Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 74ShareAlike - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. 75 76*/ 77(function ($) { 78 'use strict'; 79 80 /** 81 * jQuery Redirect 82 * @param {string} url - Url of the redirection 83 * @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url. 84 * @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST) 85 * @param {string} target - (optional) The target of the form. "_blank" will open the url in a new window. 86 * @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others. 87 * @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window. 88 */ 89 $.redirect = function (url, values, method, target, traditional, redirectTop) { 90 redirectTop = redirectTop || false; 91 var generatedForm = $.redirect.getForm(url, values, method, target, traditional); 92 $('body', redirectTop ? window.top.document : undefined).append(generatedForm.form); 93 generatedForm.submit(); 94 }; 95 96 97 $.redirect.getForm = function (url, values, method, target, traditional) { 98 method = (method && ["GET", "POST", "PUT", "DELETE"].indexOf(method.toUpperCase()) !== -1) ? method.toUpperCase() : 'POST'; 99 100 url = url.split("#"); 101 var hash = url[1] ? ("#" + url[1]) : ""; 102 url = url[0]; 103 104 if (!values) { 105 var obj = $.parseUrl(url); 106 url = obj.url; 107 values = obj.params; 108 } 109 110 values = removeNulls(values); 111 112 var form = $('<form>') 113 .attr("method", method) 114 .attr("action", url + hash); 115 116 117 if (target) { 118 form.attr("target", target); 119 } 120 121 var submit = form[0].submit; 122 iterateValues(values, [], form, null, traditional); 123 124 return { form: form, submit: function () { submit.call(form[0]); } }; 125 } 126 //Utility Functions 127 /** 128 * Url and QueryString Parser. 129 * @param {string} url - a Url to parse. 130 * @returns {object} an object with the parsed url with the following structure {url: URL, params:{ KEY: VALUE }} 131 */ 132 $.parseUrl = function (url) { 133 134 if (url.indexOf('?') === -1) { 135 return { 136 url: url, 137 params: {} 138 }; 139 } 140 var parts = url.split('?'), 141 query_string = parts[1], 142 elems = query_string.split('&'); 143 url = parts[0]; 144 145 var i, pair, obj = {}; 146 for (i = 0; i < elems.length; i += 1) { 147 pair = elems[i].split('='); 148 obj[pair[0]] = pair[1]; 149 } 150 151 return { 152 url: url, 153 params: obj 154 }; 155 }; 156
157 //Private Functions 158 var getInput = function (name, value, parent, array, traditional) { 159 var parentString; 160 if (parent.length > 0) { 161 parentString = parent[0]; 162 var i; 163 for (i = 1; i < parent.length; i += 1) { 164 parentString += "[" + parent[i] + "]"; 165 } 166 167 if (array) { 168 if (traditional) 169 name = parentString; 170 else 171 name = parentString + "[" + name + "]"; 172 } else { 173 name = parentString + "[" + name + "]"; 174 } 175 } 176 177 return $("<input>").attr("type", "hidden") 178 .attr("name", name) 179 .attr("value", value); 180 }; 181 182 var iterateValues = function (values, parent, form, isArray, traditional) { 183 var i, iterateParent = []; 184 Object.keys(values).forEach(function (i) { 185 if (typeof values[i] === "object") { 186 iterateParent = parent.slice(); 187 iterateParent.push(i); 188 iterateValues(values[i], iterateParent, form, Array.isArray(values[i]), traditional); 189 } else { 190 form.append(getInput(i, values[i], parent, isArray, traditional)); 191 } 192 }); 193 }; 194 195 var removeNulls = function (values) { 196 var propNames = Object.getOwnPropertyNames(values); 197 for (var i = 0; i < propNames.length; i++) { 198 var propName = propNames[i]; 199 if (values[propName] === null || values[propName] === undefined) { 200 delete values[propName]; 201 } else if (typeof values[propName] === 'object') { 202 values[propName] = removeNulls(values[propName]); 203 } else if (values[propName].length < 1) { 204 delete values[propName]; 205 } 206 } 207 return values; 208 }; 209 210}(window.jQuery || window.Zepto || window.jqlite)); 211 212$(document).ready(function(){ 213 $("#SpSearchLaunch").hide(); 214 $("#GenusSearchLaunch").hide(); 215 $("#Tabregion3 tr").hide(); 216 $("#Tabregion4 tr").hide(); 217 218 $("#spselect").attr("class", "js-example-basic-single"); 219 $(".js-example-basic-single").select2(); 220 221 $("#genusselect").attr("class", "js-example-basic-single"); 222 $(".js-example-basic-single").select2(); 223 224 $("#ctryselect").attr("class", "js-example-basic-single"); 225 $(".js-example-basic-single").select2(); 226 227 228 $("#spselect").change(function(){ 229 $("#SpSearchLaunch").show(); 230 }); 231 232 $("#genusselect").change(function(){ 233 $("#GenusSearchLaunch").show(); 234 }); 235 236 $("#SpSearchLaunch").click(function(){ 237 idsp=$("#spselect").val(); 238 document.location.href="https://cushionplants.osug.fr/spfiche/"+idsp; 239 }); 240 241 $("#GenusSearchLaunch").click(function(){ 242 genus=$("#genusselect").val(); 243 document.location.href="https://cushionplants.osug.fr/genusfiche/"+genus; 244 }); 245 246 $(".showdistribmap").click(function(){ 247 248 showspmap=$(this).attr('id'); 249 $("#speciesmap").attr('src','/images/OUTPUT_MAPS/_' + showspmap + '.jpg'); 250 }); 251 252 $("#ctryselect").change(function(){ 253 254 idctry="." + $("#ctryselect").val(); 255 $("#Tabregion3 tr").hide().filter(idctry).show(); 256 $("#Tabregion4 tr").hide().filter(idctry).show(); 257 258 }); 259 260}); 261$(document).ready(function(){ 262 263 $('#SpListTable').DataTable( { 264 "pagingType": "full_numbers" 265 } ); 266 267 $('#GenusListTable').DataTable( { 268 "pagingType": "full_numbers" 269 } ); 270 271 $('#SpeciesListTable').DataTable( { 272 "pagingType": "full_numbers" 273 } ); 274 275 $('#SpListTableRegion3').DataTable( { 276 "pagingType": "full_numbers" 277 } ); 278 279 $('#SpListTableRegion4').DataTable( { 280 "pagingType": "full_numbers" 281 } ); 282 283});
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.