[mashup-dev] svn commit r4659 -
trunk/mashup/java/modules/samples/digit2image/digit2image.resources/www
svn at wso2.org
svn at wso2.org
Mon Jul 2 13:51:03 PDT 2007
Author: jonathan
Date: Mon Jul 2 13:51:00 2007
New Revision: 4659
Added:
trunk/mashup/java/modules/samples/digit2image/digit2image.resources/www/
trunk/mashup/java/modules/samples/digit2image/digit2image.resources/www/index.html
Log:
Added simple custom UI.
Added: trunk/mashup/java/modules/samples/digit2image/digit2image.resources/www/index.html
==============================================================================
--- (empty file)
+++ trunk/mashup/java/modules/samples/digit2image/digit2image.resources/www/index.html Mon Jul 2 13:51:00 2007
@@ -0,0 +1,88 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Digit2Image test</title>
+<style type="text/css">
+ body {font: 75%/1.5 "Lucida Grande","Lucida Sans","Microsoft Sans Serif", "Lucida Sans Unicode",verdana,sans-serif,"trebuchet ms"; color: #111; }
+ img {margin-bottom: 0.5em}
+ span {font-weight: bold}
+ .template {margin-left:1em; margin-bottom:1em; font-size:125%}
+ #download {font-size:125%; background-color:#F88; display:none; padding:.5em; border:2px solid black; margin:1em;}
+ #console {color:red; font-weight:bold}
+</style>
+<script type="text/javascript" src="/js/wso2/WSRequest.js"></script>
+<script type="text/javascript" src="../digit2image?stub"></script>
+<script type="text/javascript">
+ var size = "s";
+ function refresh() {
+ size = document.getElementById("imageSize").value;
+ digit2image.digit2image.onError = handleError;
+ digit2image.digit2image.callback = function (url) { loadImage(1, url); }
+ digit2image.digit2image("1", size);
+ digit2image.digit2image.callback = function (url) { loadImage(2, url); }
+ digit2image.digit2image("2", size);
+ digit2image.digit2image.callback = function (url) { loadImage(3, url); }
+ digit2image.digit2image("3", size);
+ digit2image.digit2image.callback = function (url) { loadImage(4, url); }
+ digit2image.digit2image("4", size);
+ digit2image.digit2image.callback = function (url) { loadImage(5, url); }
+ digit2image.digit2image("5", size);
+ digit2image.digit2image.callback = function (url) { loadImage(6, url); }
+ digit2image.digit2image("6", size);
+ digit2image.digit2image.callback = function (url) { loadImage(7, url); }
+ digit2image.digit2image("7", size);
+ digit2image.digit2image.callback = function (url) { loadImage(8, url); }
+ digit2image.digit2image("8", size);
+ digit2image.digit2image.callback = function (url) { loadImage(9, url); }
+ digit2image.digit2image("9", size);
+ }
+
+ function load() {
+ digit2image.setAddress(digit2image.endpoint, "/services/digit2image");
+ refresh();
+ }
+
+ function loadImage(digit, url) {
+ document.getElementById("digit" + digit).src = url;
+ }
+
+ function handleError(error) {
+ log (console, "Fault: " + error.reason + "\n\n" + error.detail);
+ };
+
+ function log(console, data) {
+ var browser = WSRequest.util._getBrowser();
+ if (browser == "ie" || browser == "ie7")
+ console.innerText = data;
+ else
+ console.textContent = data;
+ }
+</script>
+</head>
+<body onload="load()">
+<h3>Digit2Image tester</h3>
+<div>
+ <select id="imageSize">
+ <option value="s">small (75x75 square)</option>
+ <option value="t">thumbnail (100 on longest side</option>
+ <option value="m">medium (240 on longest side)</option>
+ <option value="">normal (500 on longest side)</option>
+ <option value="b">big (1024 on longest side)</option>
+ <option value="o">original image</option>
+ </select>
+ <input type="button" value="Refresh" onclick="refresh()"/>
+</div>
+<div id="images">
+ <img id="digit1" src="not-found"/>
+ <img id="digit2" src="not-found"/>
+ <img id="digit3" src="not-found"/>
+ <img id="digit4" src="not-found"/>
+ <img id="digit5" src="not-found"/>
+ <img id="digit6" src="not-found"/>
+ <img id="digit7" src="not-found"/>
+ <img id="digit8" src="not-found"/>
+ <img id="digit9" src="not-found"/>
+</div>
+<div>Invoke the service directly from the <strong><a href="../digit2image?tryit">Try-it</a></strong> page.</div>
+<div id="console"></div></body>
+</html>
More information about the Mashup-dev
mailing list