Difference between revisions of "Template:Find an article"
From NSWiki
(Created page with "<shtml version="2" keyname="jenlom" hash="c8e741288d48682e853723213f42032acb7d5dfa8b372a411e11d61aa9e4119e"><script> function showDiv() { if ($('#article:hidden').length >...") |
|||
Line 1: | Line 1: | ||
− | <shtml version="2" keyname="jenlom" hash=" | + | <shtml version="2" keyname="jenlom" hash="74390a3cdd41240bba267689ed36e708d3aa7c4c864f073f3d93550d926320e8"><script> |
− | function | + | function showDivArticle() { |
if ($('#article:hidden').length > 0) { | if ($('#article:hidden').length > 0) { | ||
$('#article').slideDown('medium'); | $('#article').slideDown('medium'); | ||
Line 6: | Line 6: | ||
$('#articleinput').select(); | $('#articleinput').select(); | ||
} else { | } else { | ||
− | + | searchArticle(); | |
} | } | ||
} | } | ||
− | function | + | function pressArticle(e) { |
var evt = e || window.event | var evt = e || window.event | ||
if (evt.keyCode === 13) { | if (evt.keyCode === 13) { | ||
− | + | searchArticle(); | |
} | } | ||
} | } | ||
− | function | + | function searchArticle() { |
window.location.href = "http://nswiki.org/index.php?search=" + $("#articleinput").val(); | window.location.href = "http://nswiki.org/index.php?search=" + $("#articleinput").val(); | ||
} | } | ||
</script> | </script> | ||
<div style="border-width: 0px; border-style: solid; border-radius: 3px; background-color:#white; box-shadow: 0px 4px 10px #999999; align:center; width:80%; text-align: center; padding: 3ex 3ex; margin-top: 1em; margin-bottom: 1em; margin-left: 1em; margin-right: 1em;"><div id="welcomeDiv" style="display:none;" class="answer_list" > WELCOME</div> | <div style="border-width: 0px; border-style: solid; border-radius: 3px; background-color:#white; box-shadow: 0px 4px 10px #999999; align:center; width:80%; text-align: center; padding: 3ex 3ex; margin-top: 1em; margin-bottom: 1em; margin-left: 1em; margin-right: 1em;"><div id="welcomeDiv" style="display:none;" class="answer_list" > WELCOME</div> | ||
− | <input type="button" name="article" value="Find an article" onclick=" | + | <input type="button" name="article" value="Find an article" onclick="showDivArticle()" /><div id="article" style="display: none;"><input type="text" id= "articleinput" placeholder="article" style="border:0px solid; box-shadow: 0px 2px 10px #999999; margin-top: 10px; text-align: center; padding: 5px 5px;" onkeydown="return pressArticle( event );"></input></div></div></shtml> |
Revision as of 18:35, 22 January 2014