Widget:CJP4: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
// mw.loader.load('mediaWiki.user'); | // mw.loader.load('mediaWiki.user'); | ||
$('#search').click(runQuery); | $('#search').click(runQuery); | ||
$('#query-container'). | $('#query-container').change(updateDisplay); | ||
$('#update').click(updateDisplay); | $('#update').click(updateDisplay); | ||
Line 34: | Line 34: | ||
{ | { | ||
$("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | $("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | ||
$("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | $("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | ||
updatePillSizeImages(); | |||
} | } | ||
else if (ui.values[0] > ui.values[1]) | else if (ui.values[0] > ui.values[1]) | ||
{ | { | ||
$("input.pillSizeSlider[data-index=1]").val(ui.values[0]); | $("input.pillSizeSlider[data-index=1]").val(ui.values[0]); | ||
$("input.pillSizeSlider[data-index=0]").val(ui.values[1]); | $("input.pillSizeSlider[data-index=0]").val(ui.values[1]); | ||
updatePillSizeImages(); | |||
} | } | ||
else | else | ||
{ | { | ||
$("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | $("input.pillSizeSlider[data-index=0]").val(ui.values[0]); | ||
$("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | $("input.pillSizeSlider[data-index=1]").val(ui.values[1]); | ||
updatePillSizeImages(); | |||
} | } | ||
} | } | ||
Line 56: | Line 59: | ||
var $this = $(this); | var $this = $(this); | ||
$("#slider").slider("values", $this.data("index"), $this.val()); | $("#slider").slider("values", $this.data("index"), $this.val()); | ||
updatePillSizeImages(); | |||
}); | }); | ||
}; | }; | ||
function updatePillSizeImages() { | |||
var minPillSize = $('input.pillSizeSlider[data-index=0]').val(); | |||
var maxPillSize = $('input.pillSizeSlider[data-index=1]').val(); | |||
var pillArr = [ | |||
"http://static.wikidoc.org/3/35/Pill_Size_1_mm.png", | |||
"http://static.wikidoc.org/3/35/Pill_Size_1_mm.png", | |||
"http://static.wikidoc.org/8/8a/Pill_Size_2_mm.png", | |||
"http://static.wikidoc.org/f/f7/Pill_Size_3_mm.png", | |||
"http://static.wikidoc.org/f/fb/Pill_Size_4_mm.png", | |||
"http://static.wikidoc.org/f/f2/Pill_Size_5_mm.png", | |||
"http://static.wikidoc.org/d/d8/Pill_Size_6_mm.png", | |||
"http://static.wikidoc.org/e/ec/Pill_Size_7_mm.png", | |||
"http://static.wikidoc.org/4/4d/Pill_Size_8_mm.png", | |||
"http://static.wikidoc.org/9/97/Pill_Size_9_mm.png", | |||
"http://static.wikidoc.org/3/36/Pill_Size_10_mm.png", | |||
"http://static.wikidoc.org/2/2e/Pill_Size_11_mm.png", | |||
"http://static.wikidoc.org/c/c5/Pill_Size_12_mm.png", | |||
"http://static.wikidoc.org/0/0d/Pill_Size_13_mm.png", | |||
"http://static.wikidoc.org/1/16/Pill_Size_14_mm.png", | |||
"http://static.wikidoc.org/4/4a/Pill_Size_15_mm.png", | |||
"http://static.wikidoc.org/e/ee/Pill_Size_16_mm.png", | |||
"http://static.wikidoc.org/8/86/Pill_Size_17_mm.png", | |||
"http://static.wikidoc.org/a/af/Pill_Size_18_mm.png", | |||
"http://static.wikidoc.org/e/ea/Pill_Size_19_mm.png", | |||
"http://static.wikidoc.org/e/e6/Pill_Size_20_mm.png", | |||
"http://static.wikidoc.org/e/e2/Pill_Size_21_mm.png", | |||
"http://static.wikidoc.org/a/a3/Pill_Size_22_mm.png", | |||
"http://static.wikidoc.org/b/b4/Pill_Size_23_mm.png", | |||
"http://static.wikidoc.org/c/cf/Pill_Size_24_mm.png", | |||
"http://static.wikidoc.org/9/92/Pill_Size_25_mm.png" | |||
]; | |||
$("#queryDisplaySmallSize").attr("src",pillArr[minPillSize]); | |||
$("#queryDisplayLargeSize").attr("src",pillArr[maxPillSize]); | |||
}; | |||
function buildQueryParameters(){ | function buildQueryParameters(){ | ||
Line 378: | Line 419: | ||
height:auto !important; | height:auto !important; | ||
} | } | ||
#queryDisplayContent img{ | |||
height:44px !important; | |||
float:right !important; | |||
} | |||
/*Results***************************************************** | /*Results***************************************************** | ||
Line 552: | Line 596: | ||
</div> | </div> | ||
<div id="queryDisplaySize-container"> | <div id="queryDisplaySize-container"> | ||
<div class="queryDisplayHeader"> | |||
<span>Selected Size:</span> | |||
</div> | |||
<div id="queryDisplaySize-container"> | |||
<div class="queryDisplayHeader"> | <div class="queryDisplayHeader"> | ||
<span>Selected Size:</span> | <span>Selected Size:</span> | ||
</div> | </div> | ||
<div class="queryDisplayContent"> | <div class="queryDisplayContent"> | ||
<img id="queryDisplaySmallSize" style="height:44px !important" src="http://static.wikidoc.org/f/f2/Pill_Size_5_mm.png" /> | |||
<img id="queryDisplayDime" style="height:44px !important" src="http://static.wikidoc.org/c/c4/Pill_Size_Dime.png" /> | |||
<img id="queryDisplayLargeSize" style="height:44px !important" src="http://static.wikidoc.org/e/e6/Pill_Size_20_mm.png" /> | |||
</div> | </div> | ||
</div> | |||
</div> | </div> | ||
<div id="queryDisplaySearch-container" style="align-content:center;"> | <div id="queryDisplaySearch-container" style="align-content:center;"> |