Sha256: 1fdd9fb7bb97decef80c34e61e1d1bd069775d2b4cb1f87c994fbc24b8ae512e

Contents?: true

Size: 1.43 KB

Versions: 47

Compression:

Stored size: 1.43 KB

Contents

import setSheetParameters from './simpleSetSheetParameters.js';
import createCampusAlertsHtml from './createCampusAlertsHtml.js';
import trackAlertsCloseClicks from './trackAlertsCloseClicks.js';

const SHEET_KEY = '1IF8WbIYeEtF0C6YQjgpdVoivXb54uGbKaSxEF46Wbs4';
const SHEET_TAB_NAME = 'Alerts';

function start() {
  const params = {
    'apiKey': 'AIzaSyCEBsbXfFcdbkASlg-PodD1rT_Fe3Nw62A',
    'discoveryDocs': ['https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest']
  };
  const sheetParams = setSheetParameters(SHEET_KEY, SHEET_TAB_NAME);

  gapi.client.init(params).then(function() { // Executes an API request, and returns a Promise.
    function execute() {
      return gapi.client.sheets.spreadsheets.values.get(sheetParams)
        .then(function(response) {
          let createCampusAlertsPromise = new Promise((resolve, reject) => {
            // Do stuff with the response here
            // returned array of arrays w/ values = response.result.values
            createCampusAlertsHtml(response, resolve);
          });
          createCampusAlertsPromise.then(() => {
            // Do stuff after you handled the response here
            trackAlertsCloseClicks();
          });
        },
        function(err) {
          console.error("Execute error", err);
        });
    }
    execute();
  });
}
// Loads the JavaScript client library and invokes `start` afterwards.
//    Usage:
//  gapi.load('client', start);
export default start;

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
kcc-gem-theme-1.60.40 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.60.39 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.60.38 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.59.38 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.59.37 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.58.37 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.58.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.57.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.56.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.55.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.54.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.53.36 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.53.35 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.52.35 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.52.34 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.51.34 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.51.33 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.51.32 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.51.31 assets/js/theme/alerts/campusAlertsSheetsAPI.js
kcc-gem-theme-1.51.30 assets/js/theme/alerts/campusAlertsSheetsAPI.js