platform.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2014 James S Urquhart
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. mergeInto(LibraryManager.library, {
  23. js_AlertOK: function(title, message) {
  24. alert(message);
  25. return 1;
  26. },
  27. js_AlertOKCancel: function(title, message) {
  28. alert(message);
  29. return 1;
  30. },
  31. js_AlertRetry: function(title, message) {
  32. alert(message);
  33. return 1;
  34. },
  35. js_AlertYesNo: function(title, message) {
  36. alert(message);
  37. return 1;
  38. },
  39. js_AlertOk: function(title, message) {
  40. alert(message);
  41. return 1;
  42. },
  43. js_ConsoleEnabled: function(prompt) {
  44. // TODO
  45. },
  46. js_ConsoleDisabled: function() {
  47. // TODO
  48. },
  49. js_ConsoleLine: function(message) {
  50. },
  51. step_warn: function() {
  52. console.log('step warn');
  53. },
  54. _EmscriptenGetDesktopHeight: function() {
  55. return 768;
  56. },
  57. _EmscriptenGetDesktopWidth: function() {
  58. return 1024;
  59. },
  60. _EmscriptenGetDesktopBpp: function() {
  61. return 32;
  62. }
  63. });