The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9KB

  1. <HTML><HEAD><TITLE>Juce Plugin Test</TITLE></HEAD>
  2. <BODY>
  3. <center>
  4. <script>
  5. function printmessage(arg)
  6. {
  7. document.getElementById ("result").innerHTML += "<p>" + arg + "</p>";
  8. }
  9. function getPlugin()
  10. {
  11. return document.getElementById ("plugin");
  12. }
  13. function showAMessage()
  14. {
  15. var response = getPlugin().printText ("This is a message sent from the website's javascript...");
  16. printmessage (response);
  17. }
  18. function popUpMessageBox()
  19. {
  20. // fetch a couple of properties from the plugin and tell the plugin to show them in a pop-up box..
  21. getPlugin().popUpMessageBox ("property1 = " + getPlugin().property1
  22. + "\nproperty2 = " + getPlugin().property2);
  23. }
  24. // callbacks from plugin...
  25. function WebpageCallbacks()
  26. {
  27. this.printmessage = printmessage;
  28. }
  29. function sendCallbackObjectToPlugin()
  30. {
  31. // This gives the plugin an object containing methods that it can call, so that it
  32. // can trigger events in the webpage..
  33. getPlugin().registerCallbackObject (new WebpageCallbacks());
  34. }
  35. </script>
  36. <script>
  37. if (navigator.appName == "Microsoft Internet Explorer")
  38. {
  39. document.write('<object id="plugin" type="application/npjucedemo-plugin" classid="CLSID:F683B990-3ADF-11DE-BDFE-F9CB55D89593" width="80%" height="400"></object>');
  40. }
  41. else
  42. {
  43. document.write('<embed id="plugin" src="" type="application/npjucedemo-plugin" width="80%" height="400"></embed>');
  44. }
  45. </script>
  46. <noscript>
  47. <embed id="plugin" src="" type="application/npjucedemo-plugin" width="80%" height="400"></embed>
  48. </noscript>
  49. <br>
  50. <form name="formname">
  51. <input type=button value="Tell the plugin to show a message" onclick='showAMessage()'>
  52. <input type=button value="Tell the plugin to show a pop-up" onclick='popUpMessageBox()'>
  53. <input type=button value="Pass a callback object to the plugin" onclick='sendCallbackObjectToPlugin()'>
  54. </form>
  55. <div id="result"></div>
  56. </center>
  57. </BODY></HTML>