WikiDesk
Redesign Wikivault Main Page layout |
Exact reference recreation of Wikidesk Main Page |
||
| (30 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
< | <html> | ||
<div class="wv-homepage-wrapper"> | <div class="wv-homepage-wrapper"> | ||
<div class="wv-hero-ref"> | |||
<div class="wv-hero-backdrop-left"></div> | |||
<div class="wv-hero-backdrop-right"></div> | |||
<div class="wv-hero-ref-content"> | |||
<div class="wv-hero-ref-title">Welcome to Wikidesk</div> | |||
<div class="wv-hero-ref-subtitle">An editorially curated encyclopedia dedicated to verified public knowledge.</div> | |||
<div class="wv-hero-search-wrap"> | |||
<form action="/wiki1/index.php" method="get" class="wv-hero-search-form" autocomplete="off"> | |||
<input type="hidden" name="title" value="Special:Search" /> | |||
<input type="text" name="search" id="wv-main-search-input" class="wv-hero-search-input" placeholder="Search biographies, companies, organizations, news and more..." autocomplete="off" autofocus /> | |||
<button type="submit" class="wv-hero-search-btn" aria-label="Search">Search</button> | |||
</form> | |||
</div> | |||
<div class="wv-hero-explore-bar"> | |||
<a href="/wiki1/index.php/Category:Biographies" class="wv-hero-explore-link">Biographies</a> | |||
<span class="wv-hero-explore-divider">|</span> | |||
<a href="/wiki1/index.php/Category:Companies" class="wv-hero-explore-link">Companies</a> | |||
<span class="wv-hero-explore-divider">|</span> | |||
<a href="/wiki1/index.php/Category:Organizations" class="wv-hero-explore-link">Organizations</a> | |||
<span class="wv-hero-explore-divider">|</span> | |||
<a href="/wiki1/index.php/Category:News" class="wv-hero-explore-link">News</a> | |||
<span class="wv-hero-explore-divider">|</span> | |||
<a href="/wiki1/index.php/Category:Entertainment" class="wv-hero-explore-link">Events</a> | |||
<span class="wv-hero-explore-divider">|</span> | |||
<a href="/wiki1/index.php/Category:Technology" class="wv-hero-explore-link">Topics</a> | |||
</div> | |||
<div class="wv-hero-trust-bar"> | |||
<span>Trusted content. Editorially curated. Verified sources.</span> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-layout-ref"> | |||
<div class="wv-col-left"> | |||
<div class="wv-sec-header"> | |||
<h2 class="wv-sec-title">From today's featured content</h2> | |||
<a href="/wiki1/index.php/Special:AllPages" class="wv-sec-link">View all featured →</a> | |||
</div> | |||
<div class="wv-card-grid-3"> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="Albert Einstein" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Albert_Einstein">Albert Einstein</a></div> | |||
<div class="wv-horiz-card-subtitle">BIOGRAPHY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Theoretical physicist who developed the theory of relativity, one of the two pillars of modern physics.</p> | |||
</div> | |||
<div class="wv-horiz-card-footer"> | |||
<a href="/wiki1/index.php/Albert_Einstein" class="wv-horiz-card-link">Read biography →</a> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="Tesla, Inc." class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Tesla,_Inc.">Tesla, Inc.</a></div> | |||
<div class="wv-horiz-card-subtitle">COMPANY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Global electric vehicle and clean energy company accelerating the world's transition to sustainable energy.</p> | |||
</div> | |||
<div class="wv-horiz-card-footer"> | |||
<a href="/wiki1/index.php/Tesla,_Inc." class="wv-horiz-card-link">Read company profile →</a> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="United Nations" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/United_Nations">United Nations</a></div> | |||
<div class="wv-horiz-card-subtitle">ORGANIZATION</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">International organization working to maintain peace, develop friendly relations and promote social progress.</p> | |||
</div> | |||
<div class="wv-horiz-card-footer"> | |||
<a href="/wiki1/index.php/United_Nations" class="wv-horiz-card-link">Read organization →</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-sec-header"> | |||
<h2 class="wv-sec-title">Recent publications</h2> | |||
<a href="/wiki1/index.php/Special:NewPages" class="wv-sec-link">View all →</a> | |||
</div> | |||
<!-- RECENT_PUBLICATIONS_BLOCK --> | |||
<div class="wv-sec-header"> | |||
<h2 class="wv-sec-title">Browse by category</h2> | |||
<a href="/wiki1/index.php/Special:Categories" class="wv-sec-link">View all categories →</a> | |||
</div> | |||
<div class="wv-card-grid-3"> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:Biographies">Biographies</a></div> | |||
<p class="wv-horiz-card-body">Profiles of notable leaders, executives, scientists, and creators.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:Companies">Companies</a></div> | |||
<p class="wv-horiz-card-body">Verified profiles of enterprise corporations, startups, and firms.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:Organizations">Organizations</a></div> | |||
<p class="wv-horiz-card-body">Institutions, non-profits, foundations, and research bodies.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:News">News</a></div> | |||
<p class="wv-horiz-card-body">Editorial coverage, press announcements, and industry updates.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:Entertainment">Entertainment</a></div> | |||
<p class="wv-horiz-card-body">Media figures, arts, film, publishing, and cultural initiatives.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-content"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Category:Technology">Technology</a></div> | |||
<p class="wv-horiz-card-body">Innovations, computing, artificial intelligence, and engineering.</p> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-sec-header"> | |||
<h2 class="wv-sec-title">Featured companies</h2> | |||
<a href="/wiki1/index.php/Category:Companies" class="wv-sec-link">View all →</a> | |||
</div> | |||
<div class="wv-card-grid-3"> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="Apple Inc." class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Apple_Inc.">Apple Inc.</a></div> | |||
<div class="wv-horiz-card-subtitle">TECHNOLOGY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Designs, manufactures, and markets smartphones, computers, and consumer electronics.</p> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="Microsoft Corporation" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Microsoft_Corporation">Microsoft Corporation</a></div> | |||
<div class="wv-horiz-card-subtitle">TECHNOLOGY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Develops software, cloud services, and enterprise solutions used worldwide.</p> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="Google LLC" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/Google_LLC">Google LLC</a></div> | |||
<div class="wv-horiz-card-subtitle">TECHNOLOGY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Provides Internet services, search, cloud computing and digital advertising platforms.</p> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-sec-header"> | |||
<h2 class="wv-sec-title">Featured organizations</h2> | |||
<a href="/wiki1/index.php/Category:Organizations" class="wv-sec-link">View all →</a> | |||
</div> | |||
<div class="wv-card-grid-3"> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="United Nations" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/United_Nations">United Nations</a></div> | |||
<div class="wv-horiz-card-subtitle">INTERNATIONAL ORGANIZATION</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Promotes international cooperation and peace, and works to solve global challenges.</p> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="World Health Organization" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/World_Health_Organization">World Health Organization</a></div> | |||
<div class="wv-horiz-card-subtitle">PUBLIC HEALTH AGENCY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Leads global health efforts and supports countries in improving public health.</p> | |||
</div> | |||
</div> | |||
<div class="wv-horiz-card"> | |||
<div class="wv-horiz-card-top"> | |||
<div class="wv-horiz-card-header"> | |||
<div class="wv-horiz-card-thumb"> | |||
<img src="/wiki1/resources/assets/wv/Wikivault-logo_-_Copy.png" alt="UNESCO" class="wv-horiz-card-img" /> | |||
</div> | |||
<div class="wv-horiz-card-header-text"> | |||
<div class="wv-horiz-card-title"><a href="/wiki1/index.php/UNESCO">UNESCO</a></div> | |||
<div class="wv-horiz-card-subtitle">UNITED NATIONS AGENCY</div> | |||
</div> | |||
</div> | |||
<p class="wv-horiz-card-body">Promotes education, science, culture and communication for peace and security.</p> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-col-right"> | |||
<div class="wv-side-widget"> | |||
<div class="wv-side-header"> | |||
<h3 class="wv-side-title">In the news</h3> | |||
<a href="/wiki1/index.php/Category:News" class="wv-side-link">View all →</a> | |||
</div> | |||
<ul class="wv-news-list"> | |||
<li class="wv-news-item">Global leaders meet at the 2026 Climate Summit to accelerate action on climate change.</li> | |||
<li class="wv-news-item">New advances in AI safety research aim to build more reliable and transparent systems.</li> | |||
<li class="wv-news-item">Breakthrough in gene therapy shows promise for treating rare genetic disorders.</li> | |||
</ul> | |||
<a href="/wiki1/index.php/Category:News" class="wv-side-link">Read more news →</a> | |||
</div> | |||
<div class="wv-side-widget"> | |||
<div class="wv-side-header"> | |||
<h3 class="wv-side-title">Did you know?</h3> | |||
<a href="/wiki1/index.php/Special:Random" class="wv-side-link">View all →</a> | |||
</div> | |||
<div class="wv-dyk-box"> | |||
<p class="wv-dyk-text">The first submarine cable between India and Europe was established in 1870, revolutionizing global communication.</p> | |||
</div> | |||
<a href="/wiki1/index.php/Special:Random" class="wv-side-link">More fascinating facts →</a> | |||
</div> | |||
<div class="wv-side-widget"> | |||
<div class="wv-side-header"> | |||
<h3 class="wv-side-title">On this day</h3> | |||
<a href="/wiki1/index.php/Special:RecentChanges" class="wv-side-link">View all →</a> | |||
</div> | |||
<ul class="wv-news-list"> | |||
<li class="wv-news-item"><span class="wv-otd-year">1945</span> – Japan announced its surrender in World War II.</li> | |||
<li class="wv-news-item"><span class="wv-otd-year">1962</span> – The Beatles performed together for the first time.</li> | |||
<li class="wv-news-item"><span class="wv-otd-year">2008</span> – The Summer Olympics opened in Beijing.</li> | |||
</ul> | |||
<a href="/wiki1/index.php/Special:RecentChanges" class="wv-side-link">More events on this day →</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="wv-editorial-footer"> | |||
<div class="wv-footer-links"> | |||
<a href="/wiki1/index.php/Wikidesk:About">About Wikidesk</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Editorial_Policy">Editorial policy</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Privacy_Policy">Privacy policy</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Terms_of_Use">Terms of use</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Community_Guidelines">Community guidelines</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Contact">Contact us</a> • | |||
<a href="/wiki1/index.php/Wikidesk:Request_Correction">Request a correction</a> | |||
</div> | |||
<div class="wv-footer-copyright"> | |||
© 2026 Wikidesk. All rights reserved. | |||
</div> | |||
</div> | |||
</div> | |||
<script> | |||
(function() { | |||
function initWvHeroAutocomplete() { | |||
var input = document.getElementById("wv-main-search-input") || document.querySelector(".wv-hero-search-input"); | |||
if (!input) return; | |||
if (input.dataset.wvAutocompleteInitialized === "true") return; | |||
input.dataset.wvAutocompleteInitialized = "true"; | |||
input.setAttribute("autocomplete", "off"); | |||
setTimeout(function() { | |||
try { input.focus(); } catch(e) {} | |||
}, 50); | |||
var form = input.closest("form"); | |||
var wrap = input.closest(".wv-hero-search-wrap") || (form ? form.parentNode : input.parentNode); | |||
if (!wrap) return; | |||
wrap.style.position = "relative"; | |||
var dropdown = wrap.querySelector(".wv-search-suggestions-dropdown"); | |||
if (!dropdown) { | |||
dropdown = document.createElement("div"); | |||
dropdown.className = "wv-search-suggestions-dropdown"; | |||
wrap.appendChild(dropdown); | |||
} | |||
var timer = null; | |||
var selectedIndex = -1; | |||
function closeDropdown() { | |||
dropdown.classList.remove("active"); | |||
dropdown.innerHTML = ""; | |||
selectedIndex = -1; | |||
} | |||
function escapeRegexp(s) { | |||
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | |||
} | |||
function highlight(text, q) { | |||
if (!q) return text; | |||
var r = new RegExp("(" + escapeRegexp(q) + ")", "gi"); | |||
return text.replace(r, '<span class="wv-search-suggestion-match">$1</span>'); | |||
} | |||
function updateSel(items) { | |||
items.forEach(function(it, idx) { | |||
if (idx === selectedIndex) { | |||
it.classList.add("selected"); | |||
if (it.scrollIntoView) it.scrollIntoView({ block: "nearest" }); | |||
} else { | |||
it.classList.remove("selected"); | |||
} | |||
}); | |||
} | |||
function canUserCreatePage() { | |||
if (window.mw && window.mw.config) { | |||
var groups = window.mw.config.get("wgUserGroups") || []; | |||
var userName = window.mw.config.get("wgUserName"); | |||
if (userName && (groups.indexOf("sysop") !== -1 || groups.indexOf("editor") !== -1 || groups.indexOf("user") !== -1)) { | |||
return true; | |||
} | |||
} | |||
if (document.getElementById("pt-logout") || document.querySelector(".mw-userlink") || document.cookie.indexOf("UserID") !== -1 || document.cookie.indexOf("UserName") !== -1 || document.cookie.indexOf("session") !== -1) { | |||
return true; | |||
} | |||
return false; | |||
} | |||
function getCategoryBadge(catTitle, pageTitle) { | |||
pageTitle = pageTitle || ""; | |||
if (catTitle) { | |||
catTitle = catTitle.toLowerCase(); | |||
if (catTitle.indexOf("biograph") !== -1 || catTitle.indexOf("people") !== -1 || catTitle.indexOf("person") !== -1) return "Biography"; | |||
if (catTitle.indexOf("compan") !== -1 || catTitle.indexOf("business") !== -1) return "Company"; | |||
if (catTitle.indexOf("organiza") !== -1 || catTitle.indexOf("institution") !== -1) return "Organization"; | |||
if (catTitle.indexOf("news") !== -1) return "News"; | |||
if (catTitle.indexOf("event") !== -1 || catTitle.indexOf("entertain") !== -1 || catTitle.indexOf("mission") !== -1) return "Event"; | |||
if (catTitle.indexOf("technolog") !== -1 || catTitle.indexOf("topic") !== -1 || catTitle.indexOf("science") !== -1) return "Topic"; | |||
} | |||
var lowerT = pageTitle.toLowerCase(); | |||
if (lowerT.indexOf("kalam") !== -1 || lowerT.indexOf("einstein") !== -1 || lowerT.indexOf("jobs") !== -1 || lowerT.indexOf("pichai") !== -1 || lowerT.indexOf("musk") !== -1 || lowerT.indexOf("dr.") !== -1 || lowerT.indexOf("sir") !== -1 || lowerT.indexOf("abdul") !== -1 || lowerT.indexOf("albert") !== -1 || lowerT.indexOf("steve") !== -1 || lowerT.indexOf("sundar") !== -1) { | |||
return "Biography"; | |||
} | |||
if (lowerT.indexOf("inc") !== -1 || lowerT.indexOf("corp") !== -1 || lowerT.indexOf("ltd") !== -1 || lowerT.indexOf("apple") !== -1 || lowerT.indexOf("tesla") !== -1 || lowerT.indexOf("spacex") !== -1 || lowerT.indexOf("google") !== -1 || lowerT.indexOf("microsoft") !== -1) { | |||
return "Company"; | |||
} | |||
if (lowerT.indexOf("nations") !== -1 || lowerT.indexOf("union") !== -1 || lowerT.indexOf("org") !== -1 || lowerT.indexOf("association") !== -1 || lowerT.indexOf("institute") !== -1) { | |||
return "Organization"; | |||
} | |||
if (lowerT.indexOf("summit") !== -1 || lowerT.indexOf("mission") !== -1 || lowerT.indexOf("landing") !== -1 || lowerT.indexOf("artemis") !== -1) { | |||
return "Event"; | |||
} | |||
return "Article"; | |||
} | |||
function fetchSuggestions(query) { | |||
query = query.trim(); | |||
if (query.length < 1) { | |||
closeDropdown(); | |||
return; | |||
} | |||
var canCreate = canUserCreatePage(); | |||
var titleCased = query.replace(/\b\w/g, function(l) { return l.toUpperCase(); }); | |||
var url1 = "/wiki1/api.php?action=opensearch&search=" + encodeURIComponent(query) + "&limit=6&format=json"; | |||
var url2 = "/wiki1/api.php?action=opensearch&search=" + encodeURIComponent(titleCased) + "&limit=6&format=json"; | |||
var url3 = "/wiki1/api.php?action=query&list=search&srsearch=" + encodeURIComponent(query) + "*&srlimit=6&format=json"; | |||
var req1 = fetch(url1).then(function(r) { return r.json(); }).catch(function() { return null; }); | |||
var req2 = (titleCased !== query) ? fetch(url2).then(function(r) { return r.json(); }).catch(function() { return null; }) : Promise.resolve(null); | |||
var req3 = fetch(url3).then(function(r) { return r.json(); }).catch(function() { return null; }); | |||
Promise.all([req1, req2, req3]) | |||
.then(function(results) { | |||
if (input.value.trim().toLowerCase() !== query.toLowerCase()) { | |||
return; | |||
} | |||
var res1 = results[0]; | |||
var res2 = results[1]; | |||
var res3 = results[2]; | |||
var titles = []; | |||
var urls = []; | |||
var seen = {}; | |||
function addOpensearch(res) { | |||
if (res && res[1]) { | |||
res[1].forEach(function(t, idx) { | |||
if (!seen[t]) { | |||
seen[t] = true; | |||
titles.push(t); | |||
urls.push(res[3] ? res[3][idx] : ""); | |||
} | |||
}); | |||
} | |||
} | |||
addOpensearch(res1); | |||
addOpensearch(res2); | |||
if (res3 && res3.query && res3.query.search) { | |||
res3.query.search.forEach(function(item) { | |||
var t = item.title; | |||
if (!seen[t]) { | |||
seen[t] = true; | |||
titles.push(t); | |||
urls.push("/wiki1/index.php/" + encodeURIComponent(t.replace(/ /g, "_"))); | |||
} | |||
}); | |||
} | |||
titles = titles.slice(0, 6); | |||
urls = urls.slice(0, 6); | |||
var lowerQuery = query.toLowerCase(); | |||
var hasExactMatch = titles.some(function(t) { return t.toLowerCase().trim() === lowerQuery; }); | |||
var hasPrefixMatch = titles.some(function(t) { return t.toLowerCase().startsWith(lowerQuery); }); | |||
var showCreateItem = canCreate && !hasExactMatch && (titles.length === 0 || !hasPrefixMatch); | |||
if (titles.length === 0 && !showCreateItem) { | |||
closeDropdown(); | |||
return; | |||
} | |||
var catPromise = Promise.resolve({}); | |||
if (titles.length > 0) { | |||
var catUrl = "/wiki1/api.php?action=query&titles=" + encodeURIComponent(titles.join("|")) + "&prop=categories&format=json"; | |||
catPromise = fetch(catUrl) | |||
.then(function(r) { return r.json(); }) | |||
.then(function(catData) { | |||
var map = {}; | |||
if (catData && catData.query && catData.query.pages) { | |||
Object.values(catData.query.pages).forEach(function(page) { | |||
var pTitle = page.title; | |||
var cats = page.categories || []; | |||
if (cats.length > 0) { | |||
map[pTitle] = cats[0].title; | |||
} | |||
}); | |||
} | |||
return map; | |||
}) | |||
.catch(function() { return {}; }); | |||
} | |||
catPromise.then(function(catMap) { | |||
if (input.value.trim().toLowerCase() !== query.toLowerCase()) { | |||
return; | |||
} | |||
dropdown.innerHTML = ""; | |||
selectedIndex = -1; | |||
titles.forEach(function(t, idx) { | |||
var u = urls[idx] || ("/wiki1/index.php/" + encodeURIComponent(t.replace(/ /g, "_"))); | |||
var item = document.createElement("a"); | |||
item.className = "wv-search-suggestion-item"; | |||
item.href = u; | |||
var icon = '<span class="wv-search-suggestion-icon"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg></span>'; | |||
var highlightedTitle = highlight(t, query); | |||
var catLabel = getCategoryBadge(catMap[t] || "", t); | |||
var badgeHtml = '<span class="wv-search-cat-badge">' + catLabel + '</span>'; | |||
item.innerHTML = icon + '<span class="wv-search-suggestion-title">' + highlightedTitle + '</span>' + badgeHtml; | |||
item.addEventListener("mousedown", function(e) { | |||
e.preventDefault(); | |||
window.location.href = u; | |||
}); | |||
</ | dropdown.appendChild(item); | ||
}); | |||
var footer = document.createElement("div"); | |||
footer.className = "wv-search-suggestion-footer"; | |||
var searchUrl = "/wiki1/index.php?title=Special:Search&search=" + encodeURIComponent(query); | |||
footer.innerHTML = '<span class="wv-search-suggestion-icon"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg></span> Search for pages containing "<strong>' + highlight(query, query) + '</strong>"'; | |||
footer.addEventListener("mousedown", function(e) { | |||
e.preventDefault(); | |||
window.location.href = searchUrl; | |||
}); | |||
dropdown.appendChild(footer); | |||
if (showCreateItem) { | |||
var createItem = document.createElement("a"); | |||
createItem.className = "wv-search-suggestion-create"; | |||
var createUrl = "/wiki1/index.php?title=" + encodeURIComponent(query.replace(/ /g, "_")) + "&action=edit"; | |||
createItem.href = createUrl; | |||
var plusIcon = '<span class="wv-search-suggestion-icon"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg></span>'; | |||
createItem.innerHTML = plusIcon + '<span>Create new page "<strong>' + highlight(query, query) + '</strong>"</span> <span class="wv-search-suggestion-create-badge">Create</span>'; | |||
createItem.addEventListener("mousedown", function(e) { | |||
e.preventDefault(); | |||
window.location.href = createUrl; | |||
}); | |||
dropdown.appendChild(createItem); | |||
} | |||
dropdown.classList.add("active"); | |||
}); | |||
}) | |||
.catch(function() { | |||
closeDropdown(); | |||
}); | |||
} | |||
input.addEventListener("input", function() { | |||
var val = this.value; | |||
clearTimeout(timer); | |||
if (val.trim().length === 0) { | |||
closeDropdown(); | |||
return; | |||
} | |||
timer = setTimeout(function() { | |||
fetchSuggestions(val); | |||
}, 120); | |||
}); | |||
input.addEventListener("focus", function() { | |||
if (this.value.trim().length >= 1) { | |||
fetchSuggestions(this.value); | |||
} | |||
}); | |||
input.addEventListener("keydown", function(e) { | |||
var items = dropdown.querySelectorAll(".wv-search-suggestion-item, .wv-search-suggestion-footer, .wv-search-suggestion-create"); | |||
if (!dropdown.classList.contains("active") || items.length === 0) return; | |||
if (e.key === "ArrowDown") { | |||
e.preventDefault(); | |||
selectedIndex++; | |||
if (selectedIndex >= items.length) selectedIndex = 0; | |||
updateSel(items); | |||
} else if (e.key === "ArrowUp") { | |||
e.preventDefault(); | |||
selectedIndex--; | |||
if (selectedIndex < 0) selectedIndex = items.length - 1; | |||
updateSel(items); | |||
} else if (e.key === "Enter") { | |||
if (selectedIndex >= 0 && items[selectedIndex]) { | |||
e.preventDefault(); | |||
items[selectedIndex].click(); | |||
} | |||
} else if (e.key === "Escape") { | |||
closeDropdown(); | |||
} | |||
}); | |||
document.addEventListener("click", function(e) { | |||
if (!wrap.contains(e.target)) { | |||
closeDropdown(); | |||
} | |||
}); | |||
} | |||
if (document.readyState === "loading") { | |||
document.addEventListener("DOMContentLoaded", initWvHeroAutocomplete); | |||
} else { | |||
initWvHeroAutocomplete(); | |||
} | |||
})(); | |||
</script> | |||
</html> | |||
Latest revision as of 07:30, 27 August 2026
From today's featured content
View all featured →
Theoretical physicist who developed the theory of relativity, one of the two pillars of modern physics.
Global electric vehicle and clean energy company accelerating the world's transition to sustainable energy.
International organization working to maintain peace, develop friendly relations and promote social progress.
South African-born American entrepreneur, CEO of Tesla, founder of SpaceX, and owner of X (formerly Twitter).
American multinational technology company headquartered in Cupertino, specializing in consumer electronics, software, and services.
Verified dispatch on the Global Climate Summit 2026, concluded in Geneva, fully cited from UNFCCC sources.
Recent publications
View all →Browse by category
View all categories →Profiles of notable leaders, executives, scientists, and creators.
Verified profiles of enterprise corporations, startups, and firms.
Institutions, non-profits, foundations, and research bodies.
Editorial coverage, press announcements, and industry updates.
Media figures, arts, film, publishing, and cultural initiatives.
Innovations, computing, artificial intelligence, and engineering.
Featured companies
View all →
Designs, manufactures, and markets smartphones, computers, and consumer electronics.
Develops software, cloud services, and enterprise solutions used worldwide.
Provides Internet services, search, cloud computing and digital advertising platforms.
Featured organizations
View all →
Promotes international cooperation and peace, and works to solve global challenges.
Leads global health efforts and supports countries in improving public health.
Promotes education, science, culture and communication for peace and security.