Widget:CJP3: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<script content-type= "application/javascript" src="http://www.wikidoc.org/includes/raty/md5.js"></script> | <script content-type= "application/javascript" src="http://www.wikidoc.org/includes/raty/md5.js"></script> | ||
<script type"text/javascript"> | <script type"text/javascript"> | ||
$(document).ready(ensureLoggedIn); | //$(document).ready(ensureLoggedIn); | ||
function ensureLoggedIn() { | function ensureLoggedIn() { | ||
Line 10: | Line 10: | ||
window.location.replace("http://www.wikidoc.org/index.php?title=Special:UserLogin&returnto=User%3AChristopher+Popma%2FSandbox+TestCJP3"); | window.location.replace("http://www.wikidoc.org/index.php?title=Special:UserLogin&returnto=User%3AChristopher+Popma%2FSandbox+TestCJP3"); | ||
} else { | } else { | ||
$('#button').click(runQuery); | |||
} | } | ||
}; | |||
function buildQueryParameters(){ | |||
return "[[Pill%20Shape::Round]]"; | |||
}; | }; | ||
function runQuery() { | function runQuery() { | ||
var queryParameters = buildQueryParameters(); | |||
var queryParameters = | |||
var printoutRequests = "|?Pill%20Imprint|?Pill%20Dosage|?Pill%20Ingred|?Pill%20Color|?Pill%20Shape|?Pill%20Size%20(mm)|?Pill%20Scoring|?NDC|?Pill%20Name"; | var printoutRequests = "|?Pill%20Imprint|?Pill%20Dosage|?Pill%20Ingred|?Pill%20Color|?Pill%20Shape|?Pill%20Size%20(mm)|?Pill%20Scoring|?NDC|?Pill%20Name"; | ||
var jsonURL = "http://www.wikidoc.org/api.php?action=ask&query="+queryParameters+printoutRequests+"&format=json" | var jsonURL = "http://www.wikidoc.org/api.php?action=ask&query="+queryParameters+printoutRequests+"&format=json" | ||
Line 126: | Line 130: | ||
cellPillName.innerHTML = '<img class="pillImages" src="' + imageDirect + '" />'; | cellPillName.innerHTML = '<img class="pillImages" src="' + imageDirect + '" />'; | ||
}); | }); | ||
}); | }); | ||
$('#resultsTable-container').css("visibility", "visible") | |||
}; | };// | ||
</script> | </script> | ||
<style type="text/css"> | <style type="text/css"> | ||
.pillImages{ | #resultsTable-container{ | ||
width:300px; | width:100%; | ||
} | visibility:hidden; | ||
} | |||
#resultsTable{ | |||
border-collapse:collapse; | |||
table-layout:fixed; | |||
border:1px solid #B0E0E6; | |||
margin:10px; | |||
} | |||
.pillImages{ | |||
width:300px; | |||
} | |||
.resultsTableHeader{ | |||
background-color:#B0E0E6; | |||
padding:5px; | |||
width:125px; | |||
height:25px; | |||
} | |||
#resultsTable tbody tr:nth-child(even){ | |||
background-color:#EBEDED; | |||
text-align:center; | |||
} | |||
#resultsTable tbody tr:nth-child(odd){ | |||
background-color:#FFFFFF; | |||
text-align:center; | |||
} | |||
</style> | </style> | ||
Line 141: | Line 174: | ||
<table id="resultsTable"> | <table id="resultsTable"> | ||
<thead> | <thead> | ||
<th> | <th class="resultsTableHeader"> | ||
Drug Name | Drug Name | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Pill Imprint | Pill Imprint | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Dosage | Dosage | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Ingredients | Ingredients | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Pill Color | Pill Color | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Pill Shape | Pill Shape | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
Pill Size (mm) | Pill Size (mm) | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader" style="width:60px;"> | ||
Score | Score | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader"> | ||
NDC | NDC | ||
</th> | </th> | ||
<th> | <th class="resultsTableHeader" style="width:360px;"> | ||
Pill Image | Pill Image | ||
</th> | </th> |