full-screen.src.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * @license Highstock JS v8.0.0 (2019-12-10)
  3. *
  4. * Advanced Highstock tools
  5. *
  6. * (c) 2010-2019 Highsoft AS
  7. * Author: Torstein Honsi
  8. *
  9. * License: www.highcharts.com/license
  10. */
  11. 'use strict';
  12. (function (factory) {
  13. if (typeof module === 'object' && module.exports) {
  14. factory['default'] = factory;
  15. module.exports = factory;
  16. } else if (typeof define === 'function' && define.amd) {
  17. define('highcharts/modules/full-screen', ['highcharts'], function (Highcharts) {
  18. factory(Highcharts);
  19. factory.Highcharts = Highcharts;
  20. return factory;
  21. });
  22. } else {
  23. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  24. }
  25. }(function (Highcharts) {
  26. var _modules = Highcharts ? Highcharts._modules : {};
  27. function _registerModule(obj, path, args, fn) {
  28. if (!obj.hasOwnProperty(path)) {
  29. obj[path] = fn.apply(null, args);
  30. }
  31. }
  32. _registerModule(_modules, 'modules/full-screen.src.js', [_modules['parts/Globals.js']], function (H) {
  33. /* *
  34. *
  35. * (c) 2009-2019 Sebastian Bochann
  36. *
  37. * Full screen for Highcharts
  38. *
  39. * License: www.highcharts.com/license
  40. *
  41. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  42. *
  43. * */
  44. /* eslint-disable no-invalid-this, valid-jsdoc */
  45. /**
  46. * The FullScreen class.
  47. * The module allows user to enable full screen mode in StockTools.
  48. * Based on default solutions in browsers.
  49. *
  50. * @private
  51. * @class
  52. * @name Highcharts.FullScreen
  53. *
  54. * @param {Highcharts.HTMLDOMElement} container
  55. * Chart container
  56. */
  57. var FullScreen = H.FullScreen = function (container) {
  58. this.init(container.parentNode);
  59. };
  60. FullScreen.prototype = {
  61. /**
  62. * Init function
  63. * @private
  64. * @param {Highcharts.HTMLDOMElement} container
  65. * Chart container's parent
  66. * @return {void}
  67. */
  68. init: function (container) {
  69. var promise;
  70. if (container.requestFullscreen) {
  71. promise = container.requestFullscreen();
  72. }
  73. else if (container.mozRequestFullScreen) {
  74. promise = container.mozRequestFullScreen();
  75. }
  76. else if (container.webkitRequestFullscreen) {
  77. promise = container.webkitRequestFullscreen();
  78. }
  79. else if (container.msRequestFullscreen) {
  80. promise = container.msRequestFullscreen();
  81. }
  82. if (promise) {
  83. promise['catch'](function () {
  84. alert('Full screen is not supported inside a frame'); // eslint-disable-line no-alert
  85. });
  86. }
  87. }
  88. };
  89. });
  90. _registerModule(_modules, 'masters/modules/full-screen.src.js', [], function () {
  91. });
  92. }));