Widget:MedIDMaker: Difference between revisions

Jump to navigation Jump to search
Christopher Popma (talk | contribs)
No edit summary
Christopher Popma (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 25: Line 25:
             token : mw.user.tokens.get('editToken'),
             token : mw.user.tokens.get('editToken'),
             text : chapterText,
             text : chapterText,
             title : $("#drugName").val() + "/" + $("#microChapter").val(),
             title : $("#pillName").val(),
             format : 'json'
             format : 'json'
         })
         })
Line 31: Line 31:
             alert("Great success?");
             alert("Great success?");
             $('option:selected', 'select').removeAttr('selected').next('option').attr('selected', 'selected');
             $('option:selected', 'select').removeAttr('selected').next('option').attr('selected', 'selected');
             microChapterData();
             pageContent();
         });
         });
     }
     }
Line 50: Line 50:
         });
         });
     }
     }
     function microChapterData() {
     function pageContent() {
 
        if ($('#microChapter option:selected').text() === "Black Box Warning") {
             resetForm();
             resetForm();
             $("#chapterContent2").css("visibility", "visible");
             $("#chapterContent2").css("visibility", "visible");
Line 58: Line 56:
             $("#pend").val("|blackBoxWarningBody=");
             $("#pend").val("|blackBoxWarningBody=");
             $("#append").val("}}");
             $("#append").val("}}");
             $("#instructions").html("These are some instructions");
             $("#instructions").html("These are some instructions");      
        } else if ($('#microChapter option:selected').text() === "Adult Indications and Dosage") {
            resetForm();
            if ($('#headings option').length == 0) {
                addHeading(["FDA-Labeled Indications and Dosage Information (Adults)", "Off-Label Use and Dosage (Adults)"]);
                microChapterData();
                $("#instructions").html("These are some instructions");
            } else if ($('#headings option:selected').text() === "FDA-Labeled Indications and Dosage Information (Adults)") {
                alert("Hi");
                $('#headings option:selected').removeAttr('selected').next('option').attr('selected', 'selected');
            } else if ($('#headings option:selected').text() === "Off-Label Use and Dosage (Adults)") {
                alert("Clear!");
                resetForm();
            }
        } else if ($('#microChapter option:selected').text() === "Contraindications") {
            alert("Passed.");
        }
     }
     }
     function clearHeading() {
     function clearHeading() {
Line 109: Line 91:
Pill Image Name: <input type="text" id="pillName" /><br />
Pill Image Name: <input type="text" id="pillName" /><br />
<br />
<br />
Please enter the name of the page to which this pill is associated: <input type="text" id="drugName" /><br />
Pill Imprint: <input type="text" id="pillImprint" /><br />
Pill Imprint: <input type="text" id="pillImprint" /><br />
<br />
<br />
Line 125: Line 109:
</select><br />
</select><br />
If the dosage does not fit the above format, you may enter it here: <input type="text" id="dosageFreeText" /><br />
If the dosage does not fit the above format, you may enter it here: <input type="text" id="dosageFreeText" /><br />
<br />
Pill Size: <input type="text" id="pillSize" /><br />
Pill Size: <input type="text" id="pillSize" /><br />
<br />
<br />
Pill Shape: <select id="pillShape">
Pill Shape: <select id="pillShape">
<option>Round</option>
<option>Round</option>
<option>Round</option>
<option>Oval</option>
<option>Oval</option>
Line 177: Line 161:
</select><br />
</select><br />
<br />
<br />
Direct link to the pill image: <input type="text" id="pillImage" defualt="http://static.wikidoc.org/0/0e/No_image.jpg" />
Direct link to the Pill Image: <input type="text" id="pillImage" value="http://static.wikidoc.org/0/0e/No_image.jpg" />
<br />
<br />
<div id="headingDiv" style="visibility:hidden;">
<div id="headingDiv" style="visibility:hidden;">
Sub Headings: <select id="headings">
</select>
</div><br />
</div><br />



Latest revision as of 13:59, 27 March 2014