Widget:CJP4: Difference between revisions

Jump to navigation Jump to search
Christopher Popma (talk | contribs)
No edit summary
Christopher Popma (talk | contribs)
No edit summary
Line 6: Line 6:
function loadResources() {
function loadResources() {
mw.loader.load('mediaWiki.user');
mw.loader.load('mediaWiki.user');
$('#button').click(runQuery);
$('#search').click(runQuery);
$('#update').click(runQuery);
};
};


Line 60: Line 61:
};
};


function updateDisplay() {
if (document.getElementById('selectedShape').value)
{
switch(document.getElementById('selectedShape').value){
case "Round":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/7/79/Round_Grey_Pill.png";
break;
case "Oval":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/3/3d/Oval_Grey_Pill.png";
break;
case "Square":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/e/e9/Square_Grey_Pill.png";
break;
case "Rectangular":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/8/8e/Rectangular_Grey_Pill.png";
break;
case "Triangular":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/c/cb/Triangular_Grey_Pill.png";
break;
case "Capsule":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/b/b8/Capsule_Grey_Pill.png";
break;
case "Pentagon":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/b/be/Pentagon_Grey_Pill.png";
break;
case "Hexagon":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/2/25/Hexagon_Grey_Pill.png";
break;
case "Diamond":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/9/98/Diamond_Grey_Pill.png";
break;
case "Gear":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/5/56/Gear_Grey_Pill.png";
break;
case "DoubleCircle":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/7/73/Double_Circle_Grey_Pill.png";
break;
case "Clover":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/a/a3/Clover_Grey_Pill.png";
break;
case "TearDrop":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/9/9a/Tear_Drop_Grey_Pill.png";
break;
case "Octagon":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/f/f7/Octagon_Grey_Pill.png";
break;
case "SemiCircle":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/8/80/SemiCircle_Grey_Pill.png";
break;
case "Bullet":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/8/8c/Bullet_Grey_Pill.png";
break;
case "Trapezoid":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/7/7a/Trapezoid_Grey_Pill.png";
break;
case "FreeForm":
$(#queryDisplayShape).src = "http://www.wikidoc.org/images/f/fa/Free_Form_Grey_Pill.png";
break;
}
}
};


function changeImage(a) {
        document.getElementById("img").src=a;
}


function runQuery() {
function runQuery() {
Line 433: Line 498:
             </div>
             </div>
             <div id="queryDisplaySearch-container" style="align-content:center;">
             <div id="queryDisplaySearch-container" style="align-content:center;">
             <button id="button">Click Me</button>
             <button id="search">Search</button>
          <button id="update">Update</button>
             </div>
             </div>
         </div>
         </div>

Revision as of 21:54, 16 June 2014