Difference between revisions of "Template:Find a region"
From NSWiki
(Created page with "<shtml version="2" keyname="jenlom" hash="87c82a1691275f4cbc201bf143216f9effdfec249bd7f14f21cfcf5047aa4b3d"><script> function showDiv() { if ($('#region:hidden').length > ...") |
|||
Line 1: | Line 1: | ||
− | <shtml version="2" keyname="jenlom" hash=" | + | <shtml version="2" keyname="jenlom" hash="840e1d81ec18e99e502035f2803a70af1312464d8b9f16541a9439fa7d2d9765"><script> |
− | function | + | function showDivregion() { |
if ($('#region:hidden').length > 0) { | if ($('#region:hidden').length > 0) { | ||
$('#region').slideDown('medium'); | $('#region').slideDown('medium'); | ||
Line 6: | Line 6: | ||
$('#regioninput').select(); | $('#regioninput').select(); | ||
} else { | } else { | ||
− | + | searchregion(); | |
} | } | ||
} | } | ||
− | function | + | function pressregion(e) { |
var evt = e || window.event | var evt = e || window.event | ||
if (evt.keyCode === 13) { | if (evt.keyCode === 13) { | ||
− | + | searchregion(); | |
} | } | ||
} | } | ||
− | function | + | function searchregion() { |
− | window.location.href = "http://nswiki.org/index.php?search= | + | window.location.href = "http://nswiki.org/index.php?search=" + $("#regioninput").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="region" value="Find a region" onclick=" | + | <input type="button" name="region" value="Find a region" onclick="showDivregion()" /><div id="region" style="display: none;"><input type="text" id= "regioninput" placeholder="region" style="border:0px solid; box-shadow: 0px 2px 10px #999999; margin-top: 10px; text-align: center; padding: 5px 5px;" onkeydown="return pressregion( event );"></input></div></div></shtml> |
Revision as of 18:37, 22 January 2014