Widget:CJP: Difference between revisions

Jump to navigation Jump to search
Christopher Popma (talk | contribs)
No edit summary
Christopher Popma (talk | contribs)
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<script type = "text/javascript">
<script type = "text/javascript">
$(document).ready(function(){
$(document).ready(function() {
$(#prepend).val("{|class=&quot;wikitable sortable&quot; cellpadding=&quot;5&quot; !Drug Name !! Pill Imprint !! Dosage !! Ingredients !! Pill Color !! Pill Shape !! Pill Size (mm) !! Score !! NDC !! Pill Image
    $('#pillTable').css('visibility','hidden');
|-{{#ask:");
    $('#executeGo').click(function() {
$(#pend).val([[Pill Shape::Round]]
        $('#searchParameters').append('<string>[[Pill Shape::</string>'+$('#selectPillShape option:selected').val() +'<string>]]</string>');
$(#append).val("|?Pill Imprint|?Pill Dosage|?Pill Ingred|?Pill Color|?Pill Shape|?Pill Size (mm)|?Pill Scoring |?NDC|?Pill Name|format=template|template=PillID}} |}"
        $('#pillTable').css('visibility','visible');
});


$('#executeGo').click( function() {
        var api = new mw.Api();
  $('#prepend').type = "visible";
            api.parse( $('#pillTable') )
  $('#pend').type = "visible";
            .done( function ( html ) {
  $('#apend').type = "visible";
        console.log( 'Parsed result:', html );
            } );
    });
    $('#executeReset').click(function() {
        $('#searchParameters').empty();
        $('#pillTable').css('visibility','hidden');
    });
});
});
</script>
</script>
<input type="button" id="executeGo" value="Go" />
Pill Shape: <select id="selectPillShape">
<input type="hidden" id="prepend" />
                    <option>Round</option>
<input type="hidden" id="pend" />
                    <option>Oval</option>
<input type="hidden" id="append" />
                    <option>Capsule</option>
                </select><br />
<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>

Latest revision as of 13:36, 29 May 2014