Widget:CJP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<script type = "text/javascript"> | <script type = "text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('#pillTable').css('visibility','hidden'); | |||
$('#executeGo').click(function() { | $('#executeGo').click(function() { | ||
$('# | $('#searchParameters').append('<string>[[Pill Shape::</string>'+$('#selectPillShape option:selected').val() +'<string>]]</string>'); | ||
$('#pillTable').css('visibility','visible'); | |||
$('# | |||
var api = new mw.Api(); | |||
api.parse( $('#pillTable') ) | |||
.done( function ( html ) { | |||
console.log( 'Parsed result:', html ); | |||
} ); | |||
}); | |||
$('#executeReset').click(function() { | |||
$('#searchParameters').empty(); | |||
$('#pillTable').css('visibility','hidden'); | |||
}); | }); | ||
}); | }); | ||
</script> | </script> | ||
< | Pill Shape: <select id="selectPillShape"> | ||
<option>Round</option> | |||
<option>Oval</option> | |||
<option>Capsule</option> | |||
</select><br /> | |||
<input type="button" id="executeGo" value="Go" /> | <input type="button" id="executeGo" value="Go" /> | ||
<input type="button" id="executeReset" value="Reset" /> | |||
<div id="pillTable" style="width:500px;"> | |||
{|class="wikitable sortable" cellpadding="5" | |||
!Drug Name !! Pill Imprint !! Dosage !! Ingredients !! Pill Color !! Pill Shape !! Pill Size (mm) !! Score !! NDC !! Pill Image<br/> | |||
|- <br/> | |||
{{#ask:<string id="searchParameters"></string><br/> | |||
|?Pill Imprint<br/> | |||
|?Pill Dosage<br/> | |||
|?Pill Ingred<br/> | |||
|?Pill Color<br/> | |||
|?Pill Shape<br/> | |||
|?Pill Size (mm)<br/> | |||
|?Pill Scoring<br/> | |||
|?NDC<br/> | |||
|?Pill Name<br/> | |||
|format=template<br/> | |||
|template=PillID}}<br/> | |||
|} | |||
</div> | |||
</includeonly> | </includeonly> |