JSFiddle - React, Tailwind, and code Playground

by Sean Wessell

JavaScript

'use strict';
angular.module('myApp.controllers', []).controller('BodyCtrl', ['$scope', '$http', '$location', '$cookies', '$window', 'ESSData', '$translate', 'Connectivity', 'RenderPdf', 'CdvFile', '$interval', function($scope, $http, $location, $cookies, $window, ESSData, $translate, Connectivity, RenderPdf, CdvFile, $interval) {
  $scope.reqSuccess = 0;
  $scope.reqError = 1;
  $scope.reqNoAuth = -1;
  $scope.changesSubmittedMessageId = 'CHANGES_SUBMITTED_FOR_APPROVAL_ID';
  $scope.changesSavedMessageId = 'CHANGES_SAVED_ID';
  $scope.contactName = null;
  $scope.contactEmail = null;
  $scope.contactPhone = null;
  $scope.logoSrc = '';
  $scope.logoStyle = {
    visibility: 'hidden'
  };
  $scope.deviceType = essApp.deviceType;
  $scope.mobileApp = $scope.deviceType;
  $scope.closePdfView = null;
  $scope.getPdf = null;
  $scope.savePdf = null;
  $scope.pdfView = false;
  $scope.numPages = 0;
  $scope.noConnection = false;
  $scope.noConnectionStyle = {
    'margin-top': '0'
  };
  $scope.loginStep = null;
  var banner = document.getElementById('banner'),
    bannerOriginalWidth, companyName = document.getElementById('company-name-div'),
    companyNameOriginalWidth, mainHeader = document.getElementById('main-header'),
    mainHeaderOriginalWidth, pdfData, onBack, navHistory = [];
  $scope.setLogo = function(co) {
    if (co.logoFileName) {
      $scope.logoSrc = '/content/images/logos/' + co.logoFileName;
      $scope.logoStyle = {
        visibility: 'visible'
      };
    } else {
      $scope.logoSrc = '';
      $scope.logoStyle = {
        visibility: 'hidden'
      };
    }
  }
  $http.defaults.cache = false;
  $scope.waiting = function(x) {
    if (x === undefined) {
      return ESSData.Waiting();
    }
    ESSData.Waiting(x);
  };
  $scope.alert = null;
  $scope.getLanguage = function() {
    var language = $cookies["language"];
    if (!language) {
      language = navigator.language.slice(0, 2);
    }
    return language;
  }
  $scope.setLanguage =...