Hi
I got some doubts with the PaintWeb integration
1) Is it possible to integrate PaintWeb with classic ASP projects or
any
asp.net projects
2) I tried to integrate it with my classic ASP project and I got error
message like " Demo: PaintWeb initialization failed." and " Error:
Failed loading the configuration file."
Could you please help me to integrate it with my classic ASP web
application. I tried to run the demo from my site and it also shows
the same error message.
Following is the sample code that I used from your site
<!DOCTYPE html>
<html lang="en">
<head>
<title>PaintWeb simple demo</title>
<!-- $URL:
http://code.google.com/p/paintweb $
$Date: 2010-06-26 22:58:27 +0300 $ -->
</head>
<body>
<p><img id="editableImage" src="PaintWeb/demos/freshalicious.jpg"
alt="Freshalicious"></p>
<p><button id="buttonEditImage">Edit image!</button></p>
<div id="PaintWebTarget"></div>
<script type="text/javascript" src="PaintWeb/build/paintweb.js"></
script>
<script type="text/javascript"><!--
(function () {
// Function called when the user clicks the "Edit image" button.
function pwStart () {
document.body.insertBefore(loadp, btn.parentNode);
timeStart = (new Date()).getTime();
pw.init(pwInit);
//alert (pw.config.configFile);
};
// Function called when the PaintWeb application fires the "appInit"
event.
function pwInit (ev) {
var initTime = (new Date()).getTime() - timeStart,
str = 'Demo: Yay, PaintWeb loaded in ' + initTime + ' ms! ' +
pw.toString();
document.body.removeChild(loadp);
if (ev.state === PaintWeb.INIT_ERROR) {
alert('Demo: PaintWeb initialization failed.');
return;
} else if (ev.state === PaintWeb.INIT_DONE) {
if (window.console && console.log) {
console.log(str);
} else if (window.opera) {
opera.postError(str);
}
} else {
alert('Demo: Unrecognized PaintWeb initialization state ' +
ev.state);
return;
}
img.style.display = 'none';
btn.style.display = 'none';
};
var img = document.getElementById('editableImage'),
btn = document.getElementById('buttonEditImage'),
target = document.getElementById('PaintWebTarget'),
loadp = document.createElement('p'),
timeStart = null,
// Create a PaintWeb instance.
pw = new PaintWeb();
pw.config.guiPlaceholder = target;
pw.config.imageLoad = img;
pw.config.configFile = 'config-example.json';
loadp.appendChild(document.createTextNode('Loading, please
wait...'));
if (btn.addEventListener) {
btn.addEventListener('click', pwStart, false);
} else if (btn.attachEvent) {
btn.attachEvent('onclick', pwStart);
} else {
btn.onclick = pwStart;
}
})();
--></script>
</body>
<!-- vim:set spell spl=en fo=tcroqwanl1 tw=80 ts=2 sw=2 sts=2 sta et
ai cin fenc=utf-8 ff=unix: -->
</html>
Thanks,