LEADTOOLS JavaScript (Leadtools)
LEAD Technologies, Inc

LTHelper Object

Example 
Members 
Represents a helper class used by the various LEADTOOLS components to detect the current browser and operating system.
Syntax
function Leadtools.LTHelper() 
Remarks

LTHelper is used by the various LEADTOOLS components to detect the current browser and operating system. The capabilities and support of the various combinations are used to optimize the operation of the component.

This class is initialized automatically when the application starts. You can use the values of the properties in your own operations. However, do not change them.

Example
<!DOCTYPE html>
<html>
<head>
   <title>Leadtools Examples</title>
   <meta http-equiv="X-UA-Compatible" content="IE=9" />
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
   <meta name="apple-mobile-web-app-capable" content="yes" />
   <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
   <script type="text/javascript" src="Scripts/Leadtools.js"></script>
   <script type="text/javascript">
      (function () {
         DefaultPage = function DefaultPage() {
         }

         DefaultPage.prototype = {

            run: function SiteLibrary_DefaultPage$run() {
               this.RunExample();
            },

            dispose: function SiteLibrary_DefaultPage$dispose() {
            },

            RunExample: function() {
               var exampleButton = document.getElementById("LTHelperExampleButton");
               exampleButton.addEventListener("click", function() {
                  var text = "";

                  // Show the Operating System
                  switch (Leadtools.LTHelper.OS) {
                     case Leadtools.LTOS.windows:
                        text += "OS: Windows";
                        break;
                     case Leadtools.LTOS.mac:
                        text += "OS: Mac";
                        break;
                    case Leadtools.LTOS.iOS:
                        text += "OS: iOS";
                        break;
                    case Leadtools.LTOS.android:
                        text += "OS: Android";
                        break;
                    case Leadtools.LTOS.linux:
                        text += "OS: Linux";
                        break;
                    case Leadtools.LTOS.blackberry:
                        text += "OS: Blackberry";
                        break;
                    case Leadtools.LTOS.windows7:
                        text += "OS: Windows7";
                        break;
                    case Leadtools.LTOS.windows8:
                        text += "OS: Windows8";
                        break;
                    case Leadtools.LTOS.unknown:
                    default:
                        text += "OS: Unknown";
                        break;
                  }
                  text += "\r\n";

                  // Show the Device
                  switch (Leadtools.LTHelper.device) {
                     case Leadtools.LTDevice.desktop:
                        text += "Device: Desktop";
                        break;
                     case Leadtools.LTDevice.mobile:
                        text += "Device: Mobile";
                        break;
                     case Leadtools.LTDevice.tablet:
                        text += "Device: Tablet";
                        break;
                     case Leadtools.LTDevice.unknown:
                     default:
                        text += "Device: Unknown";
                        break;
                  }
                  text += "\r\n";

                  // Show the Browser
                  switch (Leadtools.LTHelper.browser) {
                     case Leadtools.LTBrowser.internetExplorer:
                        text += "Browser: InternetExplorer";
                        break;
                     case Leadtools.LTBrowser.firefox:
                        text += "Browser: Firefox";
                        break;
                     case Leadtools.LTBrowser.chrome:
                        text += "Browser: Chrome";
                        break;
                     case Leadtools.LTBrowser.safari:
                        text += "Browser: Safari";
                        break;
                     case Leadtools.LTBrowser.opera:
                        text += "Browser: Opera";
                        break;
                     case Leadtools.LTBrowser.android:
                        text += "Browser: Android";
                        break;
                     case Leadtools.LTBrowser.unknown:
                     default:
                        text += "Browser: Unknown";
                        break;
                  }
                  text += "\r\n";

                  // Show version and vendor
                  text += "Version: " + Leadtools.LTHelper.version + "\r\n";
                  text += "Vendor: " + Leadtools.LTHelper.vendor + "\r\n";

                  // Show the capabilities
                  text += "SupportsCanvas: " + Leadtools.LTHelper.supportsCanvas + "\r\n";
                  text += "SupportsTypedArray: " + Leadtools.LTHelper.supportsTypedArray + "\r\n";
                  text += "SupportsTouch: " + Leadtools.LTHelper.supportsTouch + "\r\n";
                  text += "SupportsMultiTouch: " + Leadtools.LTHelper.supportsMultiTouch + "\r\n";
                  text += "SupportsWebGL: " + Leadtools.LTHelper.supportsWebGL + "\r\n";
                  text += "SupportsTransform: " + Leadtools.LTHelper.supportsTransform + "\r\n";
                  text += "SupportsTransitionEnd: " + Leadtools.LTHelper.supportsTransitionEnd + "\r\n";
                  text += "SupportsAnimationFrame: " + Leadtools.LTHelper.supportsAnimationFrame + "\r\n";

                  // output the result into the text area
                  var outputTextArea = document.getElementsByName("outputTextArea")[0];
                  outputTextArea.value = text;
                  outputTextArea.scrollTop = outputTextArea.scrollHeight;
               }, false);
            },
         }

         DefaultPage.registerClass("DefaultPage", null, ss.IDisposable);
         var page = null;
         var windowLoad = null;
         var windowUnload = null;
         windowLoad = function (e) {
            window.removeEventListener("load", windowLoad, false);
            page = new DefaultPage();
            page.run();
            window.addEventListener("unload", windowUnload, false);
         };
         windowUnload = function (e) {
            window.removeEventListener("unload", windowUnload, false);
            page.dispose();
         };
         window.addEventListener("load", windowLoad, false);
      })();
   </script>
</head>
<body>
   <input type="button" id="LTHelperExampleButton" value="LTHelper Example" />
   <div>
      <textarea name="outputTextArea" cols="80" rows="10"></textarea>
   </div>
</body>
</html>
See Also

Reference

LTHelper Members
Leadtools Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.